lang
stringclasses
2 values
license
stringclasses
13 values
stderr
stringlengths
0
343
commit
stringlengths
40
40
returncode
int64
0
128
repos
stringlengths
6
87.7k
new_contents
stringlengths
0
6.23M
new_file
stringlengths
3
311
old_contents
stringlengths
0
6.23M
message
stringlengths
6
9.1k
old_file
stringlengths
3
311
subject
stringlengths
0
4k
git_diff
stringlengths
0
6.31M
Java
mit
52c4f5054c9788f89740c2be6de2854dc738e6d7
0
anthraxx/intellij-awesome-console
package awesome.console; import awesome.console.config.AwesomeConsoleConfig; import awesome.console.match.FileLinkMatch; import awesome.console.match.URLLinkMatch; import com.intellij.execution.filters.Filter; import com.intellij.execution.filters.HyperlinkInfo; import com.intellij.execution.filters.HyperlinkInfoFactory; import com.intellij.ide.browsers.OpenUrlHyperlinkInfo; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.ProjectRootManager; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.PathUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; public class AwesomeLinkFilter implements Filter { private static final Pattern FILE_PATTERN = Pattern.compile( "(?<link>(?<path>([.~])?(?:[a-zA-Z]:\\\\|/)?[a-zA-Z0-9_][a-zA-Z0-9/\\-_.\\\\]*\\.[a-zA-Z0-9\\-_.]+)" + "(?:(?::|, line |\\()(?<row>\\d+)(?:[:,]( column )?(?<col>\\d+)\\)?)?)?)" ); private static final Pattern URL_PATTERN = Pattern.compile( "(?<link>(?<protocol>(([a-zA-Z]+):)?(/|\\\\|~))(?<path>[-_.!~*\\\\'()a-zA-Z0-9;/?:@&=+$,%#]+))" ); private static final int maxSearchDepth = 1; private final AwesomeConsoleConfig config; private final Map<String, List<VirtualFile>> fileCache; private final Map<String, List<VirtualFile>> fileBaseCache; private final Project project; private final List<String> srcRoots; private final Matcher fileMatcher; private final Matcher urlMatcher; private ProjectRootManager projectRootManager; public AwesomeLinkFilter(final Project project) { this.project = project; this.fileCache = new HashMap<>(); this.fileBaseCache = new HashMap<>(); projectRootManager = ProjectRootManager.getInstance(project); srcRoots = getSourceRoots(); config = AwesomeConsoleConfig.getInstance(); fileMatcher = FILE_PATTERN.matcher(""); urlMatcher = URL_PATTERN.matcher(""); createFileCache(); } @Nullable @Override public Result applyFilter(final String line, final int endPoint) { final List<ResultItem> results = new ArrayList<>(); final int startPoint = endPoint - line.length(); final List<String> chunks = splitLine(line); int offset = 0; for (final String chunk : chunks) { if (config.SEARCH_URLS) { results.addAll(getResultItemsUrl(chunk, startPoint + offset)); } results.addAll(getResultItemsFile(chunk, startPoint + offset)); offset += chunk.length(); } return new Result(results); } public List<String> splitLine(final String line) { final List<String> chunks = new ArrayList<>(); final int length = line.length(); if (!config.LIMIT_LINE_LENGTH || config.LINE_MAX_LENGTH >= length) { chunks.add(line); return chunks; } if (!config.SPLIT_ON_LIMIT) { chunks.add(line.substring(0, config.LINE_MAX_LENGTH)); return chunks; } int offset = 0; do { final String chunk = line.substring(offset, Math.min(length, offset + config.LINE_MAX_LENGTH)); chunks.add(chunk); offset += config.LINE_MAX_LENGTH; } while (offset < length - 1); return chunks; } public List<ResultItem> getResultItemsUrl(final String line, final int startPoint) { final List<ResultItem> results = new ArrayList<>(); final List<URLLinkMatch> matches = detectURLs(line); for (final URLLinkMatch match : matches) { final String file = getFileFromUrl(match.match); if (null != file && !new File(file).exists()) { continue; } results.add( new Result( startPoint + match.start, startPoint + match.end, new OpenUrlHyperlinkInfo(match.match)) ); } return results; } public String getFileFromUrl(final String url) { if (url.startsWith("/")) { return url; } final String fileUrl = "file://"; if (url.startsWith(fileUrl)) { return url.substring(fileUrl.length()); } return null; } public List<ResultItem> getResultItemsFile(final String line, final int startPoint) { final List<ResultItem> results = new ArrayList<>(); final HyperlinkInfoFactory hyperlinkInfoFactory = HyperlinkInfoFactory.getInstance(); List<FileLinkMatch> matches = detectPaths(line); for(FileLinkMatch match: matches) { String path = PathUtil.getFileName(match.path); List<VirtualFile> matchingFiles = fileCache.get(path); if (null == matchingFiles) { matchingFiles = getResultItemsFileFromBasename(path); if (null == matchingFiles || 0 >= matchingFiles.size()) { continue; } } if (0 >= matchingFiles.size()) { continue; } List<VirtualFile> bestMatchingFiles = findBestMatchingFiles(match, matchingFiles); if (bestMatchingFiles != null && !bestMatchingFiles.isEmpty()) { matchingFiles = bestMatchingFiles; } final HyperlinkInfo linkInfo = hyperlinkInfoFactory.createMultipleFilesHyperlinkInfo( matchingFiles, match.linkedRow < 0 ? 0 : match.linkedRow - 1, project ); results.add(new Result( startPoint + match.start, startPoint + match.end, linkInfo) ); } return results; } private List<VirtualFile> findBestMatchingFiles(final FileLinkMatch match, final List<VirtualFile> matchingFiles) { String generalisedMatchPath = generalizePath(match.path); return findBestMatchingFiles(generalisedMatchPath, matchingFiles); } private List<VirtualFile> findBestMatchingFiles(final String generalizedMatchPath, final List<VirtualFile> matchingFiles) { List<VirtualFile> foundFiles = getFilesByPath(generalizedMatchPath, matchingFiles); if (!foundFiles.isEmpty()) { return foundFiles; } String widerMetchingPath = dropOneLevelFromRoot(generalizedMatchPath); if (widerMetchingPath != null) { return findBestMatchingFiles(widerMetchingPath, matchingFiles); } return null; } private List<VirtualFile> getFilesByPath(String generalizedMatchPath, List<VirtualFile> matchingFiles) { List<VirtualFile> matchedFiles = new ArrayList<>(); for (VirtualFile matchedFile : matchingFiles) { String generalizedFilePath = generalizePath(matchedFile.getPath()); if (generalizedFilePath.endsWith(generalizedMatchPath)) { matchedFiles.add(matchedFile); } } return matchedFiles; } private String dropOneLevelFromRoot(String path) { if (path.contains("/")) { return path.substring(path.indexOf('/')+1); } else { return null; } } private String generalizePath(final String path) { return path.replace('\\', '/'); } public List<VirtualFile> getResultItemsFileFromBasename(final String match) { return getResultItemsFileFromBasename(match, 0); } public List<VirtualFile> getResultItemsFileFromBasename(final String match, final int depth) { final ArrayList<VirtualFile> matches = new ArrayList<>(); final char packageSeparator = '.'; final int index = match.lastIndexOf(packageSeparator); if (-1 >= index) { return matches; } final String basename = match.substring(index + 1); final String origin = match.substring(0, index); final String path = origin.replace(packageSeparator, File.separatorChar); if (0 >= basename.length()) { return matches; } if (!fileBaseCache.containsKey(basename)) { /* Try to search deeper down the rabbit hole */ if (depth <= maxSearchDepth) { return getResultItemsFileFromBasename(origin, depth + 1); } return matches; } for (final VirtualFile file : fileBaseCache.get(basename)) { final VirtualFile parent = file.getParent(); if (null == parent) { continue; } if (!matchSource(parent.getPath(), path)) { continue; } matches.add(file); } return matches; } private void createFileCache() { projectRootManager.getFileIndex().iterateContent( new AwesomeProjectFilesIterator(fileCache, fileBaseCache)); } private List<String> getSourceRoots() { final VirtualFile[] contentSourceRoots = projectRootManager.getContentSourceRoots(); final List<String> roots = new ArrayList<>(); for (final VirtualFile root : contentSourceRoots) { roots.add(root.getPath()); } return roots; } private boolean matchSource(final String parent, final String path) { for (final String srcRoot : srcRoots) { if ((srcRoot + File.separatorChar + path).equals(parent)) { return true; } } return false; } @NotNull public List<FileLinkMatch> detectPaths(@NotNull final String line) { fileMatcher.reset(line); final List<FileLinkMatch> results = new LinkedList<>(); while (fileMatcher.find()) { final String match = fileMatcher.group("link"); final String row = fileMatcher.group("row"); final String col = fileMatcher.group("col"); results.add(new FileLinkMatch(match, fileMatcher.group("path"), fileMatcher.start(), fileMatcher.end(), null != row ? Integer.parseInt(row) : 0, null != col ? Integer.parseInt(col) : 0)); } return results; } @NotNull public List<URLLinkMatch> detectURLs(@NotNull final String line) { urlMatcher.reset(line); final List<URLLinkMatch> results = new LinkedList<>(); while (urlMatcher.find()) { final String match = urlMatcher.group("link"); results.add(new URLLinkMatch(match, urlMatcher.start(), urlMatcher.end())); } return results; } }
src/awesome/console/AwesomeLinkFilter.java
package awesome.console; import awesome.console.config.AwesomeConsoleConfig; import awesome.console.match.FileLinkMatch; import awesome.console.match.URLLinkMatch; import com.intellij.execution.filters.Filter; import com.intellij.execution.filters.HyperlinkInfo; import com.intellij.execution.filters.HyperlinkInfoFactory; import com.intellij.ide.browsers.OpenUrlHyperlinkInfo; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.ProjectRootManager; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.PathUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; public class AwesomeLinkFilter implements Filter { private static final Pattern FILE_PATTERN = Pattern.compile( "(?<link>(?<path>(\\.|~)?(?:[a-zA-Z]:\\\\|/)?[a-zA-Z0-9_][a-zA-Z0-9/\\-_.\\\\]*\\.[a-zA-Z0-9\\-_.]+)" + "(?:(?::|, line |\\()(?<row>\\d+)(?:[:,](?<col>\\d+)\\)?)?)?)" ); private static final Pattern URL_PATTERN = Pattern.compile( "(?<link>(?<protocol>(([a-zA-Z]+):)?(/|\\\\|~))(?<path>[-_.!~*\\\\'()a-zA-Z0-9;/?:@&=+$,%#]+))" ); private static final int maxSearchDepth = 1; private final AwesomeConsoleConfig config; private final Map<String, List<VirtualFile>> fileCache; private final Map<String, List<VirtualFile>> fileBaseCache; private final Project project; private final List<String> srcRoots; private final Matcher fileMatcher; private final Matcher urlMatcher; private ProjectRootManager projectRootManager; public AwesomeLinkFilter(final Project project) { this.project = project; this.fileCache = new HashMap<>(); this.fileBaseCache = new HashMap<>(); projectRootManager = ProjectRootManager.getInstance(project); srcRoots = getSourceRoots(); config = AwesomeConsoleConfig.getInstance(); fileMatcher = FILE_PATTERN.matcher(""); urlMatcher = URL_PATTERN.matcher(""); createFileCache(); } @Nullable @Override public Result applyFilter(final String line, final int endPoint) { final List<ResultItem> results = new ArrayList<>(); final int startPoint = endPoint - line.length(); final List<String> chunks = splitLine(line); int offset = 0; for (final String chunk : chunks) { if (config.SEARCH_URLS) { results.addAll(getResultItemsUrl(chunk, startPoint + offset)); } results.addAll(getResultItemsFile(chunk, startPoint + offset)); offset += chunk.length(); } return new Result(results); } public List<String> splitLine(final String line) { final List<String> chunks = new ArrayList<>(); final int length = line.length(); if (!config.LIMIT_LINE_LENGTH || config.LINE_MAX_LENGTH >= length) { chunks.add(line); return chunks; } if (!config.SPLIT_ON_LIMIT) { chunks.add(line.substring(0, config.LINE_MAX_LENGTH)); return chunks; } int offset = 0; do { final String chunk = line.substring(offset, Math.min(length, offset + config.LINE_MAX_LENGTH)); chunks.add(chunk); offset += config.LINE_MAX_LENGTH; } while (offset < length - 1); return chunks; } public List<ResultItem> getResultItemsUrl(final String line, final int startPoint) { final List<ResultItem> results = new ArrayList<>(); final List<URLLinkMatch> matches = detectURLs(line); for (final URLLinkMatch match : matches) { final String file = getFileFromUrl(match.match); if (null != file && !new File(file).exists()) { continue; } results.add( new Result( startPoint + match.start, startPoint + match.end, new OpenUrlHyperlinkInfo(match.match)) ); } return results; } public String getFileFromUrl(final String url) { if (url.startsWith("/")) { return url; } final String fileUrl = "file://"; if (url.startsWith(fileUrl)) { return url.substring(fileUrl.length()); } return null; } public List<ResultItem> getResultItemsFile(final String line, final int startPoint) { final List<ResultItem> results = new ArrayList<>(); final HyperlinkInfoFactory hyperlinkInfoFactory = HyperlinkInfoFactory.getInstance(); List<FileLinkMatch> matches = detectPaths(line); for(FileLinkMatch match: matches) { String path = PathUtil.getFileName(match.path); List<VirtualFile> matchingFiles = fileCache.get(path); if (null == matchingFiles) { matchingFiles = getResultItemsFileFromBasename(path); if (null == matchingFiles || 0 >= matchingFiles.size()) { continue; } } if (0 >= matchingFiles.size()) { continue; } List<VirtualFile> bestMatchingFiles = findBestMatchingFiles(match, matchingFiles); if (bestMatchingFiles != null && !bestMatchingFiles.isEmpty()) { matchingFiles = bestMatchingFiles; } final HyperlinkInfo linkInfo = hyperlinkInfoFactory.createMultipleFilesHyperlinkInfo( matchingFiles, match.linkedRow < 0 ? 0 : match.linkedRow - 1, project ); results.add(new Result( startPoint + match.start, startPoint + match.end, linkInfo) ); } return results; } private List<VirtualFile> findBestMatchingFiles(final FileLinkMatch match, final List<VirtualFile> matchingFiles) { String generalisedMatchPath = generalizePath(match.path); return findBestMatchingFiles(generalisedMatchPath, matchingFiles); } private List<VirtualFile> findBestMatchingFiles(final String generalizedMatchPath, final List<VirtualFile> matchingFiles) { List<VirtualFile> foundFiles = getFilesByPath(generalizedMatchPath, matchingFiles); if (!foundFiles.isEmpty()) { return foundFiles; } String widerMetchingPath = dropOneLevelFromRoot(generalizedMatchPath); if (widerMetchingPath != null) { return findBestMatchingFiles(widerMetchingPath, matchingFiles); } return null; } private List<VirtualFile> getFilesByPath(String generalizedMatchPath, List<VirtualFile> matchingFiles) { List<VirtualFile> matchedFiles = new ArrayList<>(); for (VirtualFile matchedFile : matchingFiles) { String generalizedFilePath = generalizePath(matchedFile.getPath()); if (generalizedFilePath.endsWith(generalizedMatchPath)) { matchedFiles.add(matchedFile); } } return matchedFiles; } private String dropOneLevelFromRoot(String path) { if (path.contains("/")) { return path.substring(path.indexOf('/')+1); } else { return null; } } private String generalizePath(final String path) { return path.replace('\\', '/'); } public List<VirtualFile> getResultItemsFileFromBasename(final String match) { return getResultItemsFileFromBasename(match, 0); } public List<VirtualFile> getResultItemsFileFromBasename(final String match, final int depth) { final ArrayList<VirtualFile> matches = new ArrayList<>(); final char packageSeparator = '.'; final int index = match.lastIndexOf(packageSeparator); if (-1 >= index) { return matches; } final String basename = match.substring(index + 1); final String origin = match.substring(0, index); final String path = origin.replace(packageSeparator, File.separatorChar); if (0 >= basename.length()) { return matches; } if (!fileBaseCache.containsKey(basename)) { /* Try to search deeper down the rabbit hole */ if (depth <= maxSearchDepth) { return getResultItemsFileFromBasename(origin, depth + 1); } return matches; } for (final VirtualFile file : fileBaseCache.get(basename)) { final VirtualFile parent = file.getParent(); if (null == parent) { continue; } if (!matchSource(parent.getPath(), path)) { continue; } matches.add(file); } return matches; } private void createFileCache() { projectRootManager.getFileIndex().iterateContent( new AwesomeProjectFilesIterator(fileCache, fileBaseCache)); } private List<String> getSourceRoots() { final VirtualFile[] contentSourceRoots = projectRootManager.getContentSourceRoots(); final List<String> roots = new ArrayList<>(); for (final VirtualFile root : contentSourceRoots) { roots.add(root.getPath()); } return roots; } private boolean matchSource(final String parent, final String path) { for (final String srcRoot : srcRoots) { if ((srcRoot + File.separatorChar + path).equals(parent)) { return true; } } return false; } @NotNull public List<FileLinkMatch> detectPaths(@NotNull final String line) { fileMatcher.reset(line); final List<FileLinkMatch> results = new LinkedList<>(); while (fileMatcher.find()) { final String match = fileMatcher.group("link"); final String row = fileMatcher.group("row"); final String col = fileMatcher.group("col"); results.add(new FileLinkMatch(match, fileMatcher.group("path"), fileMatcher.start(), fileMatcher.end(), null != row ? Integer.parseInt(row) : 0, null != col ? Integer.parseInt(col) : 0)); } return results; } @NotNull public List<URLLinkMatch> detectURLs(@NotNull final String line) { urlMatcher.reset(line); final List<URLLinkMatch> results = new LinkedList<>(); while (urlMatcher.find()) { final String match = urlMatcher.group("link"); results.add(new URLLinkMatch(match, urlMatcher.start(), urlMatcher.end())); } return results; } }
match: added support to match 'column' literal in file pattern
src/awesome/console/AwesomeLinkFilter.java
match: added support to match 'column' literal in file pattern
<ide><path>rc/awesome/console/AwesomeLinkFilter.java <ide> <ide> public class AwesomeLinkFilter implements Filter { <ide> private static final Pattern FILE_PATTERN = Pattern.compile( <del> "(?<link>(?<path>(\\.|~)?(?:[a-zA-Z]:\\\\|/)?[a-zA-Z0-9_][a-zA-Z0-9/\\-_.\\\\]*\\.[a-zA-Z0-9\\-_.]+)" + <del> "(?:(?::|, line |\\()(?<row>\\d+)(?:[:,](?<col>\\d+)\\)?)?)?)" <add> "(?<link>(?<path>([.~])?(?:[a-zA-Z]:\\\\|/)?[a-zA-Z0-9_][a-zA-Z0-9/\\-_.\\\\]*\\.[a-zA-Z0-9\\-_.]+)" + <add> "(?:(?::|, line |\\()(?<row>\\d+)(?:[:,]( column )?(?<col>\\d+)\\)?)?)?)" <ide> ); <ide> private static final Pattern URL_PATTERN = Pattern.compile( <ide> "(?<link>(?<protocol>(([a-zA-Z]+):)?(/|\\\\|~))(?<path>[-_.!~*\\\\'()a-zA-Z0-9;/?:@&=+$,%#]+))"
Java
apache-2.0
15fc931de6ff2ef872b6103b15d3aeac1fe13b29
0
mattyb149/pentaho-kettle,mkambol/pentaho-kettle,ccaspanello/pentaho-kettle,drndos/pentaho-kettle,lgrill-pentaho/pentaho-kettle,rmansoor/pentaho-kettle,dkincade/pentaho-kettle,SergeyTravin/pentaho-kettle,airy-ict/pentaho-kettle,lgrill-pentaho/pentaho-kettle,pymjer/pentaho-kettle,DFieldFL/pentaho-kettle,zlcnju/kettle,airy-ict/pentaho-kettle,e-cuellar/pentaho-kettle,airy-ict/pentaho-kettle,ma459006574/pentaho-kettle,ViswesvarSekar/pentaho-kettle,AliaksandrShuhayeu/pentaho-kettle,hudak/pentaho-kettle,alina-ipatina/pentaho-kettle,mkambol/pentaho-kettle,pminutillo/pentaho-kettle,sajeetharan/pentaho-kettle,aminmkhan/pentaho-kettle,nicoben/pentaho-kettle,pedrofvteixeira/pentaho-kettle,stepanovdg/pentaho-kettle,mkambol/pentaho-kettle,pavel-sakun/pentaho-kettle,graimundo/pentaho-kettle,nantunes/pentaho-kettle,DFieldFL/pentaho-kettle,nanata1115/pentaho-kettle,ddiroma/pentaho-kettle,andrei-viaryshka/pentaho-kettle,zlcnju/kettle,skofra0/pentaho-kettle,andrei-viaryshka/pentaho-kettle,TatsianaKasiankova/pentaho-kettle,matthewtckr/pentaho-kettle,Advent51/pentaho-kettle,rmansoor/pentaho-kettle,birdtsai/pentaho-kettle,ddiroma/pentaho-kettle,matrix-stone/pentaho-kettle,bmorrise/pentaho-kettle,birdtsai/pentaho-kettle,mbatchelor/pentaho-kettle,yshakhau/pentaho-kettle,e-cuellar/pentaho-kettle,zlcnju/kettle,EcoleKeine/pentaho-kettle,pymjer/pentaho-kettle,kurtwalker/pentaho-kettle,lgrill-pentaho/pentaho-kettle,CapeSepias/pentaho-kettle,tkafalas/pentaho-kettle,cjsonger/pentaho-kettle,alina-ipatina/pentaho-kettle,skofra0/pentaho-kettle,pavel-sakun/pentaho-kettle,stevewillcock/pentaho-kettle,gretchiemoran/pentaho-kettle,YuryBY/pentaho-kettle,SergeyTravin/pentaho-kettle,denisprotopopov/pentaho-kettle,akhayrutdinov/pentaho-kettle,airy-ict/pentaho-kettle,birdtsai/pentaho-kettle,CapeSepias/pentaho-kettle,skofra0/pentaho-kettle,denisprotopopov/pentaho-kettle,bmorrise/pentaho-kettle,eayoungs/pentaho-kettle,sajeetharan/pentaho-kettle,wseyler/pentaho-kettle,cjsonger/pentaho-kettle,tkafalas/pentaho-kettle,marcoslarsen/pentaho-kettle,MikhailHubanau/pentaho-kettle,CapeSepias/pentaho-kettle,pminutillo/pentaho-kettle,rfellows/pentaho-kettle,birdtsai/pentaho-kettle,GauravAshara/pentaho-kettle,nanata1115/pentaho-kettle,IvanNikolaychuk/pentaho-kettle,bmorrise/pentaho-kettle,yshakhau/pentaho-kettle,pedrofvteixeira/pentaho-kettle,ivanpogodin/pentaho-kettle,aminmkhan/pentaho-kettle,rmansoor/pentaho-kettle,pavel-sakun/pentaho-kettle,HiromuHota/pentaho-kettle,roboguy/pentaho-kettle,akhayrutdinov/pentaho-kettle,ma459006574/pentaho-kettle,AlexanderBuloichik/pentaho-kettle,IvanNikolaychuk/pentaho-kettle,aminmkhan/pentaho-kettle,bmorrise/pentaho-kettle,emartin-pentaho/pentaho-kettle,flbrino/pentaho-kettle,Advent51/pentaho-kettle,emartin-pentaho/pentaho-kettle,EcoleKeine/pentaho-kettle,yshakhau/pentaho-kettle,flbrino/pentaho-kettle,ma459006574/pentaho-kettle,kurtwalker/pentaho-kettle,ccaspanello/pentaho-kettle,graimundo/pentaho-kettle,sajeetharan/pentaho-kettle,hudak/pentaho-kettle,mbatchelor/pentaho-kettle,sajeetharan/pentaho-kettle,DFieldFL/pentaho-kettle,YuryBY/pentaho-kettle,mattyb149/pentaho-kettle,nantunes/pentaho-kettle,pymjer/pentaho-kettle,ma459006574/pentaho-kettle,tmcsantos/pentaho-kettle,dkincade/pentaho-kettle,stevewillcock/pentaho-kettle,cjsonger/pentaho-kettle,marcoslarsen/pentaho-kettle,nicoben/pentaho-kettle,brosander/pentaho-kettle,mdamour1976/pentaho-kettle,jbrant/pentaho-kettle,nanata1115/pentaho-kettle,DFieldFL/pentaho-kettle,nicoben/pentaho-kettle,GauravAshara/pentaho-kettle,akhayrutdinov/pentaho-kettle,dkincade/pentaho-kettle,cjsonger/pentaho-kettle,pminutillo/pentaho-kettle,tmcsantos/pentaho-kettle,CapeSepias/pentaho-kettle,dkincade/pentaho-kettle,pentaho/pentaho-kettle,hudak/pentaho-kettle,HiromuHota/pentaho-kettle,drndos/pentaho-kettle,ivanpogodin/pentaho-kettle,matthewtckr/pentaho-kettle,pentaho/pentaho-kettle,roboguy/pentaho-kettle,ViswesvarSekar/pentaho-kettle,IvanNikolaychuk/pentaho-kettle,drndos/pentaho-kettle,mdamour1976/pentaho-kettle,mbatchelor/pentaho-kettle,codek/pentaho-kettle,ddiroma/pentaho-kettle,wseyler/pentaho-kettle,ccaspanello/pentaho-kettle,TatsianaKasiankova/pentaho-kettle,jbrant/pentaho-kettle,mdamour1976/pentaho-kettle,nantunes/pentaho-kettle,SergeyTravin/pentaho-kettle,HiromuHota/pentaho-kettle,TatsianaKasiankova/pentaho-kettle,emartin-pentaho/pentaho-kettle,stevewillcock/pentaho-kettle,brosander/pentaho-kettle,codek/pentaho-kettle,pentaho/pentaho-kettle,denisprotopopov/pentaho-kettle,e-cuellar/pentaho-kettle,brosander/pentaho-kettle,zlcnju/kettle,ViswesvarSekar/pentaho-kettle,ViswesvarSekar/pentaho-kettle,stevewillcock/pentaho-kettle,nantunes/pentaho-kettle,AlexanderBuloichik/pentaho-kettle,drndos/pentaho-kettle,AliaksandrShuhayeu/pentaho-kettle,Advent51/pentaho-kettle,matthewtckr/pentaho-kettle,jbrant/pentaho-kettle,AliaksandrShuhayeu/pentaho-kettle,matthewtckr/pentaho-kettle,marcoslarsen/pentaho-kettle,graimundo/pentaho-kettle,roboguy/pentaho-kettle,kurtwalker/pentaho-kettle,emartin-pentaho/pentaho-kettle,roboguy/pentaho-kettle,mbatchelor/pentaho-kettle,pedrofvteixeira/pentaho-kettle,nicoben/pentaho-kettle,ivanpogodin/pentaho-kettle,YuryBY/pentaho-kettle,rmansoor/pentaho-kettle,codek/pentaho-kettle,tmcsantos/pentaho-kettle,matrix-stone/pentaho-kettle,stepanovdg/pentaho-kettle,mkambol/pentaho-kettle,TatsianaKasiankova/pentaho-kettle,tkafalas/pentaho-kettle,SergeyTravin/pentaho-kettle,EcoleKeine/pentaho-kettle,akhayrutdinov/pentaho-kettle,Advent51/pentaho-kettle,ccaspanello/pentaho-kettle,wseyler/pentaho-kettle,mdamour1976/pentaho-kettle,aminmkhan/pentaho-kettle,gretchiemoran/pentaho-kettle,ddiroma/pentaho-kettle,wseyler/pentaho-kettle,stepanovdg/pentaho-kettle,flbrino/pentaho-kettle,lgrill-pentaho/pentaho-kettle,eayoungs/pentaho-kettle,flbrino/pentaho-kettle,pentaho/pentaho-kettle,matrix-stone/pentaho-kettle,skofra0/pentaho-kettle,IvanNikolaychuk/pentaho-kettle,eayoungs/pentaho-kettle,GauravAshara/pentaho-kettle,pavel-sakun/pentaho-kettle,graimundo/pentaho-kettle,alina-ipatina/pentaho-kettle,HiromuHota/pentaho-kettle,pminutillo/pentaho-kettle,mattyb149/pentaho-kettle,marcoslarsen/pentaho-kettle,andrei-viaryshka/pentaho-kettle,MikhailHubanau/pentaho-kettle,tkafalas/pentaho-kettle,YuryBY/pentaho-kettle,GauravAshara/pentaho-kettle,codek/pentaho-kettle,rfellows/pentaho-kettle,kurtwalker/pentaho-kettle,EcoleKeine/pentaho-kettle,tmcsantos/pentaho-kettle,AlexanderBuloichik/pentaho-kettle,pedrofvteixeira/pentaho-kettle,gretchiemoran/pentaho-kettle,jbrant/pentaho-kettle,mattyb149/pentaho-kettle,AlexanderBuloichik/pentaho-kettle,ivanpogodin/pentaho-kettle,e-cuellar/pentaho-kettle,gretchiemoran/pentaho-kettle,MikhailHubanau/pentaho-kettle,alina-ipatina/pentaho-kettle,stepanovdg/pentaho-kettle,pymjer/pentaho-kettle,denisprotopopov/pentaho-kettle,eayoungs/pentaho-kettle,matrix-stone/pentaho-kettle,brosander/pentaho-kettle,AliaksandrShuhayeu/pentaho-kettle,rfellows/pentaho-kettle,hudak/pentaho-kettle,nanata1115/pentaho-kettle,yshakhau/pentaho-kettle
/* Copyright (c) 2007 Pentaho Corporation. All rights reserved. * This software was developed by Pentaho Corporation and is provided under the terms * of the GNU Lesser General Public License, Version 2.1. You may not use * this file except in compliance with the license. If you need a copy of the license, * please go to http://www.gnu.org/licenses/lgpl-2.1.txt. The Original Code is Pentaho * Data Integration. The Initial Developer is Pentaho Corporation. * * Software distributed under the GNU Lesser Public License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to * the license for the specific language governing your rights and limitations.*/ /* * * Created on 4-apr-2003 * */ package org.pentaho.di.trans.steps.excelinput; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.commons.vfs.FileObject; import org.pentaho.di.core.CheckResult; import org.pentaho.di.core.CheckResultInterface; import org.pentaho.di.core.Const; import org.pentaho.di.core.Counter; import org.pentaho.di.core.database.DatabaseMeta; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.exception.KettleStepException; import org.pentaho.di.core.exception.KettleXMLException; import org.pentaho.di.core.fileinput.FileInputList; import org.pentaho.di.core.row.RowMeta; import org.pentaho.di.core.row.RowMetaInterface; import org.pentaho.di.core.row.ValueMeta; import org.pentaho.di.core.row.ValueMetaInterface; import org.pentaho.di.core.variables.VariableSpace; import org.pentaho.di.core.xml.XMLHandler; import org.pentaho.di.i18n.BaseMessages; import org.pentaho.di.repository.Repository; import org.pentaho.di.repository.ObjectId; import org.pentaho.di.resource.ResourceDefinition; import org.pentaho.di.resource.ResourceNamingInterface; import org.pentaho.di.resource.ResourceNamingInterface.FileNamingType; import org.pentaho.di.trans.Trans; import org.pentaho.di.trans.TransMeta; import org.pentaho.di.trans.step.BaseStepMeta; import org.pentaho.di.trans.step.StepDataInterface; import org.pentaho.di.trans.step.StepInterface; import org.pentaho.di.trans.step.StepMeta; import org.pentaho.di.trans.step.StepMetaInterface; import org.w3c.dom.Node; /** * Meta data for the Excel step. */ public class ExcelInputMeta extends BaseStepMeta implements StepMetaInterface { private static Class<?> PKG = ExcelInputMeta.class; // for i18n purposes, needed by Translator2!! $NON-NLS-1$ public static final String[] RequiredFilesDesc = new String[] { BaseMessages.getString(PKG, "System.Combo.No"), BaseMessages.getString(PKG, "System.Combo.Yes") }; public static final String[] RequiredFilesCode = new String[] {"N", "Y"}; private static final String NO = "N"; private static final String YES = "Y"; public final static int TYPE_TRIM_NONE = 0; public final static int TYPE_TRIM_LEFT = 1; public final static int TYPE_TRIM_RIGHT = 2; public final static int TYPE_TRIM_BOTH = 3; public final static String type_trim_code[] = { "none", "left", "right", "both" }; public final static String type_trim_desc[] = { BaseMessages.getString(PKG, "ExcelInputMeta.TrimType.None"), BaseMessages.getString(PKG, "ExcelInputMeta.TrimType.Left"), BaseMessages.getString(PKG, "ExcelInputMeta.TrimType.Right"), BaseMessages.getString(PKG, "ExcelInputMeta.TrimType.Both") }; public static final String STRING_SEPARATOR = " \t --> "; /** * The filenames to load or directory in case a filemask was set. */ private String fileName[]; /** * The regular expression to use (null means: no mask) */ private String fileMask[]; /** Array of boolean values as string, indicating if a file is required. */ private String fileRequired[]; /** * The fieldname that holds the name of the file */ private String fileField; /** * The names of the sheets to load. * Null means: all sheets... */ private String sheetName[]; /** * The row-nr where we start processing. */ private int startRow[]; /** * The column-nr where we start processing. */ private int startColumn[]; /** * The fieldname that holds the name of the sheet */ private String sheetField; /** * The cell-range starts with a header-row */ private boolean startsWithHeader; /** * Stop reading when you hit an empty row. */ private boolean stopOnEmpty; /** * Avoid empty rows in the result. */ private boolean ignoreEmptyRows; /** * The fieldname containing the row number. * An empty (null) value means that no row number is included in the output. * This is the rownumber of all written rows (not the row in the sheet). */ private String rowNumberField; /** * The fieldname containing the sheet row number. * An empty (null) value means that no sheet row number is included in the output. * Sheet row number is the row number in the sheet. */ private String sheetRowNumberField; /** * The maximum number of rows that this step writes to the next step. */ private long rowLimit; /** * The fields to read in the range. * Note: the number of columns in the range has to match field.length */ private ExcelInputField field[]; /** Strict types : will generate erros */ private boolean strictTypes; /** Ignore error : turn into warnings */ private boolean errorIgnored; /** If error line are skipped, you can replay without introducing doubles.*/ private boolean errorLineSkipped; /** The directory that will contain warning files */ private String warningFilesDestinationDirectory; /** The extension of warning files */ private String warningFilesExtension; /** The directory that will contain error files */ private String errorFilesDestinationDirectory; /** The extension of error files */ private String errorFilesExtension; /** The directory that will contain line number files */ private String lineNumberFilesDestinationDirectory; /** The extension of line number files */ private String lineNumberFilesExtension; /** Are we accepting filenames in input rows? */ private boolean acceptingFilenames; /** The field in which the filename is placed */ private String acceptingField; /** The stepname to accept filenames from */ private String acceptingStepName; /** Array of boolean values as string, indicating if we need to fetch sub folders. */ private String includeSubFolders[]; /** The step to accept filenames from */ private StepMeta acceptingStep; /** The encoding to use for reading: null or empty string means system default encoding */ private String encoding; /** The add filenames to result filenames flag */ private boolean isaddresult; public ExcelInputMeta() { super(); // allocate BaseStepMeta } /** * @return Returns the fieldLength. */ public ExcelInputField[] getField() { return field; } /** * @param fields The excel input fields to set. */ public void setField(ExcelInputField[] fields) { this.field = fields; } /** * @return Returns the fileField. */ public String getFileField() { return fileField; } /** * @param fileField The fileField to set. */ public void setFileField(String fileField) { this.fileField = fileField; } /** * @return Returns the fileMask. */ public String[] getFileMask() { return fileMask; } /** * @param fileMask The fileMask to set. */ public void setFileMask(String[] fileMask) { this.fileMask = fileMask; } public String[] getIncludeSubFolders() { return includeSubFolders; } public void setIncludeSubFolders(String[] includeSubFoldersin) { includeSubFolders = new String[includeSubFoldersin.length]; for (int i=0;i<includeSubFoldersin.length && i <includeSubFolders.length;i++) { this.includeSubFolders[i] = getRequiredFilesCode(includeSubFoldersin[i]); } } public String getRequiredFilesCode(String tt) { if(tt==null) return RequiredFilesCode[0]; if(tt.equals(RequiredFilesDesc[1])) return RequiredFilesCode[1]; else return RequiredFilesCode[0]; } public String getRequiredFilesDesc(String tt) { if(tt==null) return RequiredFilesDesc[0]; if(tt.equals(RequiredFilesCode[1])) return RequiredFilesDesc[1]; else return RequiredFilesDesc[0]; } /** * @return Returns the fileName. */ public String[] getFileName() { return fileName; } /** * @param fileName The fileName to set. */ public void setFileName(String[] fileName) { this.fileName = fileName; } /** * @return Returns the ignoreEmptyRows. */ public boolean ignoreEmptyRows() { return ignoreEmptyRows; } /** * @param ignoreEmptyRows The ignoreEmptyRows to set. */ public void setIgnoreEmptyRows(boolean ignoreEmptyRows) { this.ignoreEmptyRows = ignoreEmptyRows; } /** * @return Returns the rowLimit. */ public long getRowLimit() { return rowLimit; } /** * @param rowLimit The rowLimit to set. */ public void setRowLimit(long rowLimit) { this.rowLimit = rowLimit; } /** * @return Returns the rowNumberField. */ public String getRowNumberField() { return rowNumberField; } /** * @param rowNumberField The rowNumberField to set. */ public void setRowNumberField(String rowNumberField) { this.rowNumberField = rowNumberField; } /** * @return Returns the sheetRowNumberField. */ public String getSheetRowNumberField() { return sheetRowNumberField; } /** * @param rowNumberField The rowNumberField to set. */ public void setSheetRowNumberField(String rowNumberField) { this.sheetRowNumberField = rowNumberField; } /** * @return Returns the sheetField. */ public String getSheetField() { return sheetField; } /** * @param sheetField The sheetField to set. */ public void setSheetField(String sheetField) { this.sheetField = sheetField; } /** * @return Returns the sheetName. */ public String[] getSheetName() { return sheetName; } /** * @param sheetName The sheetName to set. */ public void setSheetName(String[] sheetName) { this.sheetName = sheetName; } /** * @return Returns the startColumn. */ public int[] getStartColumn() { return startColumn; } /** * @param startColumn The startColumn to set. */ public void setStartColumn(int[] startColumn) { this.startColumn = startColumn; } /** * @return Returns the startRow. */ public int[] getStartRow() { return startRow; } /** * @param startRow The startRow to set. */ public void setStartRow(int[] startRow) { this.startRow = startRow; } /** * @return Returns the startsWithHeader. */ public boolean startsWithHeader() { return startsWithHeader; } /** * @param startsWithHeader The startsWithHeader to set. */ public void setStartsWithHeader(boolean startsWithHeader) { this.startsWithHeader = startsWithHeader; } /** * @return Returns the stopOnEmpty. */ public boolean stopOnEmpty() { return stopOnEmpty; } /** * @param stopOnEmpty The stopOnEmpty to set. */ public void setStopOnEmpty(boolean stopOnEmpty) { this.stopOnEmpty = stopOnEmpty; } public void loadXML(Node stepnode, List<DatabaseMeta> databases, Map<String, Counter> counters) throws KettleXMLException { readData(stepnode); } public Object clone() { ExcelInputMeta retval = (ExcelInputMeta)super.clone(); int nrfiles = fileName.length; int nrsheets = sheetName.length; int nrfields = field.length; retval.allocate(nrfiles, nrsheets, nrfields); for (int i=0;i<nrfields;i++) { retval.field[i] = (ExcelInputField) field[i].clone(); } for (int i=0;i<nrfiles;i++) { retval.fileName[i] = fileName[i]; retval.fileMask[i] = fileMask[i]; retval.fileRequired[i] = fileRequired[i]; retval.includeSubFolders[i] = includeSubFolders[i]; } for (int i=0;i<nrsheets;i++) { retval.sheetName[i] = sheetName[i]; } return retval; } private void readData(Node stepnode) throws KettleXMLException { try { startsWithHeader = YES.equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "header")); String nempty = XMLHandler.getTagValue(stepnode, "noempty"); ignoreEmptyRows = YES.equalsIgnoreCase(nempty) || nempty==null; String soempty = XMLHandler.getTagValue(stepnode, "stoponempty"); stopOnEmpty = YES.equalsIgnoreCase(soempty) || nempty==null; sheetRowNumberField = XMLHandler.getTagValue(stepnode, "sheetrownumfield"); rowNumberField = XMLHandler.getTagValue(stepnode, "rownum_field"); rowNumberField = XMLHandler.getTagValue(stepnode, "rownumfield"); rowLimit = Const.toLong(XMLHandler.getTagValue(stepnode, "limit"), 0); encoding = XMLHandler.getTagValue(stepnode, "encoding"); String addToResult=XMLHandler.getTagValue(stepnode, "add_to_result_filenames"); if(Const.isEmpty(addToResult)) isaddresult = true; else isaddresult = "Y".equalsIgnoreCase(addToResult); sheetField = XMLHandler.getTagValue(stepnode, "sheetfield"); fileField = XMLHandler.getTagValue(stepnode, "filefield"); acceptingFilenames = YES.equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "accept_filenames")); acceptingField = XMLHandler.getTagValue(stepnode, "accept_field"); acceptingStepName = XMLHandler.getTagValue(stepnode, "accept_stepname"); Node filenode = XMLHandler.getSubNode(stepnode, "file"); Node sheetsnode = XMLHandler.getSubNode(stepnode, "sheets"); Node fields = XMLHandler.getSubNode(stepnode, "fields"); int nrfiles = XMLHandler.countNodes(filenode, "name"); int nrsheets = XMLHandler.countNodes(sheetsnode, "sheet"); int nrfields = XMLHandler.countNodes(fields, "field"); allocate(nrfiles, nrsheets, nrfields); for (int i=0;i<nrfiles;i++) { Node filenamenode = XMLHandler.getSubNodeByNr(filenode, "name", i); Node filemasknode = XMLHandler.getSubNodeByNr(filenode, "filemask", i); Node fileRequirednode = XMLHandler.getSubNodeByNr(filenode, "file_required", i); Node includeSubFoldersnode = XMLHandler.getSubNodeByNr(filenode, "include_subfolders", i); fileName[i] = XMLHandler.getNodeValue(filenamenode); fileMask[i] = XMLHandler.getNodeValue(filemasknode); fileRequired[i] = XMLHandler.getNodeValue(fileRequirednode); includeSubFolders[i] = XMLHandler.getNodeValue(includeSubFoldersnode); } for (int i=0;i<nrfields;i++) { Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i); field[i] = new ExcelInputField(); field[i].setName( XMLHandler.getTagValue(fnode, "name") ); field[i].setType( ValueMeta.getType(XMLHandler.getTagValue(fnode, "type")) ); field[i].setLength( Const.toInt(XMLHandler.getTagValue(fnode, "length"), -1) ); field[i].setPrecision( Const.toInt(XMLHandler.getTagValue(fnode, "precision"), -1) ); String srepeat = XMLHandler.getTagValue(fnode, "repeat"); field[i].setTrimType( getTrimTypeByCode(XMLHandler.getTagValue(fnode, "trim_type")) ); if (srepeat!=null) field[i].setRepeated( YES.equalsIgnoreCase(srepeat) ); else field[i].setRepeated( false ); field[i].setFormat(XMLHandler.getTagValue(fnode, "format")); field[i].setCurrencySymbol(XMLHandler.getTagValue(fnode, "currency")); field[i].setDecimalSymbol(XMLHandler.getTagValue(fnode, "decimal")); field[i].setGroupSymbol(XMLHandler.getTagValue(fnode, "group")); } for (int i=0;i<nrsheets;i++) { Node snode = XMLHandler.getSubNodeByNr(sheetsnode, "sheet", i); sheetName[i] = XMLHandler.getTagValue(snode, "name"); startRow[i] = Const.toInt(XMLHandler.getTagValue(snode, "startrow"), 0); startColumn[i] = Const.toInt(XMLHandler.getTagValue(snode, "startcol"), 0); } strictTypes = YES.equalsIgnoreCase( XMLHandler.getTagValue(stepnode, "strict_types") ); errorIgnored = YES.equalsIgnoreCase( XMLHandler.getTagValue(stepnode, "error_ignored") ); errorLineSkipped = YES.equalsIgnoreCase( XMLHandler.getTagValue(stepnode, "error_line_skipped") ); warningFilesDestinationDirectory = XMLHandler.getTagValue(stepnode, "bad_line_files_destination_directory"); warningFilesExtension = XMLHandler.getTagValue(stepnode, "bad_line_files_extension"); errorFilesDestinationDirectory = XMLHandler.getTagValue(stepnode, "error_line_files_destination_directory"); errorFilesExtension = XMLHandler.getTagValue(stepnode, "error_line_files_extension"); lineNumberFilesDestinationDirectory = XMLHandler.getTagValue(stepnode, "line_number_files_destination_directory"); lineNumberFilesExtension = XMLHandler.getTagValue(stepnode, "line_number_files_extension"); } catch(Exception e) { throw new KettleXMLException("Unable to read step information from XML", e); } } public void allocate(int nrfiles, int nrsheets, int nrfields) { fileName = new String[nrfiles]; fileMask = new String[nrfiles]; fileRequired = new String[nrfiles]; includeSubFolders = new String[nrfiles]; sheetName = new String[nrsheets]; startRow = new int [nrsheets]; startColumn = new int [nrsheets]; field = new ExcelInputField[nrfields]; } public void setDefault() { startsWithHeader = true; ignoreEmptyRows = true; rowNumberField = ""; sheetRowNumberField = ""; isaddresult=true; int nrfiles=0; int nrfields=0; int nrsheets=0; allocate(nrfiles, nrsheets, nrfields); for (int i=0;i<nrfiles;i++) { fileName[i]="filename"+(i+1); fileMask[i]=""; fileRequired[i] = NO; includeSubFolders[i] = NO; } for (int i=0;i<nrfields;i++) { field[i] = new ExcelInputField(); field[i].setName( "field"+i ); field[i].setType( ValueMetaInterface.TYPE_NUMBER ); field[i].setLength( 9 ); field[i].setPrecision( 2 ); field[i].setTrimType( TYPE_TRIM_NONE ); field[i].setRepeated( false ); } rowLimit=0L; strictTypes = false; errorIgnored = false; errorLineSkipped = false; warningFilesDestinationDirectory = null; warningFilesExtension = "warning"; errorFilesDestinationDirectory = null; errorFilesExtension = "error"; lineNumberFilesDestinationDirectory = null; lineNumberFilesExtension = "line"; } public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException { for (int i=0;i<field.length;i++) { int type=field[i].getType(); if (type==ValueMetaInterface.TYPE_NONE) type=ValueMetaInterface.TYPE_STRING; ValueMetaInterface v=new ValueMeta(field[i].getName(), type); v.setLength(field[i].getLength()); v.setPrecision(field[i].getPrecision()); v.setOrigin(name); v.setConversionMask(field[i].getFormat()); v.setDecimalSymbol(field[i].getDecimalSymbol()); v.setGroupingSymbol(field[i].getGroupSymbol()); v.setCurrencySymbol(field[i].getCurrencySymbol()); row.addValueMeta(v); } if (fileField!=null && fileField.length()>0) { ValueMetaInterface v = new ValueMeta(fileField, ValueMetaInterface.TYPE_STRING); v.setLength(250); v.setPrecision(-1); v.setOrigin(name); row.addValueMeta(v); } if (sheetField!=null && sheetField.length()>0) { ValueMetaInterface v = new ValueMeta(sheetField, ValueMetaInterface.TYPE_STRING); v.setLength(250); v.setPrecision(-1); v.setOrigin(name); row.addValueMeta(v); } if (sheetRowNumberField!=null && sheetRowNumberField.length()>0) { ValueMetaInterface v = new ValueMeta(sheetRowNumberField, ValueMetaInterface.TYPE_INTEGER); v.setLength(ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0); v.setOrigin(name); row.addValueMeta(v); } if (rowNumberField!=null && rowNumberField.length()>0) { ValueMetaInterface v = new ValueMeta(rowNumberField, ValueMetaInterface.TYPE_INTEGER); v.setLength(ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0); v.setOrigin(name); row.addValueMeta(v); } } public String getXML() { StringBuffer retval = new StringBuffer(1024); retval.append(" ").append(XMLHandler.addTagValue("header", startsWithHeader)); retval.append(" ").append(XMLHandler.addTagValue("noempty", ignoreEmptyRows)); retval.append(" ").append(XMLHandler.addTagValue("stoponempty", stopOnEmpty)); retval.append(" ").append(XMLHandler.addTagValue("filefield", fileField)); retval.append(" ").append(XMLHandler.addTagValue("sheetfield", sheetField)); retval.append(" ").append(XMLHandler.addTagValue("sheetrownumfield", sheetRowNumberField)); retval.append(" ").append(XMLHandler.addTagValue("rownumfield", rowNumberField)); retval.append(" ").append(XMLHandler.addTagValue("sheetfield", sheetField)); retval.append(" ").append(XMLHandler.addTagValue("filefield", fileField)); retval.append(" ").append(XMLHandler.addTagValue("limit", rowLimit)); retval.append(" ").append(XMLHandler.addTagValue("encoding", encoding)); retval.append(" "+XMLHandler.addTagValue("add_to_result_filenames", isaddresult)); retval.append(" ").append(XMLHandler.addTagValue("accept_filenames", acceptingFilenames)); retval.append(" ").append(XMLHandler.addTagValue("accept_field", acceptingField)); retval.append(" ").append(XMLHandler.addTagValue("accept_stepname", (acceptingStep!=null?acceptingStep.getName():"") )); /* * Describe the files to read */ retval.append(" <file>").append(Const.CR); for (int i=0;i<fileName.length;i++) { retval.append(" ").append(XMLHandler.addTagValue("name", fileName[i])); retval.append(" ").append(XMLHandler.addTagValue("filemask", fileMask[i])); retval.append(" ").append(XMLHandler.addTagValue("file_required", fileRequired[i])); retval.append(" ").append(XMLHandler.addTagValue("include_subfolders", includeSubFolders[i])); } retval.append(" </file>").append(Const.CR); /* * Describe the fields to read */ retval.append(" <fields>").append(Const.CR); for (int i=0;i<field.length;i++) { retval.append(" <field>").append(Const.CR); retval.append(" ").append(XMLHandler.addTagValue("name", field[i].getName()) ); retval.append(" ").append(XMLHandler.addTagValue("type", field[i].getTypeDesc()) ); retval.append(" ").append(XMLHandler.addTagValue("length", field[i].getLength()) ); retval.append(" ").append(XMLHandler.addTagValue("precision", field[i].getPrecision())); retval.append(" ").append(XMLHandler.addTagValue("trim_type", field[i].getTrimTypeCode() ) ); retval.append(" ").append(XMLHandler.addTagValue("repeat", field[i].isRepeated()) ); retval.append(" ").append(XMLHandler.addTagValue("format", field[i].getFormat())); retval.append(" ").append(XMLHandler.addTagValue("currency", field[i].getCurrencySymbol())); retval.append(" ").append(XMLHandler.addTagValue("decimal", field[i].getDecimalSymbol())); retval.append(" ").append(XMLHandler.addTagValue("group", field[i].getGroupSymbol())); retval.append(" </field>").append(Const.CR); } retval.append(" </fields>").append(Const.CR); /* * Describe the sheets to load... */ retval.append(" <sheets>").append(Const.CR); for (int i=0;i<sheetName.length;i++) { retval.append(" <sheet>").append(Const.CR); retval.append(" ").append(XMLHandler.addTagValue("name", sheetName[i])); retval.append(" ").append(XMLHandler.addTagValue("startrow", startRow[i])); retval.append(" ").append(XMLHandler.addTagValue("startcol", startColumn[i])); retval.append(" </sheet>").append(Const.CR); } retval.append(" </sheets>").append(Const.CR); // ERROR HANDLING retval.append(" ").append(XMLHandler.addTagValue("strict_types", strictTypes)); retval.append(" ").append(XMLHandler.addTagValue("error_ignored", errorIgnored)); retval.append(" ").append(XMLHandler.addTagValue("error_line_skipped", errorLineSkipped)); retval.append(" ").append(XMLHandler.addTagValue("bad_line_files_destination_directory", warningFilesDestinationDirectory)); retval.append(" ").append(XMLHandler.addTagValue("bad_line_files_extension", warningFilesExtension)); retval.append(" ").append(XMLHandler.addTagValue("error_line_files_destination_directory", errorFilesDestinationDirectory)); retval.append(" ").append(XMLHandler.addTagValue("error_line_files_extension", errorFilesExtension)); retval.append(" ").append(XMLHandler.addTagValue("line_number_files_destination_directory", lineNumberFilesDestinationDirectory)); retval.append(" ").append(XMLHandler.addTagValue("line_number_files_extension", lineNumberFilesExtension)); return retval.toString(); } public void readRep(Repository rep, ObjectId id_step, List<DatabaseMeta> databases, Map<String, Counter> counters) throws KettleException { try { startsWithHeader = rep.getStepAttributeBoolean(id_step, "header"); ignoreEmptyRows = rep.getStepAttributeBoolean(id_step, "noempty"); stopOnEmpty = rep.getStepAttributeBoolean(id_step, "stoponempty"); fileField = rep.getStepAttributeString (id_step, "filefield"); sheetField = rep.getStepAttributeString (id_step, "sheetfield"); sheetRowNumberField = rep.getStepAttributeString (id_step, "sheetrownumfield"); rowNumberField = rep.getStepAttributeString (id_step, "rownumfield"); rowLimit = (int)rep.getStepAttributeInteger(id_step, "limit"); encoding = rep.getStepAttributeString (id_step, "encoding"); String addToResult=rep.getStepAttributeString (id_step, "add_to_result_filenames"); if(Const.isEmpty(addToResult)) isaddresult = true; else isaddresult = rep.getStepAttributeBoolean(id_step, "add_to_result_filenames"); acceptingFilenames = rep.getStepAttributeBoolean(id_step, "accept_filenames"); acceptingField = rep.getStepAttributeString (id_step, "accept_field"); acceptingStepName = rep.getStepAttributeString (id_step, "accept_stepname"); int nrfiles = rep.countNrStepAttributes(id_step, "file_name"); int nrsheets = rep.countNrStepAttributes(id_step, "sheet_name"); int nrfields = rep.countNrStepAttributes(id_step, "field_name"); allocate(nrfiles, nrsheets, nrfields); // System.out.println("Counted "+nrfiles+" files to read and "+nrsheets+" sheets, "+nrfields+" fields."); for (int i=0;i<nrfiles;i++) { fileName[i] = rep.getStepAttributeString (id_step, i, "file_name"); fileMask[i] = rep.getStepAttributeString (id_step, i, "file_mask"); fileRequired[i] = rep.getStepAttributeString(id_step, i, "file_required"); if(!YES.equalsIgnoreCase(fileRequired[i])) fileRequired[i] = NO; includeSubFolders[i] = rep.getStepAttributeString(id_step, i, "include_subfolders"); if(!YES.equalsIgnoreCase(includeSubFolders[i])) includeSubFolders[i] = NO; } for (int i=0;i<nrsheets;i++) { sheetName[i] = rep.getStepAttributeString (id_step, i, "sheet_name" ); startRow[i] = (int)rep.getStepAttributeInteger(id_step, i, "sheet_startrow" ); startColumn[i] = (int)rep.getStepAttributeInteger(id_step, i, "sheet_startcol" ); } for (int i=0;i<nrfields;i++) { field[i] = new ExcelInputField(); field[i].setName( rep.getStepAttributeString (id_step, i, "field_name") ); field[i].setType( ValueMeta.getType( rep.getStepAttributeString (id_step, i, "field_type") ) ); field[i].setLength( (int)rep.getStepAttributeInteger(id_step, i, "field_length") ); field[i].setPrecision( (int)rep.getStepAttributeInteger(id_step, i, "field_precision") ); field[i].setTrimType( getTrimTypeByCode( rep.getStepAttributeString (id_step, i, "field_trim_type") ) ); field[i].setRepeated( rep.getStepAttributeBoolean(id_step, i, "field_repeat") ); field[i].setFormat(rep.getStepAttributeString(id_step, i, "field_format")); field[i].setCurrencySymbol(rep.getStepAttributeString(id_step, i, "field_currency")); field[i].setDecimalSymbol(rep.getStepAttributeString(id_step, i, "field_decimal")); field[i].setGroupSymbol(rep.getStepAttributeString(id_step, i, "field_group")); } strictTypes = rep.getStepAttributeBoolean(id_step, 0, "strict_types", false); errorIgnored = rep.getStepAttributeBoolean(id_step, 0, "error_ignored", false); errorLineSkipped = rep.getStepAttributeBoolean(id_step, 0, "error_line_skipped", false); warningFilesDestinationDirectory = rep.getStepAttributeString(id_step, "bad_line_files_dest_dir"); warningFilesExtension = rep.getStepAttributeString(id_step, "bad_line_files_ext"); errorFilesDestinationDirectory = rep.getStepAttributeString(id_step, "error_line_files_dest_dir"); errorFilesExtension = rep.getStepAttributeString(id_step, "error_line_files_ext"); lineNumberFilesDestinationDirectory = rep.getStepAttributeString(id_step, "line_number_files_dest_dir"); lineNumberFilesExtension = rep.getStepAttributeString(id_step, "line_number_files_ext"); } catch(Exception e) { throw new KettleException("Unexpected error reading step information from the repository", e); } } public void saveRep(Repository rep, ObjectId id_transformation, ObjectId id_step) throws KettleException { try { rep.saveStepAttribute(id_transformation, id_step, "header", startsWithHeader); rep.saveStepAttribute(id_transformation, id_step, "noempty", ignoreEmptyRows); rep.saveStepAttribute(id_transformation, id_step, "stoponempty", stopOnEmpty); rep.saveStepAttribute(id_transformation, id_step, "filefield", fileField); rep.saveStepAttribute(id_transformation, id_step, "sheetfield", sheetField); rep.saveStepAttribute(id_transformation, id_step, "sheetrownumfield", sheetRowNumberField); rep.saveStepAttribute(id_transformation, id_step, "rownumfield", rowNumberField); rep.saveStepAttribute(id_transformation, id_step, "limit", rowLimit); rep.saveStepAttribute(id_transformation, id_step, "encoding", encoding); rep.saveStepAttribute(id_transformation, id_step, "add_to_result_filenames", isaddresult); rep.saveStepAttribute(id_transformation, id_step, "accept_filenames", acceptingFilenames); rep.saveStepAttribute(id_transformation, id_step, "accept_field", acceptingField); rep.saveStepAttribute(id_transformation, id_step, "accept_stepname", (acceptingStep!=null?acceptingStep.getName():"") ); for (int i=0;i<fileName.length;i++) { rep.saveStepAttribute(id_transformation, id_step, i, "file_name", fileName[i]); rep.saveStepAttribute(id_transformation, id_step, i, "file_mask", fileMask[i]); rep.saveStepAttribute(id_transformation, id_step, i, "file_required", fileRequired[i]); rep.saveStepAttribute(id_transformation, id_step, i, "include_subfolders", includeSubFolders[i]); } for (int i=0;i<sheetName.length;i++) { rep.saveStepAttribute(id_transformation, id_step, i, "sheet_name", sheetName[i]); rep.saveStepAttribute(id_transformation, id_step, i, "sheet_startrow", startRow[i]); rep.saveStepAttribute(id_transformation, id_step, i, "sheet_startcol", startColumn[i]); } for (int i=0;i<field.length;i++) { rep.saveStepAttribute(id_transformation, id_step, i, "field_name", field[i].getName() ); rep.saveStepAttribute(id_transformation, id_step, i, "field_type", field[i].getTypeDesc() ); rep.saveStepAttribute(id_transformation, id_step, i, "field_length", field[i].getLength() ); rep.saveStepAttribute(id_transformation, id_step, i, "field_precision", field[i].getPrecision() ); rep.saveStepAttribute(id_transformation, id_step, i, "field_trim_type", field[i].getTrimTypeCode() ); rep.saveStepAttribute(id_transformation, id_step, i, "field_repeat", field[i].isRepeated()); rep.saveStepAttribute(id_transformation, id_step, i, "field_format", field[i].getFormat()); rep.saveStepAttribute(id_transformation, id_step, i, "field_currency", field[i].getCurrencySymbol()); rep.saveStepAttribute(id_transformation, id_step, i, "field_decimal", field[i].getDecimalSymbol()); rep.saveStepAttribute(id_transformation, id_step, i, "field_group", field[i].getGroupSymbol()); } rep.saveStepAttribute(id_transformation, id_step, "strict_types", strictTypes); rep.saveStepAttribute(id_transformation, id_step, "error_ignored", errorIgnored); rep.saveStepAttribute(id_transformation, id_step, "error_line_skipped", errorLineSkipped); rep.saveStepAttribute(id_transformation, id_step, "bad_line_files_dest_dir", warningFilesDestinationDirectory); rep.saveStepAttribute(id_transformation, id_step, "bad_line_files_ext", warningFilesExtension); rep.saveStepAttribute(id_transformation, id_step, "error_line_files_dest_dir", errorFilesDestinationDirectory); rep.saveStepAttribute(id_transformation, id_step, "error_line_files_ext", errorFilesExtension); rep.saveStepAttribute(id_transformation, id_step, "line_number_files_dest_dir", lineNumberFilesDestinationDirectory); rep.saveStepAttribute(id_transformation, id_step, "line_number_files_ext", lineNumberFilesExtension); } catch(Exception e) { throw new KettleException("Unable to save step information to the repository for id_step="+id_step, e); } } public final static int getTrimTypeByCode(String tt) { if (tt!=null) { for (int i=0;i<type_trim_code.length;i++) { if (type_trim_code[i].equalsIgnoreCase(tt)) return i; } } return 0; } public final static int getTrimTypeByDesc(String tt) { if (tt!=null) { for (int i=0;i<type_trim_desc.length;i++) { if (type_trim_desc[i].equalsIgnoreCase(tt)) return i; } } return 0; } public final static String getTrimTypeCode(int i) { if (i<0 || i>=type_trim_code.length) return type_trim_code[0]; return type_trim_code[i]; } public final static String getTrimTypeDesc(int i) { if (i<0 || i>=type_trim_desc.length) return type_trim_desc[0]; return type_trim_desc[i]; } public String[] getFilePaths(VariableSpace space) { return FileInputList.createFilePathList(space, fileName, fileMask, fileRequired, includeSubFolderBoolean()); } public FileInputList getFileList(VariableSpace space) { return FileInputList.createFileList(space, fileName, fileMask, fileRequired, includeSubFolderBoolean()); } private boolean[] includeSubFolderBoolean() { int len=fileName.length; boolean includeSubFolderBoolean[]= new boolean[len]; for(int i=0; i<len; i++) { includeSubFolderBoolean[i]=YES.equalsIgnoreCase(includeSubFolders[i]); } return includeSubFolderBoolean; } public String getLookupStepname() { if (acceptingFilenames && acceptingStep!=null && !Const.isEmpty( acceptingStep.getName() ) ) return acceptingStep.getName(); return null; } public void searchInfoAndTargetSteps(List<StepMeta> steps) { acceptingStep = StepMeta.findStep(steps, acceptingStepName); } public String[] getInfoSteps() { return null; } public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String input[], String output[], RowMetaInterface info) { CheckResult cr; // See if we get input... if (input.length>0) { if ( !isAcceptingFilenames() ) { cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "ExcelInputMeta.CheckResult.NoInputError"), stepMeta); remarks.add(cr); } else { cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "ExcelInputMeta.CheckResult.AcceptFilenamesOk"), stepMeta); remarks.add(cr); } } else { cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "ExcelInputMeta.CheckResult.NoInputOk"), stepMeta); remarks.add(cr); } FileInputList fileList = getFileList(transMeta); if (fileList.nrOfFiles() == 0) { if ( ! isAcceptingFilenames() ) { cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "ExcelInputMeta.CheckResult.ExpectedFilesError"), stepMeta); remarks.add(cr); } } else { cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "ExcelInputMeta.CheckResult.ExpectedFilesOk", ""+fileList.nrOfFiles()), stepMeta); remarks.add(cr); } } public RowMetaInterface getEmptyFields() { RowMetaInterface row = new RowMeta(); for (int i=0;i<field.length;i++) { ValueMetaInterface v = new ValueMeta(field[i].getName(), field[i].getType()); row.addValueMeta(v); } return row; } public StepInterface getStep(StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta transMeta, Trans trans) { return new ExcelInput(stepMeta, stepDataInterface, cnr, transMeta, trans); } public StepDataInterface getStepData() { return new ExcelInputData(); } public String getWarningFilesDestinationDirectory() { return warningFilesDestinationDirectory; } public void setWarningFilesDestinationDirectory( String badLineFilesDestinationDirectory) { this.warningFilesDestinationDirectory = badLineFilesDestinationDirectory; } public String getBadLineFilesExtension() { return warningFilesExtension; } public void setBadLineFilesExtension(String badLineFilesExtension) { this.warningFilesExtension = badLineFilesExtension; } public boolean isErrorIgnored() { return errorIgnored; } public void setErrorIgnored(boolean errorIgnored) { this.errorIgnored = errorIgnored; } public String getErrorFilesDestinationDirectory() { return errorFilesDestinationDirectory; } public void setErrorFilesDestinationDirectory( String errorLineFilesDestinationDirectory) { this.errorFilesDestinationDirectory = errorLineFilesDestinationDirectory; } public String getErrorFilesExtension() { return errorFilesExtension; } public void setErrorFilesExtension(String errorLineFilesExtension) { this.errorFilesExtension = errorLineFilesExtension; } public String getLineNumberFilesDestinationDirectory() { return lineNumberFilesDestinationDirectory; } public void setLineNumberFilesDestinationDirectory( String lineNumberFilesDestinationDirectory) { this.lineNumberFilesDestinationDirectory = lineNumberFilesDestinationDirectory; } public String getLineNumberFilesExtension() { return lineNumberFilesExtension; } public void setLineNumberFilesExtension(String lineNumberFilesExtension) { this.lineNumberFilesExtension = lineNumberFilesExtension; } public boolean isErrorLineSkipped() { return errorLineSkipped; } public void setErrorLineSkipped(boolean errorLineSkipped) { this.errorLineSkipped = errorLineSkipped; } public boolean isStrictTypes() { return strictTypes; } public void setStrictTypes(boolean strictTypes) { this.strictTypes = strictTypes; } public String[] getFileRequired() { return fileRequired; } public void setFileRequired(String[] fileRequiredin) { fileRequired = new String[fileRequiredin.length]; for (int i=0;i<fileRequiredin.length && i < fileRequired.length;i++) { this.fileRequired[i] = getRequiredFilesCode(fileRequiredin[i]); } } /** * @return Returns the acceptingField. */ public String getAcceptingField() { return acceptingField; } /** * @param acceptingField The acceptingField to set. */ public void setAcceptingField(String acceptingField) { this.acceptingField = acceptingField; } /** * @return Returns the acceptingFilenames. */ public boolean isAcceptingFilenames() { return acceptingFilenames; } /** * @param acceptingFilenames The acceptingFilenames to set. */ public void setAcceptingFilenames(boolean acceptingFilenames) { this.acceptingFilenames = acceptingFilenames; } /** * @return Returns the acceptingStep. */ public StepMeta getAcceptingStep() { return acceptingStep; } /** * @param acceptingStep The acceptingStep to set. */ public void setAcceptingStep(StepMeta acceptingStep) { this.acceptingStep = acceptingStep; } /** * @return Returns the acceptingStepName. */ public String getAcceptingStepName() { return acceptingStepName; } /** * @param acceptingStepName The acceptingStepName to set. */ public void setAcceptingStepName(String acceptingStepName) { this.acceptingStepName = acceptingStepName; } public String[] getUsedLibraries() { return new String[] { "jxl.jar", }; } /** * @return the encoding */ public String getEncoding() { return encoding; } /** * @param encoding the encoding to set */ public void setEncoding(String encoding) { this.encoding = encoding; } /** * @param isaddresult The isaddresult to set. */ public void setAddResultFile(boolean isaddresult) { this.isaddresult = isaddresult; } /** * @return Returns isaddresult. */ public boolean isAddResultFile() { return isaddresult; } /** * Read all sheets if the sheet names are left blank. * @return true if all sheets are read. */ public boolean readAllSheets() { return Const.isEmpty(sheetName) || ( sheetName.length==1 && Const.isEmpty(sheetName[0]) ); } /** * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively. * So what this does is turn the name of files into absolute paths OR it simply includes the resource in the ZIP file. * For now, we'll simply turn it into an absolute path and pray that the file is on a shared drive or something like that. * TODO: create options to configure this behavior */ public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException { try { // The object that we're modifying here is a copy of the original! // So let's change the filename from relative to absolute by grabbing the file object... // In case the name of the file comes from previous steps, forget about this! // List<FileObject> newFiles = new ArrayList<FileObject>(); if (!acceptingFilenames) { FileInputList fileList = getFileList(space); if (fileList.getFiles().size()>0) { for (FileObject fileObject : fileList.getFiles()) { // From : ${Internal.Transformation.Filename.Directory}/../foo/bar.xls // To : /home/matt/test/files/foo/bar.xls // // If the file doesn't exist, forget about this effort too! // if (fileObject.exists()) { // Convert to an absolute path and add it to the list. // newFiles.add(fileObject); } } // Still here: set a new list of absolute filenames! // fileName = new String[newFiles.size()]; fileMask = new String[newFiles.size()]; // all null since converted to absolute path. fileRequired = new String[newFiles.size()]; // all null, turn to "Y" : for (int i=0;i<newFiles.size();i++) { FileObject fileObject = newFiles.get(i); fileName[i] = resourceNamingInterface.nameResource( fileObject.getName().getBaseName(), fileObject.getParent().getName().getPath(), space.toString(), FileNamingType.DATA_FILE); fileRequired[i]="Y"; } } } return null; } catch (Exception e) { throw new KettleException(e); //$NON-NLS-1$ } } }
src/org/pentaho/di/trans/steps/excelinput/ExcelInputMeta.java
/* Copyright (c) 2007 Pentaho Corporation. All rights reserved. * This software was developed by Pentaho Corporation and is provided under the terms * of the GNU Lesser General Public License, Version 2.1. You may not use * this file except in compliance with the license. If you need a copy of the license, * please go to http://www.gnu.org/licenses/lgpl-2.1.txt. The Original Code is Pentaho * Data Integration. The Initial Developer is Pentaho Corporation. * * Software distributed under the GNU Lesser Public License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to * the license for the specific language governing your rights and limitations.*/ /* * * Created on 4-apr-2003 * */ package org.pentaho.di.trans.steps.excelinput; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.commons.vfs.FileObject; import org.pentaho.di.core.CheckResult; import org.pentaho.di.core.CheckResultInterface; import org.pentaho.di.core.Const; import org.pentaho.di.core.Counter; import org.pentaho.di.core.database.DatabaseMeta; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.exception.KettleStepException; import org.pentaho.di.core.exception.KettleXMLException; import org.pentaho.di.core.fileinput.FileInputList; import org.pentaho.di.core.row.RowMeta; import org.pentaho.di.core.row.RowMetaInterface; import org.pentaho.di.core.row.ValueMeta; import org.pentaho.di.core.row.ValueMetaInterface; import org.pentaho.di.core.variables.VariableSpace; import org.pentaho.di.core.xml.XMLHandler; import org.pentaho.di.i18n.BaseMessages; import org.pentaho.di.repository.Repository; import org.pentaho.di.repository.ObjectId; import org.pentaho.di.resource.ResourceDefinition; import org.pentaho.di.resource.ResourceNamingInterface; import org.pentaho.di.trans.Trans; import org.pentaho.di.trans.TransMeta; import org.pentaho.di.trans.step.BaseStepMeta; import org.pentaho.di.trans.step.StepDataInterface; import org.pentaho.di.trans.step.StepInterface; import org.pentaho.di.trans.step.StepMeta; import org.pentaho.di.trans.step.StepMetaInterface; import org.w3c.dom.Node; /** * Meta data for the Excel step. */ public class ExcelInputMeta extends BaseStepMeta implements StepMetaInterface { private static Class<?> PKG = ExcelInputMeta.class; // for i18n purposes, needed by Translator2!! $NON-NLS-1$ public static final String[] RequiredFilesDesc = new String[] { BaseMessages.getString(PKG, "System.Combo.No"), BaseMessages.getString(PKG, "System.Combo.Yes") }; public static final String[] RequiredFilesCode = new String[] {"N", "Y"}; private static final String NO = "N"; private static final String YES = "Y"; public final static int TYPE_TRIM_NONE = 0; public final static int TYPE_TRIM_LEFT = 1; public final static int TYPE_TRIM_RIGHT = 2; public final static int TYPE_TRIM_BOTH = 3; public final static String type_trim_code[] = { "none", "left", "right", "both" }; public final static String type_trim_desc[] = { BaseMessages.getString(PKG, "ExcelInputMeta.TrimType.None"), BaseMessages.getString(PKG, "ExcelInputMeta.TrimType.Left"), BaseMessages.getString(PKG, "ExcelInputMeta.TrimType.Right"), BaseMessages.getString(PKG, "ExcelInputMeta.TrimType.Both") }; public static final String STRING_SEPARATOR = " \t --> "; /** * The filenames to load or directory in case a filemask was set. */ private String fileName[]; /** * The regular expression to use (null means: no mask) */ private String fileMask[]; /** Array of boolean values as string, indicating if a file is required. */ private String fileRequired[]; /** * The fieldname that holds the name of the file */ private String fileField; /** * The names of the sheets to load. * Null means: all sheets... */ private String sheetName[]; /** * The row-nr where we start processing. */ private int startRow[]; /** * The column-nr where we start processing. */ private int startColumn[]; /** * The fieldname that holds the name of the sheet */ private String sheetField; /** * The cell-range starts with a header-row */ private boolean startsWithHeader; /** * Stop reading when you hit an empty row. */ private boolean stopOnEmpty; /** * Avoid empty rows in the result. */ private boolean ignoreEmptyRows; /** * The fieldname containing the row number. * An empty (null) value means that no row number is included in the output. * This is the rownumber of all written rows (not the row in the sheet). */ private String rowNumberField; /** * The fieldname containing the sheet row number. * An empty (null) value means that no sheet row number is included in the output. * Sheet row number is the row number in the sheet. */ private String sheetRowNumberField; /** * The maximum number of rows that this step writes to the next step. */ private long rowLimit; /** * The fields to read in the range. * Note: the number of columns in the range has to match field.length */ private ExcelInputField field[]; /** Strict types : will generate erros */ private boolean strictTypes; /** Ignore error : turn into warnings */ private boolean errorIgnored; /** If error line are skipped, you can replay without introducing doubles.*/ private boolean errorLineSkipped; /** The directory that will contain warning files */ private String warningFilesDestinationDirectory; /** The extension of warning files */ private String warningFilesExtension; /** The directory that will contain error files */ private String errorFilesDestinationDirectory; /** The extension of error files */ private String errorFilesExtension; /** The directory that will contain line number files */ private String lineNumberFilesDestinationDirectory; /** The extension of line number files */ private String lineNumberFilesExtension; /** Are we accepting filenames in input rows? */ private boolean acceptingFilenames; /** The field in which the filename is placed */ private String acceptingField; /** The stepname to accept filenames from */ private String acceptingStepName; /** Array of boolean values as string, indicating if we need to fetch sub folders. */ private String includeSubFolders[]; /** The step to accept filenames from */ private StepMeta acceptingStep; /** The encoding to use for reading: null or empty string means system default encoding */ private String encoding; /** The add filenames to result filenames flag */ private boolean isaddresult; public ExcelInputMeta() { super(); // allocate BaseStepMeta } /** * @return Returns the fieldLength. */ public ExcelInputField[] getField() { return field; } /** * @param fields The excel input fields to set. */ public void setField(ExcelInputField[] fields) { this.field = fields; } /** * @return Returns the fileField. */ public String getFileField() { return fileField; } /** * @param fileField The fileField to set. */ public void setFileField(String fileField) { this.fileField = fileField; } /** * @return Returns the fileMask. */ public String[] getFileMask() { return fileMask; } /** * @param fileMask The fileMask to set. */ public void setFileMask(String[] fileMask) { this.fileMask = fileMask; } public String[] getIncludeSubFolders() { return includeSubFolders; } public void setIncludeSubFolders(String[] includeSubFoldersin) { includeSubFolders = new String[includeSubFoldersin.length]; for (int i=0;i<includeSubFoldersin.length && i <includeSubFolders.length;i++) { this.includeSubFolders[i] = getRequiredFilesCode(includeSubFoldersin[i]); } } public String getRequiredFilesCode(String tt) { if(tt==null) return RequiredFilesCode[0]; if(tt.equals(RequiredFilesDesc[1])) return RequiredFilesCode[1]; else return RequiredFilesCode[0]; } public String getRequiredFilesDesc(String tt) { if(tt==null) return RequiredFilesDesc[0]; if(tt.equals(RequiredFilesCode[1])) return RequiredFilesDesc[1]; else return RequiredFilesDesc[0]; } /** * @return Returns the fileName. */ public String[] getFileName() { return fileName; } /** * @param fileName The fileName to set. */ public void setFileName(String[] fileName) { this.fileName = fileName; } /** * @return Returns the ignoreEmptyRows. */ public boolean ignoreEmptyRows() { return ignoreEmptyRows; } /** * @param ignoreEmptyRows The ignoreEmptyRows to set. */ public void setIgnoreEmptyRows(boolean ignoreEmptyRows) { this.ignoreEmptyRows = ignoreEmptyRows; } /** * @return Returns the rowLimit. */ public long getRowLimit() { return rowLimit; } /** * @param rowLimit The rowLimit to set. */ public void setRowLimit(long rowLimit) { this.rowLimit = rowLimit; } /** * @return Returns the rowNumberField. */ public String getRowNumberField() { return rowNumberField; } /** * @param rowNumberField The rowNumberField to set. */ public void setRowNumberField(String rowNumberField) { this.rowNumberField = rowNumberField; } /** * @return Returns the sheetRowNumberField. */ public String getSheetRowNumberField() { return sheetRowNumberField; } /** * @param rowNumberField The rowNumberField to set. */ public void setSheetRowNumberField(String rowNumberField) { this.sheetRowNumberField = rowNumberField; } /** * @return Returns the sheetField. */ public String getSheetField() { return sheetField; } /** * @param sheetField The sheetField to set. */ public void setSheetField(String sheetField) { this.sheetField = sheetField; } /** * @return Returns the sheetName. */ public String[] getSheetName() { return sheetName; } /** * @param sheetName The sheetName to set. */ public void setSheetName(String[] sheetName) { this.sheetName = sheetName; } /** * @return Returns the startColumn. */ public int[] getStartColumn() { return startColumn; } /** * @param startColumn The startColumn to set. */ public void setStartColumn(int[] startColumn) { this.startColumn = startColumn; } /** * @return Returns the startRow. */ public int[] getStartRow() { return startRow; } /** * @param startRow The startRow to set. */ public void setStartRow(int[] startRow) { this.startRow = startRow; } /** * @return Returns the startsWithHeader. */ public boolean startsWithHeader() { return startsWithHeader; } /** * @param startsWithHeader The startsWithHeader to set. */ public void setStartsWithHeader(boolean startsWithHeader) { this.startsWithHeader = startsWithHeader; } /** * @return Returns the stopOnEmpty. */ public boolean stopOnEmpty() { return stopOnEmpty; } /** * @param stopOnEmpty The stopOnEmpty to set. */ public void setStopOnEmpty(boolean stopOnEmpty) { this.stopOnEmpty = stopOnEmpty; } public void loadXML(Node stepnode, List<DatabaseMeta> databases, Map<String, Counter> counters) throws KettleXMLException { readData(stepnode); } public Object clone() { ExcelInputMeta retval = (ExcelInputMeta)super.clone(); int nrfiles = fileName.length; int nrsheets = sheetName.length; int nrfields = field.length; retval.allocate(nrfiles, nrsheets, nrfields); for (int i=0;i<nrfields;i++) { retval.field[i] = (ExcelInputField) field[i].clone(); } for (int i=0;i<nrfiles;i++) { retval.fileName[i] = fileName[i]; retval.fileMask[i] = fileMask[i]; retval.fileRequired[i] = fileRequired[i]; retval.includeSubFolders[i] = includeSubFolders[i]; } for (int i=0;i<nrsheets;i++) { retval.sheetName[i] = sheetName[i]; } return retval; } private void readData(Node stepnode) throws KettleXMLException { try { startsWithHeader = YES.equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "header")); String nempty = XMLHandler.getTagValue(stepnode, "noempty"); ignoreEmptyRows = YES.equalsIgnoreCase(nempty) || nempty==null; String soempty = XMLHandler.getTagValue(stepnode, "stoponempty"); stopOnEmpty = YES.equalsIgnoreCase(soempty) || nempty==null; sheetRowNumberField = XMLHandler.getTagValue(stepnode, "sheetrownumfield"); rowNumberField = XMLHandler.getTagValue(stepnode, "rownum_field"); rowNumberField = XMLHandler.getTagValue(stepnode, "rownumfield"); rowLimit = Const.toLong(XMLHandler.getTagValue(stepnode, "limit"), 0); encoding = XMLHandler.getTagValue(stepnode, "encoding"); String addToResult=XMLHandler.getTagValue(stepnode, "add_to_result_filenames"); if(Const.isEmpty(addToResult)) isaddresult = true; else isaddresult = "Y".equalsIgnoreCase(addToResult); sheetField = XMLHandler.getTagValue(stepnode, "sheetfield"); fileField = XMLHandler.getTagValue(stepnode, "filefield"); acceptingFilenames = YES.equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "accept_filenames")); acceptingField = XMLHandler.getTagValue(stepnode, "accept_field"); acceptingStepName = XMLHandler.getTagValue(stepnode, "accept_stepname"); Node filenode = XMLHandler.getSubNode(stepnode, "file"); Node sheetsnode = XMLHandler.getSubNode(stepnode, "sheets"); Node fields = XMLHandler.getSubNode(stepnode, "fields"); int nrfiles = XMLHandler.countNodes(filenode, "name"); int nrsheets = XMLHandler.countNodes(sheetsnode, "sheet"); int nrfields = XMLHandler.countNodes(fields, "field"); allocate(nrfiles, nrsheets, nrfields); for (int i=0;i<nrfiles;i++) { Node filenamenode = XMLHandler.getSubNodeByNr(filenode, "name", i); Node filemasknode = XMLHandler.getSubNodeByNr(filenode, "filemask", i); Node fileRequirednode = XMLHandler.getSubNodeByNr(filenode, "file_required", i); Node includeSubFoldersnode = XMLHandler.getSubNodeByNr(filenode, "include_subfolders", i); fileName[i] = XMLHandler.getNodeValue(filenamenode); fileMask[i] = XMLHandler.getNodeValue(filemasknode); fileRequired[i] = XMLHandler.getNodeValue(fileRequirednode); includeSubFolders[i] = XMLHandler.getNodeValue(includeSubFoldersnode); } for (int i=0;i<nrfields;i++) { Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i); field[i] = new ExcelInputField(); field[i].setName( XMLHandler.getTagValue(fnode, "name") ); field[i].setType( ValueMeta.getType(XMLHandler.getTagValue(fnode, "type")) ); field[i].setLength( Const.toInt(XMLHandler.getTagValue(fnode, "length"), -1) ); field[i].setPrecision( Const.toInt(XMLHandler.getTagValue(fnode, "precision"), -1) ); String srepeat = XMLHandler.getTagValue(fnode, "repeat"); field[i].setTrimType( getTrimTypeByCode(XMLHandler.getTagValue(fnode, "trim_type")) ); if (srepeat!=null) field[i].setRepeated( YES.equalsIgnoreCase(srepeat) ); else field[i].setRepeated( false ); field[i].setFormat(XMLHandler.getTagValue(fnode, "format")); field[i].setCurrencySymbol(XMLHandler.getTagValue(fnode, "currency")); field[i].setDecimalSymbol(XMLHandler.getTagValue(fnode, "decimal")); field[i].setGroupSymbol(XMLHandler.getTagValue(fnode, "group")); } for (int i=0;i<nrsheets;i++) { Node snode = XMLHandler.getSubNodeByNr(sheetsnode, "sheet", i); sheetName[i] = XMLHandler.getTagValue(snode, "name"); startRow[i] = Const.toInt(XMLHandler.getTagValue(snode, "startrow"), 0); startColumn[i] = Const.toInt(XMLHandler.getTagValue(snode, "startcol"), 0); } strictTypes = YES.equalsIgnoreCase( XMLHandler.getTagValue(stepnode, "strict_types") ); errorIgnored = YES.equalsIgnoreCase( XMLHandler.getTagValue(stepnode, "error_ignored") ); errorLineSkipped = YES.equalsIgnoreCase( XMLHandler.getTagValue(stepnode, "error_line_skipped") ); warningFilesDestinationDirectory = XMLHandler.getTagValue(stepnode, "bad_line_files_destination_directory"); warningFilesExtension = XMLHandler.getTagValue(stepnode, "bad_line_files_extension"); errorFilesDestinationDirectory = XMLHandler.getTagValue(stepnode, "error_line_files_destination_directory"); errorFilesExtension = XMLHandler.getTagValue(stepnode, "error_line_files_extension"); lineNumberFilesDestinationDirectory = XMLHandler.getTagValue(stepnode, "line_number_files_destination_directory"); lineNumberFilesExtension = XMLHandler.getTagValue(stepnode, "line_number_files_extension"); } catch(Exception e) { throw new KettleXMLException("Unable to read step information from XML", e); } } public void allocate(int nrfiles, int nrsheets, int nrfields) { fileName = new String[nrfiles]; fileMask = new String[nrfiles]; fileRequired = new String[nrfiles]; includeSubFolders = new String[nrfiles]; sheetName = new String[nrsheets]; startRow = new int [nrsheets]; startColumn = new int [nrsheets]; field = new ExcelInputField[nrfields]; } public void setDefault() { startsWithHeader = true; ignoreEmptyRows = true; rowNumberField = ""; sheetRowNumberField = ""; isaddresult=true; int nrfiles=0; int nrfields=0; int nrsheets=0; allocate(nrfiles, nrsheets, nrfields); for (int i=0;i<nrfiles;i++) { fileName[i]="filename"+(i+1); fileMask[i]=""; fileRequired[i] = NO; includeSubFolders[i] = NO; } for (int i=0;i<nrfields;i++) { field[i] = new ExcelInputField(); field[i].setName( "field"+i ); field[i].setType( ValueMetaInterface.TYPE_NUMBER ); field[i].setLength( 9 ); field[i].setPrecision( 2 ); field[i].setTrimType( TYPE_TRIM_NONE ); field[i].setRepeated( false ); } rowLimit=0L; strictTypes = false; errorIgnored = false; errorLineSkipped = false; warningFilesDestinationDirectory = null; warningFilesExtension = "warning"; errorFilesDestinationDirectory = null; errorFilesExtension = "error"; lineNumberFilesDestinationDirectory = null; lineNumberFilesExtension = "line"; } public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException { for (int i=0;i<field.length;i++) { int type=field[i].getType(); if (type==ValueMetaInterface.TYPE_NONE) type=ValueMetaInterface.TYPE_STRING; ValueMetaInterface v=new ValueMeta(field[i].getName(), type); v.setLength(field[i].getLength()); v.setPrecision(field[i].getPrecision()); v.setOrigin(name); v.setConversionMask(field[i].getFormat()); v.setDecimalSymbol(field[i].getDecimalSymbol()); v.setGroupingSymbol(field[i].getGroupSymbol()); v.setCurrencySymbol(field[i].getCurrencySymbol()); row.addValueMeta(v); } if (fileField!=null && fileField.length()>0) { ValueMetaInterface v = new ValueMeta(fileField, ValueMetaInterface.TYPE_STRING); v.setLength(250); v.setPrecision(-1); v.setOrigin(name); row.addValueMeta(v); } if (sheetField!=null && sheetField.length()>0) { ValueMetaInterface v = new ValueMeta(sheetField, ValueMetaInterface.TYPE_STRING); v.setLength(250); v.setPrecision(-1); v.setOrigin(name); row.addValueMeta(v); } if (sheetRowNumberField!=null && sheetRowNumberField.length()>0) { ValueMetaInterface v = new ValueMeta(sheetRowNumberField, ValueMetaInterface.TYPE_INTEGER); v.setLength(ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0); v.setOrigin(name); row.addValueMeta(v); } if (rowNumberField!=null && rowNumberField.length()>0) { ValueMetaInterface v = new ValueMeta(rowNumberField, ValueMetaInterface.TYPE_INTEGER); v.setLength(ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0); v.setOrigin(name); row.addValueMeta(v); } } public String getXML() { StringBuffer retval = new StringBuffer(1024); retval.append(" ").append(XMLHandler.addTagValue("header", startsWithHeader)); retval.append(" ").append(XMLHandler.addTagValue("noempty", ignoreEmptyRows)); retval.append(" ").append(XMLHandler.addTagValue("stoponempty", stopOnEmpty)); retval.append(" ").append(XMLHandler.addTagValue("filefield", fileField)); retval.append(" ").append(XMLHandler.addTagValue("sheetfield", sheetField)); retval.append(" ").append(XMLHandler.addTagValue("sheetrownumfield", sheetRowNumberField)); retval.append(" ").append(XMLHandler.addTagValue("rownumfield", rowNumberField)); retval.append(" ").append(XMLHandler.addTagValue("sheetfield", sheetField)); retval.append(" ").append(XMLHandler.addTagValue("filefield", fileField)); retval.append(" ").append(XMLHandler.addTagValue("limit", rowLimit)); retval.append(" ").append(XMLHandler.addTagValue("encoding", encoding)); retval.append(" "+XMLHandler.addTagValue("add_to_result_filenames", isaddresult)); retval.append(" ").append(XMLHandler.addTagValue("accept_filenames", acceptingFilenames)); retval.append(" ").append(XMLHandler.addTagValue("accept_field", acceptingField)); retval.append(" ").append(XMLHandler.addTagValue("accept_stepname", (acceptingStep!=null?acceptingStep.getName():"") )); /* * Describe the files to read */ retval.append(" <file>").append(Const.CR); for (int i=0;i<fileName.length;i++) { retval.append(" ").append(XMLHandler.addTagValue("name", fileName[i])); retval.append(" ").append(XMLHandler.addTagValue("filemask", fileMask[i])); retval.append(" ").append(XMLHandler.addTagValue("file_required", fileRequired[i])); retval.append(" ").append(XMLHandler.addTagValue("include_subfolders", includeSubFolders[i])); } retval.append(" </file>").append(Const.CR); /* * Describe the fields to read */ retval.append(" <fields>").append(Const.CR); for (int i=0;i<field.length;i++) { retval.append(" <field>").append(Const.CR); retval.append(" ").append(XMLHandler.addTagValue("name", field[i].getName()) ); retval.append(" ").append(XMLHandler.addTagValue("type", field[i].getTypeDesc()) ); retval.append(" ").append(XMLHandler.addTagValue("length", field[i].getLength()) ); retval.append(" ").append(XMLHandler.addTagValue("precision", field[i].getPrecision())); retval.append(" ").append(XMLHandler.addTagValue("trim_type", field[i].getTrimTypeCode() ) ); retval.append(" ").append(XMLHandler.addTagValue("repeat", field[i].isRepeated()) ); retval.append(" ").append(XMLHandler.addTagValue("format", field[i].getFormat())); retval.append(" ").append(XMLHandler.addTagValue("currency", field[i].getCurrencySymbol())); retval.append(" ").append(XMLHandler.addTagValue("decimal", field[i].getDecimalSymbol())); retval.append(" ").append(XMLHandler.addTagValue("group", field[i].getGroupSymbol())); retval.append(" </field>").append(Const.CR); } retval.append(" </fields>").append(Const.CR); /* * Describe the sheets to load... */ retval.append(" <sheets>").append(Const.CR); for (int i=0;i<sheetName.length;i++) { retval.append(" <sheet>").append(Const.CR); retval.append(" ").append(XMLHandler.addTagValue("name", sheetName[i])); retval.append(" ").append(XMLHandler.addTagValue("startrow", startRow[i])); retval.append(" ").append(XMLHandler.addTagValue("startcol", startColumn[i])); retval.append(" </sheet>").append(Const.CR); } retval.append(" </sheets>").append(Const.CR); // ERROR HANDLING retval.append(" ").append(XMLHandler.addTagValue("strict_types", strictTypes)); retval.append(" ").append(XMLHandler.addTagValue("error_ignored", errorIgnored)); retval.append(" ").append(XMLHandler.addTagValue("error_line_skipped", errorLineSkipped)); retval.append(" ").append(XMLHandler.addTagValue("bad_line_files_destination_directory", warningFilesDestinationDirectory)); retval.append(" ").append(XMLHandler.addTagValue("bad_line_files_extension", warningFilesExtension)); retval.append(" ").append(XMLHandler.addTagValue("error_line_files_destination_directory", errorFilesDestinationDirectory)); retval.append(" ").append(XMLHandler.addTagValue("error_line_files_extension", errorFilesExtension)); retval.append(" ").append(XMLHandler.addTagValue("line_number_files_destination_directory", lineNumberFilesDestinationDirectory)); retval.append(" ").append(XMLHandler.addTagValue("line_number_files_extension", lineNumberFilesExtension)); return retval.toString(); } public void readRep(Repository rep, ObjectId id_step, List<DatabaseMeta> databases, Map<String, Counter> counters) throws KettleException { try { startsWithHeader = rep.getStepAttributeBoolean(id_step, "header"); ignoreEmptyRows = rep.getStepAttributeBoolean(id_step, "noempty"); stopOnEmpty = rep.getStepAttributeBoolean(id_step, "stoponempty"); fileField = rep.getStepAttributeString (id_step, "filefield"); sheetField = rep.getStepAttributeString (id_step, "sheetfield"); sheetRowNumberField = rep.getStepAttributeString (id_step, "sheetrownumfield"); rowNumberField = rep.getStepAttributeString (id_step, "rownumfield"); rowLimit = (int)rep.getStepAttributeInteger(id_step, "limit"); encoding = rep.getStepAttributeString (id_step, "encoding"); String addToResult=rep.getStepAttributeString (id_step, "add_to_result_filenames"); if(Const.isEmpty(addToResult)) isaddresult = true; else isaddresult = rep.getStepAttributeBoolean(id_step, "add_to_result_filenames"); acceptingFilenames = rep.getStepAttributeBoolean(id_step, "accept_filenames"); acceptingField = rep.getStepAttributeString (id_step, "accept_field"); acceptingStepName = rep.getStepAttributeString (id_step, "accept_stepname"); int nrfiles = rep.countNrStepAttributes(id_step, "file_name"); int nrsheets = rep.countNrStepAttributes(id_step, "sheet_name"); int nrfields = rep.countNrStepAttributes(id_step, "field_name"); allocate(nrfiles, nrsheets, nrfields); // System.out.println("Counted "+nrfiles+" files to read and "+nrsheets+" sheets, "+nrfields+" fields."); for (int i=0;i<nrfiles;i++) { fileName[i] = rep.getStepAttributeString (id_step, i, "file_name"); fileMask[i] = rep.getStepAttributeString (id_step, i, "file_mask"); fileRequired[i] = rep.getStepAttributeString(id_step, i, "file_required"); if(!YES.equalsIgnoreCase(fileRequired[i])) fileRequired[i] = NO; includeSubFolders[i] = rep.getStepAttributeString(id_step, i, "include_subfolders"); if(!YES.equalsIgnoreCase(includeSubFolders[i])) includeSubFolders[i] = NO; } for (int i=0;i<nrsheets;i++) { sheetName[i] = rep.getStepAttributeString (id_step, i, "sheet_name" ); startRow[i] = (int)rep.getStepAttributeInteger(id_step, i, "sheet_startrow" ); startColumn[i] = (int)rep.getStepAttributeInteger(id_step, i, "sheet_startcol" ); } for (int i=0;i<nrfields;i++) { field[i] = new ExcelInputField(); field[i].setName( rep.getStepAttributeString (id_step, i, "field_name") ); field[i].setType( ValueMeta.getType( rep.getStepAttributeString (id_step, i, "field_type") ) ); field[i].setLength( (int)rep.getStepAttributeInteger(id_step, i, "field_length") ); field[i].setPrecision( (int)rep.getStepAttributeInteger(id_step, i, "field_precision") ); field[i].setTrimType( getTrimTypeByCode( rep.getStepAttributeString (id_step, i, "field_trim_type") ) ); field[i].setRepeated( rep.getStepAttributeBoolean(id_step, i, "field_repeat") ); field[i].setFormat(rep.getStepAttributeString(id_step, i, "field_format")); field[i].setCurrencySymbol(rep.getStepAttributeString(id_step, i, "field_currency")); field[i].setDecimalSymbol(rep.getStepAttributeString(id_step, i, "field_decimal")); field[i].setGroupSymbol(rep.getStepAttributeString(id_step, i, "field_group")); } strictTypes = rep.getStepAttributeBoolean(id_step, 0, "strict_types", false); errorIgnored = rep.getStepAttributeBoolean(id_step, 0, "error_ignored", false); errorLineSkipped = rep.getStepAttributeBoolean(id_step, 0, "error_line_skipped", false); warningFilesDestinationDirectory = rep.getStepAttributeString(id_step, "bad_line_files_dest_dir"); warningFilesExtension = rep.getStepAttributeString(id_step, "bad_line_files_ext"); errorFilesDestinationDirectory = rep.getStepAttributeString(id_step, "error_line_files_dest_dir"); errorFilesExtension = rep.getStepAttributeString(id_step, "error_line_files_ext"); lineNumberFilesDestinationDirectory = rep.getStepAttributeString(id_step, "line_number_files_dest_dir"); lineNumberFilesExtension = rep.getStepAttributeString(id_step, "line_number_files_ext"); } catch(Exception e) { throw new KettleException("Unexpected error reading step information from the repository", e); } } public void saveRep(Repository rep, ObjectId id_transformation, ObjectId id_step) throws KettleException { try { rep.saveStepAttribute(id_transformation, id_step, "header", startsWithHeader); rep.saveStepAttribute(id_transformation, id_step, "noempty", ignoreEmptyRows); rep.saveStepAttribute(id_transformation, id_step, "stoponempty", stopOnEmpty); rep.saveStepAttribute(id_transformation, id_step, "filefield", fileField); rep.saveStepAttribute(id_transformation, id_step, "sheetfield", sheetField); rep.saveStepAttribute(id_transformation, id_step, "sheetrownumfield", sheetRowNumberField); rep.saveStepAttribute(id_transformation, id_step, "rownumfield", rowNumberField); rep.saveStepAttribute(id_transformation, id_step, "limit", rowLimit); rep.saveStepAttribute(id_transformation, id_step, "encoding", encoding); rep.saveStepAttribute(id_transformation, id_step, "add_to_result_filenames", isaddresult); rep.saveStepAttribute(id_transformation, id_step, "accept_filenames", acceptingFilenames); rep.saveStepAttribute(id_transformation, id_step, "accept_field", acceptingField); rep.saveStepAttribute(id_transformation, id_step, "accept_stepname", (acceptingStep!=null?acceptingStep.getName():"") ); for (int i=0;i<fileName.length;i++) { rep.saveStepAttribute(id_transformation, id_step, i, "file_name", fileName[i]); rep.saveStepAttribute(id_transformation, id_step, i, "file_mask", fileMask[i]); rep.saveStepAttribute(id_transformation, id_step, i, "file_required", fileRequired[i]); rep.saveStepAttribute(id_transformation, id_step, i, "include_subfolders", includeSubFolders[i]); } for (int i=0;i<sheetName.length;i++) { rep.saveStepAttribute(id_transformation, id_step, i, "sheet_name", sheetName[i]); rep.saveStepAttribute(id_transformation, id_step, i, "sheet_startrow", startRow[i]); rep.saveStepAttribute(id_transformation, id_step, i, "sheet_startcol", startColumn[i]); } for (int i=0;i<field.length;i++) { rep.saveStepAttribute(id_transformation, id_step, i, "field_name", field[i].getName() ); rep.saveStepAttribute(id_transformation, id_step, i, "field_type", field[i].getTypeDesc() ); rep.saveStepAttribute(id_transformation, id_step, i, "field_length", field[i].getLength() ); rep.saveStepAttribute(id_transformation, id_step, i, "field_precision", field[i].getPrecision() ); rep.saveStepAttribute(id_transformation, id_step, i, "field_trim_type", field[i].getTrimTypeCode() ); rep.saveStepAttribute(id_transformation, id_step, i, "field_repeat", field[i].isRepeated()); rep.saveStepAttribute(id_transformation, id_step, i, "field_format", field[i].getFormat()); rep.saveStepAttribute(id_transformation, id_step, i, "field_currency", field[i].getCurrencySymbol()); rep.saveStepAttribute(id_transformation, id_step, i, "field_decimal", field[i].getDecimalSymbol()); rep.saveStepAttribute(id_transformation, id_step, i, "field_group", field[i].getGroupSymbol()); } rep.saveStepAttribute(id_transformation, id_step, "strict_types", strictTypes); rep.saveStepAttribute(id_transformation, id_step, "error_ignored", errorIgnored); rep.saveStepAttribute(id_transformation, id_step, "error_line_skipped", errorLineSkipped); rep.saveStepAttribute(id_transformation, id_step, "bad_line_files_dest_dir", warningFilesDestinationDirectory); rep.saveStepAttribute(id_transformation, id_step, "bad_line_files_ext", warningFilesExtension); rep.saveStepAttribute(id_transformation, id_step, "error_line_files_dest_dir", errorFilesDestinationDirectory); rep.saveStepAttribute(id_transformation, id_step, "error_line_files_ext", errorFilesExtension); rep.saveStepAttribute(id_transformation, id_step, "line_number_files_dest_dir", lineNumberFilesDestinationDirectory); rep.saveStepAttribute(id_transformation, id_step, "line_number_files_ext", lineNumberFilesExtension); } catch(Exception e) { throw new KettleException("Unable to save step information to the repository for id_step="+id_step, e); } } public final static int getTrimTypeByCode(String tt) { if (tt!=null) { for (int i=0;i<type_trim_code.length;i++) { if (type_trim_code[i].equalsIgnoreCase(tt)) return i; } } return 0; } public final static int getTrimTypeByDesc(String tt) { if (tt!=null) { for (int i=0;i<type_trim_desc.length;i++) { if (type_trim_desc[i].equalsIgnoreCase(tt)) return i; } } return 0; } public final static String getTrimTypeCode(int i) { if (i<0 || i>=type_trim_code.length) return type_trim_code[0]; return type_trim_code[i]; } public final static String getTrimTypeDesc(int i) { if (i<0 || i>=type_trim_desc.length) return type_trim_desc[0]; return type_trim_desc[i]; } public String[] getFilePaths(VariableSpace space) { return FileInputList.createFilePathList(space, fileName, fileMask, fileRequired, includeSubFolderBoolean()); } public FileInputList getFileList(VariableSpace space) { return FileInputList.createFileList(space, fileName, fileMask, fileRequired, includeSubFolderBoolean()); } private boolean[] includeSubFolderBoolean() { int len=fileName.length; boolean includeSubFolderBoolean[]= new boolean[len]; for(int i=0; i<len; i++) { includeSubFolderBoolean[i]=YES.equalsIgnoreCase(includeSubFolders[i]); } return includeSubFolderBoolean; } public String getLookupStepname() { if (acceptingFilenames && acceptingStep!=null && !Const.isEmpty( acceptingStep.getName() ) ) return acceptingStep.getName(); return null; } public void searchInfoAndTargetSteps(List<StepMeta> steps) { acceptingStep = StepMeta.findStep(steps, acceptingStepName); } public String[] getInfoSteps() { return null; } public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String input[], String output[], RowMetaInterface info) { CheckResult cr; // See if we get input... if (input.length>0) { if ( !isAcceptingFilenames() ) { cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "ExcelInputMeta.CheckResult.NoInputError"), stepMeta); remarks.add(cr); } else { cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "ExcelInputMeta.CheckResult.AcceptFilenamesOk"), stepMeta); remarks.add(cr); } } else { cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "ExcelInputMeta.CheckResult.NoInputOk"), stepMeta); remarks.add(cr); } FileInputList fileList = getFileList(transMeta); if (fileList.nrOfFiles() == 0) { if ( ! isAcceptingFilenames() ) { cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "ExcelInputMeta.CheckResult.ExpectedFilesError"), stepMeta); remarks.add(cr); } } else { cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "ExcelInputMeta.CheckResult.ExpectedFilesOk", ""+fileList.nrOfFiles()), stepMeta); remarks.add(cr); } } public RowMetaInterface getEmptyFields() { RowMetaInterface row = new RowMeta(); for (int i=0;i<field.length;i++) { ValueMetaInterface v = new ValueMeta(field[i].getName(), field[i].getType()); row.addValueMeta(v); } return row; } public StepInterface getStep(StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta transMeta, Trans trans) { return new ExcelInput(stepMeta, stepDataInterface, cnr, transMeta, trans); } public StepDataInterface getStepData() { return new ExcelInputData(); } public String getWarningFilesDestinationDirectory() { return warningFilesDestinationDirectory; } public void setWarningFilesDestinationDirectory( String badLineFilesDestinationDirectory) { this.warningFilesDestinationDirectory = badLineFilesDestinationDirectory; } public String getBadLineFilesExtension() { return warningFilesExtension; } public void setBadLineFilesExtension(String badLineFilesExtension) { this.warningFilesExtension = badLineFilesExtension; } public boolean isErrorIgnored() { return errorIgnored; } public void setErrorIgnored(boolean errorIgnored) { this.errorIgnored = errorIgnored; } public String getErrorFilesDestinationDirectory() { return errorFilesDestinationDirectory; } public void setErrorFilesDestinationDirectory( String errorLineFilesDestinationDirectory) { this.errorFilesDestinationDirectory = errorLineFilesDestinationDirectory; } public String getErrorFilesExtension() { return errorFilesExtension; } public void setErrorFilesExtension(String errorLineFilesExtension) { this.errorFilesExtension = errorLineFilesExtension; } public String getLineNumberFilesDestinationDirectory() { return lineNumberFilesDestinationDirectory; } public void setLineNumberFilesDestinationDirectory( String lineNumberFilesDestinationDirectory) { this.lineNumberFilesDestinationDirectory = lineNumberFilesDestinationDirectory; } public String getLineNumberFilesExtension() { return lineNumberFilesExtension; } public void setLineNumberFilesExtension(String lineNumberFilesExtension) { this.lineNumberFilesExtension = lineNumberFilesExtension; } public boolean isErrorLineSkipped() { return errorLineSkipped; } public void setErrorLineSkipped(boolean errorLineSkipped) { this.errorLineSkipped = errorLineSkipped; } public boolean isStrictTypes() { return strictTypes; } public void setStrictTypes(boolean strictTypes) { this.strictTypes = strictTypes; } public String[] getFileRequired() { return fileRequired; } public void setFileRequired(String[] fileRequiredin) { fileRequired = new String[fileRequiredin.length]; for (int i=0;i<fileRequiredin.length && i < fileRequired.length;i++) { this.fileRequired[i] = getRequiredFilesCode(fileRequiredin[i]); } } /** * @return Returns the acceptingField. */ public String getAcceptingField() { return acceptingField; } /** * @param acceptingField The acceptingField to set. */ public void setAcceptingField(String acceptingField) { this.acceptingField = acceptingField; } /** * @return Returns the acceptingFilenames. */ public boolean isAcceptingFilenames() { return acceptingFilenames; } /** * @param acceptingFilenames The acceptingFilenames to set. */ public void setAcceptingFilenames(boolean acceptingFilenames) { this.acceptingFilenames = acceptingFilenames; } /** * @return Returns the acceptingStep. */ public StepMeta getAcceptingStep() { return acceptingStep; } /** * @param acceptingStep The acceptingStep to set. */ public void setAcceptingStep(StepMeta acceptingStep) { this.acceptingStep = acceptingStep; } /** * @return Returns the acceptingStepName. */ public String getAcceptingStepName() { return acceptingStepName; } /** * @param acceptingStepName The acceptingStepName to set. */ public void setAcceptingStepName(String acceptingStepName) { this.acceptingStepName = acceptingStepName; } public String[] getUsedLibraries() { return new String[] { "jxl.jar", }; } /** * @return the encoding */ public String getEncoding() { return encoding; } /** * @param encoding the encoding to set */ public void setEncoding(String encoding) { this.encoding = encoding; } /** * @param isaddresult The isaddresult to set. */ public void setAddResultFile(boolean isaddresult) { this.isaddresult = isaddresult; } /** * @return Returns isaddresult. */ public boolean isAddResultFile() { return isaddresult; } /** * Read all sheets if the sheet names are left blank. * @return true if all sheets are read. */ public boolean readAllSheets() { return Const.isEmpty(sheetName) || ( sheetName.length==1 && Const.isEmpty(sheetName[0]) ); } /** * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively. * So what this does is turn the name of files into absolute paths OR it simply includes the resource in the ZIP file. * For now, we'll simply turn it into an absolute path and pray that the file is on a shared drive or something like that. * TODO: create options to configure this behavior */ public String exportResources(VariableSpace space, Map<String, ResourceDefinition> definitions, ResourceNamingInterface resourceNamingInterface, Repository repository) throws KettleException { try { // The object that we're modifying here is a copy of the original! // So let's change the filename from relative to absolute by grabbing the file object... // In case the name of the file comes from previous steps, forget about this! // List<String> newFilenames = new ArrayList<String>(); if (!acceptingFilenames) { FileInputList fileList = getFileList(space); if (fileList.getFiles().size()>0) { for (FileObject fileObject : fileList.getFiles()) { // From : ${Internal.Transformation.Filename.Directory}/../foo/bar.xls // To : /home/matt/test/files/foo/bar.xls // // If the file doesn't exist, forget about this effort too! // if (fileObject.exists()) { // Convert to an absolute path and add it to the list. // newFilenames.add(fileObject.getName().getPath()); } } // Still here: set a new list of absolute filenames! // fileName = newFilenames.toArray(new String[newFilenames.size()]); fileMask = new String[newFilenames.size()]; // all null since converted to absolute path. fileRequired = new String[newFilenames.size()]; // all null, turn to "Y" : for (int i=0;i<newFilenames.size();i++) fileRequired[i]="Y"; } } return null; } catch (Exception e) { throw new KettleException(e); //$NON-NLS-1$ } } }
PDI-2577 : Problems with the resource exporter - two steps don't raplace the file name appropriately when exported git-svn-id: 51b39fcfd0d3a6ea7caa15377cad4af13b9d2664@13315 5fb7f6ec-07c1-534a-b4ca-9155e429e800
src/org/pentaho/di/trans/steps/excelinput/ExcelInputMeta.java
PDI-2577 : Problems with the resource exporter - two steps don't raplace the file name appropriately when exported
<ide><path>rc/org/pentaho/di/trans/steps/excelinput/ExcelInputMeta.java <ide> import org.pentaho.di.repository.ObjectId; <ide> import org.pentaho.di.resource.ResourceDefinition; <ide> import org.pentaho.di.resource.ResourceNamingInterface; <add>import org.pentaho.di.resource.ResourceNamingInterface.FileNamingType; <ide> import org.pentaho.di.trans.Trans; <ide> import org.pentaho.di.trans.TransMeta; <ide> import org.pentaho.di.trans.step.BaseStepMeta; <ide> // So let's change the filename from relative to absolute by grabbing the file object... <ide> // In case the name of the file comes from previous steps, forget about this! <ide> // <del> List<String> newFilenames = new ArrayList<String>(); <add> List<FileObject> newFiles = new ArrayList<FileObject>(); <ide> <ide> if (!acceptingFilenames) { <ide> FileInputList fileList = getFileList(space); <ide> if (fileObject.exists()) { <ide> // Convert to an absolute path and add it to the list. <ide> // <del> newFilenames.add(fileObject.getName().getPath()); <add> newFiles.add(fileObject); <ide> } <ide> } <ide> <del> // Still here: set a new list of absolute filenames! <del> // <del> fileName = newFilenames.toArray(new String[newFilenames.size()]); <del> fileMask = new String[newFilenames.size()]; // all null since converted to absolute path. <del> fileRequired = new String[newFilenames.size()]; // all null, turn to "Y" : <del> for (int i=0;i<newFilenames.size();i++) fileRequired[i]="Y"; <del> } <add> // Still here: set a new list of absolute filenames! <add> // <add> fileName = new String[newFiles.size()]; <add> fileMask = new String[newFiles.size()]; // all null since converted to absolute path. <add> fileRequired = new String[newFiles.size()]; // all null, turn to "Y" : <add> <add> for (int i=0;i<newFiles.size();i++) { <add> FileObject fileObject = newFiles.get(i); <add> fileName[i] = resourceNamingInterface.nameResource( <add> fileObject.getName().getBaseName(), <add> fileObject.getParent().getName().getPath(), <add> space.toString(), <add> FileNamingType.DATA_FILE); <add> fileRequired[i]="Y"; <add> } } <ide> } <ide> return null; <ide> } catch (Exception e) {
Java
mit
014ad96168f978b1f62360cafeefa8378188e59a
0
ildarisaev/srclib-antlr-1,alexsaveliev/srclib-basic,ildarisaev/srclib-antlr-1,alexsaveliev/srclib-basic
package com.sourcegraph.toolchain.php; import com.sourcegraph.toolchain.core.PathUtil; import com.sourcegraph.toolchain.core.objects.Def; import com.sourcegraph.toolchain.core.objects.DefKey; import com.sourcegraph.toolchain.language.*; import com.sourcegraph.toolchain.php.antlr4.PHPLexer; import com.sourcegraph.toolchain.php.antlr4.PHPParser; import com.sourcegraph.toolchain.php.composer.ComposerConfiguration; import com.sourcegraph.toolchain.php.composer.schema.Autoload; import com.sourcegraph.toolchain.php.composer.schema.ComposerSchemaJson; import com.sourcegraph.toolchain.php.resolver.CompoundClassFileResolver; import com.sourcegraph.toolchain.php.resolver.PSR0ClassFileResolver; import com.sourcegraph.toolchain.php.resolver.PSR4ClassFileResolver; import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.ParseTreeWalker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; import java.util.*; public class LanguageImpl extends LanguageBase { private static final Logger LOGGER = LoggerFactory.getLogger(LanguageImpl.class); /** * keeps global and function-level variables. At each level holds map * variable name => is_local */ Stack<Map<String, Boolean>> vars = new Stack<>(); Map<String, ClassInfo> classes = new HashMap<>(); Set<String> functions = new HashSet<>(); private Set<String> seenClasses = new HashSet<>(); /** * Map ident => definition. We using it to resolve reference candidates. */ Map<String, Def> resolutions = new HashMap<>(); private CompoundClassFileResolver classFileResolver; public String getDefiningClass(String rootClassName, String methodName) { ClassInfo info = classes.get(rootClassName); if (info == null) { return null; } if (info.definesMethods.contains(methodName)) { return rootClassName; } for (String interfaceName : info.implementsInterfaces) { String definingClass = getDefiningClass(interfaceName, methodName); if (definingClass != null) { return definingClass; } } for (String className : info.extendsClasses) { String definingClass = getDefiningClass(className, methodName); if (definingClass != null) { return definingClass; } } for (String traitName : info.usesTraits) { String definingClass = getDefiningClass(traitName, methodName); if (definingClass != null) { return definingClass; } } return null; } public String getConstantClass(String rootClassName, String constant) { ClassInfo info = classes.get(rootClassName); if (info == null) { return null; } if (info.definesConstants.contains(constant)) { return rootClassName; } for (String interfaceName : info.implementsInterfaces) { String definingClass = getConstantClass(interfaceName, constant); if (definingClass != null) { return definingClass; } } for (String className : info.extendsClasses) { String definingClass = getConstantClass(className, constant); if (definingClass != null) { return definingClass; } } for (String traitName : info.usesTraits) { String definingClass = getConstantClass(traitName, constant); if (definingClass != null) { return definingClass; } } return null; } @Override public String getName() { return "php"; } @Override public DefKey resolve(DefKey source) { Def def = resolutions.get(source.getPath()); if (def != null) { return def.defKey; } return null; } @Override public void graph() { // Before graphing, let's load composer configuration if there is any this.classFileResolver = new CompoundClassFileResolver(); File composerJson = new File(PathUtil.CWD.toFile(), "composer.json"); if (composerJson.isFile()) { try { ComposerSchemaJson configuration = ComposerConfiguration.getConfiguration(composerJson); initAutoLoader(configuration); } catch (IOException e) { LOGGER.warn("Failed to read composer configuration {}", e.getMessage()); } } super.graph(); } @Override protected void parse(File sourceFile) throws ParseException { try { GrammarConfiguration configuration = LanguageBase.createGrammarConfiguration(sourceFile, PHPLexer.class, PHPParser.class, new DefaultErrorListener(sourceFile)); ParseTree tree = ((PHPParser) configuration.parser).htmlDocument(); ParseTreeWalker walker = new ParseTreeWalker(); walker.walk(new PHPParseTreeListener(this), tree); } catch (Exception e) { throw new ParseException(e); } } @Override protected FileCollector getFileCollector(File rootDir, String repoUri) { ExtensionBasedFileCollector collector = new ExtensionBasedFileCollector().extension(".php"); File composerJson = new File(rootDir, "composer.json"); if (composerJson.isFile()) { collector.exclude("vendor"); } return collector; } /** * Invoked by PHP parse tree listener to "touch" class. * PHP language support tries to resolve class file using registered class resolver(s) * and if file is found, we are trying to parse it before processing current class * @param fullyQualifiedClassName FQCN */ protected void resolveClass(String fullyQualifiedClassName) { if (!seenClasses.add(fullyQualifiedClassName)) { return; } File file = classFileResolver.resolve(fullyQualifiedClassName); if (file != null) { process(file); } } /** * Initializes autoloader (currently PSR-4 and PSR-0 are supported) * @param composerSchemaJson configuration from composer.json */ private void initAutoLoader(ComposerSchemaJson composerSchemaJson) { Autoload autoload = composerSchemaJson.getAutoload(); if (autoload == null) { return; } Map<String, List<String>> psr4 = autoload.getPsr4(); if (psr4 != null) { PSR4ClassFileResolver psr4ClassFileResolver = new PSR4ClassFileResolver(); for (Map.Entry<String, List<String>> entry : psr4.entrySet()) { for (String directory : entry.getValue()) { psr4ClassFileResolver.addNamespace(entry.getKey(), directory); } } classFileResolver.addResolver(psr4ClassFileResolver); } Map<String, List<String>> psr0 = autoload.getPsr0(); if (psr0 != null) { PSR0ClassFileResolver psr0ClassFileResolver = new PSR0ClassFileResolver(); for (Map.Entry<String, List<String>> entry : psr0.entrySet()) { for (String directory : entry.getValue()) { psr0ClassFileResolver.addNamespace(entry.getKey(), directory); } } classFileResolver.addResolver(psr0ClassFileResolver); } // TODO: classmap? } }
toolchain-php/src/main/java/com/sourcegraph/toolchain/php/LanguageImpl.java
package com.sourcegraph.toolchain.php; import com.sourcegraph.toolchain.core.PathUtil; import com.sourcegraph.toolchain.core.objects.Def; import com.sourcegraph.toolchain.core.objects.DefKey; import com.sourcegraph.toolchain.language.*; import com.sourcegraph.toolchain.php.antlr4.PHPLexer; import com.sourcegraph.toolchain.php.antlr4.PHPParser; import com.sourcegraph.toolchain.php.composer.ComposerConfiguration; import com.sourcegraph.toolchain.php.composer.schema.Autoload; import com.sourcegraph.toolchain.php.composer.schema.ComposerSchemaJson; import com.sourcegraph.toolchain.php.resolver.ClassFileResolver; import com.sourcegraph.toolchain.php.resolver.CompoundClassFileResolver; import com.sourcegraph.toolchain.php.resolver.PSR0ClassFileResolver; import com.sourcegraph.toolchain.php.resolver.PSR4ClassFileResolver; import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.ParseTreeWalker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; import java.util.*; public class LanguageImpl extends LanguageBase { private static final Logger LOGGER = LoggerFactory.getLogger(LanguageImpl.class); /** * keeps global and function-level variables. At each level holds map * variable name => is_local */ Stack<Map<String, Boolean>> vars = new Stack<>(); Map<String, ClassInfo> classes = new HashMap<>(); Set<String> functions = new HashSet<>(); private Set<String> seenClasses = new HashSet<>(); /** * Map ident => definition. We using it to resolve reference candidates. */ Map<String, Def> resolutions = new HashMap<>(); private ClassFileResolver classFileResolver; public String getDefiningClass(String rootClassName, String methodName) { ClassInfo info = classes.get(rootClassName); if (info == null) { return null; } if (info.definesMethods.contains(methodName)) { return rootClassName; } for (String interfaceName : info.implementsInterfaces) { String definingClass = getDefiningClass(interfaceName, methodName); if (definingClass != null) { return definingClass; } } for (String className : info.extendsClasses) { String definingClass = getDefiningClass(className, methodName); if (definingClass != null) { return definingClass; } } for (String traitName : info.usesTraits) { String definingClass = getDefiningClass(traitName, methodName); if (definingClass != null) { return definingClass; } } return null; } public String getConstantClass(String rootClassName, String constant) { ClassInfo info = classes.get(rootClassName); if (info == null) { return null; } if (info.definesConstants.contains(constant)) { return rootClassName; } for (String interfaceName : info.implementsInterfaces) { String definingClass = getConstantClass(interfaceName, constant); if (definingClass != null) { return definingClass; } } for (String className : info.extendsClasses) { String definingClass = getConstantClass(className, constant); if (definingClass != null) { return definingClass; } } for (String traitName : info.usesTraits) { String definingClass = getConstantClass(traitName, constant); if (definingClass != null) { return definingClass; } } return null; } @Override public String getName() { return "php"; } @Override public DefKey resolve(DefKey source) { Def def = resolutions.get(source.getPath()); if (def != null) { return def.defKey; } return null; } @Override public void graph() { // Before graphing, let's load composer configuration if there is any File composerJson = new File(PathUtil.CWD.toFile(), "composer.json"); if (composerJson.isFile()) { try { ComposerSchemaJson configuration = ComposerConfiguration.getConfiguration(composerJson); initAutoLoader(configuration); } catch (IOException e) { LOGGER.warn("Failed to read composer configuration {}", e.getMessage()); } } super.graph(); } @Override protected void parse(File sourceFile) throws ParseException { try { GrammarConfiguration configuration = LanguageBase.createGrammarConfiguration(sourceFile, PHPLexer.class, PHPParser.class, new DefaultErrorListener(sourceFile)); ParseTree tree = ((PHPParser) configuration.parser).htmlDocument(); ParseTreeWalker walker = new ParseTreeWalker(); walker.walk(new PHPParseTreeListener(this), tree); } catch (Exception e) { throw new ParseException(e); } } @Override protected FileCollector getFileCollector(File rootDir, String repoUri) { ExtensionBasedFileCollector collector = new ExtensionBasedFileCollector().extension(".php"); File composerJson = new File(rootDir, "composer.json"); if (composerJson.isFile()) { collector.exclude("vendor"); } return collector; } /** * Invoked by PHP parse tree listener to "touch" class. * PHP language support tries to resolve class file using registered class resolver(s) * and if file is found, we are trying to parse it before processing current class * @param fullyQualifiedClassName FQCN */ protected void resolveClass(String fullyQualifiedClassName) { if (!seenClasses.add(fullyQualifiedClassName)) { return; } File file = classFileResolver.resolve(fullyQualifiedClassName); if (file != null) { process(file); } } /** * Initializes autoloader (currently PSR-4 and PSR-0 are supported) * @param composerSchemaJson configuration from composer.json */ private void initAutoLoader(ComposerSchemaJson composerSchemaJson) { CompoundClassFileResolver resolver = new CompoundClassFileResolver(); this.classFileResolver = resolver; Autoload autoload = composerSchemaJson.getAutoload(); if (autoload == null) { return; } Map<String, List<String>> psr4 = autoload.getPsr4(); if (psr4 != null) { PSR4ClassFileResolver psr4ClassFileResolver = new PSR4ClassFileResolver(); for (Map.Entry<String, List<String>> entry : psr4.entrySet()) { for (String directory : entry.getValue()) { psr4ClassFileResolver.addNamespace(entry.getKey(), directory); } } resolver.addResolver(psr4ClassFileResolver); } Map<String, List<String>> psr0 = autoload.getPsr0(); if (psr0 != null) { PSR0ClassFileResolver psr0ClassFileResolver = new PSR0ClassFileResolver(); for (Map.Entry<String, List<String>> entry : psr0.entrySet()) { for (String directory : entry.getValue()) { psr0ClassFileResolver.addNamespace(entry.getKey(), directory); } } resolver.addResolver(psr0ClassFileResolver); } // TODO: classmap? } }
Fixed NPE for non-composer PHP projects
toolchain-php/src/main/java/com/sourcegraph/toolchain/php/LanguageImpl.java
Fixed NPE for non-composer PHP projects
<ide><path>oolchain-php/src/main/java/com/sourcegraph/toolchain/php/LanguageImpl.java <ide> import com.sourcegraph.toolchain.php.composer.ComposerConfiguration; <ide> import com.sourcegraph.toolchain.php.composer.schema.Autoload; <ide> import com.sourcegraph.toolchain.php.composer.schema.ComposerSchemaJson; <del>import com.sourcegraph.toolchain.php.resolver.ClassFileResolver; <ide> import com.sourcegraph.toolchain.php.resolver.CompoundClassFileResolver; <ide> import com.sourcegraph.toolchain.php.resolver.PSR0ClassFileResolver; <ide> import com.sourcegraph.toolchain.php.resolver.PSR4ClassFileResolver; <ide> */ <ide> Map<String, Def> resolutions = new HashMap<>(); <ide> <del> private ClassFileResolver classFileResolver; <add> private CompoundClassFileResolver classFileResolver; <ide> <ide> public String getDefiningClass(String rootClassName, String methodName) { <ide> ClassInfo info = classes.get(rootClassName); <ide> @Override <ide> public void graph() { <ide> // Before graphing, let's load composer configuration if there is any <add> this.classFileResolver = new CompoundClassFileResolver(); <add> <ide> File composerJson = new File(PathUtil.CWD.toFile(), "composer.json"); <ide> if (composerJson.isFile()) { <ide> try { <ide> * @param composerSchemaJson configuration from composer.json <ide> */ <ide> private void initAutoLoader(ComposerSchemaJson composerSchemaJson) { <del> CompoundClassFileResolver resolver = new CompoundClassFileResolver(); <del> this.classFileResolver = resolver; <del> <ide> Autoload autoload = composerSchemaJson.getAutoload(); <ide> if (autoload == null) { <ide> return; <ide> psr4ClassFileResolver.addNamespace(entry.getKey(), directory); <ide> } <ide> } <del> resolver.addResolver(psr4ClassFileResolver); <add> classFileResolver.addResolver(psr4ClassFileResolver); <ide> } <ide> <ide> Map<String, List<String>> psr0 = autoload.getPsr0(); <ide> psr0ClassFileResolver.addNamespace(entry.getKey(), directory); <ide> } <ide> } <del> resolver.addResolver(psr0ClassFileResolver); <add> classFileResolver.addResolver(psr0ClassFileResolver); <ide> } <ide> // TODO: classmap? <ide>
JavaScript
mit
8aadb426f074368d65a6c4ba69525bf768990d2c
0
jean79/yested,HughG/yested,HughG/yested,jean79/yested,HughG/yested,jean79/yested
(function (Kotlin) { 'use strict'; var _ = Kotlin.defineRootPackage(null, /** @lends _ */ { net: Kotlin.definePackage(null, /** @lends _.net */ { yested: Kotlin.definePackage(function () { this.DURATION_huuymz$ = 200; this.SLIDE_DURATION_ip8yfn$ = _.net.yested.DURATION_huuymz$ * 2; }, /** @lends _.net.yested */ { AjaxRequest: Kotlin.createClass(null, function (url, type, data, contentType, dataType, success) { if (type === void 0) type = 'POST'; if (contentType === void 0) contentType = 'application/json; charset=utf-8'; if (dataType === void 0) dataType = 'json'; this.url = url; this.type = type; this.data = data; this.contentType = contentType; this.dataType = dataType; this.success = success; }, /** @lends _.net.yested.AjaxRequest.prototype */ { component1: function () { return this.url; }, component2: function () { return this.type; }, component3: function () { return this.data; }, component4: function () { return this.contentType; }, component5: function () { return this.dataType; }, component6: function () { return this.success; }, copy: function (url, type, data, contentType, dataType, success) { return new _.net.yested.AjaxRequest(url === void 0 ? this.url : url, type === void 0 ? this.type : type, data === void 0 ? this.data : data, contentType === void 0 ? this.contentType : contentType, dataType === void 0 ? this.dataType : dataType, success === void 0 ? this.success : success); }, toString: function () { return 'AjaxRequest(url=' + Kotlin.toString(this.url) + (', type=' + Kotlin.toString(this.type)) + (', data=' + Kotlin.toString(this.data)) + (', contentType=' + Kotlin.toString(this.contentType)) + (', dataType=' + Kotlin.toString(this.dataType)) + (', success=' + Kotlin.toString(this.success)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.url) | 0; result = result * 31 + Kotlin.hashCode(this.type) | 0; result = result * 31 + Kotlin.hashCode(this.data) | 0; result = result * 31 + Kotlin.hashCode(this.contentType) | 0; result = result * 31 + Kotlin.hashCode(this.dataType) | 0; result = result * 31 + Kotlin.hashCode(this.success) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.url, other.url) && Kotlin.equals(this.type, other.type) && Kotlin.equals(this.data, other.data) && Kotlin.equals(this.contentType, other.contentType) && Kotlin.equals(this.dataType, other.dataType) && Kotlin.equals(this.success, other.success)))); } }), ajaxGet_435vpa$: function (url, loaded) { $.get(url, loaded); }, ajaxPost_sd5w5e$: function (ajaxRequest) { $.ajax(ajaxRequest); }, ChartItem: Kotlin.createClass(null, function (value, color, highlight, label) { this.$value_692zr7$ = value; this.$color_5yvu5x$ = color; this.$highlight_wsl8oq$ = highlight; this.$label_63ku12$ = label; }, /** @lends _.net.yested.ChartItem.prototype */ { value: { get: function () { return this.$value_692zr7$; } }, color: { get: function () { return this.$color_5yvu5x$; } }, highlight: { get: function () { return this.$highlight_wsl8oq$; } }, label: { get: function () { return this.$label_63ku12$; } }, component1: function () { return this.value; }, component2: function () { return this.color; }, component3: function () { return this.highlight; }, component4: function () { return this.label; }, copy_1qdp2k$: function (value, color, highlight, label) { return new _.net.yested.ChartItem(value === void 0 ? this.value : value, color === void 0 ? this.color : color, highlight === void 0 ? this.highlight : highlight, label === void 0 ? this.label : label); }, toString: function () { return 'ChartItem(value=' + Kotlin.toString(this.value) + (', color=' + Kotlin.toString(this.color)) + (', highlight=' + Kotlin.toString(this.highlight)) + (', label=' + Kotlin.toString(this.label)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.value) | 0; result = result * 31 + Kotlin.hashCode(this.color) | 0; result = result * 31 + Kotlin.hashCode(this.highlight) | 0; result = result * 31 + Kotlin.hashCode(this.label) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.value, other.value) && Kotlin.equals(this.color, other.color) && Kotlin.equals(this.highlight, other.highlight) && Kotlin.equals(this.label, other.label)))); } }), SingleLineData: Kotlin.createClass(null, function (label, fillColor, strokeColor, pointColor, pointStrokeColor, pointHighlightFill, pointHighlightStroke, data) { this.$label_afr525$ = label; this.$fillColor_llb3wp$ = fillColor; this.$strokeColor_4jgoms$ = strokeColor; this.$pointColor_39s846$ = pointColor; this.$pointStrokeColor_839w7m$ = pointStrokeColor; this.$pointHighlightFill_sqw4im$ = pointHighlightFill; this.$pointHighlightStroke_16i0ur$ = pointHighlightStroke; this.$data_6jhdy7$ = data; }, /** @lends _.net.yested.SingleLineData.prototype */ { label: { get: function () { return this.$label_afr525$; } }, fillColor: { get: function () { return this.$fillColor_llb3wp$; } }, strokeColor: { get: function () { return this.$strokeColor_4jgoms$; } }, pointColor: { get: function () { return this.$pointColor_39s846$; } }, pointStrokeColor: { get: function () { return this.$pointStrokeColor_839w7m$; } }, pointHighlightFill: { get: function () { return this.$pointHighlightFill_sqw4im$; } }, pointHighlightStroke: { get: function () { return this.$pointHighlightStroke_16i0ur$; } }, data: { get: function () { return this.$data_6jhdy7$; } }, component1: function () { return this.label; }, component2: function () { return this.fillColor; }, component3: function () { return this.strokeColor; }, component4: function () { return this.pointColor; }, component5: function () { return this.pointStrokeColor; }, component6: function () { return this.pointHighlightFill; }, component7: function () { return this.pointHighlightStroke; }, component8: function () { return this.data; }, copy_6k1o7m$: function (label, fillColor, strokeColor, pointColor, pointStrokeColor, pointHighlightFill, pointHighlightStroke, data) { return new _.net.yested.SingleLineData(label === void 0 ? this.label : label, fillColor === void 0 ? this.fillColor : fillColor, strokeColor === void 0 ? this.strokeColor : strokeColor, pointColor === void 0 ? this.pointColor : pointColor, pointStrokeColor === void 0 ? this.pointStrokeColor : pointStrokeColor, pointHighlightFill === void 0 ? this.pointHighlightFill : pointHighlightFill, pointHighlightStroke === void 0 ? this.pointHighlightStroke : pointHighlightStroke, data === void 0 ? this.data : data); }, toString: function () { return 'SingleLineData(label=' + Kotlin.toString(this.label) + (', fillColor=' + Kotlin.toString(this.fillColor)) + (', strokeColor=' + Kotlin.toString(this.strokeColor)) + (', pointColor=' + Kotlin.toString(this.pointColor)) + (', pointStrokeColor=' + Kotlin.toString(this.pointStrokeColor)) + (', pointHighlightFill=' + Kotlin.toString(this.pointHighlightFill)) + (', pointHighlightStroke=' + Kotlin.toString(this.pointHighlightStroke)) + (', data=' + Kotlin.toString(this.data)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.label) | 0; result = result * 31 + Kotlin.hashCode(this.fillColor) | 0; result = result * 31 + Kotlin.hashCode(this.strokeColor) | 0; result = result * 31 + Kotlin.hashCode(this.pointColor) | 0; result = result * 31 + Kotlin.hashCode(this.pointStrokeColor) | 0; result = result * 31 + Kotlin.hashCode(this.pointHighlightFill) | 0; result = result * 31 + Kotlin.hashCode(this.pointHighlightStroke) | 0; result = result * 31 + Kotlin.hashCode(this.data) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.label, other.label) && Kotlin.equals(this.fillColor, other.fillColor) && Kotlin.equals(this.strokeColor, other.strokeColor) && Kotlin.equals(this.pointColor, other.pointColor) && Kotlin.equals(this.pointStrokeColor, other.pointStrokeColor) && Kotlin.equals(this.pointHighlightFill, other.pointHighlightFill) && Kotlin.equals(this.pointHighlightStroke, other.pointHighlightStroke) && Kotlin.equals(this.data, other.data)))); } }), LineData: Kotlin.createClass(null, function (labels, datasets) { this.$labels_s8o8f6$ = labels; this.$datasets_eqt6qu$ = datasets; }, /** @lends _.net.yested.LineData.prototype */ { labels: { get: function () { return this.$labels_s8o8f6$; } }, datasets: { get: function () { return this.$datasets_eqt6qu$; } }, component1: function () { return this.labels; }, component2: function () { return this.datasets; }, copy_5rvrpk$: function (labels, datasets) { return new _.net.yested.LineData(labels === void 0 ? this.labels : labels, datasets === void 0 ? this.datasets : datasets); }, toString: function () { return 'LineData(labels=' + Kotlin.toString(this.labels) + (', datasets=' + Kotlin.toString(this.datasets)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.labels) | 0; result = result * 31 + Kotlin.hashCode(this.datasets) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.labels, other.labels) && Kotlin.equals(this.datasets, other.datasets)))); } }), Chart: Kotlin.createClass(function () { return [_.net.yested.Canvas]; }, function $fun(width, height) { $fun.baseInitializer.call(this, width, height); }, /** @lends _.net.yested.Chart.prototype */ { Pie: function (data) { return new Chart(this.getContext_61zpoe$('2d')).Pie(data); }, Line: function (data, options) { if (options === void 0) options = null; return new Chart(this.getContext_61zpoe$('2d')).Line(data, options); } }), Effect: Kotlin.createTrait(null), BiDirectionEffect: Kotlin.createTrait(null), call$f: function (function_0) { return function (it) { (function_0 != null ? function_0 : Kotlin.throwNPE())(); }; }, call: function (function_0) { function_0 != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(function_0, _.net.yested.call$f(function_0)) : null; }, SlideUp: Kotlin.createClass(function () { return [_.net.yested.Effect]; }, null, /** @lends _.net.yested.SlideUp.prototype */ { apply_suy7ya$: function (component, callback) { if (callback === void 0) callback = null; $(component.element).slideUp(_.net.yested.SLIDE_DURATION_ip8yfn$, _.net.yested.SlideUp.apply_suy7ya$f(callback)); } }, /** @lends _.net.yested.SlideUp */ { apply_suy7ya$f: function (callback) { return function () { _.net.yested.call(callback); }; } }), SlideDown: Kotlin.createClass(function () { return [_.net.yested.Effect]; }, null, /** @lends _.net.yested.SlideDown.prototype */ { apply_suy7ya$: function (component, callback) { if (callback === void 0) callback = null; $(component.element).slideDown(_.net.yested.SLIDE_DURATION_ip8yfn$, _.net.yested.SlideDown.apply_suy7ya$f(callback)); } }, /** @lends _.net.yested.SlideDown */ { apply_suy7ya$f: function (callback) { return function () { _.net.yested.call(callback); }; } }), FadeOut: Kotlin.createClass(function () { return [_.net.yested.Effect]; }, null, /** @lends _.net.yested.FadeOut.prototype */ { apply_suy7ya$: function (component, callback) { if (callback === void 0) callback = null; $(component.element).fadeOut(_.net.yested.DURATION_huuymz$, _.net.yested.FadeOut.apply_suy7ya$f(callback)); } }, /** @lends _.net.yested.FadeOut */ { apply_suy7ya$f: function (callback) { return function () { _.net.yested.call(callback); }; } }), FadeIn: Kotlin.createClass(function () { return [_.net.yested.Effect]; }, null, /** @lends _.net.yested.FadeIn.prototype */ { apply_suy7ya$: function (component, callback) { if (callback === void 0) callback = null; $(component.element).fadeIn(_.net.yested.DURATION_huuymz$, _.net.yested.FadeIn.apply_suy7ya$f(callback)); } }, /** @lends _.net.yested.FadeIn */ { apply_suy7ya$f: function (callback) { return function () { _.net.yested.call(callback); }; } }), Fade: Kotlin.createClass(function () { return [_.net.yested.BiDirectionEffect]; }, null, /** @lends _.net.yested.Fade.prototype */ { applyIn_suy7ya$: function (component, callback) { if (callback === void 0) callback = null; (new _.net.yested.FadeIn()).apply_suy7ya$(component, callback); }, applyOut_suy7ya$: function (component, callback) { if (callback === void 0) callback = null; (new _.net.yested.FadeOut()).apply_suy7ya$(component, callback); } }), Slide: Kotlin.createClass(function () { return [_.net.yested.BiDirectionEffect]; }, null, /** @lends _.net.yested.Slide.prototype */ { applyIn_suy7ya$: function (component, callback) { if (callback === void 0) callback = null; (new _.net.yested.SlideDown()).apply_suy7ya$(component, callback); }, applyOut_suy7ya$: function (component, callback) { if (callback === void 0) callback = null; (new _.net.yested.SlideUp()).apply_suy7ya$(component, callback); } }), replaceAll_ex0kps$: function ($receiver, regex, with_0) { return $receiver.replace(new RegExp(regex, 'g'), with_0); }, Color: Kotlin.createClass(null, function (red, green, blue, alpha) { this.red = red; this.green = green; this.blue = blue; this.alpha = alpha; }, /** @lends _.net.yested.Color.prototype */ { component1: function () { return this.red; }, component2: function () { return this.green; }, component3: function () { return this.blue; }, component4: function () { return this.alpha; }, copy_gb4hak$: function (red, green, blue, alpha) { return new _.net.yested.Color(red === void 0 ? this.red : red, green === void 0 ? this.green : green, blue === void 0 ? this.blue : blue, alpha === void 0 ? this.alpha : alpha); }, toString: function () { return 'Color(red=' + Kotlin.toString(this.red) + (', green=' + Kotlin.toString(this.green)) + (', blue=' + Kotlin.toString(this.blue)) + (', alpha=' + Kotlin.toString(this.alpha)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.red) | 0; result = result * 31 + Kotlin.hashCode(this.green) | 0; result = result * 31 + Kotlin.hashCode(this.blue) | 0; result = result * 31 + Kotlin.hashCode(this.alpha) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.red, other.red) && Kotlin.equals(this.green, other.green) && Kotlin.equals(this.blue, other.blue) && Kotlin.equals(this.alpha, other.alpha)))); } }), toHTMLColor_p73cws$: function ($receiver) { return 'rgba(' + $receiver.red + ',' + $receiver.green + ',' + $receiver.blue + ',' + $receiver.alpha + ')'; }, Colorized: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun(color, backgroundColor, init) { if (color === void 0) color = null; if (backgroundColor === void 0) backgroundColor = null; $fun.baseInitializer.call(this, 'span'); this.style = (color != null ? 'color: ' + _.net.yested.toHTMLColor_p73cws$(color) + ';' : '') + (backgroundColor != null ? 'background-color: ' + _.net.yested.toHTMLColor_p73cws$(backgroundColor) + ';' : ''); init.call(this); }), Attribute: Kotlin.createClass(null, function (attributeName) { if (attributeName === void 0) attributeName = null; this.attributeName = attributeName; }, /** @lends _.net.yested.Attribute.prototype */ { get_262zbl$: function (thisRef, prop) { var tmp$0; return (thisRef != null ? thisRef : Kotlin.throwNPE()).element.getAttribute((tmp$0 = this.attributeName) != null ? tmp$0 : prop.name); }, set_ujvi5f$: function (thisRef, prop, value) { var tmp$0; (thisRef != null ? thisRef : Kotlin.throwNPE()).element.setAttribute((tmp$0 = this.attributeName) != null ? tmp$0 : prop.name, value); } }), Component: Kotlin.createTrait(null), createElement_61zpoe$: function (name) { return document.createElement(name); }, appendComponent_c36dq0$: function ($receiver, component) { $receiver.appendChild(component.element); }, removeChildByName_thdyg2$: function ($receiver, childElementName) { var child = Kotlin.modules['stdlib'].kotlin.dom.get_first_d3eamn$($receiver.getElementsByTagName(childElementName)); if (child != null) { $receiver.removeChild(child); } }, HTMLComponent: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function (tagName) { this.$element_7lm5ox$ = _.net.yested.createElement_61zpoe$(tagName); this.role$delegate = new _.net.yested.Attribute(); this.style$delegate = new _.net.yested.Attribute(); this.id$delegate = new _.net.yested.Attribute(); this.clazz$delegate = new _.net.yested.Attribute('class'); }, /** @lends _.net.yested.HTMLComponent.prototype */ { element: { get: function () { return this.$element_7lm5ox$; }, set: function (element) { this.$element_7lm5ox$ = element; } }, role: { get: function () { return this.role$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('role')); }, set: function (role) { this.role$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('role'), role); } }, style: { get: function () { return this.style$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('style')); }, set: function (style) { this.style$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('style'), style); } }, id: { get: function () { return this.id$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('id')); }, set: function (id) { this.id$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('id'), id); } }, clazz: { get: function () { return this.clazz$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('clazz')); }, set: function (clazz) { this.clazz$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('clazz'), clazz); } }, rangeTo_94jgcu$: function ($receiver, value) { this.element.setAttribute($receiver, value); }, plus_pdl1w0$: function ($receiver) { this.element.innerHTML = this.element.innerHTML + $receiver; }, plus_pv6laa$: function ($receiver) { this.appendChild_5f0h2k$($receiver); }, appendChild_5f0h2k$: function (component) { _.net.yested.appendComponent_c36dq0$(this.element, component); }, setContent_61zpoe$: function (text) { this.element.innerHTML = text; }, setChild_5f0h2k$: function (component) { this.element.innerHTML = ''; this.element.appendChild(component.element); }, setChild_hu5ove$: function (content, effect, callback) { if (callback === void 0) callback = null; effect.applyOut_suy7ya$(this, _.net.yested.HTMLComponent.setChild_hu5ove$f(content, this, effect, callback)); }, onclick: { get: function () { return this.element.onclick; }, set: function (f) { this.element.onclick = f; } }, a_b4th6h$: function (clazz, href, onclick, init) { if (clazz === void 0) clazz = null; if (href === void 0) href = null; if (onclick === void 0) onclick = null; if (init === void 0) init = _.net.yested.HTMLComponent.a_b4th6h$f; var anchor = new _.net.yested.Anchor(); if (href != null) { anchor.href = href; } if (onclick != null) { anchor.onclick = onclick; } if (clazz != null) { anchor.clazz = clazz; } init.call(anchor); _.net.yested.appendComponent_c36dq0$(this.element, anchor); }, div_5rsex9$: function (id, clazz, init) { if (id === void 0) id = null; if (clazz === void 0) clazz = ''; var div = new _.net.yested.Div(); init.call(div); div.clazz = clazz; if (id != null) { div.id = id; } _.net.yested.appendComponent_c36dq0$(this.element, div); return div; }, span_dkuwo$: function (clazz, init) { if (clazz === void 0) clazz = null; var span = new _.net.yested.Span(); init.call(span); clazz != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(clazz, _.net.yested.HTMLComponent.span_dkuwo$f(clazz, span)) : null; _.net.yested.appendComponent_c36dq0$(this.element, span); return span; }, img_puj7f4$: function (src, alt) { if (alt === void 0) alt = null; this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.Image(), _.net.yested.HTMLComponent.img_puj7f4$f(src, alt))); }, p_omdg96$: function (init) { this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.P(), _.net.yested.HTMLComponent.p_omdg96$f(init))); }, tag_s8xvdm$: function (tagName, init) { this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.HTMLComponent(tagName), _.net.yested.HTMLComponent.tag_s8xvdm$f(init))); }, table_or8fdg$: function (init) { this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.Table(), _.net.yested.HTMLComponent.table_or8fdg$f(init))); }, button_fpm6mz$: function (label, type, onclick) { if (type === void 0) type = _.net.yested.ButtonType.object.BUTTON; this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.Button(type), _.net.yested.HTMLComponent.button_fpm6mz$f(label, onclick))); }, code_puj7f4$: function (lang, content) { if (lang === void 0) lang = 'javascript'; this.tag_s8xvdm$('pre', _.net.yested.HTMLComponent.code_puj7f4$f(content)); }, ul_8qfrsd$: function (init) { this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.HTMLComponent.ul_8qfrsd$f(init))); }, ol_t3splz$: function (init) { this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.OL(), _.net.yested.HTMLComponent.ol_t3splz$f(init))); }, dl_79d1z0$: function (init) { this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.DL(), _.net.yested.HTMLComponent.dl_79d1z0$f(init))); }, nbsp_za3lpa$: function (times) { var tmp$0; if (times === void 0) times = 1; tmp$0 = Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(new Kotlin.NumberRange(1, times), _.net.yested.HTMLComponent.nbsp_za3lpa$f(this)); tmp$0; }, h1_kv1miw$: function (init) { this.tag_s8xvdm$('h1', init); }, h2_kv1miw$: function (init) { this.tag_s8xvdm$('h2', init); }, h3_kv1miw$: function (init) { this.tag_s8xvdm$('h3', init); }, h4_kv1miw$: function (init) { this.tag_s8xvdm$('h4', init); }, h5_kv1miw$: function (init) { this.tag_s8xvdm$('h5', init); }, emph_kv1miw$: function (init) { this.tag_s8xvdm$('strong', init); }, small_kv1miw$: function (init) { this.tag_s8xvdm$('small', init); }, mark_kv1miw$: function (init) { this.tag_s8xvdm$('mark', init); }, del_kv1miw$: function (init) { this.tag_s8xvdm$('del', init); }, s_kv1miw$: function (init) { this.tag_s8xvdm$('s', init); }, ins_kv1miw$: function (init) { this.tag_s8xvdm$('ins', init); }, u_kv1miw$: function (init) { this.tag_s8xvdm$('u', init); }, strong_kv1miw$: function (init) { this.tag_s8xvdm$('strong', init); }, em_kv1miw$: function (init) { this.tag_s8xvdm$('em', init); }, b_kv1miw$: function (init) { this.tag_s8xvdm$('b', init); }, i_kv1miw$: function (init) { this.tag_s8xvdm$('i', init); }, kbd_kv1miw$: function (init) { this.tag_s8xvdm$('kbd', init); }, variable_kv1miw$: function (init) { this.tag_s8xvdm$('var', init); }, samp_kv1miw$: function (init) { this.tag_s8xvdm$('samp', init); }, blockquote_kv1miw$: function (init) { this.tag_s8xvdm$('blockquote', init); }, form_kv1miw$: function (init) { this.tag_s8xvdm$('form', init); }, textArea_tt6the$: function (rows, init) { if (rows === void 0) rows = 3; this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('textarea'), _.net.yested.HTMLComponent.textArea_tt6the$f(rows, init))); }, abbr_s8xvdm$: function (title, init) { this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('abbr'), _.net.yested.HTMLComponent.abbr_s8xvdm$f(title, init))); }, br: function () { this.tag_s8xvdm$('br', _.net.yested.HTMLComponent.br$f); }, label_aisbro$: function (forId, clazz, init) { if (forId === void 0) forId = null; if (clazz === void 0) clazz = null; var l = _.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('label'), _.net.yested.HTMLComponent.label_aisbro$f(forId, clazz, init)); this.plus_pv6laa$(l); return l; } }, /** @lends _.net.yested.HTMLComponent */ { f: function (callback) { return function (it) { (callback != null ? callback : Kotlin.throwNPE())(); }; }, f_0: function (callback) { return function () { callback != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(callback, _.net.yested.HTMLComponent.f(callback)) : null; }; }, setChild_hu5ove$f: function (content, this$HTMLComponent, effect, callback) { return function () { this$HTMLComponent.setChild_5f0h2k$(content); effect.applyIn_suy7ya$(this$HTMLComponent, _.net.yested.HTMLComponent.f_0(callback)); }; }, a_b4th6h$f: function () { }, span_dkuwo$f: function (clazz, span) { return function (it) { span.clazz = clazz != null ? clazz : Kotlin.throwNPE(); }; }, img_puj7f4$f: function (src, alt) { return function () { this.src = src; this.alt = alt != null ? alt : ''; }; }, p_omdg96$f: function (init) { return function () { init.call(this); }; }, tag_s8xvdm$f: function (init) { return function () { init.call(this); }; }, table_or8fdg$f: function (init) { return function () { init.call(this); }; }, button_fpm6mz$f: function (label, onclick) { return function () { label.call(this); this.element.onclick = onclick; }; }, f_1: function (content) { return function () { this.plus_pdl1w0$(_.net.yested.printMarkup(content)); }; }, code_puj7f4$f: function (content) { return function () { this.tag_s8xvdm$('code', _.net.yested.HTMLComponent.f_1(content)); }; }, ul_8qfrsd$f: function (init) { return function () { init.call(this); }; }, ol_t3splz$f: function (init) { return function () { init.call(this); }; }, dl_79d1z0$f: function (init) { return function () { init.call(this); }; }, nbsp_za3lpa$f: function (this$HTMLComponent) { return function (it) { this$HTMLComponent.plus_pdl1w0$('&nbsp;'); }; }, textArea_tt6the$f: function (rows, init) { return function () { this.element.setAttribute('rows', rows.toString()); init.call(this); }; }, abbr_s8xvdm$f: function (title, init) { return function () { this.element.setAttribute('title', title); init.call(this); }; }, br$f: function () { }, f_2: function (forId, this$) { return function (it) { this$.rangeTo_94jgcu$('for', forId != null ? forId : Kotlin.throwNPE()); }; }, f_3: function (clazz, this$) { return function (it) { this$.rangeTo_94jgcu$('class', clazz != null ? clazz : Kotlin.throwNPE()); }; }, label_aisbro$f: function (forId, clazz, init) { return function () { forId != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(forId, _.net.yested.HTMLComponent.f_2(forId, this)) : null; clazz != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(clazz, _.net.yested.HTMLComponent.f_3(clazz, this)) : null; init.call(this); }; } }), Table: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function () { this.$element_47ilv9$ = _.net.yested.createElement_61zpoe$('table'); this.border$delegate = new _.net.yested.Attribute(); }, /** @lends _.net.yested.Table.prototype */ { element: { get: function () { return this.$element_47ilv9$; }, set: function (element) { this.$element_47ilv9$ = element; } }, border: { get: function () { return this.border$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('border')); }, set: function (border) { this.border$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('border'), border); } }, thead_3ua0vu$: function (init) { _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.THead(), _.net.yested.Table.thead_3ua0vu$f(init))); }, tbody_rj77wk$: function (init) { _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.TBody(), _.net.yested.Table.tbody_rj77wk$f(init))); } }, /** @lends _.net.yested.Table */ { thead_3ua0vu$f: function (init) { return function () { init.call(this); }; }, tbody_rj77wk$f: function (init) { return function () { init.call(this); }; } }), THead: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function () { this.$element_a26vm7$ = _.net.yested.createElement_61zpoe$('thead'); }, /** @lends _.net.yested.THead.prototype */ { element: { get: function () { return this.$element_a26vm7$; }, set: function (element) { this.$element_a26vm7$ = element; } }, tr_l9w0g6$: function (init) { _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.TRHead(), _.net.yested.THead.tr_l9w0g6$f(init))); } }, /** @lends _.net.yested.THead */ { tr_l9w0g6$f: function (init) { return function () { init.call(this); }; } }), TBody: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function () { this.$element_y4rphp$ = _.net.yested.createElement_61zpoe$('tbody'); }, /** @lends _.net.yested.TBody.prototype */ { element: { get: function () { return this.$element_y4rphp$; }, set: function (element) { this.$element_y4rphp$ = element; } }, tr_idqsqk$: function (init) { _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.TRBody(), _.net.yested.TBody.tr_idqsqk$f(init))); } }, /** @lends _.net.yested.TBody */ { tr_idqsqk$f: function (init) { return function () { init.call(this); }; } }), TRHead: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function () { this.$element_59289p$ = _.net.yested.createElement_61zpoe$('tr'); }, /** @lends _.net.yested.TRHead.prototype */ { element: { get: function () { return this.$element_59289p$; }, set: function (element) { this.$element_59289p$ = element; } }, th_kv1miw$: function (init) { _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('th'), _.net.yested.TRHead.th_kv1miw$f(init))); } }, /** @lends _.net.yested.TRHead */ { th_kv1miw$f: function (init) { return function () { init.call(this); }; } }), TRBody: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function () { this.$element_itillt$ = _.net.yested.createElement_61zpoe$('tr'); }, /** @lends _.net.yested.TRBody.prototype */ { element: { get: function () { return this.$element_itillt$; }, set: function (element) { this.$element_itillt$ = element; } }, td_kv1miw$: function (init) { _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('td'), _.net.yested.TRBody.td_kv1miw$f(init))); } }, /** @lends _.net.yested.TRBody */ { td_kv1miw$f: function (init) { return function () { init.call(this); }; } }), OL: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'ol'); }, /** @lends _.net.yested.OL.prototype */ { li_8y48wp$: function (init) { this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.OL.li_8y48wp$f(init))); } }, /** @lends _.net.yested.OL */ { li_8y48wp$f: function (init) { return function () { init.call(this); }; } }), UL: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'ul'); }, /** @lends _.net.yested.UL.prototype */ { li_8y48wp$: function (init) { this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.UL.li_8y48wp$f(init))); } }, /** @lends _.net.yested.UL */ { li_8y48wp$f: function (init) { return function () { init.call(this); }; } }), DL: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'dl'); }, /** @lends _.net.yested.DL.prototype */ { item_z5xo0k$: function (dt, dd) { this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('dt'), _.net.yested.DL.item_z5xo0k$f(dt))); this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('dd'), _.net.yested.DL.item_z5xo0k$f_0(dd))); } }, /** @lends _.net.yested.DL */ { item_z5xo0k$f: function (dt) { return function () { dt.call(this); }; }, item_z5xo0k$f_0: function (dd) { return function () { dd.call(this); }; } }), Canvas: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun(width, height) { $fun.baseInitializer.call(this, 'canvas'); this.width = width; this.height = height; this.element.setAttribute('width', this.width.toString()); this.element.setAttribute('height', this.height.toString()); }, /** @lends _.net.yested.Canvas.prototype */ { getContext_61zpoe$: function (id) { return this.element.getContext(id); } }), Div: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'div'); }), Span: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'span'); }), ButtonType: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { BUTTON: new _.net.yested.ButtonType('button'), SUBMIT: new _.net.yested.ButtonType('submit'), RESET: new _.net.yested.ButtonType('reset') }; }), Button: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun(type) { if (type === void 0) type = _.net.yested.ButtonType.object.BUTTON; $fun.baseInitializer.call(this, 'button'); this.element.setAttribute('type', type.code); }), Image: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function () { this.$element_lb4lns$ = _.net.yested.createElement_61zpoe$('img'); this.src$delegate = new _.net.yested.Attribute(); this.alt$delegate = new _.net.yested.Attribute(); }, /** @lends _.net.yested.Image.prototype */ { element: { get: function () { return this.$element_lb4lns$; } }, src: { get: function () { return this.src$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('src')); }, set: function (src) { this.src$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('src'), src); } }, alt: { get: function () { return this.alt$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('alt')); }, set: function (alt) { this.alt$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('alt'), alt); } } }), P: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'p'); }), Li: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'li'); }), Anchor: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'a'); this.href$delegate = new _.net.yested.Attribute(); }, /** @lends _.net.yested.Anchor.prototype */ { href: { get: function () { return this.href$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('href')); }, set: function (href) { this.href$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('href'), href); } } }), div_5rsex9$: function (id, clazz, init) { if (id === void 0) id = null; if (clazz === void 0) clazz = null; var div = new _.net.yested.Div(); init.call(div); if (clazz != null) { div.clazz = clazz; } if (id != null) { div.id = id; } return div; }, text_61zpoe$f: function (text) { return function () { this.plus_pdl1w0$(text); }; }, text_61zpoe$: function (text) { return _.net.yested.text_61zpoe$f(text); }, getHashSplitted: function () { return Kotlin.splitString(window.location.hash, '_'); }, registerHashChangeListener_owl47g$f: function (listener) { return function () { listener(_.net.yested.getHashSplitted()); }; }, registerHashChangeListener_owl47g$: function (runNow, listener) { if (runNow === void 0) runNow = true; $(window).on('hashchange', _.net.yested.registerHashChangeListener_owl47g$f(listener)); if (runNow) { listener(_.net.yested.getHashSplitted()); } }, with_owvm91$: function ($receiver, init) { init.call($receiver); return $receiver; }, el: function (elementId) { return document.getElementById(elementId); }, printMarkup: function (content) { return _.net.yested.replaceAll_ex0kps$(_.net.yested.replaceAll_ex0kps$(content, '<', '&lt;'), '>', '&gt;'); }, bootstrap: Kotlin.definePackage(null, /** @lends _.net.yested.bootstrap */ { enableScrollSpy_61zpoe$: function (id) { $('body').scrollspy(Kotlin.createObject(null, function () { this.target = '#' + id; })); }, AlertStyle: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { SUCCESS: new _.net.yested.bootstrap.AlertStyle('success'), INFO: new _.net.yested.bootstrap.AlertStyle('info'), WARNING: new _.net.yested.bootstrap.AlertStyle('warning'), DANGER: new _.net.yested.bootstrap.AlertStyle('danger') }; }), Alert: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun(style) { $fun.baseInitializer.call(this, 'div'); this.clazz = 'alert alert-' + style.code; }, /** @lends _.net.yested.bootstrap.Alert.prototype */ { a_b4th6h$: function (clazz, href, onclick, init) { if (clazz === void 0) clazz = null; if (href === void 0) href = null; if (onclick === void 0) onclick = null; if (init === void 0) init = _.net.yested.bootstrap.Alert.a_b4th6h$f; _.net.yested.HTMLComponent.prototype.a_b4th6h$.call(this, clazz != null ? clazz : 'alert-link', href, onclick, init); } }, /** @lends _.net.yested.bootstrap.Alert */ { a_b4th6h$f: function () { } }), alert$f: function (init) { return function () { init.call(this); }; }, alert: function ($receiver, style, init) { $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Alert(style), _.net.yested.bootstrap.alert$f(init))); }, Breadcrumbs: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function () { this.$element_atatgz$ = _.net.yested.createElement_61zpoe$('ol'); this.element.setAttribute('class', 'breadcrumb'); }, /** @lends _.net.yested.bootstrap.Breadcrumbs.prototype */ { element: { get: function () { return this.$element_atatgz$; } }, link: function (href, onclick, init) { if (href === void 0) href = null; if (onclick === void 0) onclick = null; _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Breadcrumbs.link$f(href, onclick, init))); }, selected: function (init) { _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Breadcrumbs.selected$f(init))); } }, /** @lends _.net.yested.bootstrap.Breadcrumbs */ { link$f: function (href, onclick, init) { return function () { this.a_b4th6h$(void 0, href, onclick, init); }; }, selected$f: function (init) { return function () { this.clazz = 'active'; init.call(this); }; } }), breadcrumbs_3d8lml$f: function (init) { return function () { init.call(this); }; }, breadcrumbs_3d8lml$: function ($receiver, init) { var breadcrumbs = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.Breadcrumbs(), _.net.yested.bootstrap.breadcrumbs_3d8lml$f(init)); $receiver.plus_pv6laa$(breadcrumbs); return breadcrumbs; }, ButtonGroup: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function (size, onSelect) { if (size === void 0) size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; if (onSelect === void 0) onSelect = null; this.size = size; this.onSelect = onSelect; this.$element_t6mq6u$ = _.net.yested.createElement_61zpoe$('div'); this.buttons_2b2nvz$ = new Kotlin.DefaultPrimitiveHashMap(); this.element.setAttribute('class', 'btn-group'); this.element.setAttribute('role', 'group'); this.value = null; }, /** @lends _.net.yested.bootstrap.ButtonGroup.prototype */ { element: { get: function () { return this.$element_t6mq6u$; } }, select_61zpoe$: function (selectValue) { var tmp$0, tmp$2; this.value = selectValue; if (this.onSelect != null) { ((tmp$0 = this.onSelect) != null ? tmp$0 : Kotlin.throwNPE())(selectValue); } tmp$2 = Kotlin.modules['stdlib'].kotlin.iterator_acfufl$(this.buttons_2b2nvz$); while (tmp$2.hasNext()) { var tmp$1 = tmp$2.next() , key = Kotlin.modules['stdlib'].kotlin.component1_mxmdx1$(tmp$1) , button = Kotlin.modules['stdlib'].kotlin.component2_mxmdx1$(tmp$1); if (Kotlin.equals(key, selectValue)) { button.active = true; } else { button.active = false; } } }, button_ubg574$: function (value, look, label) { if (look === void 0) look = _.net.yested.bootstrap.ButtonLook.object.DEFAULT; var button = new _.net.yested.bootstrap.BtsButton(void 0, label, look, this.size, void 0, _.net.yested.bootstrap.ButtonGroup.button_ubg574$f(value, this)); _.net.yested.appendComponent_c36dq0$(this.element, button); this.buttons_2b2nvz$.put_wn2jw4$(value, button); } }, /** @lends _.net.yested.bootstrap.ButtonGroup */ { button_ubg574$f: function (value, this$ButtonGroup) { return function () { this$ButtonGroup.select_61zpoe$(value); }; } }), buttonGroup_wnptsr$: function ($receiver, size, onSelect, init) { if (size === void 0) size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; if (onSelect === void 0) onSelect = null; $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.ButtonGroup(size, onSelect), init)); }, ButtonLook: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { DEFAULT: new _.net.yested.bootstrap.ButtonLook('default'), PRIMARY: new _.net.yested.bootstrap.ButtonLook('primary'), SUCCESS: new _.net.yested.bootstrap.ButtonLook('success'), INFO: new _.net.yested.bootstrap.ButtonLook('info'), WARNING: new _.net.yested.bootstrap.ButtonLook('warning'), DANGER: new _.net.yested.bootstrap.ButtonLook('danger'), LINK: new _.net.yested.bootstrap.ButtonLook('link') }; }), ButtonSize: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { DEFAULT: new _.net.yested.bootstrap.ButtonSize('default'), LARGE: new _.net.yested.bootstrap.ButtonSize('lg'), SMALL: new _.net.yested.bootstrap.ButtonSize('sm'), EXTRA_SMALL: new _.net.yested.bootstrap.ButtonSize('xs') }; }), BtsButton: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun(type, label, look, size, block, onclick) { if (type === void 0) type = _.net.yested.ButtonType.object.BUTTON; if (look === void 0) look = _.net.yested.bootstrap.ButtonLook.object.DEFAULT; if (size === void 0) size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; if (block === void 0) block = false; $fun.baseInitializer.call(this, 'button'); this.look = look; this.size = size; this.block = block; this.buttonActive_nol8t8$ = false; this.setClass(); this.element.setAttribute('type', type.code); label.call(this); this.onclick = onclick; }, /** @lends _.net.yested.bootstrap.BtsButton.prototype */ { active: { get: function () { return this.buttonActive_nol8t8$; }, set: function (value) { this.buttonActive_nol8t8$ = value; this.setClass(); } }, disabled: { get: function () { return Kotlin.equals(this.element.getAttribute('disabled'), 'disabled'); }, set: function (value) { this.element.setAttribute('disabled', value ? 'disabled' : ''); } }, setClass: function () { this.element.setAttribute('class', 'btn btn-' + this.look.code + ' btn-' + this.size.code + ' ' + (this.block ? 'btn-block' : '') + ' ' + (this.buttonActive_nol8t8$ ? 'active' : '')); } }), BtsAnchor: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun(href, look, size, block) { if (look === void 0) look = _.net.yested.bootstrap.ButtonLook.object.DEFAULT; if (size === void 0) size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; if (block === void 0) block = false; $fun.baseInitializer.call(this, 'a'); this.href$delegate = new _.net.yested.Attribute(); this.href = href; this.element.setAttribute('class', 'btn btn-' + look.code + ' btn-' + size.code + ' ' + (block ? 'btn-block' : '')); }, /** @lends _.net.yested.bootstrap.BtsAnchor.prototype */ { href: { get: function () { return this.href$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('href')); }, set: function (href) { this.href$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('href'), href); } } }), btsButton_adnmfr$: function ($receiver, type, label, look, size, block, onclick) { if (type === void 0) type = _.net.yested.ButtonType.object.BUTTON; if (look === void 0) look = _.net.yested.bootstrap.ButtonLook.object.DEFAULT; if (size === void 0) size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; if (block === void 0) block = false; $receiver.plus_pv6laa$(new _.net.yested.bootstrap.BtsButton(type, label, look, size, block, onclick)); }, btsAnchor_2ak3uo$f: function (init) { return function () { init.call(this); }; }, btsAnchor_2ak3uo$: function ($receiver, href, look, size, block, init) { if (look === void 0) look = _.net.yested.bootstrap.ButtonLook.object.DEFAULT; if (size === void 0) size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; if (block === void 0) block = false; $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.BtsAnchor(href, look, size, block), _.net.yested.bootstrap.btsAnchor_2ak3uo$f(init))); }, Device: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { EXTRA_SMALL: new _.net.yested.bootstrap.Device('xs'), SMALL: new _.net.yested.bootstrap.Device('sm'), MEDIUM: new _.net.yested.bootstrap.Device('md'), LARGER: new _.net.yested.bootstrap.Device('lg') }; }), ColumnModifier: Kotlin.createClass(null, function (size, device, modifierString) { this.size = size; this.device = device; this.modifierString = modifierString; }, /** @lends _.net.yested.bootstrap.ColumnModifier.prototype */ { toString: function () { return 'col-' + this.device.code + this.modifierString + '-' + this.size; } }), DeviceSize: Kotlin.createClass(function () { return [_.net.yested.bootstrap.ColumnModifier]; }, function $fun(size, device) { $fun.baseInitializer.call(this, size, device, ''); }, /** @lends _.net.yested.bootstrap.DeviceSize.prototype */ { copy_sq2403$: function (size, device) { return new _.net.yested.bootstrap.DeviceSize(size, device); } }), Offset: Kotlin.createClass(function () { return [_.net.yested.bootstrap.ColumnModifier]; }, function $fun(size, device) { $fun.baseInitializer.call(this, size, device, '-offset'); }, /** @lends _.net.yested.bootstrap.Offset.prototype */ { copy_sq2403$: function (size, device) { return new _.net.yested.bootstrap.Offset(size, device); } }), ExtraSmall: Kotlin.createClass(function () { return [_.net.yested.bootstrap.DeviceSize]; }, function $fun(size) { $fun.baseInitializer.call(this, size, _.net.yested.bootstrap.Device.object.EXTRA_SMALL); }), Small: Kotlin.createClass(function () { return [_.net.yested.bootstrap.DeviceSize]; }, function $fun(size) { $fun.baseInitializer.call(this, size, _.net.yested.bootstrap.Device.object.SMALL); }), Medium: Kotlin.createClass(function () { return [_.net.yested.bootstrap.DeviceSize]; }, function $fun(size) { $fun.baseInitializer.call(this, size, _.net.yested.bootstrap.Device.object.MEDIUM); }), Larger: Kotlin.createClass(function () { return [_.net.yested.bootstrap.DeviceSize]; }, function $fun(size) { $fun.baseInitializer.call(this, size, _.net.yested.bootstrap.Device.object.LARGER); }), Align: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { LEFT: new _.net.yested.bootstrap.Align('left'), CENTER: new _.net.yested.bootstrap.Align('center'), RIGHT: new _.net.yested.bootstrap.Align('right') }; }), Dialog: Kotlin.createClass(null, function () { this.dialog = null; this.header = null; this.body = null; this.footer = null; }, /** @lends _.net.yested.bootstrap.Dialog.prototype */ { header_1: function (init) { this.header = _.net.yested.div_5rsex9$(void 0, 'modal-header', _.net.yested.bootstrap.Dialog.header_1$f(init)); }, body_1: function (init) { this.body = _.net.yested.div_5rsex9$(void 0, 'modal-body', init); }, footer_1: function (init) { this.footer = _.net.yested.div_5rsex9$(void 0, 'modal-footer', init); }, open: function () { var tmp$0; this.dialog = _.net.yested.div_5rsex9$(void 0, 'modal fade', _.net.yested.bootstrap.Dialog.open$f(this)); $(((tmp$0 = this.dialog) != null ? tmp$0 : Kotlin.throwNPE()).element).modal('show'); }, close: function () { var tmp$0; (tmp$0 = this.dialog) != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(tmp$0, _.net.yested.bootstrap.Dialog.close$f(this)) : null; } }, /** @lends _.net.yested.bootstrap.Dialog */ { f: function () { this.rangeTo_94jgcu$('aria-hidden', 'true'); this.plus_pv6laa$(new _.net.yested.bootstrap.Glyphicon('remove')); }, f_0: function () { this.plus_pdl1w0$('Close'); }, f_1: function () { this.clazz = 'close'; this.rangeTo_94jgcu$('type', 'button'); this.rangeTo_94jgcu$('data-dismiss', 'modal'); this.span_dkuwo$(void 0, _.net.yested.bootstrap.Dialog.f); this.span_dkuwo$('sr-only', _.net.yested.bootstrap.Dialog.f_0); }, f_2: function () { this.clazz = 'modal-title'; }, f_3: function (init, this$) { return function () { init.call(this$); }; }, header_1$f: function (init) { return function () { this.tag_s8xvdm$('button', _.net.yested.bootstrap.Dialog.f_1); _.net.yested.with_owvm91$(this.tag_s8xvdm$('h4', _.net.yested.bootstrap.Dialog.f_2), _.net.yested.bootstrap.Dialog.f_3(init, this)); }; }, f_4: function (this$Dialog, this$) { return function (it) { var tmp$0; this$.plus_pv6laa$((tmp$0 = this$Dialog.footer) != null ? tmp$0 : Kotlin.throwNPE()); }; }, f_5: function (this$Dialog) { return function () { var tmp$0, tmp$1, tmp$2; this.plus_pv6laa$((tmp$0 = this$Dialog.header) != null ? tmp$0 : Kotlin.throwNPE()); this.plus_pv6laa$((tmp$1 = this$Dialog.body) != null ? tmp$1 : Kotlin.throwNPE()); (tmp$2 = this$Dialog.footer) != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(tmp$2, _.net.yested.bootstrap.Dialog.f_4(this$Dialog, this)) : null; }; }, f_6: function (this$Dialog) { return function () { this.div_5rsex9$(void 0, 'modal-content', _.net.yested.bootstrap.Dialog.f_5(this$Dialog)); }; }, open$f: function (this$Dialog) { return function () { this.rangeTo_94jgcu$('aria-hidden', 'true'); this.role = 'dialog'; this.div_5rsex9$(void 0, 'modal-dialog', _.net.yested.bootstrap.Dialog.f_6(this$Dialog)); }; }, close$f: function (this$Dialog) { return function (it) { var tmp$0; $(((tmp$0 = this$Dialog.dialog) != null ? tmp$0 : Kotlin.throwNPE()).element).modal('hide'); }; } }), ValidatorI: Kotlin.createTrait(null), Validator: Kotlin.createClass(function () { return [_.net.yested.bootstrap.ValidatorI]; }, function (inputElement, errorText, validator) { this.inputElement = inputElement; this.$errorText_ydsons$ = errorText; this.validator = validator; this.onChangeListeners_f7f7h9$ = new Kotlin.ArrayList(); this.listen_4abga4$ = false; this.inputElement.addOnChangeListener_qshda6$(_.net.yested.bootstrap.Validator.Validator$f(this)); this.inputElement.addOnChangeLiveListener_qshda6$(_.net.yested.bootstrap.Validator.Validator$f_0(this)); }, /** @lends _.net.yested.bootstrap.Validator.prototype */ { errorText: { get: function () { return this.$errorText_ydsons$; } }, onchange_ra2fzg$: function (invoke) { this.onChangeListeners_f7f7h9$.add_za3rmp$(invoke); }, revalidate: function () { return _.net.yested.with_owvm91$(this.validator(this.inputElement.value), _.net.yested.bootstrap.Validator.revalidate$f(this)); }, isValid: function () { return this.revalidate(); } }, /** @lends _.net.yested.bootstrap.Validator */ { Validator$f: function (this$Validator) { return function () { this$Validator.listen_4abga4$ = true; this$Validator.revalidate(); }; }, Validator$f_0: function (this$Validator) { return function () { if (this$Validator.listen_4abga4$) { this$Validator.revalidate(); } }; }, revalidate$f: function (this$Validator) { return function () { var tmp$0; tmp$0 = this$Validator.onChangeListeners_f7f7h9$.iterator(); while (tmp$0.hasNext()) { var listener = tmp$0.next(); listener(this); } }; } }), Form: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun(labelDef, inputDef) { if (labelDef === void 0) labelDef = 'col-sm-2'; if (inputDef === void 0) inputDef = 'col-sm-10'; $fun.baseInitializer.call(this, 'form'); this.labelDef_hl3t2u$ = labelDef; this.inputDef_mlmxkk$ = inputDef; this.element.setAttribute('class', 'form-horizontal'); this.role = 'form'; this.element.setAttribute('onsubmit', 'return false'); }, /** @lends _.net.yested.bootstrap.Form.prototype */ { item_gthhqa$: function (forId, label, validator, content) { if (forId === void 0) forId = ''; if (validator === void 0) validator = null; var spanErrMsg = _.net.yested.with_owvm91$(new _.net.yested.Span(), _.net.yested.bootstrap.Form.item_gthhqa$f); var divInput = _.net.yested.with_owvm91$(this.div_5rsex9$(void 0, this.inputDef_mlmxkk$, content), _.net.yested.bootstrap.Form.item_gthhqa$f_0(spanErrMsg)); var divFormGroup = this.div_5rsex9$(void 0, 'form-group', _.net.yested.bootstrap.Form.item_gthhqa$f_1(forId, this, label, divInput)); validator != null ? validator.onchange_ra2fzg$(_.net.yested.bootstrap.Form.item_gthhqa$f_2(divFormGroup, spanErrMsg, validator)) : null; } }, /** @lends _.net.yested.bootstrap.Form */ { item_gthhqa$f: function () { this.clazz = 'help-block'; }, item_gthhqa$f_0: function (spanErrMsg) { return function () { this.plus_pv6laa$(spanErrMsg); }; }, item_gthhqa$f_1: function (forId, this$Form, label, divInput) { return function () { this.label_aisbro$(forId, this$Form.labelDef_hl3t2u$ + ' control-label', label); this.plus_pv6laa$(divInput); }; }, item_gthhqa$f_2: function (divFormGroup, spanErrMsg, validator) { return function (isValid) { divFormGroup.clazz = isValid ? 'form-group' : 'form-group has-error'; spanErrMsg.setContent_61zpoe$(isValid ? '' : (validator != null ? validator : Kotlin.throwNPE()).errorText); }; } }), btsForm_iz33rd$: function ($receiver, labelDef, inputDef, init) { if (labelDef === void 0) labelDef = 'col-sm-2'; if (inputDef === void 0) inputDef = 'col-sm-10'; var form = new _.net.yested.bootstrap.Form(labelDef, inputDef); init.call(form); $receiver.plus_pv6laa$(form); }, Glyphicon: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function (icon) { this.$element_bxaorm$ = _.net.yested.createElement_61zpoe$('span'); this.element.className = 'glyphicon glyphicon-' + icon; }, /** @lends _.net.yested.bootstrap.Glyphicon.prototype */ { element: { get: function () { return this.$element_bxaorm$; } } }), glyphicon_8jxlbl$: function ($receiver, icon) { $receiver.plus_pv6laa$(new _.net.yested.bootstrap.Glyphicon(icon)); }, Column: Kotlin.createClass(null, function (label, render, sortFunction, align, defaultSort, defaultSortOrderAsc) { if (align === void 0) align = _.net.yested.bootstrap.Align.object.LEFT; if (defaultSort === void 0) defaultSort = false; if (defaultSortOrderAsc === void 0) defaultSortOrderAsc = true; this.label = label; this.render = render; this.sortFunction = sortFunction; this.align = align; this.defaultSort = defaultSort; this.defaultSortOrderAsc = defaultSortOrderAsc; }, /** @lends _.net.yested.bootstrap.Column.prototype */ { component1: function () { return this.label; }, component2: function () { return this.render; }, component3: function () { return this.sortFunction; }, component4: function () { return this.align; }, component5: function () { return this.defaultSort; }, component6: function () { return this.defaultSortOrderAsc; }, copy_66o9md$: function (label, render, sortFunction, align, defaultSort, defaultSortOrderAsc) { return new _.net.yested.bootstrap.Column(label === void 0 ? this.label : label, render === void 0 ? this.render : render, sortFunction === void 0 ? this.sortFunction : sortFunction, align === void 0 ? this.align : align, defaultSort === void 0 ? this.defaultSort : defaultSort, defaultSortOrderAsc === void 0 ? this.defaultSortOrderAsc : defaultSortOrderAsc); }, toString: function () { return 'Column(label=' + Kotlin.toString(this.label) + (', render=' + Kotlin.toString(this.render)) + (', sortFunction=' + Kotlin.toString(this.sortFunction)) + (', align=' + Kotlin.toString(this.align)) + (', defaultSort=' + Kotlin.toString(this.defaultSort)) + (', defaultSortOrderAsc=' + Kotlin.toString(this.defaultSortOrderAsc)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.label) | 0; result = result * 31 + Kotlin.hashCode(this.render) | 0; result = result * 31 + Kotlin.hashCode(this.sortFunction) | 0; result = result * 31 + Kotlin.hashCode(this.align) | 0; result = result * 31 + Kotlin.hashCode(this.defaultSort) | 0; result = result * 31 + Kotlin.hashCode(this.defaultSortOrderAsc) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.label, other.label) && Kotlin.equals(this.render, other.render) && Kotlin.equals(this.sortFunction, other.sortFunction) && Kotlin.equals(this.align, other.align) && Kotlin.equals(this.defaultSort, other.defaultSort) && Kotlin.equals(this.defaultSortOrderAsc, other.defaultSortOrderAsc)))); } }), ColumnHeader: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun(column, sortFunction) { $fun.baseInitializer.call(this, 'span'); this.column = column; this.sortOrderAsc = this.column.defaultSortOrderAsc; this.arrowPlaceholder = new _.net.yested.Span(); this.element.setAttribute('style', 'cursor: pointer;'); this.column.label.call(this); this.plus_pv6laa$(this.arrowPlaceholder); this.onclick = _.net.yested.bootstrap.ColumnHeader.ColumnHeader$f(sortFunction, this); }, /** @lends _.net.yested.bootstrap.ColumnHeader.prototype */ { updateSorting: function (sorteByColumn, sortAscending) { if (!Kotlin.equals(sorteByColumn, this.column)) { this.arrowPlaceholder.setContent_61zpoe$(''); } else { this.arrowPlaceholder.setChild_5f0h2k$(new _.net.yested.bootstrap.Glyphicon('arrow-' + (sortAscending ? 'up' : 'down'))); } } }, /** @lends _.net.yested.bootstrap.ColumnHeader */ { ColumnHeader$f: function (sortFunction, this$ColumnHeader) { return function () { sortFunction(this$ColumnHeader.column); }; } }), Grid: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function (columns) { var tmp$0, tmp$1, tmp$2, tmp$3; this.columns = columns; this.$element_88h9vf$ = _.net.yested.createElement_61zpoe$('table'); this.sortColumn_xix3o5$ = null; this.asc_s2pzui$ = true; this.arrowsPlaceholders_39i6vz$ = new Kotlin.ArrayList(); this.columnHeaders_13ipnd$ = null; this.element.className = 'table table-striped table-hover table-condensed'; tmp$0 = Kotlin.modules['stdlib'].kotlin.map_rie7ol$(this.columns, _.net.yested.bootstrap.Grid.Grid$f(this)); this.columnHeaders_13ipnd$ = tmp$0; this.renderHeader(); tmp$1 = Kotlin.modules['stdlib'].kotlin.filter_dgtl0h$(this.columns, _.net.yested.bootstrap.Grid.Grid$f_0); this.sortColumn_xix3o5$ = Kotlin.modules['stdlib'].kotlin.firstOrNull_ir3nkc$(tmp$1); this.asc_s2pzui$ = (tmp$3 = (tmp$2 = this.sortColumn_xix3o5$) != null ? tmp$2.defaultSortOrderAsc : null) != null ? tmp$3 : true; this.setSortingArrow(); this.dataList_chk18h$ = null; }, /** @lends _.net.yested.bootstrap.Grid.prototype */ { element: { get: function () { return this.$element_88h9vf$; } }, list: { get: function () { return this.dataList_chk18h$; }, set: function (value) { this.dataList_chk18h$ = value; this.displayData(); } }, setSortingArrow: function () { var tmp$0; Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$((tmp$0 = this.columnHeaders_13ipnd$) != null ? tmp$0 : Kotlin.throwNPE(), _.net.yested.bootstrap.Grid.setSortingArrow$f(this)); }, sortByColumn: function (column) { if (Kotlin.equals(column, this.sortColumn_xix3o5$)) { this.asc_s2pzui$ = !this.asc_s2pzui$; } else { this.asc_s2pzui$ = true; this.sortColumn_xix3o5$ = column; } this.displayData(); this.setSortingArrow(); }, renderHeader: function () { _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.THead(), _.net.yested.bootstrap.Grid.renderHeader$f(this))); }, sortData: function (toSort) { return Kotlin.modules['stdlib'].kotlin.sortBy_r48qxn$(toSort, _.net.yested.bootstrap.Grid.sortData$f(this)); }, displayData: function () { var tmp$0; _.net.yested.removeChildByName_thdyg2$(this.element, 'tbody'); (tmp$0 = this.dataList_chk18h$) != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(tmp$0, _.net.yested.bootstrap.Grid.displayData$f(this)) : null; } }, /** @lends _.net.yested.bootstrap.Grid */ { f: function (this$Grid) { return function (it) { this$Grid.sortByColumn(it); }; }, Grid$f: function (this$Grid) { return function (it) { return new _.net.yested.bootstrap.ColumnHeader(it, _.net.yested.bootstrap.Grid.f(this$Grid)); }; }, Grid$f_0: function (it) { return it.defaultSort; }, setSortingArrow$f: function (this$Grid) { return function (it) { it.updateSorting(this$Grid.sortColumn_xix3o5$, this$Grid.asc_s2pzui$); }; }, f_0: function (columnHeader) { return function () { this.rangeTo_94jgcu$('class', 'text-' + columnHeader.column.align.code); this.plus_pv6laa$(columnHeader); }; }, f_1: function (this$) { return function (columnHeader) { this$.th_kv1miw$(_.net.yested.bootstrap.Grid.f_0(columnHeader)); }; }, f_2: function (this$Grid) { return function () { var tmp$0; Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$((tmp$0 = this$Grid.columnHeaders_13ipnd$) != null ? tmp$0 : Kotlin.throwNPE(), _.net.yested.bootstrap.Grid.f_1(this)); }; }, renderHeader$f: function (this$Grid) { return function () { this.tr_l9w0g6$(_.net.yested.bootstrap.Grid.f_2(this$Grid)); }; }, sortData$f: function (this$Grid) { return Kotlin.createObject(function () { return [Kotlin.Comparator]; }, null, { compare: function (obj1, obj2) { var tmp$0; return ((tmp$0 = this$Grid.sortColumn_xix3o5$) != null ? tmp$0 : Kotlin.throwNPE()).sortFunction(obj1, obj2) * (this$Grid.asc_s2pzui$ ? 1 : -1); } }); }, f_3: function (column, item) { return function () { this.rangeTo_94jgcu$('class', 'text-' + column.align.code); column.render.call(this, item); }; }, f_4: function (item, this$) { return function (column) { this$.td_kv1miw$(_.net.yested.bootstrap.Grid.f_3(column, item)); }; }, f_5: function (this$Grid, item) { return function () { Kotlin.modules['stdlib'].kotlin.forEach_5wd4f$(this$Grid.columns, _.net.yested.bootstrap.Grid.f_4(item, this)); }; }, f_6: function (this$Grid, this$) { return function (item) { this$.tr_idqsqk$(_.net.yested.bootstrap.Grid.f_5(this$Grid, item)); }; }, f_7: function (values, this$Grid) { return function () { Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(values, _.net.yested.bootstrap.Grid.f_6(this$Grid, this)); }; }, displayData$f: function (this$Grid) { return function (it) { var tmp$0, tmp$1; var values = this$Grid.sortColumn_xix3o5$ != null ? this$Grid.sortData((tmp$0 = this$Grid.dataList_chk18h$) != null ? tmp$0 : Kotlin.throwNPE()) : (tmp$1 = this$Grid.dataList_chk18h$) != null ? tmp$1 : Kotlin.throwNPE(); _.net.yested.appendComponent_c36dq0$(this$Grid.element, _.net.yested.with_owvm91$(new _.net.yested.TBody(), _.net.yested.bootstrap.Grid.f_7(values, this$Grid))); }; } }), InputElement: Kotlin.createTrait(null), TextInput: Kotlin.createClass(function () { return [_.net.yested.bootstrap.InputElement, _.net.yested.Component]; }, function (placeholder) { if (placeholder === void 0) placeholder = null; this.$element_lks82i$ = _.net.yested.createElement_61zpoe$('input'); this.id$delegate = new _.net.yested.Attribute(); this.onChangeListeners_gt5ey6$ = new Kotlin.ArrayList(); this.onChangeLiveListeners_tps6xq$ = new Kotlin.ArrayList(); this.element.setAttribute('class', 'form-control'); this.element.onchange = _.net.yested.bootstrap.TextInput.TextInput$f(this); this.element.onkeyup = _.net.yested.bootstrap.TextInput.TextInput$f_0(this); this.element.setAttribute('type', 'text'); if (placeholder != null) { this.element.setAttribute('placeholder', placeholder); } }, /** @lends _.net.yested.bootstrap.TextInput.prototype */ { element: { get: function () { return this.$element_lks82i$; } }, id: { get: function () { return this.id$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('id')); }, set: function (id) { this.id$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('id'), id); } }, value: { get: function () { return this.element.value; }, set: function (value) { this.element.value = value; } }, decorate_6taknv$: function (valid) { this.element.setAttribute('class', valid ? 'form-control' : 'form-control has-error'); }, addOnChangeListener_qshda6$: function (invoke) { this.onChangeListeners_gt5ey6$.add_za3rmp$(invoke); }, addOnChangeLiveListener_qshda6$: function (invoke) { this.onChangeLiveListeners_tps6xq$.add_za3rmp$(invoke); } }, /** @lends _.net.yested.bootstrap.TextInput */ { f: function (it) { it(); }, f_0: function (it) { it(); }, TextInput$f: function (this$TextInput) { return function () { Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this$TextInput.onChangeListeners_gt5ey6$, _.net.yested.bootstrap.TextInput.f); Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this$TextInput.onChangeLiveListeners_tps6xq$, _.net.yested.bootstrap.TextInput.f_0); }; }, f_1: function (it) { it(); }, TextInput$f_0: function (this$TextInput) { return function () { Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this$TextInput.onChangeLiveListeners_tps6xq$, _.net.yested.bootstrap.TextInput.f_1); }; } }), textInput_ra92pu$f: function (init) { return function () { init.call(this); }; }, textInput_ra92pu$: function ($receiver, placeholder, init) { $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.TextInput(placeholder), _.net.yested.bootstrap.textInput_ra92pu$f(init))); }, CheckBox: Kotlin.createClass(function () { return [_.net.yested.bootstrap.InputElement, _.net.yested.Component]; }, function () { this.$element_k0miea$ = _.net.yested.createElement_61zpoe$('input'); this.onChangeListeners_o7wbwq$ = new Kotlin.ArrayList(); this.onChangeLiveListeners_6q2boq$ = new Kotlin.ArrayList(); this.element.setAttribute('type', 'checkbox'); this.getElement().onchange = _.net.yested.bootstrap.CheckBox.CheckBox$f(this); }, /** @lends _.net.yested.bootstrap.CheckBox.prototype */ { element: { get: function () { return this.$element_k0miea$; } }, getElement: function () { return this.element; }, value: { get: function () { return this.getElement().checked; }, set: function (value) { this.getElement().checked = value; } }, decorate_6taknv$: function (valid) { }, addOnChangeListener_qshda6$: function (invoke) { this.onChangeListeners_o7wbwq$.add_za3rmp$(invoke); }, addOnChangeLiveListener_qshda6$: function (invoke) { this.onChangeLiveListeners_6q2boq$.add_za3rmp$(invoke); } }, /** @lends _.net.yested.bootstrap.CheckBox */ { f: function (it) { it(); }, f_0: function (it) { it(); }, CheckBox$f: function (this$CheckBox) { return function () { Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this$CheckBox.onChangeListeners_o7wbwq$, _.net.yested.bootstrap.CheckBox.f); Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this$CheckBox.onChangeLiveListeners_6q2boq$, _.net.yested.bootstrap.CheckBox.f_0); }; } }), SelectOption: Kotlin.createClass(null, function (tag, value) { this.tag = tag; this.value = value; }, /** @lends _.net.yested.bootstrap.SelectOption.prototype */ { component1: function () { return this.tag; }, component2: function () { return this.value; }, copy: function (tag, value) { return new _.net.yested.bootstrap.SelectOption(tag === void 0 ? this.tag : tag, value === void 0 ? this.value : value); }, toString: function () { return 'SelectOption(tag=' + Kotlin.toString(this.tag) + (', value=' + Kotlin.toString(this.value)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.tag) | 0; result = result * 31 + Kotlin.hashCode(this.value) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.tag, other.tag) && Kotlin.equals(this.value, other.value)))); } }), Select: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function (multiple, size, renderer) { if (multiple === void 0) multiple = false; if (size === void 0) size = 1; this.renderer = renderer; this.$element_cjfx6t$ = _.net.yested.createElement_61zpoe$('select'); this.onChangeListeners_ufju29$ = new Kotlin.ArrayList(); this.selectedItemsInt_m31zmd$ = Kotlin.modules['stdlib'].kotlin.listOf(); this.dataInt_w7bdgc$ = null; this.optionTags_gajdrl$ = new Kotlin.ArrayList(); this.element.setAttribute('class', 'form-control'); this.element.setAttribute('size', size.toString()); if (multiple) { this.element.setAttribute('multiple', 'multiple'); } this.element.onchange = _.net.yested.bootstrap.Select.Select$f(this); }, /** @lends _.net.yested.bootstrap.Select.prototype */ { element: { get: function () { return this.$element_cjfx6t$; } }, data: { get: function () { return this.dataInt_w7bdgc$; }, set: function (newData) { this.dataInt_w7bdgc$ = newData; this.regenerate(); this.changeSelected(); } }, selectedItems: { get: function () { return this.selectedItemsInt_m31zmd$; }, set: function (newData) { this.selectThese(newData); this.changeSelected(); } }, changeSelected: function () { var tmp$0, tmp$1; tmp$0 = Kotlin.modules['stdlib'].kotlin.filter_azvtw4$(this.optionTags_gajdrl$, _.net.yested.bootstrap.Select.changeSelected$f); tmp$1 = Kotlin.modules['stdlib'].kotlin.map_m3yiqg$(tmp$0, _.net.yested.bootstrap.Select.changeSelected$f_0); this.selectedItemsInt_m31zmd$ = tmp$1; Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this.onChangeListeners_ufju29$, _.net.yested.bootstrap.Select.changeSelected$f_1); }, selectThese: function (selectedItems) { Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this.optionTags_gajdrl$, _.net.yested.bootstrap.Select.selectThese$f(selectedItems)); }, regenerate: function () { var tmp$0; this.element.innerHTML = ''; this.optionTags_gajdrl$ = new Kotlin.ArrayList(); this.selectedItemsInt_m31zmd$ = Kotlin.modules['stdlib'].kotlin.listOf(); if (this.dataInt_w7bdgc$ != null) { (tmp$0 = this.dataInt_w7bdgc$) != null ? Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(tmp$0, _.net.yested.bootstrap.Select.regenerate$f(this)) : null; } }, addOnChangeListener_qshda6$: function (invoke) { this.onChangeListeners_ufju29$.add_za3rmp$(invoke); } }, /** @lends _.net.yested.bootstrap.Select */ { Select$f: function (this$Select) { return function () { this$Select.changeSelected(); }; }, changeSelected$f: function (it) { return it.tag.selected; }, changeSelected$f_0: function (it) { return it.value; }, changeSelected$f_1: function (it) { it(); }, selectThese$f: function (selectedItems) { return function (it) { it.tag.selected = selectedItems.contains_za3rmp$(it.value); }; }, f: function (this$Select, it) { return function () { this.plus_pdl1w0$(this$Select.renderer(it)); }; }, regenerate$f: function (this$Select) { return function (it) { var optionTag = _.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('option'), _.net.yested.bootstrap.Select.f(this$Select, it)); var value = it; var selectOption = new _.net.yested.bootstrap.SelectOption(optionTag.element, value); this$Select.optionTags_gajdrl$.add_za3rmp$(selectOption); _.net.yested.appendComponent_c36dq0$(this$Select.element, optionTag); }; } }), f: function (prefix) { return function () { this.plus_pdl1w0$(prefix != null ? prefix : Kotlin.throwNPE()); }; }, f_0: function (prefix, this$) { return function (it) { return this$.div_5rsex9$(void 0, 'input-group-addon', _.net.yested.bootstrap.f(prefix)); }; }, f_1: function (suffix) { return function () { this.plus_pdl1w0$(suffix != null ? suffix : Kotlin.throwNPE()); }; }, f_2: function (suffix, this$) { return function (it) { return this$.div_5rsex9$(void 0, 'input-group-addon', _.net.yested.bootstrap.f_1(suffix)); }; }, inputAddOn_cc7g17$f: function (prefix, textInput, suffix) { return function () { prefix != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(prefix, _.net.yested.bootstrap.f_0(prefix, this)) : null; this.plus_pv6laa$(textInput); suffix != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(suffix, _.net.yested.bootstrap.f_2(suffix, this)) : null; }; }, inputAddOn_cc7g17$: function ($receiver, prefix, suffix, textInput) { if (prefix === void 0) prefix = null; if (suffix === void 0) suffix = null; $receiver.plus_pv6laa$($receiver.div_5rsex9$(void 0, 'input-group', _.net.yested.bootstrap.inputAddOn_cc7g17$f(prefix, textInput, suffix))); }, Row: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function () { this.$element_njfknr$ = _.net.yested.createElement_61zpoe$('div'); this.element.setAttribute('class', 'row'); }, /** @lends _.net.yested.bootstrap.Row.prototype */ { element: { get: function () { return this.$element_njfknr$; } }, col_zcukl0$: function (modifiers, init) { _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Row.col_zcukl0$f(modifiers, init))); } }, /** @lends _.net.yested.bootstrap.Row */ { f: function (it) { return it.toString(); }, col_zcukl0$f: function (modifiers, init) { return function () { this.clazz = Kotlin.modules['stdlib'].kotlin.join_raq5lb$(Kotlin.modules['stdlib'].kotlin.map_rie7ol$(modifiers, _.net.yested.bootstrap.Row.f), ' '); init.call(this); }; } }), ContainerLayout: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { DEFAULT: new _.net.yested.bootstrap.ContainerLayout('container'), FLUID: new _.net.yested.bootstrap.ContainerLayout('container-fluid') }; }), Page: Kotlin.createClass(null, function (element, layout) { if (layout === void 0) layout = _.net.yested.bootstrap.ContainerLayout.object.DEFAULT; this.element = element; this.layout = layout; }, /** @lends _.net.yested.bootstrap.Page.prototype */ { topMenu_tx5hdt$: function (navbar) { _.net.yested.appendComponent_c36dq0$(this.element, navbar); }, content_kv1miw$: function (init) { this.element.appendChild(_.net.yested.div_5rsex9$(void 0, void 0, _.net.yested.bootstrap.Page.content_kv1miw$f(this, init)).element); }, footer_kv1miw$: function (init) { this.element.appendChild(_.net.yested.div_5rsex9$(void 0, void 0, _.net.yested.bootstrap.Page.footer_kv1miw$f(init)).element); } }, /** @lends _.net.yested.bootstrap.Page */ { content_kv1miw$f: function (this$Page, init) { return function () { this.rangeTo_94jgcu$('class', this$Page.layout.code); init.call(this); }; }, f: function () { }, f_0: function (init) { return function () { this.tag_s8xvdm$('hr', _.net.yested.bootstrap.Page.f); init.call(this); }; }, footer_kv1miw$f: function (init) { return function () { this.div_5rsex9$(void 0, 'container', _.net.yested.bootstrap.Page.f_0(init)); }; } }), PageHeader: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'div'); this.clazz = 'page-header'; }), pageHeader_kzm4yj$f: function (init) { return function () { init.call(this); }; }, pageHeader_kzm4yj$: function ($receiver, init) { $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.PageHeader(), _.net.yested.bootstrap.pageHeader_kzm4yj$f(init))); }, row_xnql8t$f: function (init) { return function () { init.call(this); }; }, row_xnql8t$: function ($receiver, init) { $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Row(), _.net.yested.bootstrap.row_xnql8t$f(init))); }, page_uplc13$f: function (init) { return function () { init.call(this); }; }, page_uplc13$: function (placeholderElementId, layout, init) { if (layout === void 0) layout = _.net.yested.bootstrap.ContainerLayout.object.DEFAULT; _.net.yested.with_owvm91$(new _.net.yested.bootstrap.Page(_.net.yested.el(placeholderElementId), layout), _.net.yested.bootstrap.page_uplc13$f(init)); }, MediaAlign: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(className) { $fun.baseInitializer.call(this); this.className = className; }, function () { return { Left: new _.net.yested.bootstrap.MediaAlign('pull-left'), Right: new _.net.yested.bootstrap.MediaAlign('pull-right') }; }), MediaBody: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'div'); this.heading_5cm9rd$ = _.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('h4'), _.net.yested.bootstrap.MediaBody.MediaBody$f); this.element.setAttribute('class', 'media-body'); }, /** @lends _.net.yested.bootstrap.MediaBody.prototype */ { heading_kv1miw$: function (init) { init.call(this.heading_5cm9rd$); this.plus_pv6laa$(this.heading_5cm9rd$); }, content_kv1miw$: function (init) { init.call(this); } }, /** @lends _.net.yested.bootstrap.MediaBody */ { MediaBody$f: function () { this.clazz = 'media-heading'; } }), MediaObject: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun(align) { $fun.baseInitializer.call(this, 'div'); this.media_ni72hk$ = _.net.yested.with_owvm91$(new _.net.yested.Anchor(), _.net.yested.bootstrap.MediaObject.MediaObject$f(align)); this.body_vbc7dq$ = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.MediaBody(), _.net.yested.bootstrap.MediaObject.MediaObject$f_0); this.element.setAttribute('class', 'media'); this.appendChild_5f0h2k$(this.media_ni72hk$); this.appendChild_5f0h2k$(this.body_vbc7dq$); }, /** @lends _.net.yested.bootstrap.MediaObject.prototype */ { media_kv1miw$: function (init) { var tmp$0; init.call(this.media_ni72hk$); var childElement = this.media_ni72hk$.element.firstChild; var clazz = (tmp$0 = childElement.getAttribute('class')) != null ? tmp$0 : ''; childElement.setAttribute('class', clazz + ' media-object'); }, content_tq11g4$: function (init) { init.call(this.body_vbc7dq$); } }, /** @lends _.net.yested.bootstrap.MediaObject */ { MediaObject$f: function (align) { return function () { this.clazz = align.className; this.href = '#'; }; }, MediaObject$f_0: function () { } }), mediaObject_wda2nk$f: function (init) { return function () { init.call(this); }; }, mediaObject_wda2nk$: function ($receiver, align, init) { $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.MediaObject(align), _.net.yested.bootstrap.mediaObject_wda2nk$f(init))); }, NavbarPosition: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { STATIC_TOP: new _.net.yested.bootstrap.NavbarPosition('static-top'), FIXED_TOP: new _.net.yested.bootstrap.NavbarPosition('fixed-top'), FIXED_BOTTOM: new _.net.yested.bootstrap.NavbarPosition('fixed-bottom') }; }), NavbarLook: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { DEFAULT: new _.net.yested.bootstrap.NavbarLook('default'), INVERSE: new _.net.yested.bootstrap.NavbarLook('inverse') }; }), Navbar: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function (id, position, look) { if (position === void 0) position = null; if (look === void 0) look = _.net.yested.bootstrap.NavbarLook.object.DEFAULT; this.$element_cd9gsv$ = _.net.yested.createElement_61zpoe$('nav'); this.ul_6lssbo$ = _.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.bootstrap.Navbar.Navbar$f); this.collapsible_lhbokj$ = _.net.yested.div_5rsex9$(id, 'navbar-collapse collapse', _.net.yested.bootstrap.Navbar.Navbar$f_0(this)); this.menuItems_2kpyr8$ = new Kotlin.ArrayList(); this.brandLink_f4xx9w$ = new _.net.yested.Anchor(); this.element.setAttribute('class', 'navbar navbar-' + look.code + ' ' + (position != null ? 'navbar-' + position.code : '')); this.element.setAttribute('role', 'navigation'); _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.div_5rsex9$(void 0, 'container', _.net.yested.bootstrap.Navbar.Navbar$f_1(id, this))); }, /** @lends _.net.yested.bootstrap.Navbar.prototype */ { element: { get: function () { return this.$element_cd9gsv$; }, set: function (element) { this.$element_cd9gsv$ = element; } }, brand_s8xvdm$: function (href, init) { if (href === void 0) href = '/'; this.brandLink_f4xx9w$.href = href; this.brandLink_f4xx9w$.clazz = 'navbar-brand'; this.brandLink_f4xx9w$.setChild_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Span(), _.net.yested.bootstrap.Navbar.brand_s8xvdm$f(init))); this.brandLink_f4xx9w$.onclick = _.net.yested.bootstrap.Navbar.brand_s8xvdm$f_0(this); }, item_b1t645$: function (href, onclick, init) { if (href === void 0) href = '#'; if (onclick === void 0) onclick = null; var li = new _.net.yested.Li(); var linkClicked = _.net.yested.bootstrap.Navbar.item_b1t645$linkClicked(this, li, onclick); _.net.yested.with_owvm91$(li, _.net.yested.bootstrap.Navbar.item_b1t645$f(href, linkClicked, init)); this.ul_6lssbo$.appendChild_5f0h2k$(li); this.menuItems_2kpyr8$.add_za3rmp$(li); }, dropdown_vvlqvy$: function (label, init) { var dropdown = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.NavBarDropdown(_.net.yested.bootstrap.Navbar.dropdown_vvlqvy$f(this), label), _.net.yested.bootstrap.Navbar.dropdown_vvlqvy$f_0(init)); this.ul_6lssbo$.appendChild_5f0h2k$(dropdown); this.menuItems_2kpyr8$.add_za3rmp$(dropdown); }, deselectAll: function () { Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this.menuItems_2kpyr8$, _.net.yested.bootstrap.Navbar.deselectAll$f); }, left_oe5uhj$: function (init) { this.collapsible_lhbokj$.appendChild_5f0h2k$(_.net.yested.div_5rsex9$(void 0, 'navbar-left', _.net.yested.bootstrap.Navbar.left_oe5uhj$f(init))); }, right_oe5uhj$: function (init) { this.collapsible_lhbokj$.appendChild_5f0h2k$(_.net.yested.div_5rsex9$(void 0, 'navbar-right', _.net.yested.bootstrap.Navbar.right_oe5uhj$f(init))); } }, /** @lends _.net.yested.bootstrap.Navbar */ { Navbar$f: function () { this.clazz = 'nav navbar-nav'; }, Navbar$f_0: function (this$Navbar) { return function () { this.plus_pv6laa$(this$Navbar.ul_6lssbo$); }; }, f: function () { this.plus_pdl1w0$('Toogle navigation'); }, f_0: function () { }, f_1: function () { }, f_2: function () { }, f_3: function (id) { return function () { this.rangeTo_94jgcu$('type', 'button'); this.rangeTo_94jgcu$('class', 'navbar-toggle collapsed'); this.rangeTo_94jgcu$('data-toggle', 'collapse'); this.rangeTo_94jgcu$('data-target', '#' + id); this.rangeTo_94jgcu$('aria-expanded', 'false'); this.rangeTo_94jgcu$('aria-controls', 'navbar'); this.span_dkuwo$('sr-only', _.net.yested.bootstrap.Navbar.f); this.span_dkuwo$('icon-bar', _.net.yested.bootstrap.Navbar.f_0); this.span_dkuwo$('icon-bar', _.net.yested.bootstrap.Navbar.f_1); this.span_dkuwo$('icon-bar', _.net.yested.bootstrap.Navbar.f_2); }; }, f_4: function (id, this$Navbar) { return function () { this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('button'), _.net.yested.bootstrap.Navbar.f_3(id))); this.plus_pv6laa$(this$Navbar.brandLink_f4xx9w$); }; }, Navbar$f_1: function (id, this$Navbar) { return function () { this.div_5rsex9$(void 0, 'navbar-header', _.net.yested.bootstrap.Navbar.f_4(id, this$Navbar)); this.plus_pv6laa$(this$Navbar.collapsible_lhbokj$); }; }, brand_s8xvdm$f: function (init) { return function () { init.call(this); }; }, brand_s8xvdm$f_0: function (this$Navbar) { return function () { this$Navbar.deselectAll(); }; }, linkClicked$f: function (onclick) { return function (it) { (onclick != null ? onclick : Kotlin.throwNPE())(); }; }, item_b1t645$linkClicked: function (this$Navbar, li, onclick) { return function () { this$Navbar.deselectAll(); li.clazz = 'active'; onclick != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(onclick, _.net.yested.bootstrap.Navbar.linkClicked$f(onclick)) : null; }; }, item_b1t645$f: function (href, linkClicked, init) { return function () { this.a_b4th6h$(void 0, href, linkClicked, init); }; }, dropdown_vvlqvy$f: function (this$Navbar) { return function () { this$Navbar.deselectAll(); }; }, dropdown_vvlqvy$f_0: function (init) { return function () { init.call(this); }; }, deselectAll$f: function (it) { it.clazz = ''; }, left_oe5uhj$f: function (init) { return function () { init.call(this); }; }, right_oe5uhj$f: function (init) { return function () { init.call(this); }; } }), NavBarDropdown: Kotlin.createClass(function () { return [_.net.yested.HTMLComponent]; }, function $fun(deselectFun, label) { $fun.baseInitializer.call(this, 'li'); this.deselectFun_qdujve$ = deselectFun; this.ul_e2is7h$ = _.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.bootstrap.NavBarDropdown.NavBarDropdown$f); this.element.setAttribute('class', 'dropdown'); _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.Anchor(), _.net.yested.bootstrap.NavBarDropdown.NavBarDropdown$f_0(label))); _.net.yested.appendComponent_c36dq0$(this.element, this.ul_e2is7h$); }, /** @lends _.net.yested.bootstrap.NavBarDropdown.prototype */ { selectThis: function () { this.deselectFun_qdujve$(); this.element.setAttribute('class', 'dropdown active'); }, item: function (href, onclick, init) { if (href === void 0) href = '#'; if (onclick === void 0) onclick = null; var li = _.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.NavBarDropdown.item$f(href, this, onclick, init)); this.ul_e2is7h$.appendChild_5f0h2k$(li); }, divider: function () { this.ul_e2is7h$.appendChild_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('li'), _.net.yested.bootstrap.NavBarDropdown.divider$f)); } }, /** @lends _.net.yested.bootstrap.NavBarDropdown */ { NavBarDropdown$f: function () { this.rangeTo_94jgcu$('class', 'dropdown-menu'); this.rangeTo_94jgcu$('role', 'menu'); }, f: function () { }, NavBarDropdown$f_0: function (label) { return function () { this.rangeTo_94jgcu$('class', 'dropdown-toggle'); this.rangeTo_94jgcu$('data-toggle', 'dropdown'); this.rangeTo_94jgcu$('role', 'button'); this.rangeTo_94jgcu$('aria-expanded', 'false'); this.href = '#'; label.call(this); this.span_dkuwo$('caret', _.net.yested.bootstrap.NavBarDropdown.f); }; }, f_0: function (this$) { return function (it) { this$.onclick(); }; }, f_1: function (this$NavBarDropdown, onclick, this$) { return function () { this$NavBarDropdown.selectThis(); onclick != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(onclick, _.net.yested.bootstrap.NavBarDropdown.f_0(this$)) : null; }; }, item$f: function (href, this$NavBarDropdown, onclick, init) { return function () { this.a_b4th6h$(void 0, href, _.net.yested.bootstrap.NavBarDropdown.f_1(this$NavBarDropdown, onclick, this), init); }; }, divider$f: function () { this.rangeTo_94jgcu$('class', 'divider'); } }), navbar_x6lhct$f: function (init) { return function () { init.call(this); }; }, navbar_x6lhct$: function ($receiver, id, position, look, init) { if (position === void 0) position = null; if (look === void 0) look = _.net.yested.bootstrap.NavbarLook.object.DEFAULT; $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Navbar(id, position, look), _.net.yested.bootstrap.navbar_x6lhct$f(init))); }, Pagination: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function (count, defaultSelection, listener) { if (defaultSelection === void 0) defaultSelection = 1; this.count = count; this.defaultSelection = defaultSelection; this.listener = listener; this.$element_z5clzt$ = _.net.yested.createElement_61zpoe$('nav'); this.selectedItem_cr0avl$ = this.defaultSelection; this.list_z57r8f$ = _.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.bootstrap.Pagination.Pagination$f); this.items_o2ga03$ = Kotlin.modules['stdlib'].kotlin.arrayListOf_9mqe4v$([]); _.net.yested.appendComponent_c36dq0$(this.element, this.list_z57r8f$); this.replaceItems(); this.redisplay(this.selectedItem_cr0avl$); }, /** @lends _.net.yested.bootstrap.Pagination.prototype */ { element: { get: function () { return this.$element_z5clzt$; } }, selected: { get: function () { return this.selectedItem_cr0avl$; }, set: function (newValue) { this.selectedItem_cr0avl$ = newValue; this.redisplay(this.selectedItem_cr0avl$); } }, replaceItems: function () { this.items_o2ga03$ = this.generateItems(); this.list_z57r8f$.setContent_61zpoe$(''); Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this.items_o2ga03$, _.net.yested.bootstrap.Pagination.replaceItems$f(this)); }, generateItems: function () { var tmp$0; var newList = new Kotlin.ArrayList(); newList.add_za3rmp$(_.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Pagination.generateItems$f(this))); tmp$0 = this.count; for (var i = 1; i <= tmp$0; i++) { newList.add_za3rmp$(_.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Pagination.generateItems$f_0(i, this))); } newList.add_za3rmp$(_.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Pagination.generateItems$f_1(this))); return newList; }, backward: function () { if (this.selectedItem_cr0avl$ > 1) { this.selectedItem_cr0avl$--; this.changeSelection(); } }, forward: function () { if (this.selectedItem_cr0avl$ < this.count) { this.selectedItem_cr0avl$++; this.changeSelection(); } }, select: function (newPosition) { if (newPosition !== this.selectedItem_cr0avl$) { this.selectedItem_cr0avl$ = newPosition; this.changeSelection(); } }, changeSelection: function () { this.redisplay(this.selectedItem_cr0avl$); this.listener(this.selectedItem_cr0avl$); }, redisplay: function (position) { var tmp$0; tmp$0 = this.count; for (var i = 1; i <= tmp$0; i++) { this.items_o2ga03$.get_za3lpa$(i).clazz = ''; } this.items_o2ga03$.get_za3lpa$(position).clazz = 'active'; this.items_o2ga03$.get_za3lpa$(0).clazz = position === 1 ? 'disabled' : ''; this.items_o2ga03$.get_za3lpa$(this.items_o2ga03$.size() - 1).clazz = position === this.count ? 'disabled' : ''; } }, /** @lends _.net.yested.bootstrap.Pagination */ { Pagination$f: function () { this.clazz = 'pagination'; }, replaceItems$f: function (this$Pagination) { return function (it) { this$Pagination.list_z57r8f$.appendChild_5f0h2k$(it); }; }, f: function (this$Pagination) { return function () { this$Pagination.backward(); }; }, f_0: function () { this.plus_pdl1w0$('&laquo;'); }, f_1: function () { this.span_dkuwo$(void 0, _.net.yested.bootstrap.Pagination.f_0); }, generateItems$f: function (this$Pagination) { return function () { this.rangeTo_94jgcu$('style', 'cursor: pointer;'); this.a_b4th6h$(void 0, void 0, _.net.yested.bootstrap.Pagination.f(this$Pagination), _.net.yested.bootstrap.Pagination.f_1); }; }, f_2: function (i, this$Pagination) { return function () { this$Pagination.select(i); }; }, f_3: function (i) { return function () { this.plus_pdl1w0$(i.toString()); }; }, f_4: function (i) { return function () { this.rangeTo_94jgcu$('style', 'cursor: pointer;'); this.span_dkuwo$(void 0, _.net.yested.bootstrap.Pagination.f_3(i)); }; }, generateItems$f_0: function (i, this$Pagination) { return function () { this.a_b4th6h$(void 0, void 0, _.net.yested.bootstrap.Pagination.f_2(i, this$Pagination), _.net.yested.bootstrap.Pagination.f_4(i)); }; }, f_5: function (this$Pagination) { return function () { this$Pagination.forward(); }; }, f_6: function () { this.plus_pdl1w0$('&raquo;'); }, f_7: function () { this.span_dkuwo$(void 0, _.net.yested.bootstrap.Pagination.f_6); }, generateItems$f_1: function (this$Pagination) { return function () { this.rangeTo_94jgcu$('style', 'cursor: pointer;'); this.a_b4th6h$(void 0, void 0, _.net.yested.bootstrap.Pagination.f_5(this$Pagination), _.net.yested.bootstrap.Pagination.f_7); }; } }), pagination_vs56l6$: function ($receiver, count, defaultSelection, listener) { if (defaultSelection === void 0) defaultSelection = 1; $receiver.plus_pv6laa$(new _.net.yested.bootstrap.Pagination(count, defaultSelection, listener)); }, PanelStyle: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { DEFAULT: new _.net.yested.bootstrap.PanelStyle('default'), PRIMARY: new _.net.yested.bootstrap.PanelStyle('primary'), SUCCESS: new _.net.yested.bootstrap.PanelStyle('success'), INFO: new _.net.yested.bootstrap.PanelStyle('info'), WARNING: new _.net.yested.bootstrap.PanelStyle('warning'), DANGER: new _.net.yested.bootstrap.PanelStyle('danger') }; }), Panel: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function (style) { if (style === void 0) style = _.net.yested.bootstrap.PanelStyle.object.DEFAULT; this.$element_njm3sx$ = _.net.yested.createElement_61zpoe$('div'); this.heading_6tzak9$ = _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Panel.Panel$f); this.body_fx0fel$ = _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Panel.Panel$f_0); this.footer_qhkwty$ = _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Panel.Panel$f_1); this.element.setAttribute('class', 'panel panel-' + style.code); _.net.yested.appendComponent_c36dq0$(this.element, this.heading_6tzak9$); _.net.yested.appendComponent_c36dq0$(this.element, this.body_fx0fel$); }, /** @lends _.net.yested.bootstrap.Panel.prototype */ { element: { get: function () { return this.$element_njm3sx$; } }, heading_kv1miw$: function (init) { init.call(this.heading_6tzak9$); }, content_kv1miw$: function (init) { init.call(this.body_fx0fel$); }, footer_kv1miw$: function (init) { init.call(this.footer_qhkwty$); _.net.yested.appendComponent_c36dq0$(this.element, this.footer_qhkwty$); } }, /** @lends _.net.yested.bootstrap.Panel */ { Panel$f: function () { this.clazz = 'panel-heading'; }, Panel$f_0: function () { this.clazz = 'panel-body'; }, Panel$f_1: function () { this.clazz = 'panel-footer'; } }), panel_mkklid$f: function (init) { return function () { init.call(this); }; }, panel_mkklid$: function ($receiver, style, init) { if (style === void 0) style = _.net.yested.bootstrap.PanelStyle.object.DEFAULT; $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Panel(style), _.net.yested.bootstrap.panel_mkklid$f(init))); }, Tabs: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function () { this.$element_s2egal$ = _.net.yested.createElement_61zpoe$('div'); this.bar_83ssd0$ = _.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.bootstrap.Tabs.Tabs$f); this.content_9tda2$ = _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Tabs.Tabs$f_0); this.anchorsLi_g1z45g$ = new Kotlin.ArrayList(); this.tabsRendered_rgvx82$ = new Kotlin.PrimitiveNumberHashMap(); this.index_nuub59$ = 0; this.element.setAttribute('role', 'tabpanel'); _.net.yested.appendComponent_c36dq0$(this.element, this.bar_83ssd0$); _.net.yested.appendComponent_c36dq0$(this.element, this.content_9tda2$); }, /** @lends _.net.yested.bootstrap.Tabs.prototype */ { element: { get: function () { return this.$element_s2egal$; } }, renderContent: function (tabId, init) { var tmp$0; if (this.tabsRendered_rgvx82$.containsKey_za3rmp$(tabId)) { return (tmp$0 = this.tabsRendered_rgvx82$.get_za3rmp$(tabId)) != null ? tmp$0 : Kotlin.throwNPE(); } else { var div = _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Tabs.renderContent$f(init)); this.tabsRendered_rgvx82$.put_wn2jw4$(tabId, div); return div; } }, activateTab: function (li, tabId, onSelect, init) { var tmp$0; li.clazz = 'active'; tmp$0 = Kotlin.modules['stdlib'].kotlin.filter_azvtw4$(this.anchorsLi_g1z45g$, _.net.yested.bootstrap.Tabs.activateTab$f(li)); Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(tmp$0, _.net.yested.bootstrap.Tabs.activateTab$f_0); this.content_9tda2$.setChild_hu5ove$(this.renderContent(tabId, init), new _.net.yested.Fade()); if (onSelect != null) { onSelect(); } }, tab_l25lo7$: function (active, header, onSelect, init) { if (active === void 0) active = false; if (onSelect === void 0) onSelect = null; var tabId = this.index_nuub59$++; var a = _.net.yested.with_owvm91$(new _.net.yested.Anchor(), _.net.yested.bootstrap.Tabs.tab_l25lo7$f(header)); var li = _.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Tabs.tab_l25lo7$f_0(a)); this.bar_83ssd0$.appendChild_5f0h2k$(li); a.onclick = _.net.yested.bootstrap.Tabs.tab_l25lo7$f_1(li, tabId, onSelect, init, this); this.anchorsLi_g1z45g$.add_za3rmp$(li); if (active) { this.activateTab(li, tabId, onSelect, init); } } }, /** @lends _.net.yested.bootstrap.Tabs */ { Tabs$f: function () { this.role = 'tablist'; this.clazz = 'nav nav-tabs'; }, Tabs$f_0: function () { this.clazz = 'tab-content'; }, renderContent$f: function (init) { return function () { this.rangeTo_94jgcu$('class', 'fade in'); init.call(this); }; }, activateTab$f: function (li) { return function (it) { return !Kotlin.equals(it, li); }; }, activateTab$f_0: function (it) { it.clazz = ''; }, tab_l25lo7$f: function (header) { return function () { this.rangeTo_94jgcu$('role', 'tab'); this.rangeTo_94jgcu$('style', 'cursor: pointer;'); header.call(this); }; }, tab_l25lo7$f_0: function (a) { return function () { this.plus_pv6laa$(a); this.role = 'presentation'; }; }, tab_l25lo7$f_1: function (li, tabId, onSelect, init, this$Tabs) { return function () { this$Tabs.activateTab(li, tabId, onSelect, init); }; } }), tabs_fe4fv1$f: function (init) { return function () { init.call(this); }; }, tabs_fe4fv1$: function ($receiver, init) { $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Tabs(), _.net.yested.bootstrap.tabs_fe4fv1$f(init))); }, TextAlign: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { LEFT: new _.net.yested.bootstrap.TextAlign('left'), CENTER: new _.net.yested.bootstrap.TextAlign('center'), RIGHT: new _.net.yested.bootstrap.TextAlign('right'), JUSTIFY: new _.net.yested.bootstrap.TextAlign('justify'), NOWRAP: new _.net.yested.bootstrap.TextAlign('nowrap') }; }), aligned_xlk53m$f: function (align, init) { return function () { this.clazz = 'text-' + align.code; init.call(this); }; }, aligned_xlk53m$: function ($receiver, align, init) { $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.P(), _.net.yested.bootstrap.aligned_xlk53m$f(align, init))); }, addSpan$f: function (clazz, init) { return function () { this.clazz = clazz; init.call(this); }; }, addSpan: function (parent, clazz, init) { parent.appendChild_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Span(), _.net.yested.bootstrap.addSpan$f(clazz, init))); }, uppercase_71h449$: function ($receiver, init) { _.net.yested.bootstrap.addSpan($receiver, 'text-uppercase', init); }, lowercase_71h449$: function ($receiver, init) { _.net.yested.bootstrap.addSpan($receiver, 'text-lowercase', init); }, capitalize_71h449$: function ($receiver, init) { _.net.yested.bootstrap.addSpan($receiver, 'text-capitalize', init); } }), spin: Kotlin.definePackage(null, /** @lends _.net.yested.spin */ { SpinnerOptions: Kotlin.createClass(null, function (lines, length, width, radius, corners, rotate, direction, color, speed, trail, shadow, hwaccel, className, zIndex, top, left) { if (lines === void 0) lines = 13; if (length === void 0) length = 20; if (width === void 0) width = 10; if (radius === void 0) radius = 30; if (corners === void 0) corners = 1; if (rotate === void 0) rotate = 0; if (direction === void 0) direction = 1; if (color === void 0) color = '#000'; if (speed === void 0) speed = 1; if (trail === void 0) trail = 60; if (shadow === void 0) shadow = false; if (hwaccel === void 0) hwaccel = false; if (className === void 0) className = 'spinner'; if (zIndex === void 0) zIndex = 2.0E9; if (top === void 0) top = '50%'; if (left === void 0) left = '50%'; this.lines = lines; this.length = length; this.width = width; this.radius = radius; this.corners = corners; this.rotate = rotate; this.direction = direction; this.color = color; this.speed = speed; this.trail = trail; this.shadow = shadow; this.hwaccel = hwaccel; this.className = className; this.zIndex = zIndex; this.top = top; this.left = left; }, /** @lends _.net.yested.spin.SpinnerOptions.prototype */ { component1: function () { return this.lines; }, component2: function () { return this.length; }, component3: function () { return this.width; }, component4: function () { return this.radius; }, component5: function () { return this.corners; }, component6: function () { return this.rotate; }, component7: function () { return this.direction; }, component8: function () { return this.color; }, component9: function () { return this.speed; }, component10: function () { return this.trail; }, component11: function () { return this.shadow; }, component12: function () { return this.hwaccel; }, component13: function () { return this.className; }, component14: function () { return this.zIndex; }, component15: function () { return this.top; }, component16: function () { return this.left; }, copy: function (lines, length, width, radius, corners, rotate, direction, color, speed, trail, shadow, hwaccel, className, zIndex, top, left) { return new _.net.yested.spin.SpinnerOptions(lines === void 0 ? this.lines : lines, length === void 0 ? this.length : length, width === void 0 ? this.width : width, radius === void 0 ? this.radius : radius, corners === void 0 ? this.corners : corners, rotate === void 0 ? this.rotate : rotate, direction === void 0 ? this.direction : direction, color === void 0 ? this.color : color, speed === void 0 ? this.speed : speed, trail === void 0 ? this.trail : trail, shadow === void 0 ? this.shadow : shadow, hwaccel === void 0 ? this.hwaccel : hwaccel, className === void 0 ? this.className : className, zIndex === void 0 ? this.zIndex : zIndex, top === void 0 ? this.top : top, left === void 0 ? this.left : left); }, toString: function () { return 'SpinnerOptions(lines=' + Kotlin.toString(this.lines) + (', length=' + Kotlin.toString(this.length)) + (', width=' + Kotlin.toString(this.width)) + (', radius=' + Kotlin.toString(this.radius)) + (', corners=' + Kotlin.toString(this.corners)) + (', rotate=' + Kotlin.toString(this.rotate)) + (', direction=' + Kotlin.toString(this.direction)) + (', color=' + Kotlin.toString(this.color)) + (', speed=' + Kotlin.toString(this.speed)) + (', trail=' + Kotlin.toString(this.trail)) + (', shadow=' + Kotlin.toString(this.shadow)) + (', hwaccel=' + Kotlin.toString(this.hwaccel)) + (', className=' + Kotlin.toString(this.className)) + (', zIndex=' + Kotlin.toString(this.zIndex)) + (', top=' + Kotlin.toString(this.top)) + (', left=' + Kotlin.toString(this.left)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.lines) | 0; result = result * 31 + Kotlin.hashCode(this.length) | 0; result = result * 31 + Kotlin.hashCode(this.width) | 0; result = result * 31 + Kotlin.hashCode(this.radius) | 0; result = result * 31 + Kotlin.hashCode(this.corners) | 0; result = result * 31 + Kotlin.hashCode(this.rotate) | 0; result = result * 31 + Kotlin.hashCode(this.direction) | 0; result = result * 31 + Kotlin.hashCode(this.color) | 0; result = result * 31 + Kotlin.hashCode(this.speed) | 0; result = result * 31 + Kotlin.hashCode(this.trail) | 0; result = result * 31 + Kotlin.hashCode(this.shadow) | 0; result = result * 31 + Kotlin.hashCode(this.hwaccel) | 0; result = result * 31 + Kotlin.hashCode(this.className) | 0; result = result * 31 + Kotlin.hashCode(this.zIndex) | 0; result = result * 31 + Kotlin.hashCode(this.top) | 0; result = result * 31 + Kotlin.hashCode(this.left) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.lines, other.lines) && Kotlin.equals(this.length, other.length) && Kotlin.equals(this.width, other.width) && Kotlin.equals(this.radius, other.radius) && Kotlin.equals(this.corners, other.corners) && Kotlin.equals(this.rotate, other.rotate) && Kotlin.equals(this.direction, other.direction) && Kotlin.equals(this.color, other.color) && Kotlin.equals(this.speed, other.speed) && Kotlin.equals(this.trail, other.trail) && Kotlin.equals(this.shadow, other.shadow) && Kotlin.equals(this.hwaccel, other.hwaccel) && Kotlin.equals(this.className, other.className) && Kotlin.equals(this.zIndex, other.zIndex) && Kotlin.equals(this.top, other.top) && Kotlin.equals(this.left, other.left)))); } }), Spinner: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function (options) { if (options === void 0) options = new _.net.yested.spin.SpinnerOptions(); this.options = options; this.jsSpinnerElement_vuqxo$ = new Spinner(this.createOptions()).spin().el; this.$element_lzlbvw$ = this.jsSpinnerElement_vuqxo$; }, /** @lends _.net.yested.spin.Spinner.prototype */ { createOptions: function () { return _.net.yested.spin.Spinner.createOptions$f(this); }, element: { get: function () { return this.$element_lzlbvw$; } } }, /** @lends _.net.yested.spin.Spinner */ { createOptions$f: function (this$Spinner) { return Kotlin.createObject(null, function () { this.lines = this$Spinner.options.lines; this.length = this$Spinner.options.length; this.width = this$Spinner.options.width; this.radius = this$Spinner.options.radius; this.corners = this$Spinner.options.corners; this.rotate = this$Spinner.options.rotate; this.direction = this$Spinner.options.direction; this.color = this$Spinner.options.color; this.speed = this$Spinner.options.speed; this.trail = this$Spinner.options.trail; this.shadow = this$Spinner.options.shadow; this.hwaccel = this$Spinner.options.hwaccel; this.className = this$Spinner.options.className; this.zIndex = this$Spinner.options.zIndex; this.top = this$Spinner.options.top; this.left = this$Spinner.options.left; }); } }), spinner_4tyilv$: function ($receiver, options) { if (options === void 0) options = new _.net.yested.spin.SpinnerOptions(); $receiver.plus_pv6laa$(new _.net.yested.spin.Spinner(options)); } }) }) }), f: function () { this.plus_pdl1w0$('Yested'); }, f_0: function () { this.plus_pdl1w0$('Getting Started'); }, f_1: function () { this.plus_pdl1w0$('Examples'); }, f_2: function () { this.plus_pdl1w0$('Basic HTML'); }, f_3: function () { this.plus_pdl1w0$('Twitter Bootstrap'); }, f_4: function () { this.plus_pdl1w0$('Ajax Call'); }, f_5: function () { this.plus_pdl1w0$('Master/Detail'); }, f_6: function () { this.plus_pdl1w0$('Spinner'); }, f_7: function () { this.plus_pdl1w0$('Effects'); }, f_8: function () { this.item('#html', void 0, _.f_2); this.item('#bootstrapComponents', void 0, _.f_3); this.item('#ajax', void 0, _.f_4); this.item('#masterdetail', void 0, _.f_5); this.item('#spinner', void 0, _.f_6); this.item('#effects', void 0, _.f_7); }, main$f: function () { this.brand_s8xvdm$('#', _.f); this.item_b1t645$('#gettingstarted', void 0, _.f_0); this.dropdown_vvlqvy$(_.f_1, _.f_8); }, main$f_0: function () { }, main$f_1: function (divContainer) { return function (hash) { var tmp$0; tmp$0 = hash[0]; if (tmp$0 === '#' || tmp$0 === '') divContainer.setChild_hu5ove$(_.basics.basicPage(), new _.net.yested.Fade()); else if (tmp$0 === '#gettingstarted') divContainer.setChild_hu5ove$(_.gettingstarted.gettingStartedSection(), new _.net.yested.Fade()); else if (tmp$0 === '#html') divContainer.setChild_hu5ove$(_.html.htmlPage(), new _.net.yested.Fade()); else if (tmp$0 === '#bootstrapComponents') { if (hash.length === 1) { divContainer.setChild_hu5ove$(_.bootstrap.bootstrapPage(), new _.net.yested.Fade()); } } else if (tmp$0 === '#ajax') divContainer.setChild_hu5ove$(_.ajax.ajaxPage(), new _.net.yested.Fade()); else if (tmp$0 === '#masterdetail') divContainer.setChild_hu5ove$(_.complex.masterDetail(), new _.net.yested.Fade()); else if (tmp$0 === '#spinner') divContainer.setChild_hu5ove$(_.complex.createSpinner(), new _.net.yested.Fade()); else if (tmp$0 === '#effects') divContainer.setChild_hu5ove$(_.bootstrap.effectsPage(), new _.net.yested.Fade()); }; }, f_9: function (divContainer) { return function () { this.br(); this.br(); this.plus_pv6laa$(divContainer); }; }, f_10: function (divContainer) { return function () { this.div_5rsex9$(void 0, void 0, _.f_9(divContainer)); }; }, f_11: function () { this.plus_pdl1w0$('Contact: '); }, f_12: function () { this.plus_pdl1w0$('[email protected]'); }, f_13: function () { this.emph_kv1miw$(_.f_11); this.a_b4th6h$(void 0, 'mailto:[email protected]', void 0, _.f_12); }, f_14: function () { this.small_kv1miw$(_.f_13); this.br(); this.br(); }, main$f_2: function (navbar, divContainer) { return function () { this.topMenu_tx5hdt$(navbar); this.content_kv1miw$(_.f_10(divContainer)); this.footer_kv1miw$(_.f_14); }; }, main: function (args) { var navbar = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.Navbar('appMenuBar', _.net.yested.bootstrap.NavbarPosition.object.FIXED_TOP, _.net.yested.bootstrap.NavbarLook.object.INVERSE), _.main$f); var divContainer = _.net.yested.div_5rsex9$(void 0, void 0, _.main$f_0); _.net.yested.registerHashChangeListener_owl47g$(void 0, _.main$f_1(divContainer)); _.net.yested.bootstrap.page_uplc13$('page', void 0, _.main$f_2(navbar, divContainer)); }, ajax: Kotlin.definePackage(null, /** @lends _.ajax */ { ajaxPage$f: function () { this.plus_pv6laa$(_.ajax.createAjaxGetSection()); }, ajaxPage: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.ajax.ajaxPage$f); }, createAjaxGetSection$f: function (it) { return it.length > 2; }, f: function () { this.plus_pdl1w0$('Celcius'); }, f_0: function () { this.plus_pdl1w0$('Fahrenheit'); }, createAjaxGetSection$f_0: function () { this.button_ubg574$('metric', void 0, _.ajax.f); this.button_ubg574$('imperial', void 0, _.ajax.f_0); }, f_1: function (weatherData) { return function () { this.plus_pdl1w0$('Temperature in ' + Kotlin.toString(weatherData.name)); }; }, f_2: function (weatherData) { return function () { var tmp$0; this.plus_pdl1w0$(((tmp$0 = weatherData.main) != null ? tmp$0 : Kotlin.throwNPE()).temp.toString()); }; }, f_3: function (weatherData) { return function () { this.emph_kv1miw$(_.ajax.f_2(weatherData)); }; }, f_4: function (weatherData) { return function () { this.heading_kv1miw$(_.ajax.f_1(weatherData)); this.content_kv1miw$(_.ajax.f_3(weatherData)); }; }, f_5: function () { this.plus_pdl1w0$('Location not found'); }, fetchWeather$f: function (temperatureSpan) { return function (weatherData) { if (weatherData != null && weatherData.main != null) { temperatureSpan.setChild_hu5ove$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Panel(_.net.yested.bootstrap.PanelStyle.object.SUCCESS), _.ajax.f_4(weatherData)), new _.net.yested.Fade()); } else { temperatureSpan.setChild_hu5ove$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Alert(_.net.yested.bootstrap.AlertStyle.object.DANGER), _.ajax.f_5), new _.net.yested.Fade()); } }; }, createAjaxGetSection$fetchWeather: function (validator, textInput, btnGroup, temperatureSpan) { return function () { if (validator.isValid()) { _.net.yested.ajaxGet_435vpa$('http://api.openweathermap.org/data/2.5/weather?q=' + textInput.value + '&units=' + Kotlin.toString(btnGroup.value), _.ajax.fetchWeather$f(temperatureSpan)); } }; }, f_6: function () { this.plus_pdl1w0$('Ajax Get'); }, f_7: function () { this.h3_kv1miw$(_.ajax.f_6); }, f_8: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.ajax.f_7); }, f_9: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.ajax.f_8); }, f_10: function () { this.plus_pdl1w0$('Yested provides JQuery Ajax wrappers:'); this.code_puj7f4$('kotlin', 'ajaxGet&lt;ResponseType&gt;(url) {\n response -> do something with response\n}'); this.br(); this.plus_pdl1w0$('ResponseType is a native trait. It is a special Kotlin interface.\n Kotlin data classes cannot be used here as JQuery returns simple JS object parsed from JSON response.'); this.code_puj7f4$('kotlin', 'native trait Coordinates {\n val lon : Double\n val lat : Double\n}\n'); }, f_11: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.ajax.f_10); }, f_12: function () { this.plus_pdl1w0$('Demo'); }, f_13: function () { this.h4_kv1miw$(_.ajax.f_12); }, f_14: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.ajax.f_13); }, f_15: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.ajax.f_14); }, f_16: function () { this.plus_pdl1w0$('Location'); }, f_17: function (textInput) { return function () { this.plus_pv6laa$(textInput); }; }, f_18: function () { this.plus_pdl1w0$('Units'); }, f_19: function (btnGroup) { return function () { this.plus_pv6laa$(btnGroup); }; }, f_20: function () { }, f_21: function () { this.plus_pdl1w0$('Get Weather'); }, f_22: function (fetchWeather) { return function () { fetchWeather(); }; }, f_23: function (fetchWeather) { return function () { _.net.yested.bootstrap.btsButton_adnmfr$(this, _.net.yested.ButtonType.object.SUBMIT, _.ajax.f_21, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, void 0, void 0, _.ajax.f_22(fetchWeather)); }; }, f_24: function (validator, textInput, btnGroup, fetchWeather) { return function () { this.item_gthhqa$(void 0, _.ajax.f_16, validator, _.ajax.f_17(textInput)); this.item_gthhqa$(void 0, _.ajax.f_18, void 0, _.ajax.f_19(btnGroup)); this.item_gthhqa$(void 0, _.ajax.f_20, void 0, _.ajax.f_23(fetchWeather)); }; }, f_25: function (validator, textInput, btnGroup, fetchWeather) { return function () { _.net.yested.bootstrap.btsForm_iz33rd$(this, 'col-sm-4', 'col-sm-8', _.ajax.f_24(validator, textInput, btnGroup, fetchWeather)); }; }, f_26: function (temperatureSpan) { return function () { this.plus_pv6laa$(temperatureSpan); }; }, f_27: function (temperatureSpan) { return function () { this.p_omdg96$(_.ajax.f_26(temperatureSpan)); }; }, f_28: function (validator, textInput, btnGroup, fetchWeather, temperatureSpan) { return function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.ajax.f_25(validator, textInput, btnGroup, fetchWeather)); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.ajax.f_27(temperatureSpan)); }; }, f_29: function () { this.plus_pdl1w0$('Source for demo'); }, f_30: function () { this.h4_kv1miw$(_.ajax.f_29); }, f_31: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.ajax.f_30); this.code_puj7f4$('kotlin', '//definition of response, just fragment\nnative trait Main {\n val temp : Double\n val pressure : Int\n val humidity: Int\n val temp_min : Double\n val temp_max : Double\n}\n\nnative trait WeatherData {\n ...\n val base: String?\n val main : Main?\n val wind : Wind?\n ...\n}\n\n...\nval textInput = TextInput(placeholder = "Type city name and press Enter")\nval validator = Validator(inputElement = textInput, errorText = "Enter at least 3 characters", validator = { it.length() > 2})\nval temperatureSpan = Div()\n\nval btnGroup = ButtonGroup() with {\n button("metric", label = { + "Celcius"})\n button("imperial", label = { + "Fahrenheit"})\n}\nbtnGroup.select("metric")\n\nfun fetchWeather() {\n if (validator.isValid()) {\n ajaxGet&lt;WeatherData&gt;("http://api.openweathermap.org/data/2.5/weather?q=$\\{textInput.value}&units=$\\{btnGroup.value}") {\n weatherData ->\n if (weatherData != null && weatherData.main != null) {\n temperatureSpan.setChild(\n Panel(panelStyle = PanelStyle.SUCCESS) with {\n heading { +"Temperature in $\\{weatherData.name}" }\n content { emph { +"$\\{weatherData.main!!.temp}"} }\n }, Fade())\n } else {\n temperatureSpan.setChild("Location not found", Fade())\n }\n }\n }\n}\n...\ndiv {\n form(labelDef = "col-sm-4", inputDef = "col-sm-8") {\n item(label = { +"Location"}, validator = validator) {\n +textInput\n }\n item(label = { +"Units"}) {\n +btnGroup\n }\n item(label = { }) {\n btsButton(type = ButtonType.SUBMIT, label = { +"Get Weather"}, look = ButtonLook.PRIMARY) {\n fetchWeather()\n }\n }\n }\n}\n'); }, f_32: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.ajax.f_31); }, createAjaxGetSection$f_1: function (validator, textInput, btnGroup, fetchWeather, temperatureSpan) { return function () { _.net.yested.bootstrap.row_xnql8t$(this, _.ajax.f_9); _.net.yested.bootstrap.row_xnql8t$(this, _.ajax.f_11); _.net.yested.bootstrap.row_xnql8t$(this, _.ajax.f_15); _.net.yested.bootstrap.row_xnql8t$(this, _.ajax.f_28(validator, textInput, btnGroup, fetchWeather, temperatureSpan)); _.net.yested.bootstrap.row_xnql8t$(this, _.ajax.f_32); }; }, createAjaxGetSection: function () { var textInput = new _.net.yested.bootstrap.TextInput('Type city name and press Enter'); var validator = new _.net.yested.bootstrap.Validator(textInput, 'Enter at least 3 characters', _.ajax.createAjaxGetSection$f); var temperatureSpan = new _.net.yested.Div(); var btnGroup = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.ButtonGroup(), _.ajax.createAjaxGetSection$f_0); btnGroup.select_61zpoe$('metric'); var fetchWeather = _.ajax.createAjaxGetSection$fetchWeather(validator, textInput, btnGroup, temperatureSpan); return _.net.yested.div_5rsex9$(void 0, void 0, _.ajax.createAjaxGetSection$f_1(validator, textInput, btnGroup, fetchWeather, temperatureSpan)); } }), basics: Kotlin.definePackage(function () { this.latestVersion = '0.0.4'; }, /** @lends _.basics */ { f: function () { this.plus_pdl1w0$('What is Yested'); }, f_0: function () { this.h3_kv1miw$(_.basics.f); }, f_1: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.basics.f_0); }, f_2: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.basics.f_1); }, f_3: function () { this.plus_pdl1w0$('Yested is a Kotlin framework for building single-page web applications in Javascript.'); }, f_4: function () { this.plus_pdl1w0$('Check the source code for this site here!'); }, f_5: function () { this.plus_pdl1w0$('This page is developed in Yested framework'); this.br(); this.a_b4th6h$(void 0, 'https://github.com/jean79/yested/tree/master/src/main/docsite', void 0, _.basics.f_4); }, f_6: function () { _.net.yested.bootstrap.alert(this, _.net.yested.bootstrap.AlertStyle.object.SUCCESS, _.basics.f_5); }, f_7: function () { this.plus_pdl1w0$('Main features'); }, f_8: function () { this.plus_pdl1w0$('Strongly typed development of Web applications'); }, f_9: function () { this.plus_pdl1w0$('Minimalistic code'); }, f_10: function () { this.plus_pdl1w0$('DSL for layout construction'); }, f_11: function () { this.plus_pdl1w0$('Debugging within browser'); }, f_12: function () { this.plus_pdl1w0$('Component style of development'); }, f_13: function () { this.plus_pdl1w0$('Simple re-use of 3rd party Javascript libraries'); }, f_14: function () { this.plus_pdl1w0$('Simple creation and re-use of custom components'); }, f_15: function () { this.plus_pdl1w0$('Built-in support for Twitter Bootstrap for a quick start'); }, f_16: function () { this.li_8y48wp$(_.basics.f_8); this.li_8y48wp$(_.basics.f_9); this.li_8y48wp$(_.basics.f_10); this.li_8y48wp$(_.basics.f_11); this.li_8y48wp$(_.basics.f_12); this.li_8y48wp$(_.basics.f_13); this.li_8y48wp$(_.basics.f_14); this.li_8y48wp$(_.basics.f_15); }, f_17: function () { this.h4_kv1miw$(_.basics.f_7); this.ul_8qfrsd$(_.basics.f_16); }, f_18: function () { this.plus_pdl1w0$('What is missing'); }, f_19: function () { this.plus_pdl1w0$('Data binding'); }, f_20: function () { this.plus_pdl1w0$('HTML templates'); }, f_21: function () { this.plus_pdl1w0$("Let's wait for web components to do the difficult job for us. "); this.plus_pdl1w0$('Fortunately DSL way of layout coding is almost as comfortable is HTML coding.'); }, f_22: function () { this.li_8y48wp$(_.basics.f_19); this.li_8y48wp$(_.basics.f_20); this.p_omdg96$(_.basics.f_21); }, f_23: function () { this.h4_kv1miw$(_.basics.f_18); this.ul_8qfrsd$(_.basics.f_22); }, f_24: function () { this.p_omdg96$(_.basics.f_3); this.p_omdg96$(_.basics.f_6); this.p_omdg96$(_.basics.f_17); this.br(); this.p_omdg96$(_.basics.f_23); }, f_25: function () { this.div_5rsex9$(void 0, void 0, _.basics.f_24); }, f_26: function () { this.plus_pdl1w0$('Get on GitHub'); }, f_27: function () { _.net.yested.bootstrap.btsAnchor_2ak3uo$(this, 'https://github.com/jean79/yested', _.net.yested.bootstrap.ButtonLook.object.PRIMARY, _.net.yested.bootstrap.ButtonSize.object.LARGE, void 0, _.basics.f_26); }, f_28: function () { this.plus_pdl1w0$('Binaries: '); }, f_29: function () { this.plus_pdl1w0$('Yested-0.0.4.jar'); }, f_30: function () { this.emph_kv1miw$(_.basics.f_28); this.a_b4th6h$(void 0, 'http://jankovar.net:8081/nexus/content/repositories/releases/net/yested/Yested/0.0.4/Yested-0.0.4.jar', void 0, _.basics.f_29); }, f_31: function () { this.plus_pdl1w0$('Maven Repository'); }, f_32: function () { this.h4_kv1miw$(_.basics.f_31); this.code_puj7f4$('xml', '<repository>\n <id>Yested<\/id>\n <url>http://jankovar.net:8081/nexus/content/repositories/releases/<\/url>\n<\/repository>\n\n<dependency>\n <groupId>net.yested<\/groupId>\n <artifactId>Yested<\/artifactId>\n <version>0.0.4<\/version>\n<\/dependency>\n'); }, f_33: function () { this.p_omdg96$(_.basics.f_27); this.p_omdg96$(_.basics.f_30); this.p_omdg96$(_.basics.f_32); }, f_34: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.basics.f_25); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.basics.f_33); }, aboutSection$f: function () { _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_2); _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_34); }, aboutSection: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.basics.aboutSection$f); }, basicPage$f: function () { this.plus_pv6laa$(_.basics.aboutSection()); this.plus_pv6laa$(_.basics.kotlinSection()); this.plus_pv6laa$(_.basics.howItWorksSection()); }, basicPage: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.basics.basicPage$f); }, f_35: function () { this.plus_pdl1w0$('Fundamentals of Framework'); }, f_36: function () { this.h3_kv1miw$(_.basics.f_35); }, f_37: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.basics.f_36); }, f_38: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.basics.f_37); }, f_39: function () { this.plus_pdl1w0$('Just a single interface'); }, f_40: function () { this.plus_pdl1w0$('All framework components are just simple wrappers around HTMLElement.<br />\n Then they provide usefull methods for manipulation with HTML. I.e. attribute settings or DOM subtree manipulatio.<br />\n All components have to implement trait (interface) Component.'); }, f_41: function () { this.h4_kv1miw$(_.basics.f_39); this.div_5rsex9$(void 0, void 0, _.basics.f_40); }, f_42: function () { this.nbsp_za3lpa$(); }, f_43: function () { this.h4_kv1miw$(_.basics.f_42); this.code_puj7f4$('kotlin', 'trait Component {\n val element : HTMLElement\n}'); }, f_44: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_41); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_43); }, f_45: function () { this.plus_pdl1w0$('Component creation'); }, f_46: function () { this.plus_pdl1w0$('Typicaly components extend HTMLParentComponent'); }, f_47: function () { this.h4_kv1miw$(_.basics.f_45); this.div_5rsex9$(void 0, void 0, _.basics.f_46); }, f_48: function () { this.nbsp_za3lpa$(); }, f_49: function () { this.h4_kv1miw$(_.basics.f_48); this.code_puj7f4$('kotlin', 'class Anchor() : HTMLParentComponent("a") {\n\n public var href : String by Attribute()\n\n}'); }, f_50: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_47); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_49); }, f_51: function () { this.plus_pdl1w0$('Yested application initialization'); }, f_52: function () { this.plus_pdl1w0$('You need to have a DIV in your html page with id "page". Then Yested app will be renderred into this div using command on the right.'); }, f_53: function () { this.h4_kv1miw$(_.basics.f_51); this.div_5rsex9$(void 0, void 0, _.basics.f_52); }, f_54: function () { this.nbsp_za3lpa$(); }, f_55: function () { this.h4_kv1miw$(_.basics.f_54); this.code_puj7f4$('kotlin', 'page("page") {\n topMenu(navbar)\n content {\n div {\n a(href="http://www.yested.net") { +"Yested homepage" }\n }\n }\n }'); }, f_56: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_53); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_55); }, f_57: function () { this.plus_pdl1w0$('DSL for layout construction'); }, f_58: function () { this.plus_pdl1w0$('To understand the DSL please take look at <a href="http://kotlinlang.org/docs/reference/type-safe-builders.html">Kotlin HTML builder<\/a>.\n Have you got it? Then Yested is written in the same DSL way but each object wraps a single HTML element and manipulates with it in a runtime.\n '); }, f_59: function () { this.h4_kv1miw$(_.basics.f_57); this.div_5rsex9$(void 0, void 0, _.basics.f_58); }, f_60: function () { this.nbsp_za3lpa$(); }, f_61: function () { this.h4_kv1miw$(_.basics.f_60); this.code_puj7f4$('kotlin', 'div {\n p {\n h5 { +"Demo list" }\n ul {\n li { a(href="http://www.yested.net") { +"Yested" } }\n li { emph { +"Bold text" }\n li { colorized(color="#778822") { +"Colorized text" } }\n }\n }\n}'); }, f_62: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_59); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_61); }, howItWorksSection$f: function () { _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_38); _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_44); this.br(); _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_50); this.br(); _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_56); _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_62); }, howItWorksSection: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.basics.howItWorksSection$f); }, f_63: function () { this.plus_pdl1w0$('Kotlin to Javascript Compiler'); }, f_64: function () { this.h3_kv1miw$(_.basics.f_63); }, f_65: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.basics.f_64); }, f_66: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.basics.f_65); }, f_67: function () { this.plus_pdl1w0$('Kotlin'); }, f_68: function () { this.a_b4th6h$(void 0, 'http://kotlinlang.org', void 0, _.basics.f_67); this.plus_pdl1w0$(' is a language created by JetBrains company. It compiles to JVM or to Javascript.'); }, f_69: function () { this.plus_pdl1w0$('Main method (see example on the right) will be executed when HTML page is loaded.\n '); }, f_70: function () { this.plus_pdl1w0$('Kotlin to Javascript compiler allows you to simply call Javascript functions, allowing\n us to create a simple strongly typed wrappers.\n '); }, f_71: function () { this.p_omdg96$(_.basics.f_68); this.p_omdg96$(_.basics.f_69); this.p_omdg96$(_.basics.f_70); }, f_72: function () { this.div_5rsex9$(void 0, void 0, _.basics.f_71); }, f_73: function () { this.plus_pdl1w0$('Simplest Kotlin Code'); }, f_74: function () { this.h4_kv1miw$(_.basics.f_73); this.code_puj7f4$('kotlin', 'fun main(args: Array<String>) {\n println("This will be printed into a Javascript console.")\n}'); }, f_75: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_72); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_74); }, kotlinSection$f: function () { _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_66); _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_75); }, kotlinSection: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.basics.kotlinSection$f); } }), bootstrap: Kotlin.definePackage(null, /** @lends _.bootstrap */ { f: function () { this.plus_pdl1w0$('Twitter Bootstrap wrappers'); }, f_0: function () { this.h3_kv1miw$(_.bootstrap.f); }, f_1: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_0); this.plus_pdl1w0$('Yested Framework provides simple wrappers for some Twitter Boootstrap components.'); }, f_2: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_1); }, f_3: function () { this.plus_pv6laa$(_.bootstrap.createButtons('bootstrapComponents_Buttons')); this.plus_pv6laa$(_.bootstrap.createTypographySection('bootstrapComponents_Typography')); this.plus_pv6laa$(_.bootstrap.buttonGroupsSection('bootstrapComponents_ButtonGroups')); this.plus_pv6laa$(_.bootstrap.createForm('bootstrapComponents_Form')); this.plus_pv6laa$(_.bootstrap.createSelectSection('bootstrapComponents_Select')); this.plus_pv6laa$(_.bootstrap.createInputs('bootstrapComponents_Inputs')); this.plus_pv6laa$(_.bootstrap.createGrid('bootstrapComponents_Grid')); this.plus_pv6laa$(_.bootstrap.createTabs('bootstrapComponents_Tabs')); this.plus_pv6laa$(_.bootstrap.createPanelSection('bootstrapComponents_Panel')); this.plus_pv6laa$(_.bootstrap.createDialogs('bootstrapComponents_Dialogs')); this.plus_pv6laa$(_.bootstrap.createMediaObjectSection('bootstrapComponents_MediaObject')); this.plus_pv6laa$(_.bootstrap.createPaginationSection('bootstrapComponents_Pagination')); this.plus_pv6laa$(_.bootstrap.createNavbarSection('bootstrapComponents_Navbar')); this.plus_pv6laa$(_.bootstrap.createBreadcrumbsSection('bootstrapComponents_Breadcrumbs')); }, f_4: function () { this.plus_pdl1w0$('Buttons'); }, f_5: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Buttons', void 0, _.bootstrap.f_4); this.clazz = 'active'; }, f_6: function () { this.plus_pdl1w0$('Typography'); }, f_7: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Typography', void 0, _.bootstrap.f_6); }, f_8: function () { this.plus_pdl1w0$('Button Group'); }, f_9: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_ButtonGroups', void 0, _.bootstrap.f_8); }, f_10: function () { this.plus_pdl1w0$('Form'); }, f_11: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Form', void 0, _.bootstrap.f_10); }, f_12: function () { this.plus_pdl1w0$('Select'); }, f_13: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Select', void 0, _.bootstrap.f_12); }, f_14: function () { this.plus_pdl1w0$('Text Input with Validation'); }, f_15: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Inputs', void 0, _.bootstrap.f_14); }, f_16: function () { this.plus_pdl1w0$('Grid'); }, f_17: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Grid', void 0, _.bootstrap.f_16); }, f_18: function () { this.plus_pdl1w0$('Tabs'); }, f_19: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Tabs', void 0, _.bootstrap.f_18); }, f_20: function () { this.plus_pdl1w0$('Panels'); }, f_21: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Panel', void 0, _.bootstrap.f_20); }, f_22: function () { this.plus_pdl1w0$('Dialogs'); }, f_23: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Dialogs', void 0, _.bootstrap.f_22); }, f_24: function () { this.plus_pdl1w0$('Media Object'); }, f_25: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_MediaObject', void 0, _.bootstrap.f_24); }, f_26: function () { this.plus_pdl1w0$('Pagination'); }, f_27: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Pagination', void 0, _.bootstrap.f_26); }, f_28: function () { this.plus_pdl1w0$('Navbar'); }, f_29: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Navbar', void 0, _.bootstrap.f_28); }, f_30: function () { this.clazz = 'nav nav-pills nav-stacked affix'; this.li_8y48wp$(_.bootstrap.f_5); this.li_8y48wp$(_.bootstrap.f_7); this.li_8y48wp$(_.bootstrap.f_9); this.li_8y48wp$(_.bootstrap.f_11); this.li_8y48wp$(_.bootstrap.f_13); this.li_8y48wp$(_.bootstrap.f_15); this.li_8y48wp$(_.bootstrap.f_17); this.li_8y48wp$(_.bootstrap.f_19); this.li_8y48wp$(_.bootstrap.f_21); this.li_8y48wp$(_.bootstrap.f_23); this.li_8y48wp$(_.bootstrap.f_25); this.li_8y48wp$(_.bootstrap.f_27); this.li_8y48wp$(_.bootstrap.f_29); }, f_31: function () { this.id = 'bootstrapNavbar'; this.ul_8qfrsd$(_.bootstrap.f_30); }, f_32: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_31); }, f_33: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(10)], _.bootstrap.f_3); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(2)], _.bootstrap.f_32); }, f_34: function (this$) { return function () { _.net.yested.bootstrap.row_xnql8t$(this$, _.bootstrap.f_2); _.net.yested.bootstrap.row_xnql8t$(this$, _.bootstrap.f_33); }; }, bootstrapPage$f: function () { _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_34(this)); }, bootstrapPage: function () { _.net.yested.bootstrap.enableScrollSpy_61zpoe$('bootstrapNavbar'); return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.bootstrapPage$f); }, f_35: function () { this.plus_pdl1w0$('Breadcrumbs'); }, f_36: function () { this.h3_kv1miw$(_.bootstrap.f_35); }, f_37: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_36); }, f_38: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_37); }, f_39: function () { this.plus_pdl1w0$('http://getbootstrap.com/components/#breadcrumbs'); }, f_40: function () { this.plus_pdl1w0$('Refer to Bootstrap Breadcrumbs.'); this.br(); this.a_b4th6h$(void 0, 'http://getbootstrap.com/components/#breadcrumbs', void 0, _.bootstrap.f_39); }, f_41: function () { this.plus_pdl1w0$('Demo'); }, f_42: function () { }, f_43: function () { this.plus_pdl1w0$('Top'); }, f_44: function () { }, f_45: function () { this.plus_pdl1w0$('Level 2'); }, f_46: function () { }, f_47: function () { this.plus_pdl1w0$('Level 3'); }, f_48: function () { this.plus_pdl1w0$('Current'); }, f_49: function () { this.link('#bootstrapComponents_Breadcrumbs', _.bootstrap.f_42, _.bootstrap.f_43); this.link('#bootstrapComponents_Breadcrumbs', _.bootstrap.f_44, _.bootstrap.f_45); this.link('#bootstrapComponents_Breadcrumbs', _.bootstrap.f_46, _.bootstrap.f_47); this.selected(_.bootstrap.f_48); }, f_50: function () { _.net.yested.bootstrap.breadcrumbs_3d8lml$(this, _.bootstrap.f_49); }, f_51: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_40); this.br(); this.h4_kv1miw$(_.bootstrap.f_41); this.div_5rsex9$(void 0, void 0, _.bootstrap.f_50); }, f_52: function () { this.plus_pdl1w0$('Code'); }, f_53: function () { this.h4_kv1miw$(_.bootstrap.f_52); this.code_puj7f4$('kotlin', 'breadcrumbs {\n link(href = "#", onclick = {}) { +"Top" }\n link(href = "#", onclick = {}) { +"Level 2" }\n link(href = "#", onclick = {}) { +"Level 3" }\n selected { +"Current" }\n}'); }, f_54: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.bootstrap.f_51); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.bootstrap.f_53); }, createBreadcrumbsSection$f: function () { _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_38); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_54); }, createBreadcrumbsSection: function (id) { return _.net.yested.div_5rsex9$(id, void 0, _.bootstrap.createBreadcrumbsSection$f); }, buttonGroupsSection$f: function (span) { return function (value) { span.setContent_61zpoe$('Selected: ' + value); }; }, f_55: function () { this.plus_pdl1w0$('Option 1'); }, f_56: function () { this.plus_pdl1w0$('Option 2'); }, buttonGroupsSection$f_0: function () { this.button_ubg574$('1', void 0, _.bootstrap.f_55); this.button_ubg574$('2', void 0, _.bootstrap.f_56); }, f_57: function () { this.plus_pdl1w0$('Button Group'); }, f_58: function () { this.h3_kv1miw$(_.bootstrap.f_57); }, f_59: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_58); }, f_60: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_59); }, f_61: function () { this.plus_pdl1w0$('Refer to Bootstrap buttons groups. Yested version\n in addition offers a way to get selected value (via btnGroup.value)'); }, f_62: function () { this.plus_pdl1w0$('Demo'); }, f_63: function (btnGroup, span) { return function () { this.plus_pv6laa$(btnGroup); this.br(); this.plus_pv6laa$(span); }; }, f_64: function (btnGroup, span) { return function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_61); this.br(); this.h4_kv1miw$(_.bootstrap.f_62); this.div_5rsex9$(void 0, void 0, _.bootstrap.f_63(btnGroup, span)); }; }, f_65: function () { this.plus_pdl1w0$('Code'); }, f_66: function () { this.h4_kv1miw$(_.bootstrap.f_65); this.code_puj7f4$('kotlin', 'val span = Span()\nval btnGroup =\n ButtonGroup(\n size = ButtonSize.DEFAULT,\n onSelect = { value -> span.replace("Selected: $\\{value}")}\n ) with {\n button(value = "1", label = { + "Option 1"})\n button(value = "2", label = { + "Option 2"})\n }'); }, f_67: function (btnGroup, span) { return function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_64(btnGroup, span)); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_66); }; }, buttonGroupsSection$f_1: function (id, btnGroup, span) { return function () { this.id = id; _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_60); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_67(btnGroup, span)); }; }, buttonGroupsSection: function (id) { var span = new _.net.yested.Span(); var btnGroup = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.ButtonGroup(_.net.yested.bootstrap.ButtonSize.object.DEFAULT, _.bootstrap.buttonGroupsSection$f(span)), _.bootstrap.buttonGroupsSection$f_0); return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.buttonGroupsSection$f_1(id, btnGroup, span)); }, f_68: function () { this.plus_pdl1w0$('Buttons'); }, f_69: function () { this.h3_kv1miw$(_.bootstrap.f_68); }, f_70: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_69); }, f_71: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_70); }, f_72: function () { this.plus_pdl1w0$('\nRefer to Bootstrap buttons.\n'); }, f_73: function () { this.plus_pdl1w0$('Demo'); }, f_74: function () { this.plus_pdl1w0$('Primary'); }, f_75: function () { Kotlin.println('First Button pressed.'); }, f_76: function () { this.plus_pdl1w0$('Success'); }, f_77: function () { Kotlin.println('Second Button pressed.'); }, f_78: function () { _.net.yested.bootstrap.btsButton_adnmfr$(this, _.net.yested.ButtonType.object.BUTTON, _.bootstrap.f_74, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, _.net.yested.bootstrap.ButtonSize.object.LARGE, void 0, _.bootstrap.f_75); this.nbsp_za3lpa$(); _.net.yested.bootstrap.btsButton_adnmfr$(this, _.net.yested.ButtonType.object.BUTTON, _.bootstrap.f_76, _.net.yested.bootstrap.ButtonLook.object.SUCCESS, _.net.yested.bootstrap.ButtonSize.object.LARGE, void 0, _.bootstrap.f_77); }, f_79: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_72); this.br(); this.h4_kv1miw$(_.bootstrap.f_73); this.div_5rsex9$(void 0, void 0, _.bootstrap.f_78); }, f_80: function () { this.plus_pdl1w0$('Code'); }, f_81: function () { this.h4_kv1miw$(_.bootstrap.f_80); this.code_puj7f4$('kotlin', 'div {\n btsButton(\n type = ButtonType.BUTTON,\n label = { +"Primary" },\n look = ButtonLook.PRIMARY,\n size = ButtonSize.LARGE,\n onclick = { println("First Button pressed.") })\n nbsp()\n btsButton(\n type = ButtonType.BUTTON,\n label = { +"Success" },\n look = ButtonLook.SUCCESS,\n size = ButtonSize.LARGE,\n onclick = { println("Second Button pressed.") })\n}'); }, f_82: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_79); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_81); }, createButtons$f: function (id) { return function () { this.id = id; _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_71); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_82); }; }, createButtons: function (id) { return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createButtons$f(id)); }, f_83: function () { this.plus_pdl1w0$('This is dialog with text input'); }, f_84: function () { this.plus_pdl1w0$('Name'); }, f_85: function () { this.id = 'nameId'; }, f_86: function () { _.net.yested.bootstrap.textInput_ra92pu$(this, 'Name', _.bootstrap.f_85); }, f_87: function () { this.item_gthhqa$('nameId', _.bootstrap.f_84, void 0, _.bootstrap.f_86); }, f_88: function () { _.net.yested.bootstrap.btsForm_iz33rd$(this, void 0, void 0, _.bootstrap.f_87); }, f_89: function () { this.plus_pdl1w0$('Submit'); }, f_90: function (dialog) { return function () { dialog.close(); }; }, f_91: function (dialog) { return function () { _.net.yested.bootstrap.btsButton_adnmfr$(this, _.net.yested.ButtonType.object.SUBMIT, _.bootstrap.f_89, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, void 0, void 0, _.bootstrap.f_90(dialog)); }; }, createDialogs$f: function (dialog) { return function () { this.header_1(_.bootstrap.f_83); this.body_1(_.bootstrap.f_88); this.footer_1(_.bootstrap.f_91(dialog)); }; }, f_92: function () { this.plus_pdl1w0$('Dialogs'); }, f_93: function () { this.h3_kv1miw$(_.bootstrap.f_92); }, f_94: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_93); }, f_95: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_94); }, f_96: function () { this.plus_pdl1w0$('This is a wrapper around Bootstrap dialogs.'); }, f_97: function () { this.plus_pdl1w0$('Demo'); }, f_98: function () { this.plus_pdl1w0$('Open dialog'); }, f_99: function (dialog) { return function () { dialog.open(); }; }, f_100: function (dialog) { return function () { _.net.yested.bootstrap.btsButton_adnmfr$(this, void 0, _.bootstrap.f_98, void 0, void 0, void 0, _.bootstrap.f_99(dialog)); }; }, f_101: function (dialog) { return function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_96); this.h4_kv1miw$(_.bootstrap.f_97); this.div_5rsex9$(void 0, void 0, _.bootstrap.f_100(dialog)); }; }, f_102: function () { this.plus_pdl1w0$('Code'); }, f_103: function () { this.h4_kv1miw$(_.bootstrap.f_102); this.code_puj7f4$('kotlin', 'val dialog = Dialog()\n\ndialog with {\n header { + "This is dialog with text input" }\n body {\n btsForm {\n item(forId = "nameId", label = { + "Name" }) {\n textInput(placeholder = "Name") { id = "nameId"}\n }\n }\n }\n footer {\n btsButton(\n type = ButtonType.SUBMIT,\n look = ButtonLook.PRIMARY,\n label = { +"Submit"},\n onclick = { dialog.close() })\n\n }\n}\n\n//somewhere in a dom tree:\ndiv {\n btsButton(label = { +"Open dialog" }, onclick = { dialog.open() })\n}'); }, f_104: function (dialog) { return function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_101(dialog)); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_103); }; }, createDialogs$f_0: function (id, dialog) { return function () { this.id = id; _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_95); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_104(dialog)); }; }, createDialogs: function (id) { var dialog = new _.net.yested.bootstrap.Dialog(); _.net.yested.with_owvm91$(dialog, _.bootstrap.createDialogs$f(dialog)); return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createDialogs$f_0(id, dialog)); }, f_105: function () { this.plus_pdl1w0$('Form'); }, f_106: function () { this.h3_kv1miw$(_.bootstrap.f_105); }, f_107: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_106); }, f_108: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_107); }, f_109: function () { this.plus_pdl1w0$('\n'); }, f_110: function () { this.plus_pdl1w0$('Demo'); }, f_111: function () { this.plus_pdl1w0$('Username'); }, f_112: function () { }, f_113: function () { _.net.yested.bootstrap.textInput_ra92pu$(this, 'Enter your username', _.bootstrap.f_112); }, f_114: function () { this.plus_pdl1w0$('Salary'); }, f_115: function () { _.net.yested.bootstrap.inputAddOn_cc7g17$(this, '$', '.00', new _.net.yested.bootstrap.TextInput('Your expectation')); }, f_116: function () { this.item_gthhqa$(void 0, _.bootstrap.f_111, void 0, _.bootstrap.f_113); this.item_gthhqa$(void 0, _.bootstrap.f_114, void 0, _.bootstrap.f_115); }, f_117: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_109); this.br(); this.h4_kv1miw$(_.bootstrap.f_110); _.net.yested.bootstrap.btsForm_iz33rd$(this, 'col-sm-4', 'col-sm-8', _.bootstrap.f_116); }, f_118: function () { this.plus_pdl1w0$('Code'); }, f_119: function () { this.h4_kv1miw$(_.bootstrap.f_118); this.code_puj7f4$('kotlin', 'btsForm(labelDef = "col-sm-4", inputDef = "col-sm-8") {\n item(label = { +"Username"}) {\n textInput(placeholder = "Enter your username") { }\n }\n item(label = { +"Salary" }) {\n inputAddOn(prefix = "$", suffix = ".00", textInput = TextInput(placeholder = "Your expectation") )\n }\n}'); }, f_120: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_117); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_119); }, createForm$f: function (id) { return function () { this.id = id; _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_108); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_120); }; }, createForm: function (id) { return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createForm$f(id)); }, Person: Kotlin.createClass(null, function (name, age) { this.name = name; this.age = age; }, /** @lends _.bootstrap.Person.prototype */ { component1: function () { return this.name; }, component2: function () { return this.age; }, copy: function (name, age) { return new _.bootstrap.Person(name === void 0 ? this.name : name, age === void 0 ? this.age : age); }, toString: function () { return 'Person(name=' + Kotlin.toString(this.name) + (', age=' + Kotlin.toString(this.age)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.name) | 0; result = result * 31 + Kotlin.hashCode(this.age) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.name, other.name) && Kotlin.equals(this.age, other.age)))); } }), compareBy$f: function (get) { return function (l, r) { return Kotlin.modules['stdlib'].kotlin.compareValues_cj5vqg$(get(l), get(r)); }; }, compareBy: function (get) { return _.bootstrap.compareBy$f(get); }, createGrid$f: function (it) { this.plus_pdl1w0$(it.name); }, createGrid$f_0: function (l, r) { return Kotlin.modules['stdlib'].kotlin.compareValues_cj5vqg$(l.name, r.name); }, createGrid$f_1: function (it) { this.plus_pdl1w0$(it.age.toString()); }, createGrid$f_2: function (it) { return it.age; }, f_121: function () { this.plus_pdl1w0$('Grid'); }, f_122: function () { this.h3_kv1miw$(_.bootstrap.f_121); }, f_123: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_122); }, f_124: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_123); }, f_125: function () { this.plus_pdl1w0$('\nGrid is simply a renderred HTML Table element. It is not suitable for too many rows.\n'); }, f_126: function () { this.plus_pdl1w0$('Demo'); }, f_127: function (grid) { return function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_125); this.br(); this.h4_kv1miw$(_.bootstrap.f_126); this.plus_pv6laa$(grid); }; }, f_128: function () { this.plus_pdl1w0$('Code'); }, f_129: function () { this.h4_kv1miw$(_.bootstrap.f_128); this.code_puj7f4$('kotlin', 'data class Person(val name:String, val age:Int)\nval data = listOf(Person("Jan", 15), Person("Peter", 30), Person("Martin", 31))\n\nval grid = Grid(columns = array(\n Column(\n label = text("Name"),\n render = { +it.name },\n sortFunction = {(l,r) -> compareValues(l.name, r.name)}),\n Column(\n label = text("Age "),\n render = { +"\\$\\{it.age}" },\n sortFunction = compareBy<Person,Int> { it.age },\n defaultSort = true,\n defaultSortOrderAsc = true)\n))\n\ngrid.list = data;\n'); }, f_130: function (grid) { return function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_127(grid)); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_129); }; }, createGrid$f_3: function (id, grid) { return function () { this.id = id; _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_124); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_130(grid)); }; }, createGrid: function (id) { var data = Kotlin.modules['stdlib'].kotlin.listOf_9mqe4v$([new _.bootstrap.Person('Jan', 15), new _.bootstrap.Person('Peter', 30), new _.bootstrap.Person('Martin', 31)]); var grid = new _.net.yested.bootstrap.Grid([new _.net.yested.bootstrap.Column(_.net.yested.text_61zpoe$('Name'), _.bootstrap.createGrid$f, _.bootstrap.createGrid$f_0), new _.net.yested.bootstrap.Column(_.net.yested.text_61zpoe$('Age '), _.bootstrap.createGrid$f_1, _.bootstrap.compareBy(_.bootstrap.createGrid$f_2), void 0, true, true)]); grid.list = data; return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createGrid$f_3(id, grid)); }, createInputs$f: function (value) { return value.length > 2; }, createInputs$submit: function (validator) { return function () { if (validator.isValid()) { Kotlin.println('submit'); } }; }, createInputs$f_0: function () { this.plus_pdl1w0$('Send'); }, f_131: function () { this.plus_pdl1w0$('Text Input with Validation'); }, f_132: function () { this.h3_kv1miw$(_.bootstrap.f_131); }, f_133: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_132); }, f_134: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_133); }, f_135: function () { this.plus_pdl1w0$('\nThis example demonstrates simple text input with custom validation.\nPlease note that validator is also attached to form item.\n'); }, f_136: function () { this.plus_pdl1w0$('Demo'); }, f_137: function () { this.plus_pdl1w0$('Name'); }, f_138: function (textInput) { return function () { this.plus_pv6laa$(textInput); }; }, f_139: function () { }, f_140: function (button) { return function () { this.plus_pv6laa$(button); }; }, f_141: function (validator, textInput, button) { return function () { this.item_gthhqa$(void 0, _.bootstrap.f_137, validator, _.bootstrap.f_138(textInput)); this.item_gthhqa$(void 0, _.bootstrap.f_139, void 0, _.bootstrap.f_140(button)); }; }, f_142: function (validator, textInput, button) { return function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_135); this.br(); this.h4_kv1miw$(_.bootstrap.f_136); _.net.yested.bootstrap.btsForm_iz33rd$(this, 'col-sm-3', 'col-sm-9', _.bootstrap.f_141(validator, textInput, button)); }; }, f_143: function () { this.plus_pdl1w0$('Code'); }, f_144: function () { this.h4_kv1miw$(_.bootstrap.f_143); this.code_puj7f4$('kotlin', 'val textInput = TextInput(placeholder = "Mandatory field")\n\nval validator = Validator(textInput, errorText = "At least 3 chars!!") { value -> value.size > 2 }\n\nfun submit() {\n if (validator.isValid()) {\n println("submit")\n }\n}\n\nval button = BtsButton(label = { +"Send"}, onclick = ::submit)\n\nform(labelDef = "col-sm-3", inputDef = "col-sm-9") {\n item(label = { +"Name"}, validator = validator) {\n +textInput\n }\n item(label = {}) {\n +button\n }\n}\n'); }, f_145: function (validator, textInput, button) { return function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_142(validator, textInput, button)); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_144); }; }, createInputs$f_1: function (id, validator, textInput, button) { return function () { this.id = id; _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_134); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_145(validator, textInput, button)); }; }, createInputs: function (id) { var textInput = new _.net.yested.bootstrap.TextInput('Mandatory field'); var validator = new _.net.yested.bootstrap.Validator(textInput, 'At least 3 chars!!', _.bootstrap.createInputs$f); var submit = _.bootstrap.createInputs$submit(validator); var button = new _.net.yested.bootstrap.BtsButton(void 0, _.bootstrap.createInputs$f_0, void 0, void 0, void 0, submit); return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createInputs$f_1(id, validator, textInput, button)); }, f_146: function () { this.plus_pdl1w0$('Media Object'); }, f_147: function () { this.h3_kv1miw$(_.bootstrap.f_146); }, f_148: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_147); }, f_149: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_148); }, f_150: function () { this.plus_pdl1w0$('Media object is used for creating components that should contain left- or rightaligned\n\t\t\t\t\t\tmedia (image, video, or audio) alongside some textual content. It is best\n\t\t\t\t\t\tsuited for creating features such as a comments section, displaying tweets, or\n\t\t\t\t\t\tshowing product details where a product image is present.'); }, f_151: function () { this.plus_pdl1w0$('Demo'); }, f_152: function () { this.img_puj7f4$('demo-site/img/leaf.gif'); }, f_153: function () { this.plus_pdl1w0$('Media Object'); }, f_154: function () { this.plus_pdl1w0$('Media object is used for creating components that should contain left- or rightaligned\n\t\t\t\t\t\t\tmedia (image, video, or audio) alongside some textual content. It is best\n\t\t\t\t\t\t\tsuited for creating features such as a comments section, displaying tweets, or\n\t\t\t\t\t\t\tshowing product details where a product image is present.'); }, f_155: function () { this.img_puj7f4$('demo-site/img/leaf.gif'); }, f_156: function () { this.plus_pdl1w0$('Nested Media Object'); }, f_157: function () { this.plus_pdl1w0$(' Nested Text'); }, f_158: function () { this.p_omdg96$(_.bootstrap.f_157); }, f_159: function () { this.heading_kv1miw$(_.bootstrap.f_156); this.content_kv1miw$(_.bootstrap.f_158); }, f_160: function () { this.media_kv1miw$(_.bootstrap.f_155); this.content_tq11g4$(_.bootstrap.f_159); }, f_161: function () { this.p_omdg96$(_.bootstrap.f_154); _.net.yested.bootstrap.mediaObject_wda2nk$(this, _.net.yested.bootstrap.MediaAlign.object.Left, _.bootstrap.f_160); }, f_162: function () { this.heading_kv1miw$(_.bootstrap.f_153); this.content_kv1miw$(_.bootstrap.f_161); }, f_163: function () { this.media_kv1miw$(_.bootstrap.f_152); this.content_tq11g4$(_.bootstrap.f_162); }, f_164: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_150); this.br(); this.h4_kv1miw$(_.bootstrap.f_151); _.net.yested.bootstrap.mediaObject_wda2nk$(this, _.net.yested.bootstrap.MediaAlign.object.Left, _.bootstrap.f_163); }, f_165: function () { this.plus_pdl1w0$('Code'); }, f_166: function () { this.h4_kv1miw$(_.bootstrap.f_165); this.code_puj7f4$('kotlin', '\nmediaObject(MediaAlign.Left) {\n\tmedia {\n\t\timg(src = "demo-site/img/leaf.gif")\n\t}\n\tcontent {\n\t\theading {\n\t\t\t+ "Media Object"\n\t\t}\n\t\tcontent {\n\t\t\t+ p { "Media object is used ..." }\n\t\t\tmediaObject(MediaAlign.Left) {\n\t\t\t\tmedia {\n\t\t\t\t\timg(src = "demo-site/img/leaf.gif")\n\t\t\t\t}\n\t\t\t\tcontent {\n\t\t\t\t\theading {\n\t\t\t\t\t\t+ "Nested Media Object"\n\t\t\t\t\t}\n\t\t\t\t\tcontent {\n\t\t\t\t\t\t+ p { "Nested Text" }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\t\t\t\t'); }, f_167: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_164); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_166); }, createMediaObjectSection$f: function (id) { return function () { this.id = id; _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_149); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_167); }; }, createMediaObjectSection: function (id) { return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createMediaObjectSection$f(id)); }, f_168: function () { this.plus_pdl1w0$('Navbar'); }, f_169: function () { this.h3_kv1miw$(_.bootstrap.f_168); }, f_170: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_169); }, f_171: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_170); }, f_172: function () { this.plus_pdl1w0$('http://getbootstrap.com/components/#navbar'); }, f_173: function () { this.plus_pdl1w0$('Features:'); }, f_174: function () { this.plus_pdl1w0$('Navbar collapses on mobile screens.'); }, f_175: function () { this.plus_pdl1w0$('Once clicked on menu item, it stays selected.'); }, f_176: function () { this.plus_pdl1w0$('You can set hrefs of menu items or capture onclick events.'); }, f_177: function () { this.li_8y48wp$(_.bootstrap.f_174); this.li_8y48wp$(_.bootstrap.f_175); this.li_8y48wp$(_.bootstrap.f_176); }, f_178: function () { this.plus_pdl1w0$('Please note!'); }, f_179: function () { this.plus_pdl1w0$('Set correct Bootrsap classes to forms/text you use in header (see in the example below)'); }, f_180: function () { this.plus_pdl1w0$('Keep the order of the elements as specified by Bootstrap'); }, f_181: function () { this.plus_pdl1w0$('Set different IDs if you have multiple navbars in one application'); }, f_182: function () { this.li_8y48wp$(_.bootstrap.f_179); this.li_8y48wp$(_.bootstrap.f_180); this.li_8y48wp$(_.bootstrap.f_181); }, f_183: function () { this.plus_pdl1w0$('Complete implementation of Twitter Bootstrap Navbar. Please see: '); this.a_b4th6h$(void 0, 'http://getbootstrap.com/components/#navbar', void 0, _.bootstrap.f_172); this.br(); this.br(); this.emph_kv1miw$(_.bootstrap.f_173); this.ul_8qfrsd$(_.bootstrap.f_177); this.br(); this.emph_kv1miw$(_.bootstrap.f_178); this.ul_8qfrsd$(_.bootstrap.f_182); this.br(); }, f_184: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_183); }, f_185: function () { this.plus_pdl1w0$("Navbar Positions (parameter 'position'):"); }, f_186: function () { this.plus_pdl1w0$('Empty - Navbar will render in the current element'); }, f_187: function () { this.plus_pdl1w0$('FIXED_TOP - Navbar will be at the top and always visible'); }, f_188: function () { this.plus_pdl1w0$('FIXED_BOTTOM - Navbar will be at the bottom and always visiblet'); }, f_189: function () { this.plus_pdl1w0$('STATIC_TOP - Navbar will be at the top and will scroll out'); }, f_190: function () { this.li_8y48wp$(_.bootstrap.f_186); this.li_8y48wp$(_.bootstrap.f_187); this.li_8y48wp$(_.bootstrap.f_188); this.li_8y48wp$(_.bootstrap.f_189); }, f_191: function () { this.plus_pdl1w0$("Navbar Look (parameter 'look'):"); }, f_192: function () { this.plus_pdl1w0$('DEFAULT - Default look (light)'); }, f_193: function () { this.plus_pdl1w0$('INVERSE - Inversed colours (dark)'); }, f_194: function () { this.li_8y48wp$(_.bootstrap.f_192); this.li_8y48wp$(_.bootstrap.f_193); }, f_195: function () { this.plus_pdl1w0$('Navbar features (DSL functions):'); }, f_196: function () { this.plus_pdl1w0$('brand - Page title/logo (Anchor) (optional, once)'); }, f_197: function () { this.plus_pdl1w0$('item - Top menu item (Anchor) (optional, many times)'); }, f_198: function () { this.plus_pdl1w0$('dropdown - Top menu item (Anchor) (optional, many times)'); }, f_199: function () { this.plus_pdl1w0$('left - Content will be position on the left (after last menu link)'); }, f_200: function () { this.plus_pdl1w0$('right - Content will be position on the right'); }, f_201: function () { this.li_8y48wp$(_.bootstrap.f_196); this.li_8y48wp$(_.bootstrap.f_197); this.li_8y48wp$(_.bootstrap.f_198); this.li_8y48wp$(_.bootstrap.f_199); this.li_8y48wp$(_.bootstrap.f_200); }, f_202: function () { this.emph_kv1miw$(_.bootstrap.f_185); this.ul_8qfrsd$(_.bootstrap.f_190); this.br(); this.emph_kv1miw$(_.bootstrap.f_191); this.ul_8qfrsd$(_.bootstrap.f_194); this.br(); this.emph_kv1miw$(_.bootstrap.f_195); this.ul_8qfrsd$(_.bootstrap.f_201); }, f_203: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_202); }, f_204: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.bootstrap.f_184); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.bootstrap.f_203); }, f_205: function () { this.plus_pdl1w0$('Demo'); }, f_206: function () { _.net.yested.bootstrap.glyphicon_8jxlbl$(this, 'home'); this.nbsp_za3lpa$(); this.plus_pdl1w0$('Home'); }, f_207: function () { this.plus_pdl1w0$('Some Link 1'); }, f_208: function () { Kotlin.println('clicked'); }, f_209: function () { this.plus_pdl1w0$('Some Link 2'); }, f_210: function () { this.plus_pdl1w0$('Dropdown'); }, f_211: function () { Kotlin.println('clicked'); }, f_212: function () { this.plus_pdl1w0$('Link 1'); }, f_213: function () { Kotlin.println('clicked'); }, f_214: function () { this.plus_pdl1w0$('Link 2'); }, f_215: function () { Kotlin.println('clicked'); }, f_216: function () { this.plus_pdl1w0$('Link 3'); }, f_217: function () { this.item('#bootstrapComponents', _.bootstrap.f_211, _.bootstrap.f_212); this.item('#bootstrapComponents', _.bootstrap.f_213, _.bootstrap.f_214); this.divider(); this.item('#bootstrapComponents', _.bootstrap.f_215, _.bootstrap.f_216); }, f_218: function () { }, f_219: function () { _.net.yested.bootstrap.textInput_ra92pu$(this, 'username', _.bootstrap.f_218); }, f_220: function () { this.plus_pdl1w0$('Login'); }, f_221: function () { }, f_222: function () { this.rangeTo_94jgcu$('class', 'navbar-form'); this.div_5rsex9$(void 0, 'form-group', _.bootstrap.f_219); _.net.yested.bootstrap.btsButton_adnmfr$(this, _.net.yested.ButtonType.object.SUBMIT, _.bootstrap.f_220, void 0, void 0, void 0, _.bootstrap.f_221); }, f_223: function () { this.form_kv1miw$(_.bootstrap.f_222); }, f_224: function () { this.plus_pdl1w0$('On the right1'); }, f_225: function () { this.span_dkuwo$('navbar-text', _.bootstrap.f_224); }, f_226: function () { this.brand_s8xvdm$('#bootstrapComponents', _.bootstrap.f_206); this.item_b1t645$('#bootstrapComponents', void 0, _.bootstrap.f_207); this.item_b1t645$('#bootstrapComponents', _.bootstrap.f_208, _.bootstrap.f_209); this.dropdown_vvlqvy$(_.bootstrap.f_210, _.bootstrap.f_217); this.left_oe5uhj$(_.bootstrap.f_223); this.right_oe5uhj$(_.bootstrap.f_225); }, f_227: function () { this.h4_kv1miw$(_.bootstrap.f_205); _.net.yested.bootstrap.navbar_x6lhct$(this, 'navbarDemo', void 0, _.net.yested.bootstrap.NavbarLook.object.INVERSE, _.bootstrap.f_226); }, f_228: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_227); }, f_229: function () { this.plus_pdl1w0$('Code'); }, f_230: function () { this.h4_kv1miw$(_.bootstrap.f_229); this.code_puj7f4$('kotlin', 'navbar(id = "navbarDemo", look = NavbarLook.INVERSE) {\n brand(href = "#bootstrapComponents") {glyphicon(icon = "home"); nbsp(); +" Home" }\n item(href = "#bootstrapComponents") { +"Some Link 1" }\n item(href = "#bootstrapComponents", onclick = { println("clicked")}) { +"Some Link 2" }\n dropdown(label = { +"Dropdown"}) {\n item(href = "#bootstrapComponents", onclick = { println("clicked")}) { +"Link 1" }\n item(href = "#bootstrapComponents", onclick = { println("clicked")}) { +"Link 2" }\n divider()\n item(href = "#bootstrapComponents", onclick = { println("clicked")}) { +"Link 3" }\n }\n left {\n form { "class".."navbar-form"\n div(clazz = "form-group") {\n textInput(placeholder = "username") {}\n }\n btsButton(type = ButtonType.SUBMIT, label = { +"Login"}) {}\n }\n }\n right {\n span(clazz = "navbar-text") {\n +"On the right1"\n }\n }\n}'); }, f_231: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_230); }, createNavbarSection$f: function (id) { return function () { this.id = id; _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_171); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_204); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_228); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_231); }; }, createNavbarSection: function (id) { return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createNavbarSection$f(id)); }, f_232: function () { this.plus_pdl1w0$('Pagination'); }, f_233: function () { this.h3_kv1miw$(_.bootstrap.f_232); }, f_234: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_233); }, f_235: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_234); }, f_236: function () { this.plus_pdl1w0$('\nPagination from Bootstrap.\n'); }, f_237: function () { this.plus_pdl1w0$('Demo'); }, f_238: function (result) { return function (it) { result.setContent_61zpoe$('Selected: ' + it); }; }, f_239: function (result) { return function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_236); this.br(); this.h4_kv1miw$(_.bootstrap.f_237); _.net.yested.bootstrap.pagination_vs56l6$(this, 6, 2, _.bootstrap.f_238(result)); this.plus_pv6laa$(result); }; }, f_240: function () { this.plus_pdl1w0$('Code'); }, f_241: function () { this.h4_kv1miw$(_.bootstrap.f_240); this.code_puj7f4$('kotlin', 'val result = Span()\n...\ndiv {\n pagination(count = 6, defaultSelection = 2) { result.replace("Selected: $\\{it}")}\n +result\n}\n'); }, f_242: function (result) { return function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_239(result)); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_241); }; }, createPaginationSection$f: function (id, result) { return function () { this.id = id; _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_235); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_242(result)); }; }, createPaginationSection: function (id) { var result = new _.net.yested.Span(); return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createPaginationSection$f(id, result)); }, f_243: function () { this.plus_pdl1w0$('Panels'); }, f_244: function () { this.h3_kv1miw$(_.bootstrap.f_243); }, f_245: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_244); }, f_246: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_245); }, f_247: function () { this.plus_pdl1w0$('\nPlease refer to Bootstrap Panels\n'); }, f_248: function () { this.plus_pdl1w0$('Demo'); }, f_249: function () { this.plus_pdl1w0$('Panel Header'); }, f_250: function () { this.plus_pdl1w0$('This site'); }, f_251: function () { this.a_b4th6h$(void 0, 'http://www.yested.net', void 0, _.bootstrap.f_250); }, f_252: function () { this.plus_pdl1w0$('Panel Footer'); }, f_253: function () { this.heading_kv1miw$(_.bootstrap.f_249); this.content_kv1miw$(_.bootstrap.f_251); this.footer_kv1miw$(_.bootstrap.f_252); }, f_254: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_247); this.br(); this.h4_kv1miw$(_.bootstrap.f_248); _.net.yested.bootstrap.panel_mkklid$(this, _.net.yested.bootstrap.PanelStyle.object.SUCCESS, _.bootstrap.f_253); }, f_255: function () { this.plus_pdl1w0$('Code'); }, f_256: function () { this.h4_kv1miw$(_.bootstrap.f_255); this.code_puj7f4$('kotlin', 'panel {\n heading { +"Panel Header" }\n content {\n a(href="http://www.yested.net") { + "This site"}\n }\n footer { +"Panel Footer" }\n}'); }, f_257: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_254); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_256); }, createPanelSection$f: function (id) { return function () { this.id = id; _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_246); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_257); }; }, createPanelSection: function (id) { return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createPanelSection$f(id)); }, Car: Kotlin.createClass(null, function (model, color) { this.model = model; this.color = color; }, /** @lends _.bootstrap.Car.prototype */ { component1: function () { return this.model; }, component2: function () { return this.color; }, copy: function (model, color) { return new _.bootstrap.Car(model === void 0 ? this.model : model, color === void 0 ? this.color : color); }, toString: function () { return 'Car(model=' + Kotlin.toString(this.model) + (', color=' + Kotlin.toString(this.color)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.model) | 0; result = result * 31 + Kotlin.hashCode(this.color) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.model, other.model) && Kotlin.equals(this.color, other.color)))); } }), createSelectSection$f: function (it) { return it.model + ' (' + it.color + ')'; }, createSelectSection$f_0: function (resultSingleSelect, singleSelect) { return function () { resultSingleSelect.setContent_61zpoe$('Selected: ' + Kotlin.modules['stdlib'].kotlin.first_fvq2g0$(singleSelect.selectedItems).model); }; }, createSelectSection$f_1: function (it) { return it.model + ' (' + it.color + ')'; }, f_258: function (it) { return it.model; }, createSelectSection$f_2: function (resultMultiSelect, multiSelect) { return function () { var tmp$0; tmp$0 = Kotlin.modules['stdlib'].kotlin.map_m3yiqg$(multiSelect.selectedItems, _.bootstrap.f_258); resultMultiSelect.setContent_61zpoe$('Selected: ' + Kotlin.modules['stdlib'].kotlin.join_raq5lb$(tmp$0, ' and ')); }; }, createSelectSection$f_3: function () { this.plus_pdl1w0$('Select Skoda and Ford'); }, f_259: function (it) { return Kotlin.equals(it.model, 'Skoda') || Kotlin.equals(it.model, 'Ford'); }, createSelectSection$f_4: function (someData, multiSelect) { return function () { var tmp$0, tmp$1; tmp$1 = multiSelect; tmp$0 = Kotlin.modules['stdlib'].kotlin.filter_azvtw4$(someData, _.bootstrap.f_259); tmp$1.selectedItems = tmp$0; }; }, f_260: function () { this.plus_pdl1w0$('Select'); }, f_261: function () { this.h3_kv1miw$(_.bootstrap.f_260); }, f_262: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_261); }, f_263: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_262); }, f_264: function () { this.plus_pdl1w0$('HTML Select demo with listener.'); }, f_265: function () { this.plus_pdl1w0$('Demo'); }, f_266: function (singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn) { return function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_264); this.br(); this.h4_kv1miw$(_.bootstrap.f_265); this.plus_pv6laa$(singleSelect); this.plus_pv6laa$(resultSingleSelect); this.br(); this.br(); this.plus_pv6laa$(multiSelect); this.plus_pv6laa$(resultMultiSelect); this.br(); this.plus_pv6laa$(btn); }; }, f_267: function () { this.plus_pdl1w0$('Code'); }, f_268: function () { this.h4_kv1miw$(_.bootstrap.f_267); this.code_puj7f4$('kotlin', 'val someData = listOf(\n Car("Ford", "Black"),\n Car("Skoda", "White"),\n Car("Renault", "Red"),\n Car("Citroen", "Purple"))\n\nval resultSingleSelect = Div()\nval singleSelect = Select<Car>(renderer = { "$\\{it.model} ($\\{it.color})" })\nsingleSelect.data = someData\nsingleSelect.addOnChangeListener {\n resultSingleSelect.replace( "Selected: $\\{singleSelect.selectedItems.first().model}")\n}\n\nval resultMultiSelect = Div()\nval multiSelect = Select<Car>(multiple = true, size = 4, renderer = { "$\\{it.model} ($\\{it.color})" })\nmultiSelect.data = someData\nmultiSelect.addOnChangeListener {\n resultMultiSelect.replace( "Selected: " + multiSelect.selectedItems.map { "$\\{it.model}" }.join(" and "))\n}\n\nval btn = BtsButton(label = { +"Select Skoda and Ford" }) {\n multiSelect.selectedItems = someData.filter { it.model == "Skoda" || it.model == "Ford"}\n}\n\n...\ndiv {\n + singleSelect\n + resultSingleSelect\n br()\n br()\n + multiSelect\n + resultMultiSelect\n br()\n + btn\n}'); }, f_269: function (singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn) { return function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_266(singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn)); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_268); }; }, createSelectSection$f_5: function (id, singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn) { return function () { this.id = id; _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_263); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_269(singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn)); }; }, createSelectSection: function (id) { var someData = Kotlin.modules['stdlib'].kotlin.listOf_9mqe4v$([new _.bootstrap.Car('Ford', 'Black'), new _.bootstrap.Car('Skoda', 'White'), new _.bootstrap.Car('Renault', 'Red'), new _.bootstrap.Car('Citroen', 'Purple')]); var resultSingleSelect = new _.net.yested.Div(); var singleSelect = new _.net.yested.bootstrap.Select(void 0, void 0, _.bootstrap.createSelectSection$f); singleSelect.data = someData; singleSelect.addOnChangeListener_qshda6$(_.bootstrap.createSelectSection$f_0(resultSingleSelect, singleSelect)); var resultMultiSelect = new _.net.yested.Div(); var multiSelect = new _.net.yested.bootstrap.Select(true, 4, _.bootstrap.createSelectSection$f_1); multiSelect.data = someData; multiSelect.addOnChangeListener_qshda6$(_.bootstrap.createSelectSection$f_2(resultMultiSelect, multiSelect)); var btn = new _.net.yested.bootstrap.BtsButton(void 0, _.bootstrap.createSelectSection$f_3, void 0, void 0, void 0, _.bootstrap.createSelectSection$f_4(someData, multiSelect)); return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createSelectSection$f_5(id, singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn)); }, f_270: function () { this.plus_pdl1w0$('Tabs'); }, f_271: function () { this.h3_kv1miw$(_.bootstrap.f_270); }, f_272: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_271); }, f_273: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_272); }, f_274: function () { this.plus_pdl1w0$('\nTabs are based on Bootstrap Tabs.\nContent of tab is rendedered upon click on a tab link. When clicking on anoother link, content is preserved.\n'); }, f_275: function () { this.plus_pdl1w0$('Demo'); }, f_276: function () { }, f_277: function () { _.net.yested.bootstrap.textInput_ra92pu$(this, 'Placeholder 1', _.bootstrap.f_276); }, f_278: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_277); }, f_279: function () { this.plus_pdl1w0$('This tab is selected by default.'); }, f_280: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_279); }, f_281: function () { this.plus_pdl1w0$('Wikipedia'); }, f_282: function () { this.a_b4th6h$(void 0, 'http://www.wikipedia.org', void 0, _.bootstrap.f_281); }, f_283: function () { this.tab_l25lo7$(void 0, _.net.yested.text_61zpoe$('First'), void 0, _.bootstrap.f_278); this.tab_l25lo7$(true, _.net.yested.text_61zpoe$('Second'), void 0, _.bootstrap.f_280); this.tab_l25lo7$(void 0, _.net.yested.text_61zpoe$('Third'), void 0, _.bootstrap.f_282); }, f_284: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_274); this.br(); this.h4_kv1miw$(_.bootstrap.f_275); _.net.yested.bootstrap.tabs_fe4fv1$(this, _.bootstrap.f_283); }, f_285: function () { this.plus_pdl1w0$('Code'); }, f_286: function () { this.h4_kv1miw$(_.bootstrap.f_285); this.code_puj7f4$('kotlin', 'tabs {\n tab(header = text("First")) {\n div {\n textInput(placeholder = "Placeholder 1") { }\n }\n }\n tab(active = true, header = text("Second")) {\n div {\n +"This tab is selected by default."\n }\n }\n tab(header = text("Third")) {\n a(href = "http://www.wikipedia.org") { +"Wikipedia"}\n }\n}'); }, f_287: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_284); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_286); }, createTabs$f: function (id) { return function () { this.id = id; _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_273); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_287); }; }, createTabs: function (id) { return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createTabs$f(id)); }, f_288: function () { this.plus_pdl1w0$('Typography'); }, f_289: function () { this.h3_kv1miw$(_.bootstrap.f_288); }, f_290: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_289); }, f_291: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_290); }, f_292: function () { this.plus_pdl1w0$('\nSimple Typography support.\n'); }, f_293: function () { this.plus_pdl1w0$('Demo'); }, f_294: function () { this.plus_pdl1w0$('Right Align'); }, f_295: function () { this.plus_pdl1w0$('Left Align'); }, f_296: function () { this.plus_pdl1w0$('Center'); }, f_297: function () { this.plus_pdl1w0$('Justify'); }, f_298: function () { this.plus_pdl1w0$('No wrap'); }, f_299: function () { this.plus_pdl1w0$('all is upercase'); }, f_300: function () { _.net.yested.bootstrap.uppercase_71h449$(this, _.bootstrap.f_299); }, f_301: function () { this.plus_pdl1w0$('ALL IS lowerCase'); }, f_302: function () { _.net.yested.bootstrap.lowercase_71h449$(this, _.bootstrap.f_301); }, f_303: function () { this.plus_pdl1w0$('capitalized'); }, f_304: function () { _.net.yested.bootstrap.capitalize_71h449$(this, _.bootstrap.f_303); }, f_305: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_292); this.br(); this.h4_kv1miw$(_.bootstrap.f_293); _.net.yested.bootstrap.aligned_xlk53m$(this, _.net.yested.bootstrap.TextAlign.object.RIGHT, _.bootstrap.f_294); _.net.yested.bootstrap.aligned_xlk53m$(this, _.net.yested.bootstrap.TextAlign.object.LEFT, _.bootstrap.f_295); _.net.yested.bootstrap.aligned_xlk53m$(this, _.net.yested.bootstrap.TextAlign.object.CENTER, _.bootstrap.f_296); _.net.yested.bootstrap.aligned_xlk53m$(this, _.net.yested.bootstrap.TextAlign.object.JUSTIFY, _.bootstrap.f_297); _.net.yested.bootstrap.aligned_xlk53m$(this, _.net.yested.bootstrap.TextAlign.object.NOWRAP, _.bootstrap.f_298); this.p_omdg96$(_.bootstrap.f_300); this.p_omdg96$(_.bootstrap.f_302); this.p_omdg96$(_.bootstrap.f_304); }, f_306: function () { this.plus_pdl1w0$('Code'); }, f_307: function () { this.h4_kv1miw$(_.bootstrap.f_306); this.code_puj7f4$('kotlin', 'aligned(TextAlign.RIGHT) { +"Right Align"}\naligned(TextAlign.LEFT) { +"Left Align"}\naligned(TextAlign.CENTER) { +"Center"}\naligned(TextAlign.JUSTIFY) { +"Justify"}\naligned(TextAlign.NOWRAP) { +"No wrap"}\np { uppercase { +"all is upercase" }}\np { lowercase { +"ALL IS lowerCase" }}\np { capitalize { +"capitalized" }}'); }, f_308: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_305); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_307); }, createTypographySection$f: function (id) { return function () { this.id = id; _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_291); _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_308); }; }, createTypographySection: function (id) { return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createTypographySection$f(id)); }, f_309: function () { this.plus_pdl1w0$('Effects'); }, f_310: function () { this.h3_kv1miw$(_.bootstrap.f_309); }, f_311: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_310); this.plus_pdl1w0$('Effects are applied to components. They must implement the Effect interface:'); this.code_puj7f4$('kotlin', 'public trait Effect {\n fun apply(component:Component)\n}'); this.plus_pdl1w0$('Effects are based on JQuery effects.'); this.br(); this.plus_pdl1w0$('Some effects can applied bidirectionaly - to hide and to show an element for example.'); this.br(); this.plus_pdl1w0$('These effects must implement BiDirectionalEffect interface:'); this.code_puj7f4$('kotlin', 'public trait BiDirectionEffect {\n fun applyIn(component:Component, callback:Function0<Unit>? = null)\n fun applyOut(component:Component, callback:Function0<Unit>? = null)\n}'); }, f_312: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_311); }, f_313: function () { this.plus_pv6laa$(_.effects.createEffectsSection()); this.plus_pv6laa$(_.effects.createBidirectionalEffectsSection()); }, f_314: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_313); }, f_315: function (this$) { return function () { _.net.yested.bootstrap.row_xnql8t$(this$, _.bootstrap.f_312); _.net.yested.bootstrap.row_xnql8t$(this$, _.bootstrap.f_314); }; }, effectsPage$f: function () { _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_315(this)); }, effectsPage: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.effectsPage$f); } }), complex: Kotlin.definePackage(null, /** @lends _.complex */ { Continent: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(label) { $fun.baseInitializer.call(this); this.label = label; }, function () { return { EUROPE: new _.complex.Continent('Europe'), AMERICA: new _.complex.Continent('America'), ASIA: new _.complex.Continent('Asia'), AFRICA: new _.complex.Continent('Africa') }; }), City: Kotlin.createClass(null, function (name, continent) { this.name = name; this.continent = continent; }, /** @lends _.complex.City.prototype */ { component1: function () { return this.name; }, component2: function () { return this.continent; }, copy: function (name, continent) { return new _.complex.City(name === void 0 ? this.name : name, continent === void 0 ? this.continent : continent); }, toString: function () { return 'City(name=' + Kotlin.toString(this.name) + (', continent=' + Kotlin.toString(this.continent)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.name) | 0; result = result * 31 + Kotlin.hashCode(this.continent) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.name, other.name) && Kotlin.equals(this.continent, other.continent)))); } }), MasterDetail: Kotlin.createClass(null, function () { this.placeholder = new _.net.yested.Div(); this.list = Kotlin.modules['stdlib'].kotlin.arrayListOf_9mqe4v$([new _.complex.City('Prague', _.complex.Continent.object.EUROPE), new _.complex.City('London', _.complex.Continent.object.EUROPE), new _.complex.City('New York', _.complex.Continent.object.AMERICA)]); this.grid = new _.net.yested.bootstrap.Grid([new _.net.yested.bootstrap.Column(_.complex.MasterDetail.MasterDetail$f, _.complex.MasterDetail.MasterDetail$f_0, _.bootstrap.compareBy(_.complex.MasterDetail.MasterDetail$f_1), void 0, true), new _.net.yested.bootstrap.Column(_.complex.MasterDetail.MasterDetail$f_2, _.complex.MasterDetail.MasterDetail$f_3, _.bootstrap.compareBy(_.complex.MasterDetail.MasterDetail$f_4)), new _.net.yested.bootstrap.Column(_.complex.MasterDetail.MasterDetail$f_5, _.complex.MasterDetail.MasterDetail$f_6(this), _.bootstrap.compareBy(_.complex.MasterDetail.MasterDetail$f_7)), new _.net.yested.bootstrap.Column(_.complex.MasterDetail.MasterDetail$f_8, _.complex.MasterDetail.MasterDetail$f_9(this), _.bootstrap.compareBy(_.complex.MasterDetail.MasterDetail$f_10))]); }, /** @lends _.complex.MasterDetail.prototype */ { delete: function (city) { this.list.remove_za3rmp$(city); this.grid.list = this.list; }, edit: function (editedCity) { if (editedCity === void 0) editedCity = null; var textInput = new _.net.yested.bootstrap.TextInput('City name'); var validator = new _.net.yested.bootstrap.Validator(textInput, 'Name is mandatory', _.complex.MasterDetail.edit$f); var select = new _.net.yested.bootstrap.Select(void 0, void 0, _.complex.MasterDetail.edit$f_0); select.data = Kotlin.modules['stdlib'].kotlin.toList_eg9ybj$(_.complex.Continent.values()); var close = _.complex.MasterDetail.edit$close(this); var save = _.complex.MasterDetail.edit$save(validator, editedCity, this, textInput, select, close); if (editedCity != null) { textInput.value = editedCity.name; select.selectedItems = Kotlin.modules['stdlib'].kotlin.listOf_9mqe4v$([editedCity.continent]); } this.placeholder.setChild_hu5ove$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Form('col-sm-4', 'col-sm-8'), _.complex.MasterDetail.edit$f_1(validator, textInput, select, save, close)), new _.net.yested.Fade()); }, createMasterView: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.complex.MasterDetail.createMasterView$f(this)); }, createDiv: function () { this.placeholder.setChild_hu5ove$(this.createMasterView(), new _.net.yested.Fade()); this.grid.list = this.list; return _.net.yested.div_5rsex9$(void 0, void 0, _.complex.MasterDetail.createDiv$f(this)); } }, /** @lends _.complex.MasterDetail */ { MasterDetail$f: function () { this.plus_pdl1w0$('City name'); }, MasterDetail$f_0: function (it) { this.plus_pdl1w0$(it.name); }, MasterDetail$f_1: function (it) { return it.name; }, MasterDetail$f_2: function () { this.plus_pdl1w0$('Continent'); }, MasterDetail$f_3: function (it) { this.plus_pdl1w0$(it.continent.label); }, MasterDetail$f_4: function (it) { return it.continent.label; }, MasterDetail$f_5: function () { }, f: function () { this.plus_pdl1w0$('Edit'); }, f_0: function (it, this$MasterDetail) { return function () { this$MasterDetail.edit(it); }; }, MasterDetail$f_6: function (this$MasterDetail) { return function (it) { _.net.yested.bootstrap.btsButton_adnmfr$(this, void 0, _.complex.MasterDetail.f, void 0, _.net.yested.bootstrap.ButtonSize.object.EXTRA_SMALL, void 0, _.complex.MasterDetail.f_0(it, this$MasterDetail)); }; }, MasterDetail$f_7: function (it) { return it.name; }, MasterDetail$f_8: function () { }, f_1: function () { this.plus_pdl1w0$('Delete'); }, f_2: function (it, this$MasterDetail) { return function () { this$MasterDetail.delete(it); }; }, MasterDetail$f_9: function (this$MasterDetail) { return function (it) { _.net.yested.bootstrap.btsButton_adnmfr$(this, void 0, _.complex.MasterDetail.f_1, _.net.yested.bootstrap.ButtonLook.object.DANGER, _.net.yested.bootstrap.ButtonSize.object.EXTRA_SMALL, void 0, _.complex.MasterDetail.f_2(it, this$MasterDetail)); }; }, MasterDetail$f_10: function (it) { return it.name; }, edit$f: function (it) { return it.length > 3; }, edit$f_0: function (it) { return it.label; }, edit$close: function (this$MasterDetail) { return function () { this$MasterDetail.placeholder.setChild_hu5ove$(this$MasterDetail.createMasterView(), new _.net.yested.Fade()); }; }, edit$save: function (validator, editedCity, this$MasterDetail, textInput, select, close) { return function () { if (validator.isValid()) { if (editedCity != null) { this$MasterDetail.list.remove_za3rmp$(editedCity); } this$MasterDetail.list.add_za3rmp$(new _.complex.City(textInput.value, Kotlin.modules['stdlib'].kotlin.first_fvq2g0$(select.selectedItems))); this$MasterDetail.grid.list = this$MasterDetail.list; close(); } }; }, f_3: function () { this.plus_pdl1w0$('City name'); }, f_4: function (textInput) { return function () { this.plus_pv6laa$(textInput); }; }, f_5: function () { this.plus_pdl1w0$('Continent'); }, f_6: function (select) { return function () { this.plus_pv6laa$(select); }; }, f_7: function () { }, f_8: function () { this.plus_pdl1w0$('Save'); }, f_9: function () { this.plus_pdl1w0$('Cancel'); }, f_10: function (save, close) { return function () { _.net.yested.bootstrap.btsButton_adnmfr$(this, _.net.yested.ButtonType.object.SUBMIT, _.complex.MasterDetail.f_8, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, void 0, void 0, save); _.net.yested.bootstrap.btsButton_adnmfr$(this, void 0, _.complex.MasterDetail.f_9, void 0, void 0, void 0, close); }; }, f_11: function (save, close) { return function () { this.div_5rsex9$(void 0, void 0, _.complex.MasterDetail.f_10(save, close)); }; }, edit$f_1: function (validator, textInput, select, save, close) { return function () { this.item_gthhqa$(void 0, _.complex.MasterDetail.f_3, validator, _.complex.MasterDetail.f_4(textInput)); this.item_gthhqa$(void 0, _.complex.MasterDetail.f_5, void 0, _.complex.MasterDetail.f_6(select)); this.item_gthhqa$(void 0, _.complex.MasterDetail.f_7, void 0, _.complex.MasterDetail.f_11(save, close)); }; }, f_12: function () { this.plus_pdl1w0$('Add'); }, f_13: function (this$MasterDetail) { return function () { this$MasterDetail.edit(); }; }, createMasterView$f: function (this$MasterDetail) { return function () { this.plus_pv6laa$(this$MasterDetail.grid); _.net.yested.bootstrap.btsButton_adnmfr$(this, void 0, _.complex.MasterDetail.f_12, void 0, void 0, void 0, _.complex.MasterDetail.f_13(this$MasterDetail)); }; }, f_14: function () { this.plus_pdl1w0$('Master / Detail'); }, f_15: function () { this.h3_kv1miw$(_.complex.MasterDetail.f_14); }, f_16: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.complex.MasterDetail.f_15); }, f_17: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.complex.MasterDetail.f_16); }, f_18: function () { this.plus_pdl1w0$('Demo'); }, f_19: function (this$MasterDetail) { return function () { this.h4_kv1miw$(_.complex.MasterDetail.f_18); this.plus_pv6laa$(this$MasterDetail.placeholder); }; }, f_20: function () { this.plus_pdl1w0$('Source code'); }, f_21: function () { this.plus_pdl1w0$('Source code is deployed on GitHub'); }, f_22: function () { this.h4_kv1miw$(_.complex.MasterDetail.f_20); this.a_b4th6h$(void 0, 'https://github.com/jean79/yested/blob/master/src/main/docsite/complex/masterdetails.kt', void 0, _.complex.MasterDetail.f_21); }, f_23: function (this$MasterDetail) { return function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.complex.MasterDetail.f_19(this$MasterDetail)); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.complex.MasterDetail.f_22); }; }, createDiv$f: function (this$MasterDetail) { return function () { _.net.yested.bootstrap.row_xnql8t$(this, _.complex.MasterDetail.f_17); _.net.yested.bootstrap.row_xnql8t$(this, _.complex.MasterDetail.f_23(this$MasterDetail)); }; } }), masterDetail: function () { return (new _.complex.MasterDetail()).createDiv(); }, f: function () { this.plus_pdl1w0$('Spinner'); }, f_0: function () { this.h3_kv1miw$(_.complex.f); }, f_1: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.complex.f_0); }, f_2: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.complex.f_1); }, f_3: function () { this.plus_pdl1w0$('http://fgnass.github.io/spin.js/'); }, f_4: function () { this.plus_pdl1w0$('\nThis spinner is based on Spinner library:\n'); this.a_b4th6h$(void 0, 'http://fgnass.github.io/spin.js/', void 0, _.complex.f_3); this.br(); this.plus_pdl1w0$('You need to include spin.js library in your html file.'); this.br(); this.plus_pdl1w0$('All spinner options are supported.'); }, f_5: function () { this.plus_pdl1w0$('Demo'); }, f_6: function () { this.style = 'height: 200px'; _.net.yested.spin.spinner_4tyilv$(this, new _.net.yested.spin.SpinnerOptions(void 0, 7)); }, f_7: function () { this.div_5rsex9$(void 0, void 0, _.complex.f_4); this.br(); this.h4_kv1miw$(_.complex.f_5); this.div_5rsex9$(void 0, void 0, _.complex.f_6); }, f_8: function () { this.plus_pdl1w0$('Code'); }, f_9: function () { this.h4_kv1miw$(_.complex.f_8); this.code_puj7f4$('kotlin', 'div {\n style = "height: 200px"\n spinner(SpinnerOptions(length = 7))\n}'); }, f_10: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.complex.f_7); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.complex.f_9); }, createSpinner$f: function () { _.net.yested.bootstrap.row_xnql8t$(this, _.complex.f_2); _.net.yested.bootstrap.row_xnql8t$(this, _.complex.f_10); }, createSpinner: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.complex.createSpinner$f); } }), effects: Kotlin.definePackage(null, /** @lends _.effects */ { f: function (n) { return function () { this.plus_pdl1w0$('Sample component ' + n); }; }, f_0: function (n) { return function () { this.plus_pdl1w0$('Sample Text of component ' + n); }; }, createPanel$f: function (n) { return function () { this.heading_kv1miw$(_.effects.f(n)); this.content_kv1miw$(_.effects.f_0(n)); }; }, createPanel: function (n) { return _.net.yested.with_owvm91$(new _.net.yested.bootstrap.Panel(), _.effects.createPanel$f(n)); }, createBidirectionalEffectsSection$selectEffect: function (effect) { return function (effectCode) { var tmp$0; if (effectCode === 'fade') tmp$0 = new _.net.yested.Fade(); else if (effectCode === 'slide') tmp$0 = new _.net.yested.Slide(); else throw new Kotlin.Exception('Unknown effect.'); effect.v = tmp$0; }; }, createBidirectionalEffectsSection$toogleContent: function (container, panels, index, effect) { return function () { container.setChild_hu5ove$(panels[index.v++ % panels.length], effect.v); }; }, f_1: function () { this.plus_pdl1w0$('BiDirectional Effects'); }, f_2: function () { this.h3_kv1miw$(_.effects.f_1); }, f_3: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.effects.f_2); }, f_4: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.effects.f_3); }, f_5: function () { this.plus_pdl1w0$('Demo'); }, f_6: function () { this.plus_pdl1w0$('Toogle it'); }, f_7: function (toogleContent) { return function () { _.net.yested.bootstrap.btsButton_adnmfr$(this, void 0, _.effects.f_6, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, void 0, void 0, toogleContent); }; }, f_8: function () { this.plus_pdl1w0$('Fade Effect'); }, f_9: function () { this.plus_pdl1w0$('Slide Effect'); }, f_10: function () { this.button_ubg574$('fade', void 0, _.effects.f_8); this.button_ubg574$('slide', void 0, _.effects.f_9); this.select_61zpoe$('fade'); }, f_11: function (selectEffect) { return function () { _.net.yested.bootstrap.buttonGroup_wnptsr$(this, void 0, selectEffect, _.effects.f_10); }; }, f_12: function (selectEffect) { return function () { _.net.yested.bootstrap.aligned_xlk53m$(this, _.net.yested.bootstrap.TextAlign.object.RIGHT, _.effects.f_11(selectEffect)); }; }, f_13: function (toogleContent, selectEffect) { return function () { this.col_zcukl0$([new _.net.yested.bootstrap.ExtraSmall(4)], _.effects.f_7(toogleContent)); this.col_zcukl0$([new _.net.yested.bootstrap.ExtraSmall(8)], _.effects.f_12(selectEffect)); }; }, f_14: function (toogleContent, selectEffect, container) { return function () { this.plus_pdl1w0$('BiDirectonalEffects can be used to swap content of parent component like Div or Span'); this.code_puj7f4$('kotlin', 'divOrSpan.setChild(anotherComponent, Fade())'); this.h4_kv1miw$(_.effects.f_5); _.net.yested.bootstrap.row_xnql8t$(this, _.effects.f_13(toogleContent, selectEffect)); this.plus_pv6laa$(container); }; }, f_15: function () { this.plus_pdl1w0$('Source code'); }, f_16: function () { this.h4_kv1miw$(_.effects.f_15); this.code_puj7f4$('kotlin', 'var index = 0\nval panels = array(createPanel(0), createPanel(1))\nval container = Div()\nvar effect: BiDirectionEffect = Fade()\n\nfun selectEffect(effectCode:String) {\n effect =\n when(effectCode) {\n "fade" -> Fade()\n "slide" -> Slide()\n else -> throw Exception("Unknown effect.")\n }\n}\n\nfun toogleContent() =\n container.setChild(panels.get(index++ % panels.size()), effect)\n\ntoogleContent()\n\n...\n\nrow {\n col(ExtraSmall(4)) {\n btsButton(look = ButtonLook.PRIMARY, label = { +"Toogle it" }, onclick = ::toogleContent)\n }\n col(ExtraSmall(8)) {\n aligned(align = TextAlign.RIGHT) {\n buttonGroup(onSelect = ::selectEffect) {\n button(value = "fade") { +"Fade Effect" }\n button(value = "slide") { +"Slide Effect" }\n select("fade")\n }\n }\n }\n}\n+container'); }, f_17: function (toogleContent, selectEffect, container) { return function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.effects.f_14(toogleContent, selectEffect, container)); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.effects.f_16); }; }, createBidirectionalEffectsSection$f: function (toogleContent, selectEffect, container) { return function () { _.net.yested.bootstrap.row_xnql8t$(this, _.effects.f_4); _.net.yested.bootstrap.row_xnql8t$(this, _.effects.f_17(toogleContent, selectEffect, container)); }; }, createBidirectionalEffectsSection: function () { var index = {v: 0}; var panels = [_.effects.createPanel(0), _.effects.createPanel(1)]; var container = new _.net.yested.Div(); var effect = {v: new _.net.yested.Fade()}; var selectEffect = _.effects.createBidirectionalEffectsSection$selectEffect(effect); var toogleContent = _.effects.createBidirectionalEffectsSection$toogleContent(container, panels, index, effect); toogleContent(); return _.net.yested.div_5rsex9$(void 0, void 0, _.effects.createBidirectionalEffectsSection$f(toogleContent, selectEffect, container)); }, f_18: function () { this.plus_pdl1w0$('Sample component'); }, f_19: function () { this.plus_pdl1w0$('Some bolded text'); }, f_20: function () { this.plus_pdl1w0$('Some link'); }, f_21: function () { this.plus_pdl1w0$('Sample Text'); this.br(); this.emph_kv1miw$(_.effects.f_19); this.br(); this.a_b4th6h$(void 0, void 0, void 0, _.effects.f_20); }, createEffectsSection$f: function () { this.heading_kv1miw$(_.effects.f_18); this.content_kv1miw$(_.effects.f_21); }, f_22: function () { this.plus_pdl1w0$('Slide Up/Down'); }, f_23: function () { this.h3_kv1miw$(_.effects.f_22); }, f_24: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.effects.f_23); }, f_25: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.effects.f_24); }, f_26: function () { this.plus_pdl1w0$('Demo'); }, f_27: function () { this.plus_pdl1w0$('Toogle it'); }, f_28: function (visible, target) { return function () { if (visible.v) { (new _.net.yested.SlideUp()).apply_suy7ya$(target); } else { (new _.net.yested.SlideDown()).apply_suy7ya$(target); } visible.v = !visible.v; }; }, f_29: function (visible, target) { return function () { this.plus_pdl1w0$('Effects are applied directly on components:'); this.code_puj7f4$('kotlin', 'SlideUp().apply(component)'); this.h4_kv1miw$(_.effects.f_26); _.net.yested.bootstrap.btsButton_adnmfr$(this, void 0, _.effects.f_27, void 0, void 0, void 0, _.effects.f_28(visible, target)); this.br(); this.br(); this.plus_pv6laa$(target); }; }, f_30: function () { this.plus_pdl1w0$('Source code'); }, f_31: function () { this.h4_kv1miw$(_.effects.f_30); this.code_puj7f4$('kotlin', 'var visible: Boolean = true\n\nval target = Panel() with {\n heading { +"Sample component" }\n content {\n +"Sample Text"\n br()\n emph { +"Some bolded text" }\n br()\n br()\n a() { +"Some text" }\n }\n}\n\n...\n\ndiv {\n btsButton(label = { +"Toogle it" }) {\n if (visible) {\n SlideUp().apply(target)\n } else {\n SlideDown().apply(target)\n }\n visible = !visible\n }\n br()\n +target\n}'); }, f_32: function (visible, target) { return function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.effects.f_29(visible, target)); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.effects.f_31); }; }, createEffectsSection$f_0: function (visible, target) { return function () { _.net.yested.bootstrap.row_xnql8t$(this, _.effects.f_25); _.net.yested.bootstrap.row_xnql8t$(this, _.effects.f_32(visible, target)); }; }, createEffectsSection: function () { var visible = {v: true}; var target = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.Panel(), _.effects.createEffectsSection$f); return _.net.yested.div_5rsex9$(void 0, void 0, _.effects.createEffectsSection$f_0(visible, target)); } }), gettingstarted: Kotlin.definePackage(null, /** @lends _.gettingstarted */ { f: function () { this.plus_pdl1w0$('Getting Started'); }, f_0: function () { this.h3_kv1miw$(_.gettingstarted.f); }, f_1: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.gettingstarted.f_0); }, f_2: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_1); }, f_3: function () { this.plus_pdl1w0$('1. Get Intellij Idea'); }, f_4: function () { this.plus_pdl1w0$('Get Intellij Idea 14 from JetBrains.'); }, f_5: function () { this.a_b4th6h$(void 0, 'https://www.jetbrains.com/idea/', void 0, _.gettingstarted.f_4); }, f_6: function () { this.h4_kv1miw$(_.gettingstarted.f_3); this.p_omdg96$(_.gettingstarted.f_5); }, f_7: function () { this.div_5rsex9$(void 0, void 0, _.gettingstarted.f_6); }, f_8: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.gettingstarted.f_7); }, f_9: function () { this.plus_pdl1w0$('2. Enable Kotlin Plugin'); }, f_10: function () { this.plus_pdl1w0$('Install JetBrains Kotlin plugin into Idea.'); this.img_puj7f4$('demo-site/img/plugin_install.png'); }, f_11: function () { this.h4_kv1miw$(_.gettingstarted.f_9); this.p_omdg96$(_.gettingstarted.f_10); }, f_12: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_11); }, f_13: function () { this.plus_pdl1w0$('3. Create Kotlin - Javascript project'); }, f_14: function () { this.plus_pdl1w0$("Call it 'YestedSample'"); }, f_15: function () { this.h4_kv1miw$(_.gettingstarted.f_13); this.p_omdg96$(_.gettingstarted.f_14); this.img_puj7f4$('demo-site/img/create_project.png'); }, f_16: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_15); }, f_17: function () { this.plus_pdl1w0$('4. Create Kotlin Javascript Library'); }, f_18: function () { this.h4_kv1miw$(_.gettingstarted.f_17); this.img_puj7f4$('demo-site/img/create_project_create_lib.png'); }, f_19: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_18); }, f_20: function () { this.plus_pdl1w0$('Copy to: lib'); }, f_21: function () { this.plus_pdl1w0$('Select:'); this.emph_kv1miw$(_.gettingstarted.f_20); }, f_22: function () { this.p_omdg96$(_.gettingstarted.f_21); this.img_puj7f4$('demo-site/img/create_library.png'); }, f_23: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_22); }, f_24: function () { this.plus_pdl1w0$('4. Add Yested Library dependency'); }, f_25: function () { this.h4_kv1miw$(_.gettingstarted.f_24); this.img_puj7f4$('demo-site/img/add_library_dependency.png'); }, f_26: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_25); }, f_27: function () { this.plus_pdl1w0$('5. Create index.html file'); }, f_28: function () { this.h4_kv1miw$(_.gettingstarted.f_27); this.plus_pdl1w0$("Create HTML wrapper for our Yested application. It is a simple HTML that contains placeholder div with id 'page',"); this.plus_pdl1w0$('Place index.html in the root of your project.'); this.plus_pdl1w0$('It mainly references Boostrap and JQuery libraries. If you are not going to use Boostrap, you can have empty index.html with just placeholder div.'); this.code_puj7f4$('html', '<!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <meta http-equiv="X-UA-Compatible" content="IE=edge">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <title>Yested Sample<\/title>\n\n <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">\n <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">\n\n <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn\'t work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"><\/script>\n <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"><\/script>\n <![endif]-->\n\n <\/head>\n\n <body role="document">\n\n <div id="page"><\/div>\n\n <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"><\/script>\n <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"><\/script>\n\n <script src="out/production/YestedSample/lib/kotlin.js"><\/script>\n <script src="out/production/YestedSample/lib/Yested.js"><\/script>\n <script src="out/production/YestedSample/YestedSample.js"><\/script>\n\n <\/body>\n <\/html>\n '); }, f_29: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_28); }, f_30: function () { this.plus_pdl1w0$('6. Create basic Yested application'); }, f_31: function () { this.h4_kv1miw$(_.gettingstarted.f_30); }, f_32: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_31); }, f_33: function () { this.plus_pdl1w0$('Create file sample.kt in src/main/kotlin and insert content on the right.<br />\n Kotlin Javascript calls this main function when page is loaded.\n '); }, f_34: function () { this.code_puj7f4$('kotlin', 'import net.yested.bootstrap.page\n\nfun main(args: Array<String>) {\n page("page") {\n content {\n +"Hello World"\n br()\n a(href = "http://www.yested.net") { +"link to yested.net"}\n ol {\n li { +"First item" }\n li { +"Second item" }\n }\n }\n }\n}\n'); }, f_35: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.gettingstarted.f_33); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.gettingstarted.f_34); }, f_36: function () { this.plus_pdl1w0$('7. Build Project'); }, f_37: function () { this.plus_pdl1w0$("Build -> Make Module 'YestedSample'"); this.br(); this.plus_pdl1w0$('It should generate all javascript libraries into out/production/YestedSample.'); this.plus_pdl1w0$('We reference these files in our index.html file.'); }, f_38: function () { this.h4_kv1miw$(_.gettingstarted.f_36); this.p_omdg96$(_.gettingstarted.f_37); }, f_39: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_38); }, f_40: function () { this.plus_pdl1w0$('8. Create build configuration'); }, f_41: function () { this.plus_pdl1w0$('Create build configuration - Kotlin - Javascript. '); this.plus_pdl1w0$('Set correct path to our index.html'); this.img_puj7f4$('demo-site/img/build.png'); }, f_42: function () { this.h4_kv1miw$(_.gettingstarted.f_40); this.p_omdg96$(_.gettingstarted.f_41); }, f_43: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_42); }, f_44: function () { this.plus_pdl1w0$('9. Run It!'); }, f_45: function () { this.h4_kv1miw$(_.gettingstarted.f_44); }, f_46: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_45); }, gettingStartedSection$f: function () { _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_2); _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_8); _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_12); _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_16); _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_19); _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_23); _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_26); _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_29); _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_32); _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_35); _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_39); _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_43); _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_46); }, gettingStartedSection: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.gettingstarted.gettingStartedSection$f); } }), html: Kotlin.definePackage(null, /** @lends _.html */ { htmlPage$f: function () { this.plus_pv6laa$(_.html.htmlSection()); }, htmlPage: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.html.htmlPage$f); }, f: function () { this.plus_pdl1w0$('HTML'); }, f_0: function () { this.h3_kv1miw$(_.html.f); }, f_1: function () { _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.html.f_0); }, f_2: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.html.f_1); }, f_3: function () { this.plus_pdl1w0$('Yested provides basic DSL for construction of HTML page from HTML basic elements.<br /><br />\n This DSL can be easily enhanced with your custom or built-in Bootstrap components via Kotlin Extension methods.'); }, f_4: function () { this.div_5rsex9$(void 0, void 0, _.html.f_3); }, f_5: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.html.f_4); }, f_6: function () { this.plus_pdl1w0$('Demo'); }, f_7: function () { this.plus_pdl1w0$('Yested'); }, f_8: function () { this.plus_pdl1w0$('Text in span which is in div'); }, f_9: function () { this.span_dkuwo$(void 0, _.html.f_8); }, f_10: function () { this.plus_pdl1w0$('Text in Paragraph'); }, f_11: function () { this.plus_pdl1w0$('Strikethrough text'); }, f_12: function () { this.plus_pdl1w0$('Deleted text'); }, f_13: function () { this.plus_pdl1w0$('Marked text'); }, f_14: function () { this.plus_pdl1w0$('Inserted text'); }, f_15: function () { this.plus_pdl1w0$('Underlined text'); }, f_16: function () { this.plus_pdl1w0$('Small text'); }, f_17: function () { this.plus_pdl1w0$('Strong text'); }, f_18: function () { this.plus_pdl1w0$('Italicized text.'); }, f_19: function () { this.plus_pdl1w0$('blockquote'); }, f_20: function () { this.plus_pdl1w0$('First column'); }, f_21: function () { this.plus_pdl1w0$('Second column'); }, f_22: function () { this.th_kv1miw$(_.html.f_20); this.th_kv1miw$(_.html.f_21); }, f_23: function () { this.tr_l9w0g6$(_.html.f_22); }, f_24: function () { this.plus_pdl1w0$('Cell 1'); }, f_25: function () { this.plus_pdl1w0$('Cell 2'); }, f_26: function () { this.td_kv1miw$(_.html.f_24); this.td_kv1miw$(_.html.f_25); }, f_27: function () { this.plus_pdl1w0$('Cell 1'); }, f_28: function () { this.plus_pdl1w0$('Cell 2'); }, f_29: function () { this.td_kv1miw$(_.html.f_27); this.td_kv1miw$(_.html.f_28); }, f_30: function () { this.tr_idqsqk$(_.html.f_26); this.tr_idqsqk$(_.html.f_29); }, f_31: function () { this.border = '1'; this.thead_3ua0vu$(_.html.f_23); this.tbody_rj77wk$(_.html.f_30); }, f_32: function () { this.plus_pdl1w0$('bold text'); }, f_33: function () { this.plus_pdl1w0$('H1'); }, f_34: function () { this.plus_pdl1w0$('H2'); }, f_35: function () { this.plus_pdl1w0$('H3'); }, f_36: function () { this.plus_pdl1w0$('H4'); }, f_37: function () { this.plus_pdl1w0$('H5'); }, f_38: function () { this.plus_pdl1w0$('Press me'); }, f_39: function () { Kotlin.println('Check console!'); }, f_40: function () { this.plus_pdl1w0$('List item 1'); }, f_41: function () { this.plus_pdl1w0$('List item 2'); }, f_42: function () { this.plus_pdl1w0$('List item 3'); }, f_43: function () { this.plus_pdl1w0$('List item 4'); }, f_44: function () { this.li_8y48wp$(_.html.f_40); this.li_8y48wp$(_.html.f_41); this.li_8y48wp$(_.html.f_42); this.li_8y48wp$(_.html.f_43); }, f_45: function () { this.plus_pdl1w0$('List item 1'); }, f_46: function () { this.plus_pdl1w0$('List item 2'); }, f_47: function () { this.plus_pdl1w0$('List item 3'); }, f_48: function () { this.plus_pdl1w0$('List item 4'); }, f_49: function () { this.li_8y48wp$(_.html.f_45); this.li_8y48wp$(_.html.f_46); this.li_8y48wp$(_.html.f_47); this.li_8y48wp$(_.html.f_48); }, f_50: function () { this.plus_pdl1w0$('Term 1'); }, f_51: function () { this.plus_pdl1w0$('Definition'); }, f_52: function () { this.plus_pdl1w0$('Term 2'); }, f_53: function () { this.plus_pdl1w0$('Definition'); }, f_54: function () { this.clazz = 'dl-horizontal'; this.item_z5xo0k$(_.html.f_50, _.html.f_51); this.item_z5xo0k$(_.html.f_52, _.html.f_53); }, f_55: function () { this.plus_pdl1w0$('cd'); }, f_56: function () { this.a_b4th6h$(void 0, 'http://www.yested.net', void 0, _.html.f_7); this.br(); this.div_5rsex9$(void 0, void 0, _.html.f_9); this.p_omdg96$(_.html.f_10); this.s_kv1miw$(_.html.f_11); this.nbsp_za3lpa$(); this.del_kv1miw$(_.html.f_12); this.nbsp_za3lpa$(); this.mark_kv1miw$(_.html.f_13); this.nbsp_za3lpa$(); this.ins_kv1miw$(_.html.f_14); this.nbsp_za3lpa$(); this.u_kv1miw$(_.html.f_15); this.nbsp_za3lpa$(); this.small_kv1miw$(_.html.f_16); this.nbsp_za3lpa$(); this.strong_kv1miw$(_.html.f_17); this.nbsp_za3lpa$(); this.em_kv1miw$(_.html.f_18); this.br(); this.br(); this.blockquote_kv1miw$(_.html.f_19); this.table_or8fdg$(_.html.f_31); this.img_puj7f4$('demo-site/img/sample_img.jpg', 'bla'); this.emph_kv1miw$(_.html.f_32); this.h1_kv1miw$(_.html.f_33); this.h2_kv1miw$(_.html.f_34); this.h3_kv1miw$(_.html.f_35); this.h4_kv1miw$(_.html.f_36); this.h5_kv1miw$(_.html.f_37); this.button_fpm6mz$(_.html.f_38, _.net.yested.ButtonType.object.BUTTON, _.html.f_39); this.ul_8qfrsd$(_.html.f_44); this.ol_t3splz$(_.html.f_49); this.dl_79d1z0$(_.html.f_54); this.kbd_kv1miw$(_.html.f_55); }, f_57: function () { this.h4_kv1miw$(_.html.f_6); this.div_5rsex9$(void 0, void 0, _.html.f_56); }, f_58: function () { this.plus_pdl1w0$('Code'); }, f_59: function () { this.h4_kv1miw$(_.html.f_58); this.code_puj7f4$('kotlin', '\na(href="http://www.yested.net") { +"Yested"}\nbr()\ndiv {\n span { +"Text in span which is in div"}\n}\np { +"Text in Paragraph" }\ns { +"Strikethrough text" }\nnbsp()\ndel { +"Deleted text" }\nnbsp()\nmark { +"Marked text" }\nnbsp()\nins { +"Inserted text" }\nnbsp()\nu { +"Underlined text" }\nnbsp()\nsmall { +"Small text" }\nnbsp()\nstrong { +"Strong text" }\nnbsp()\nem { +"Italicized text." }\nbr()\nbr()\nblockquote { +"blockquote" }\ntable { border = "1"\n thead {\n tr {\n th { +"First column" }\n th { +"Second column"}\n }\n }\n tbody {\n tr {\n td { +"Cell 1"}\n td { +"Cell 2"}\n }\n tr {\n td { +"Cell 1"}\n td { +"Cell 2"}\n }\n }\n}\nimg(src = "demo-site/img/sample_img.jpg", alt = "bla") {}\nemph { +"bold text" }\nh1 { +"H1" }\nh2 { +"H2" }\nh3 { +"H3" }\nh4 { +"H4" }\nh5 { +"H5" }\nbutton(label = { +"Press me"},\n type = ButtonType.BUTTON,\n onclick = { println("Check console!")})\nul {\n li { +"List item 1"}\n li { +"List item 2"}\n li { +"List item 3"}\n li { +"List item 4"}\n}\n\nol {\n li { +"List item 1" }\n li { +"List item 2" }\n li { +"List item 3" }\n li { +"List item 4" }\n}\n\ndl {\n clazz = "dl-horizontal"\n item(dt = { +"Term 1"}) { +"Definition"}\n item(dt = { +"Term 2"}) { +"Definition"}\n}\n\nkbd { +"cd" }\n\n'); }, f_60: function () { this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.html.f_57); this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.html.f_59); }, htmlSection$f: function () { _.net.yested.bootstrap.row_xnql8t$(this, _.html.f_2); _.net.yested.bootstrap.row_xnql8t$(this, _.html.f_5); _.net.yested.bootstrap.row_xnql8t$(this, _.html.f_60); }, htmlSection: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.html.htmlSection$f); } }) }); Kotlin.defineModule('Yested', _); _.main([]); }(Kotlin)); //@ sourceMappingURL=Yested.js.map
demo-site/js/Yested.js
(function (Kotlin) { 'use strict'; var _ = Kotlin.defineRootPackage(null, /** @lends _ */ { net: Kotlin.definePackage(null, /** @lends _.net */ { yested: Kotlin.definePackage(null, /** @lends _.net.yested */ { AjaxRequest: Kotlin.createClass(null, function (url, type, data, contentType, dataType, success) { if (type === void 0) type = 'POST'; if (contentType === void 0) contentType = 'application/json; charset=utf-8'; if (dataType === void 0) dataType = 'json'; this.url = url; this.type = type; this.data = data; this.contentType = contentType; this.dataType = dataType; this.success = success; }, /** @lends _.net.yested.AjaxRequest.prototype */ { component1: function () { return this.url; }, component2: function () { return this.type; }, component3: function () { return this.data; }, component4: function () { return this.contentType; }, component5: function () { return this.dataType; }, component6: function () { return this.success; }, copy: function (url, type, data, contentType, dataType, success) { return new _.net.yested.AjaxRequest(url === void 0 ? this.url : url, type === void 0 ? this.type : type, data === void 0 ? this.data : data, contentType === void 0 ? this.contentType : contentType, dataType === void 0 ? this.dataType : dataType, success === void 0 ? this.success : success); }, toString: function () { return 'AjaxRequest(url=' + Kotlin.toString(this.url) + (', type=' + Kotlin.toString(this.type)) + (', data=' + Kotlin.toString(this.data)) + (', contentType=' + Kotlin.toString(this.contentType)) + (', dataType=' + Kotlin.toString(this.dataType)) + (', success=' + Kotlin.toString(this.success)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.url) | 0; result = result * 31 + Kotlin.hashCode(this.type) | 0; result = result * 31 + Kotlin.hashCode(this.data) | 0; result = result * 31 + Kotlin.hashCode(this.contentType) | 0; result = result * 31 + Kotlin.hashCode(this.dataType) | 0; result = result * 31 + Kotlin.hashCode(this.success) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.url, other.url) && Kotlin.equals(this.type, other.type) && Kotlin.equals(this.data, other.data) && Kotlin.equals(this.contentType, other.contentType) && Kotlin.equals(this.dataType, other.dataType) && Kotlin.equals(this.success, other.success)))); } }), ajaxGet_435vpa$: function (url, loaded) { $.get(url, loaded); }, ajaxPost_sd5w5e$: function (ajaxRequest) { $.ajax(ajaxRequest); }, ChartItem: Kotlin.createClass(null, function (value, color, highlight, label) { this.$value_692zr7$ = value; this.$color_5yvu5x$ = color; this.$highlight_wsl8oq$ = highlight; this.$label_63ku12$ = label; }, /** @lends _.net.yested.ChartItem.prototype */ { value: { get: function () { return this.$value_692zr7$; } }, color: { get: function () { return this.$color_5yvu5x$; } }, highlight: { get: function () { return this.$highlight_wsl8oq$; } }, label: { get: function () { return this.$label_63ku12$; } }, component1: function () { return this.value; }, component2: function () { return this.color; }, component3: function () { return this.highlight; }, component4: function () { return this.label; }, copy_1qdp2k$: function (value, color, highlight, label) { return new _.net.yested.ChartItem(value === void 0 ? this.value : value, color === void 0 ? this.color : color, highlight === void 0 ? this.highlight : highlight, label === void 0 ? this.label : label); }, toString: function () { return 'ChartItem(value=' + Kotlin.toString(this.value) + (', color=' + Kotlin.toString(this.color)) + (', highlight=' + Kotlin.toString(this.highlight)) + (', label=' + Kotlin.toString(this.label)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.value) | 0; result = result * 31 + Kotlin.hashCode(this.color) | 0; result = result * 31 + Kotlin.hashCode(this.highlight) | 0; result = result * 31 + Kotlin.hashCode(this.label) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.value, other.value) && Kotlin.equals(this.color, other.color) && Kotlin.equals(this.highlight, other.highlight) && Kotlin.equals(this.label, other.label)))); } }), SingleLineData: Kotlin.createClass(null, function (label, fillColor, strokeColor, pointColor, pointStrokeColor, pointHighlightFill, pointHighlightStroke, data) { this.$label_afr525$ = label; this.$fillColor_llb3wp$ = fillColor; this.$strokeColor_4jgoms$ = strokeColor; this.$pointColor_39s846$ = pointColor; this.$pointStrokeColor_839w7m$ = pointStrokeColor; this.$pointHighlightFill_sqw4im$ = pointHighlightFill; this.$pointHighlightStroke_16i0ur$ = pointHighlightStroke; this.$data_6jhdy7$ = data; }, /** @lends _.net.yested.SingleLineData.prototype */ { label: { get: function () { return this.$label_afr525$; } }, fillColor: { get: function () { return this.$fillColor_llb3wp$; } }, strokeColor: { get: function () { return this.$strokeColor_4jgoms$; } }, pointColor: { get: function () { return this.$pointColor_39s846$; } }, pointStrokeColor: { get: function () { return this.$pointStrokeColor_839w7m$; } }, pointHighlightFill: { get: function () { return this.$pointHighlightFill_sqw4im$; } }, pointHighlightStroke: { get: function () { return this.$pointHighlightStroke_16i0ur$; } }, data: { get: function () { return this.$data_6jhdy7$; } }, component1: function () { return this.label; }, component2: function () { return this.fillColor; }, component3: function () { return this.strokeColor; }, component4: function () { return this.pointColor; }, component5: function () { return this.pointStrokeColor; }, component6: function () { return this.pointHighlightFill; }, component7: function () { return this.pointHighlightStroke; }, component8: function () { return this.data; }, copy_6k1o7m$: function (label, fillColor, strokeColor, pointColor, pointStrokeColor, pointHighlightFill, pointHighlightStroke, data) { return new _.net.yested.SingleLineData(label === void 0 ? this.label : label, fillColor === void 0 ? this.fillColor : fillColor, strokeColor === void 0 ? this.strokeColor : strokeColor, pointColor === void 0 ? this.pointColor : pointColor, pointStrokeColor === void 0 ? this.pointStrokeColor : pointStrokeColor, pointHighlightFill === void 0 ? this.pointHighlightFill : pointHighlightFill, pointHighlightStroke === void 0 ? this.pointHighlightStroke : pointHighlightStroke, data === void 0 ? this.data : data); }, toString: function () { return 'SingleLineData(label=' + Kotlin.toString(this.label) + (', fillColor=' + Kotlin.toString(this.fillColor)) + (', strokeColor=' + Kotlin.toString(this.strokeColor)) + (', pointColor=' + Kotlin.toString(this.pointColor)) + (', pointStrokeColor=' + Kotlin.toString(this.pointStrokeColor)) + (', pointHighlightFill=' + Kotlin.toString(this.pointHighlightFill)) + (', pointHighlightStroke=' + Kotlin.toString(this.pointHighlightStroke)) + (', data=' + Kotlin.toString(this.data)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.label) | 0; result = result * 31 + Kotlin.hashCode(this.fillColor) | 0; result = result * 31 + Kotlin.hashCode(this.strokeColor) | 0; result = result * 31 + Kotlin.hashCode(this.pointColor) | 0; result = result * 31 + Kotlin.hashCode(this.pointStrokeColor) | 0; result = result * 31 + Kotlin.hashCode(this.pointHighlightFill) | 0; result = result * 31 + Kotlin.hashCode(this.pointHighlightStroke) | 0; result = result * 31 + Kotlin.hashCode(this.data) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.label, other.label) && Kotlin.equals(this.fillColor, other.fillColor) && Kotlin.equals(this.strokeColor, other.strokeColor) && Kotlin.equals(this.pointColor, other.pointColor) && Kotlin.equals(this.pointStrokeColor, other.pointStrokeColor) && Kotlin.equals(this.pointHighlightFill, other.pointHighlightFill) && Kotlin.equals(this.pointHighlightStroke, other.pointHighlightStroke) && Kotlin.equals(this.data, other.data)))); } }), LineData: Kotlin.createClass(null, function (labels, datasets) { this.$labels_s8o8f6$ = labels; this.$datasets_eqt6qu$ = datasets; }, /** @lends _.net.yested.LineData.prototype */ { labels: { get: function () { return this.$labels_s8o8f6$; } }, datasets: { get: function () { return this.$datasets_eqt6qu$; } }, component1: function () { return this.labels; }, component2: function () { return this.datasets; }, copy_5rvrpk$: function (labels, datasets) { return new _.net.yested.LineData(labels === void 0 ? this.labels : labels, datasets === void 0 ? this.datasets : datasets); }, toString: function () { return 'LineData(labels=' + Kotlin.toString(this.labels) + (', datasets=' + Kotlin.toString(this.datasets)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.labels) | 0; result = result * 31 + Kotlin.hashCode(this.datasets) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.labels, other.labels) && Kotlin.equals(this.datasets, other.datasets)))); } }), Chart: Kotlin.createClass(function () { return [_.net.yested.Canvas]; }, function $fun(width, height) { $fun.baseInitializer.call(this, width, height); }, /** @lends _.net.yested.Chart.prototype */ { Pie: function (data) { return new Chart(this.getContext_61zpoe$('2d')).Pie(data); }, Line: function (data, options) { if (options === void 0) options = null; return new Chart(this.getContext_61zpoe$('2d')).Line(data, options); } }), replaceAll_ex0kps$: function ($receiver, regex, with_0) { return $receiver.replace(new RegExp(regex, 'g'), with_0); }, Color: Kotlin.createClass(null, function (red, green, blue, alpha) { this.red = red; this.green = green; this.blue = blue; this.alpha = alpha; }, /** @lends _.net.yested.Color.prototype */ { component1: function () { return this.red; }, component2: function () { return this.green; }, component3: function () { return this.blue; }, component4: function () { return this.alpha; }, copy_gb4hak$: function (red, green, blue, alpha) { return new _.net.yested.Color(red === void 0 ? this.red : red, green === void 0 ? this.green : green, blue === void 0 ? this.blue : blue, alpha === void 0 ? this.alpha : alpha); }, toString: function () { return 'Color(red=' + Kotlin.toString(this.red) + (', green=' + Kotlin.toString(this.green)) + (', blue=' + Kotlin.toString(this.blue)) + (', alpha=' + Kotlin.toString(this.alpha)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.red) | 0; result = result * 31 + Kotlin.hashCode(this.green) | 0; result = result * 31 + Kotlin.hashCode(this.blue) | 0; result = result * 31 + Kotlin.hashCode(this.alpha) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.red, other.red) && Kotlin.equals(this.green, other.green) && Kotlin.equals(this.blue, other.blue) && Kotlin.equals(this.alpha, other.alpha)))); } }), toHTMLColor_p73cws$: function ($receiver) { return 'rgba(' + $receiver.red + ',' + $receiver.green + ',' + $receiver.blue + ',' + $receiver.alpha + ')'; }, Colorized: Kotlin.createClass(function () { return [_.net.yested.Span]; }, function $fun(color, backgroundColor, init) { if (color === void 0) color = null; if (backgroundColor === void 0) backgroundColor = null; $fun.baseInitializer.call(this); this.style = (color != null ? 'color: ' + _.net.yested.toHTMLColor_p73cws$(color) + ';' : '') + (backgroundColor != null ? 'background-color: ' + _.net.yested.toHTMLColor_p73cws$(backgroundColor) + ';' : ''); init.call(this); }), Attribute: Kotlin.createClass(null, null, /** @lends _.net.yested.Attribute.prototype */ { get_262zbl$: function (thisRef, prop) { return (thisRef != null ? thisRef : Kotlin.throwNPE()).element.getAttribute(prop.name); }, set_ujvi5f$: function (thisRef, prop, value) { (thisRef != null ? thisRef : Kotlin.throwNPE()).element.setAttribute(prop.name, value); } }), Component: Kotlin.createTrait(null, /** @lends _.net.yested.Component.prototype */ { clazz: { get: function () { return this.element.getAttribute('class'); }, set: function (value) { this.element.setAttribute('class', value); } } }), ParentComponent: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function (tagName) { this.$element_jz8lgw$ = document.createElement(tagName); this.id$delegate = new _.net.yested.Attribute(); }, /** @lends _.net.yested.ParentComponent.prototype */ { element: { get: function () { return this.$element_jz8lgw$; } }, id: { get: function () { return this.id$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('id')); }, set: function (id) { this.id$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('id'), id); } }, setAttribute_puj7f4$: function (name, value) { this.element.setAttribute(name, value); }, getAttribute_61zpoe$: function (name) { return this.element.getAttribute(name); }, add_5f0h2k$: function (component) { this.element.appendChild(component.element); }, add_61zpoe$: function (text) { this.element.innerHTML = this.element.innerHTML + text; }, removeChild_61zpoe$: function (childElementName) { var child = Kotlin.modules['stdlib'].kotlin.dom.get_first_d3eamn$(this.element.getElementsByTagName(childElementName)); if (child != null) { this.element.removeChild(child); } } }), HTMLParentComponent: Kotlin.createClass(function () { return [_.net.yested.ParentComponent]; }, function $fun(tagName) { $fun.baseInitializer.call(this, tagName); this.role$delegate = new _.net.yested.Attribute(); this.style$delegate = new _.net.yested.Attribute(); }, /** @lends _.net.yested.HTMLParentComponent.prototype */ { role: { get: function () { return this.role$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('role')); }, set: function (role) { this.role$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('role'), role); } }, style: { get: function () { return this.style$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('style')); }, set: function (style) { this.style$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('style'), style); } }, rangeTo_94jgcu$: function ($receiver, value) { this.element.setAttribute($receiver, value); }, plus_pdl1w0$: function ($receiver) { this.add_61zpoe$($receiver); }, plus_pv6laa$: function ($receiver) { this.add_5f0h2k$($receiver); }, add_5f0h2k$: function (component) { _.net.yested.ParentComponent.prototype.add_5f0h2k$.call(this, component); }, add_61zpoe$: function (text) { _.net.yested.ParentComponent.prototype.add_61zpoe$.call(this, text); }, replace_61zpoe$: function (text) { this.element.innerHTML = text; }, replace_5f0h2k$: function (component) { this.element.innerHTML = ''; this.element.appendChild(component.element); }, fade_suy7ya$: function (component, callback) { if (callback === void 0) callback = _.net.yested.HTMLParentComponent.fade_suy7ya$f; $(this.element).fadeOut(200, _.net.yested.HTMLParentComponent.fade_suy7ya$f_0(this, component, callback)); }, onclick: { get: function () { return this.element.onclick; }, set: function (f) { this.element.onclick = f; } }, a_b4th6h$: function (clazz, href, onclick, init) { if (clazz === void 0) clazz = null; if (href === void 0) href = null; if (onclick === void 0) onclick = null; if (init === void 0) init = _.net.yested.HTMLParentComponent.a_b4th6h$f; var anchor = new _.net.yested.Anchor(); if (href != null) { anchor.href = href; } if (onclick != null) { anchor.onclick = onclick; } if (clazz != null) { anchor.clazz = clazz; } init.call(anchor); this.add_5f0h2k$(anchor); }, div_5rsex9$: function (id, clazz, init) { if (id === void 0) id = null; if (clazz === void 0) clazz = ''; var div = new _.net.yested.Div(); init.call(div); div.clazz = clazz; if (id != null) { div.id = id; } this.add_5f0h2k$(div); return div; }, span_dkuwo$: function (clazz, init) { if (clazz === void 0) clazz = null; var span = new _.net.yested.Span(); init.call(span); clazz != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(clazz, _.net.yested.HTMLParentComponent.span_dkuwo$f(clazz, span)) : null; this.add_5f0h2k$(span); return span; }, img_puj7f4$: function (src, alt) { if (alt === void 0) alt = null; this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.Image(), _.net.yested.HTMLParentComponent.img_puj7f4$f(src, alt))); }, p_omdg96$: function (init) { var p = new _.net.yested.P(); init.call(p); this.add_5f0h2k$(p); }, tag_hgkgkc$: function (tagName, init) { var tag = new _.net.yested.HTMLParentComponent(tagName); init.call(tag); this.add_5f0h2k$(tag); return tag; }, table_or8fdg$: function (init) { var table = new _.net.yested.Table(); init.call(table); this.add_5f0h2k$(table); }, button_mqmp2n$: function (label, type, onclick) { if (type === void 0) type = _.net.yested.ButtonType.object.BUTTON; this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Button(type), _.net.yested.HTMLParentComponent.button_mqmp2n$f(label, onclick))); }, code_puj7f4$: function (lang, content) { if (lang === void 0) lang = 'javascript'; this.add_5f0h2k$(this.tag_hgkgkc$('pre', _.net.yested.HTMLParentComponent.code_puj7f4$f(content))); }, ul_8qfrsd$: function (init) { this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.HTMLParentComponent.ul_8qfrsd$f(init))); }, ol_t3splz$: function (init) { this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.OL(), _.net.yested.HTMLParentComponent.ol_t3splz$f(init))); }, dl_79d1z0$: function (init) { this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.DL(), _.net.yested.HTMLParentComponent.dl_79d1z0$f(init))); }, nbsp_za3lpa$: function (times) { var tmp$0; if (times === void 0) times = 1; tmp$0 = Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(new Kotlin.NumberRange(1, times), _.net.yested.HTMLParentComponent.nbsp_za3lpa$f(this)); tmp$0; }, addTag_hgkgkc$: function (tagName, init) { this.add_5f0h2k$(this.tag_hgkgkc$(tagName, _.net.yested.HTMLParentComponent.addTag_hgkgkc$f(init))); }, h1_mfnzi$: function (init) { this.addTag_hgkgkc$('h1', init); }, h2_mfnzi$: function (init) { this.addTag_hgkgkc$('h2', init); }, h3_mfnzi$: function (init) { this.addTag_hgkgkc$('h3', init); }, h4_mfnzi$: function (init) { this.addTag_hgkgkc$('h4', init); }, h5_mfnzi$: function (init) { this.addTag_hgkgkc$('h5', init); }, emph_mfnzi$: function (init) { this.addTag_hgkgkc$('strong', init); }, small_mfnzi$: function (init) { this.addTag_hgkgkc$('small', init); }, mark_mfnzi$: function (init) { this.addTag_hgkgkc$('mark', init); }, del_mfnzi$: function (init) { this.addTag_hgkgkc$('del', init); }, s_mfnzi$: function (init) { this.addTag_hgkgkc$('s', init); }, ins_mfnzi$: function (init) { this.addTag_hgkgkc$('ins', init); }, u_mfnzi$: function (init) { this.addTag_hgkgkc$('u', init); }, strong_mfnzi$: function (init) { this.addTag_hgkgkc$('strong', init); }, em_mfnzi$: function (init) { this.addTag_hgkgkc$('em', init); }, b_mfnzi$: function (init) { this.addTag_hgkgkc$('b', init); }, i_mfnzi$: function (init) { this.addTag_hgkgkc$('i', init); }, kbd_mfnzi$: function (init) { this.addTag_hgkgkc$('kbd', init); }, variable_mfnzi$: function (init) { this.addTag_hgkgkc$('var', init); }, samp_mfnzi$: function (init) { this.addTag_hgkgkc$('samp', init); }, blockquote_mfnzi$: function (init) { this.addTag_hgkgkc$('blockquote', init); }, form_mfnzi$: function (init) { this.addTag_hgkgkc$('form', init); }, textArea_20433s$: function (rows, init) { if (rows === void 0) rows = 3; this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.HTMLParentComponent('textarea'), _.net.yested.HTMLParentComponent.textArea_20433s$f(rows, init))); }, abbr_hgkgkc$: function (title, init) { this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.HTMLParentComponent('abbr'), _.net.yested.HTMLParentComponent.abbr_hgkgkc$f(title, init))); }, br: function () { this.addTag_hgkgkc$('br', _.net.yested.HTMLParentComponent.br$f); }, label_y7cemi$: function (forId, clazz, init) { if (forId === void 0) forId = null; if (clazz === void 0) clazz = null; var l = _.net.yested.with_owvm91$(new _.net.yested.HTMLParentComponent('label'), _.net.yested.HTMLParentComponent.label_y7cemi$f(forId, clazz, init)); this.add_5f0h2k$(l); return l; } }, /** @lends _.net.yested.HTMLParentComponent */ { fade_suy7ya$f: function () { }, fade_suy7ya$f_0: function (this$HTMLParentComponent, component, callback) { return function () { this$HTMLParentComponent.element.innerHTML = ''; this$HTMLParentComponent.element.appendChild(component.element); $(this$HTMLParentComponent.element).fadeIn(200, callback); }; }, a_b4th6h$f: function () { }, span_dkuwo$f: function (clazz, span) { return function (it) { span.clazz = clazz != null ? clazz : Kotlin.throwNPE(); }; }, img_puj7f4$f: function (src, alt) { return function () { this.src = src; this.alt = alt != null ? alt : ''; }; }, button_mqmp2n$f: function (label, onclick) { return function () { label.call(this); this.element.onclick = onclick; }; }, f: function (content) { return function () { this.plus_pdl1w0$(_.net.yested.printMarkup(content)); }; }, code_puj7f4$f: function (content) { return function () { this.tag_hgkgkc$('code', _.net.yested.HTMLParentComponent.f(content)); }; }, ul_8qfrsd$f: function (init) { return function () { init.call(this); }; }, ol_t3splz$f: function (init) { return function () { init.call(this); }; }, dl_79d1z0$f: function (init) { return function () { init.call(this); }; }, nbsp_za3lpa$f: function (this$HTMLParentComponent) { return function (it) { this$HTMLParentComponent.add_61zpoe$('&nbsp;'); }; }, addTag_hgkgkc$f: function (init) { return function () { init.call(this); }; }, textArea_20433s$f: function (rows, init) { return function () { this.setAttribute_puj7f4$('rows', rows.toString()); init.call(this); }; }, abbr_hgkgkc$f: function (title, init) { return function () { this.setAttribute_puj7f4$('title', title); init.call(this); }; }, br$f: function () { }, f_0: function (forId, this$) { return function (it) { this$.rangeTo_94jgcu$('for', forId != null ? forId : Kotlin.throwNPE()); }; }, f_1: function (clazz, this$) { return function (it) { this$.rangeTo_94jgcu$('class', clazz != null ? clazz : Kotlin.throwNPE()); }; }, label_y7cemi$f: function (forId, clazz, init) { return function () { forId != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(forId, _.net.yested.HTMLParentComponent.f_0(forId, this)) : null; clazz != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(clazz, _.net.yested.HTMLParentComponent.f_1(clazz, this)) : null; init.call(this); }; } }), Table: Kotlin.createClass(function () { return [_.net.yested.ParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'table'); this.border$delegate = new _.net.yested.Attribute(); }, /** @lends _.net.yested.Table.prototype */ { border: { get: function () { return this.border$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('border')); }, set: function (border) { this.border$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('border'), border); } }, thead_3ua0vu$: function (init) { var thead = new _.net.yested.THead(); init.call(thead); this.add_5f0h2k$(thead); }, tbody_rj77wk$: function (init) { var tbody = new _.net.yested.TBody(); init.call(tbody); this.add_5f0h2k$(tbody); } }), THead: Kotlin.createClass(function () { return [_.net.yested.ParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'thead'); }, /** @lends _.net.yested.THead.prototype */ { tr_l9w0g6$: function (init) { var tr = new _.net.yested.TRHead(); init.call(tr); this.add_5f0h2k$(tr); } }), TBody: Kotlin.createClass(function () { return [_.net.yested.ParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'tbody'); }, /** @lends _.net.yested.TBody.prototype */ { tr_idqsqk$: function (init) { var tr = new _.net.yested.TRBody(); init.call(tr); this.add_5f0h2k$(tr); } }), TRHead: Kotlin.createClass(function () { return [_.net.yested.ParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'tr'); }, /** @lends _.net.yested.TRHead.prototype */ { th_mfnzi$: function (init) { var th = new _.net.yested.HTMLParentComponent('th'); init.call(th); this.add_5f0h2k$(th); return th; } }), TRBody: Kotlin.createClass(function () { return [_.net.yested.ParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'tr'); }, /** @lends _.net.yested.TRBody.prototype */ { td_mfnzi$: function (init) { var td = new _.net.yested.HTMLParentComponent('td'); init.call(td); this.add_5f0h2k$(td); } }), OL: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'ol'); }, /** @lends _.net.yested.OL.prototype */ { li_8y48wp$: function (init) { var li = new _.net.yested.Li(); init.call(li); this.add_5f0h2k$(li); return li; } }), UL: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'ul'); }, /** @lends _.net.yested.UL.prototype */ { li_8y48wp$: function (init) { var li = new _.net.yested.Li(); init.call(li); this.add_5f0h2k$(li); return li; } }), DL: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'dl'); }, /** @lends _.net.yested.DL.prototype */ { item_b459qs$: function (dt, dd) { this.add_5f0h2k$(this.tag_hgkgkc$('dt', dt)); this.add_5f0h2k$(this.tag_hgkgkc$('dd', dd)); } }), Canvas: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun(width, height) { $fun.baseInitializer.call(this, 'canvas'); this.width = width; this.height = height; this.setAttribute_puj7f4$('width', this.width.toString()); this.setAttribute_puj7f4$('height', this.height.toString()); }, /** @lends _.net.yested.Canvas.prototype */ { getContext_61zpoe$: function (id) { return this.element.getContext(id); } }), Div: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'div'); }), Span: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'span'); }), ButtonType: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { BUTTON: new _.net.yested.ButtonType('button'), SUBMIT: new _.net.yested.ButtonType('submit'), RESET: new _.net.yested.ButtonType('reset') }; }), Button: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun(type) { if (type === void 0) type = _.net.yested.ButtonType.object.BUTTON; $fun.baseInitializer.call(this, 'button'); this.setAttribute_puj7f4$('type', type.code); }), Image: Kotlin.createClass(function () { return [_.net.yested.ParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'img'); this.src$delegate = new _.net.yested.Attribute(); this.alt$delegate = new _.net.yested.Attribute(); }, /** @lends _.net.yested.Image.prototype */ { src: { get: function () { return this.src$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('src')); }, set: function (src) { this.src$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('src'), src); } }, alt: { get: function () { return this.alt$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('alt')); }, set: function (alt) { this.alt$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('alt'), alt); } } }), P: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'p'); }), Li: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'li'); }), Anchor: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'a'); this.href$delegate = new _.net.yested.Attribute(); }, /** @lends _.net.yested.Anchor.prototype */ { href: { get: function () { return this.href$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('href')); }, set: function (href) { this.href$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('href'), href); } } }), div_5rsex9$: function (id, clazz, init) { if (id === void 0) id = null; if (clazz === void 0) clazz = null; var div = new _.net.yested.Div(); init.call(div); if (clazz != null) { div.clazz = clazz; } if (id != null) { div.id = id; } return div; }, thead_3ua0vu$: function (init) { var thead = new _.net.yested.THead(); init.call(thead); return thead; }, tbody_rj77wk$: function (init) { var tbody = new _.net.yested.TBody(); init.call(tbody); return tbody; }, tag_hgkgkc$f: function (init) { return function () { init.call(this); }; }, tag_hgkgkc$: function (tagName, init) { return _.net.yested.with_owvm91$(new _.net.yested.HTMLParentComponent(tagName), _.net.yested.tag_hgkgkc$f(init)); }, text_61zpoe$f: function (text) { return function () { this.plus_pdl1w0$(text); }; }, text_61zpoe$: function (text) { return _.net.yested.text_61zpoe$f(text); }, getHashSplitted: function () { return Kotlin.splitString(window.location.hash, '_'); }, registerHashChangeListener_owl47g$f: function (listener) { return function () { listener(_.net.yested.getHashSplitted()); }; }, registerHashChangeListener_owl47g$: function (runNow, listener) { if (runNow === void 0) runNow = true; $(window).on('hashchange', _.net.yested.registerHashChangeListener_owl47g$f(listener)); if (runNow) { listener(_.net.yested.getHashSplitted()); } }, with_owvm91$: function ($receiver, init) { init.call($receiver); return $receiver; }, el: function (elementId) { return document.getElementById(elementId); }, printMarkup: function (content) { return _.net.yested.replaceAll_ex0kps$(_.net.yested.replaceAll_ex0kps$(content, '<', '&lt;'), '>', '&gt;'); }, bootstrap: Kotlin.definePackage(null, /** @lends _.net.yested.bootstrap */ { enableScrollSpy_61zpoe$: function (id) { $('body').scrollspy(Kotlin.createObject(null, function () { this.target = '#' + id; })); }, AlertStyle: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { SUCCESS: new _.net.yested.bootstrap.AlertStyle('success'), INFO: new _.net.yested.bootstrap.AlertStyle('info'), WARNING: new _.net.yested.bootstrap.AlertStyle('warning'), DANGER: new _.net.yested.bootstrap.AlertStyle('danger') }; }), Alert: Kotlin.createClass(function () { return [_.net.yested.Div]; }, function $fun(style) { $fun.baseInitializer.call(this); this.clazz = 'alert alert-' + style.code; }, /** @lends _.net.yested.bootstrap.Alert.prototype */ { a_b4th6h$: function (clazz, href, onclick, init) { if (clazz === void 0) clazz = null; if (href === void 0) href = null; if (onclick === void 0) onclick = null; if (init === void 0) init = _.net.yested.bootstrap.Alert.a_b4th6h$f; _.net.yested.Div.prototype.a_b4th6h$.call(this, clazz != null ? clazz : 'alert-link', href, onclick, init); } }, /** @lends _.net.yested.bootstrap.Alert */ { a_b4th6h$f: function () { } }), alert$f: function (init) { return function () { init.call(this); }; }, alert: function ($receiver, style, init) { $receiver.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Alert(style), _.net.yested.bootstrap.alert$f(init))); }, Breadcrumbs: Kotlin.createClass(function () { return [_.net.yested.ParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'ol'); this.setAttribute_puj7f4$('class', 'breadcrumb'); }, /** @lends _.net.yested.bootstrap.Breadcrumbs.prototype */ { link: function (href, onclick, init) { if (href === void 0) href = null; if (onclick === void 0) onclick = null; this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Breadcrumbs.link$f(href, onclick, init))); }, selected: function (init) { this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Breadcrumbs.selected$f(init))); } }, /** @lends _.net.yested.bootstrap.Breadcrumbs */ { link$f: function (href, onclick, init) { return function () { this.a_b4th6h$(void 0, href, onclick, init); }; }, selected$f: function (init) { return function () { this.clazz = 'active'; init.call(this); }; } }), breadcrumbs_6bcd71$: function ($receiver, init) { var breadcrumbs = new _.net.yested.bootstrap.Breadcrumbs(); init.call(breadcrumbs); $receiver.add_5f0h2k$(breadcrumbs); return breadcrumbs; }, ButtonGroup: Kotlin.createClass(function () { return [_.net.yested.ParentComponent]; }, function $fun(size, onSelect) { if (size === void 0) size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; if (onSelect === void 0) onSelect = null; $fun.baseInitializer.call(this, 'div'); this.size = size; this.onSelect = onSelect; this.buttons_2b2nvz$ = new Kotlin.DefaultPrimitiveHashMap(); this.setAttribute_puj7f4$('class', 'btn-group'); this.setAttribute_puj7f4$('role', 'group'); this.value = null; }, /** @lends _.net.yested.bootstrap.ButtonGroup.prototype */ { select_61zpoe$: function (selectValue) { var tmp$0, tmp$2; this.value = selectValue; if (this.onSelect != null) { ((tmp$0 = this.onSelect) != null ? tmp$0 : Kotlin.throwNPE())(selectValue); } tmp$2 = Kotlin.modules['stdlib'].kotlin.iterator_acfufl$(this.buttons_2b2nvz$); while (tmp$2.hasNext()) { var tmp$1 = tmp$2.next() , key = Kotlin.modules['stdlib'].kotlin.component1_mxmdx1$(tmp$1) , button = Kotlin.modules['stdlib'].kotlin.component2_mxmdx1$(tmp$1); if (Kotlin.equals(key, selectValue)) { button.active = true; } else { button.active = false; } } }, button_mtl9nq$: function (value, look, label) { if (look === void 0) look = _.net.yested.bootstrap.ButtonLook.object.DEFAULT; var button = new _.net.yested.bootstrap.BtsButton(void 0, label, look, this.size, void 0, _.net.yested.bootstrap.ButtonGroup.button_mtl9nq$f(value, this)); this.add_5f0h2k$(button); this.buttons_2b2nvz$.put_wn2jw4$(value, button); } }, /** @lends _.net.yested.bootstrap.ButtonGroup */ { button_mtl9nq$f: function (value, this$ButtonGroup) { return function () { this$ButtonGroup.select_61zpoe$(value); }; } }), ButtonLook: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { DEFAULT: new _.net.yested.bootstrap.ButtonLook('default'), PRIMARY: new _.net.yested.bootstrap.ButtonLook('primary'), SUCCESS: new _.net.yested.bootstrap.ButtonLook('success'), INFO: new _.net.yested.bootstrap.ButtonLook('info'), WARNING: new _.net.yested.bootstrap.ButtonLook('warning'), DANGER: new _.net.yested.bootstrap.ButtonLook('danger'), LINK: new _.net.yested.bootstrap.ButtonLook('link') }; }), ButtonSize: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { DEFAULT: new _.net.yested.bootstrap.ButtonSize('default'), LARGE: new _.net.yested.bootstrap.ButtonSize('lg'), SMALL: new _.net.yested.bootstrap.ButtonSize('sm'), EXTRA_SMALL: new _.net.yested.bootstrap.ButtonSize('xs') }; }), BtsButton: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun(type, label, look, size, block, onclick) { if (type === void 0) type = _.net.yested.ButtonType.object.BUTTON; if (look === void 0) look = _.net.yested.bootstrap.ButtonLook.object.DEFAULT; if (size === void 0) size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; if (block === void 0) block = false; $fun.baseInitializer.call(this, 'button'); this.look = look; this.size = size; this.block = block; this.buttonActive_nol8t8$ = false; this.setClass(); this.setAttribute_puj7f4$('type', type.code); label.call(this); this.onclick = onclick; }, /** @lends _.net.yested.bootstrap.BtsButton.prototype */ { active: { get: function () { return this.buttonActive_nol8t8$; }, set: function (value) { this.buttonActive_nol8t8$ = value; this.setClass(); } }, disabled: { get: function () { return Kotlin.equals(this.element.getAttribute('disabled'), 'disabled'); }, set: function (value) { this.element.setAttribute('disabled', value ? 'disabled' : ''); } }, setClass: function () { this.setAttribute_puj7f4$('class', 'btn btn-' + this.look.code + ' btn-' + this.size.code + ' ' + (this.block ? 'btn-block' : '') + ' ' + (this.buttonActive_nol8t8$ ? 'active' : '')); } }), BtsAnchor: Kotlin.createClass(function () { return [_.net.yested.Anchor]; }, function $fun(href, look, size, block) { if (look === void 0) look = _.net.yested.bootstrap.ButtonLook.object.DEFAULT; if (size === void 0) size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; if (block === void 0) block = false; $fun.baseInitializer.call(this); this.href = href; this.setAttribute_puj7f4$('class', 'btn btn-' + look.code + ' btn-' + size.code + ' ' + (block ? 'btn-block' : '')); }), btsButton_j2rvkn$: function ($receiver, type, label, look, size, block, onclick) { if (type === void 0) type = _.net.yested.ButtonType.object.BUTTON; if (look === void 0) look = _.net.yested.bootstrap.ButtonLook.object.DEFAULT; if (size === void 0) size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; if (block === void 0) block = false; var btn = new _.net.yested.bootstrap.BtsButton(type, label, look, size, block, onclick); $receiver.add_5f0h2k$(btn); }, btsAnchor_ydi2fr$: function ($receiver, href, look, size, block, init) { if (look === void 0) look = _.net.yested.bootstrap.ButtonLook.object.DEFAULT; if (size === void 0) size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; if (block === void 0) block = false; var btn = new _.net.yested.bootstrap.BtsAnchor(href, look, size, block); init.call(btn); $receiver.add_5f0h2k$(btn); }, Device: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { EXTRA_SMALL: new _.net.yested.bootstrap.Device('xs'), SMALL: new _.net.yested.bootstrap.Device('sm'), MEDIUM: new _.net.yested.bootstrap.Device('md'), LARGER: new _.net.yested.bootstrap.Device('lg') }; }), ColumnModifier: Kotlin.createClass(null, function (size, device, modifierString) { this.size = size; this.device = device; this.modifierString = modifierString; }, /** @lends _.net.yested.bootstrap.ColumnModifier.prototype */ { toString: function () { return 'col-' + this.device.code + this.modifierString + '-' + this.size; } }), DeviceSize: Kotlin.createClass(function () { return [_.net.yested.bootstrap.ColumnModifier]; }, function $fun(size, device) { $fun.baseInitializer.call(this, size, device, ''); }, /** @lends _.net.yested.bootstrap.DeviceSize.prototype */ { copy_sq2403$: function (size, device) { return new _.net.yested.bootstrap.DeviceSize(size, device); } }), Offset: Kotlin.createClass(function () { return [_.net.yested.bootstrap.ColumnModifier]; }, function $fun(size, device) { $fun.baseInitializer.call(this, size, device, '-offset'); }, /** @lends _.net.yested.bootstrap.Offset.prototype */ { copy_sq2403$: function (size, device) { return new _.net.yested.bootstrap.Offset(size, device); } }), ExtraSmall: Kotlin.createClass(function () { return [_.net.yested.bootstrap.DeviceSize]; }, function $fun(size) { $fun.baseInitializer.call(this, size, _.net.yested.bootstrap.Device.object.EXTRA_SMALL); }), Small: Kotlin.createClass(function () { return [_.net.yested.bootstrap.DeviceSize]; }, function $fun(size) { $fun.baseInitializer.call(this, size, _.net.yested.bootstrap.Device.object.SMALL); }), Medium: Kotlin.createClass(function () { return [_.net.yested.bootstrap.DeviceSize]; }, function $fun(size) { $fun.baseInitializer.call(this, size, _.net.yested.bootstrap.Device.object.MEDIUM); }), Larger: Kotlin.createClass(function () { return [_.net.yested.bootstrap.DeviceSize]; }, function $fun(size) { $fun.baseInitializer.call(this, size, _.net.yested.bootstrap.Device.object.LARGER); }), Align: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { LEFT: new _.net.yested.bootstrap.Align('left'), CENTER: new _.net.yested.bootstrap.Align('center'), RIGHT: new _.net.yested.bootstrap.Align('right') }; }), Dialog: Kotlin.createClass(null, function () { this.dialog = null; this.header = null; this.body = null; this.footer = null; }, /** @lends _.net.yested.bootstrap.Dialog.prototype */ { header_1: function (init) { this.header = _.net.yested.div_5rsex9$(void 0, 'modal-header', _.net.yested.bootstrap.Dialog.header_1$f(init)); }, body_1: function (init) { this.body = _.net.yested.div_5rsex9$(void 0, 'modal-body', init); }, footer_1: function (init) { this.footer = _.net.yested.div_5rsex9$(void 0, 'modal-footer', init); }, open: function () { var tmp$0; this.dialog = _.net.yested.div_5rsex9$(void 0, 'modal fade', _.net.yested.bootstrap.Dialog.open$f(this)); $(((tmp$0 = this.dialog) != null ? tmp$0 : Kotlin.throwNPE()).element).modal('show'); }, close: function () { var tmp$0; (tmp$0 = this.dialog) != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(tmp$0, _.net.yested.bootstrap.Dialog.close$f(this)) : null; } }, /** @lends _.net.yested.bootstrap.Dialog */ { f: function () { this.rangeTo_94jgcu$('aria-hidden', 'true'); this.plus_pv6laa$(new _.net.yested.bootstrap.Glyphicon('remove')); }, f_0: function () { this.plus_pdl1w0$('Close'); }, f_1: function () { this.clazz = 'close'; this.rangeTo_94jgcu$('type', 'button'); this.rangeTo_94jgcu$('data-dismiss', 'modal'); this.span_dkuwo$(void 0, _.net.yested.bootstrap.Dialog.f); this.span_dkuwo$('sr-only', _.net.yested.bootstrap.Dialog.f_0); }, f_2: function () { this.clazz = 'modal-title'; }, f_3: function (init) { return function () { init.call(this); }; }, header_1$f: function (init) { return function () { this.tag_hgkgkc$('button', _.net.yested.bootstrap.Dialog.f_1); _.net.yested.with_owvm91$(this.tag_hgkgkc$('h4', _.net.yested.bootstrap.Dialog.f_2), _.net.yested.bootstrap.Dialog.f_3(init)); }; }, f_4: function (this$Dialog, this$) { return function (it) { var tmp$0; this$.plus_pv6laa$((tmp$0 = this$Dialog.footer) != null ? tmp$0 : Kotlin.throwNPE()); }; }, f_5: function (this$Dialog) { return function () { var tmp$0, tmp$1, tmp$2; this.plus_pv6laa$((tmp$0 = this$Dialog.header) != null ? tmp$0 : Kotlin.throwNPE()); this.plus_pv6laa$((tmp$1 = this$Dialog.body) != null ? tmp$1 : Kotlin.throwNPE()); (tmp$2 = this$Dialog.footer) != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(tmp$2, _.net.yested.bootstrap.Dialog.f_4(this$Dialog, this)) : null; }; }, f_6: function (this$Dialog) { return function () { this.div_5rsex9$(void 0, 'modal-content', _.net.yested.bootstrap.Dialog.f_5(this$Dialog)); }; }, open$f: function (this$Dialog) { return function () { this.rangeTo_94jgcu$('aria-hidden', 'true'); this.role = 'dialog'; this.div_5rsex9$(void 0, 'modal-dialog', _.net.yested.bootstrap.Dialog.f_6(this$Dialog)); }; }, close$f: function (this$Dialog) { return function (it) { var tmp$0; $(((tmp$0 = this$Dialog.dialog) != null ? tmp$0 : Kotlin.throwNPE()).element).modal('hide'); }; } }), ValidatorI: Kotlin.createTrait(null), Validator: Kotlin.createClass(function () { return [_.net.yested.bootstrap.ValidatorI]; }, function (inputElement, errorText, validator) { this.inputElement = inputElement; this.$errorText_ydsons$ = errorText; this.validator = validator; this.onChangeListeners_f7f7h9$ = new Kotlin.ArrayList(); this.listen_4abga4$ = false; this.inputElement.addOnChangeListener_qshda6$(_.net.yested.bootstrap.Validator.Validator$f(this)); this.inputElement.addOnChangeLiveListener_qshda6$(_.net.yested.bootstrap.Validator.Validator$f_0(this)); }, /** @lends _.net.yested.bootstrap.Validator.prototype */ { errorText: { get: function () { return this.$errorText_ydsons$; } }, onchange_ra2fzg$: function (invoke) { this.onChangeListeners_f7f7h9$.add_za3rmp$(invoke); }, revalidate: function () { return _.net.yested.with_owvm91$(this.validator(this.inputElement.value), _.net.yested.bootstrap.Validator.revalidate$f(this)); }, isValid: function () { return this.revalidate(); } }, /** @lends _.net.yested.bootstrap.Validator */ { Validator$f: function (this$Validator) { return function () { this$Validator.listen_4abga4$ = true; this$Validator.revalidate(); }; }, Validator$f_0: function (this$Validator) { return function () { if (this$Validator.listen_4abga4$) { this$Validator.revalidate(); } }; }, revalidate$f: function (this$Validator) { return function () { var tmp$0; tmp$0 = this$Validator.onChangeListeners_f7f7h9$.iterator(); while (tmp$0.hasNext()) { var listener = tmp$0.next(); listener(this); } }; } }), Form: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun(labelDef, inputDef) { if (labelDef === void 0) labelDef = 'col-sm-2'; if (inputDef === void 0) inputDef = 'col-sm-10'; $fun.baseInitializer.call(this, 'form'); this.labelDef_hl3t2u$ = labelDef; this.inputDef_mlmxkk$ = inputDef; this.element.setAttribute('class', 'form-horizontal'); this.role = 'form'; this.element.setAttribute('onsubmit', 'return false'); }, /** @lends _.net.yested.bootstrap.Form.prototype */ { item_2xyzwi$: function (forId, label, validator, content) { if (forId === void 0) forId = ''; if (validator === void 0) validator = null; var spanErrMsg = _.net.yested.with_owvm91$(new _.net.yested.Span(), _.net.yested.bootstrap.Form.item_2xyzwi$f); var divInput = _.net.yested.with_owvm91$(this.div_5rsex9$(void 0, this.inputDef_mlmxkk$, content), _.net.yested.bootstrap.Form.item_2xyzwi$f_0(spanErrMsg)); var divFormGroup = this.div_5rsex9$(void 0, 'form-group', _.net.yested.bootstrap.Form.item_2xyzwi$f_1(forId, this, label, divInput)); validator != null ? validator.onchange_ra2fzg$(_.net.yested.bootstrap.Form.item_2xyzwi$f_2(divFormGroup, spanErrMsg, validator)) : null; } }, /** @lends _.net.yested.bootstrap.Form */ { item_2xyzwi$f: function () { this.clazz = 'help-block'; }, item_2xyzwi$f_0: function (spanErrMsg) { return function () { this.plus_pv6laa$(spanErrMsg); }; }, item_2xyzwi$f_1: function (forId, this$Form, label, divInput) { return function () { this.label_y7cemi$(forId, this$Form.labelDef_hl3t2u$ + ' control-label', label); this.plus_pv6laa$(divInput); }; }, item_2xyzwi$f_2: function (divFormGroup, spanErrMsg, validator) { return function (isValid) { divFormGroup.clazz = isValid ? 'form-group' : 'form-group has-error'; spanErrMsg.replace_61zpoe$(isValid ? '' : (validator != null ? validator : Kotlin.throwNPE()).errorText); }; } }), btsForm_nas0k3$: function ($receiver, labelDef, inputDef, init) { if (labelDef === void 0) labelDef = 'col-sm-2'; if (inputDef === void 0) inputDef = 'col-sm-10'; var form = new _.net.yested.bootstrap.Form(labelDef, inputDef); init.call(form); $receiver.add_5f0h2k$(form); }, Glyphicon: Kotlin.createClass(function () { return [_.net.yested.Span]; }, function $fun(icon) { $fun.baseInitializer.call(this); this.clazz = 'glyphicon glyphicon-' + icon; }), glyphicon_a53mlj$: function ($receiver, icon) { var glyphicon = new _.net.yested.bootstrap.Glyphicon(icon); $receiver.add_5f0h2k$(glyphicon); return glyphicon; }, Column: Kotlin.createClass(null, function (label, render, sortFunction, align, defaultSort, defaultSortOrderAsc) { if (align === void 0) align = _.net.yested.bootstrap.Align.object.LEFT; if (defaultSort === void 0) defaultSort = false; if (defaultSortOrderAsc === void 0) defaultSortOrderAsc = true; this.label = label; this.render = render; this.sortFunction = sortFunction; this.align = align; this.defaultSort = defaultSort; this.defaultSortOrderAsc = defaultSortOrderAsc; }, /** @lends _.net.yested.bootstrap.Column.prototype */ { component1: function () { return this.label; }, component2: function () { return this.render; }, component3: function () { return this.sortFunction; }, component4: function () { return this.align; }, component5: function () { return this.defaultSort; }, component6: function () { return this.defaultSortOrderAsc; }, copy_cd4ud1$: function (label, render, sortFunction, align, defaultSort, defaultSortOrderAsc) { return new _.net.yested.bootstrap.Column(label === void 0 ? this.label : label, render === void 0 ? this.render : render, sortFunction === void 0 ? this.sortFunction : sortFunction, align === void 0 ? this.align : align, defaultSort === void 0 ? this.defaultSort : defaultSort, defaultSortOrderAsc === void 0 ? this.defaultSortOrderAsc : defaultSortOrderAsc); }, toString: function () { return 'Column(label=' + Kotlin.toString(this.label) + (', render=' + Kotlin.toString(this.render)) + (', sortFunction=' + Kotlin.toString(this.sortFunction)) + (', align=' + Kotlin.toString(this.align)) + (', defaultSort=' + Kotlin.toString(this.defaultSort)) + (', defaultSortOrderAsc=' + Kotlin.toString(this.defaultSortOrderAsc)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.label) | 0; result = result * 31 + Kotlin.hashCode(this.render) | 0; result = result * 31 + Kotlin.hashCode(this.sortFunction) | 0; result = result * 31 + Kotlin.hashCode(this.align) | 0; result = result * 31 + Kotlin.hashCode(this.defaultSort) | 0; result = result * 31 + Kotlin.hashCode(this.defaultSortOrderAsc) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.label, other.label) && Kotlin.equals(this.render, other.render) && Kotlin.equals(this.sortFunction, other.sortFunction) && Kotlin.equals(this.align, other.align) && Kotlin.equals(this.defaultSort, other.defaultSort) && Kotlin.equals(this.defaultSortOrderAsc, other.defaultSortOrderAsc)))); } }), ColumnHeader: Kotlin.createClass(function () { return [_.net.yested.Span]; }, function $fun(column, sortFunction) { $fun.baseInitializer.call(this); this.column = column; this.sortOrderAsc = this.column.defaultSortOrderAsc; this.arrowPlaceholder = new _.net.yested.Span(); this.setAttribute_puj7f4$('style', 'cursor: pointer;'); this.column.label.call(this); this.plus_pv6laa$(this.arrowPlaceholder); this.onclick = _.net.yested.bootstrap.ColumnHeader.ColumnHeader$f(sortFunction, this); }, /** @lends _.net.yested.bootstrap.ColumnHeader.prototype */ { updateSorting: function (sorteByColumn, sortAscending) { if (!Kotlin.equals(sorteByColumn, this.column)) { this.arrowPlaceholder.replace_61zpoe$(''); } else { this.arrowPlaceholder.replace_5f0h2k$(_.net.yested.bootstrap.glyphicon_a53mlj$(this, 'arrow-' + (sortAscending ? 'up' : 'down'))); } } }, /** @lends _.net.yested.bootstrap.ColumnHeader */ { ColumnHeader$f: function (sortFunction, this$ColumnHeader) { return function () { sortFunction(this$ColumnHeader.column); }; } }), Grid: Kotlin.createClass(function () { return [_.net.yested.ParentComponent]; }, function $fun(columns) { var tmp$0, tmp$1, tmp$2, tmp$3; $fun.baseInitializer.call(this, 'table'); this.columns = columns; this.sortColumn_xix3o5$ = null; this.asc_s2pzui$ = true; this.arrowsPlaceholders_39i6vz$ = new Kotlin.ArrayList(); this.columnHeaders_13ipnd$ = null; this.element.className = 'table table-striped table-hover table-condensed'; tmp$0 = Kotlin.modules['stdlib'].kotlin.map_rie7ol$(this.columns, _.net.yested.bootstrap.Grid.Grid$f(this)); this.columnHeaders_13ipnd$ = tmp$0; this.renderHeader(); tmp$1 = Kotlin.modules['stdlib'].kotlin.filter_dgtl0h$(this.columns, _.net.yested.bootstrap.Grid.Grid$f_0); this.sortColumn_xix3o5$ = Kotlin.modules['stdlib'].kotlin.firstOrNull_ir3nkc$(tmp$1); this.asc_s2pzui$ = (tmp$3 = (tmp$2 = this.sortColumn_xix3o5$) != null ? tmp$2.defaultSortOrderAsc : null) != null ? tmp$3 : true; this.setSortingArrow(); this.dataList_chk18h$ = null; }, /** @lends _.net.yested.bootstrap.Grid.prototype */ { list: { get: function () { return this.dataList_chk18h$; }, set: function (value) { this.dataList_chk18h$ = value; this.displayData(); } }, setSortingArrow: function () { var tmp$0; Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$((tmp$0 = this.columnHeaders_13ipnd$) != null ? tmp$0 : Kotlin.throwNPE(), _.net.yested.bootstrap.Grid.setSortingArrow$f(this)); }, sortByColumn: function (column) { if (Kotlin.equals(column, this.sortColumn_xix3o5$)) { this.asc_s2pzui$ = !this.asc_s2pzui$; } else { this.asc_s2pzui$ = true; this.sortColumn_xix3o5$ = column; } this.displayData(); this.setSortingArrow(); }, renderHeader: function () { this.add_5f0h2k$(_.net.yested.thead_3ua0vu$(_.net.yested.bootstrap.Grid.renderHeader$f(this))); }, sortData: function (toSort) { return Kotlin.modules['stdlib'].kotlin.sortBy_r48qxn$(toSort, _.net.yested.bootstrap.Grid.sortData$f(this)); }, displayData: function () { var tmp$0; this.removeChild_61zpoe$('tbody'); (tmp$0 = this.dataList_chk18h$) != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(tmp$0, _.net.yested.bootstrap.Grid.displayData$f(this)) : null; } }, /** @lends _.net.yested.bootstrap.Grid */ { f: function (this$Grid) { return function (it) { this$Grid.sortByColumn(it); }; }, Grid$f: function (this$Grid) { return function (it) { return new _.net.yested.bootstrap.ColumnHeader(it, _.net.yested.bootstrap.Grid.f(this$Grid)); }; }, Grid$f_0: function (it) { return it.defaultSort; }, setSortingArrow$f: function (this$Grid) { return function (it) { it.updateSorting(this$Grid.sortColumn_xix3o5$, this$Grid.asc_s2pzui$); }; }, f_0: function (columnHeader) { return function () { this.rangeTo_94jgcu$('class', 'text-' + columnHeader.column.align.code); this.plus_pv6laa$(columnHeader); }; }, f_1: function (this$) { return function (columnHeader) { this$.th_mfnzi$(_.net.yested.bootstrap.Grid.f_0(columnHeader)); }; }, f_2: function (this$Grid) { return function () { var tmp$0; Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$((tmp$0 = this$Grid.columnHeaders_13ipnd$) != null ? tmp$0 : Kotlin.throwNPE(), _.net.yested.bootstrap.Grid.f_1(this)); }; }, renderHeader$f: function (this$Grid) { return function () { this.tr_l9w0g6$(_.net.yested.bootstrap.Grid.f_2(this$Grid)); }; }, sortData$f: function (this$Grid) { return Kotlin.createObject(function () { return [Kotlin.Comparator]; }, null, { compare: function (obj1, obj2) { var tmp$0; return ((tmp$0 = this$Grid.sortColumn_xix3o5$) != null ? tmp$0 : Kotlin.throwNPE()).sortFunction(obj1, obj2) * (this$Grid.asc_s2pzui$ ? 1 : -1); } }); }, f_3: function (column, item) { return function () { this.rangeTo_94jgcu$('class', 'text-' + column.align.code); column.render.call(this, item); }; }, f_4: function (item, this$) { return function (column) { this$.td_mfnzi$(_.net.yested.bootstrap.Grid.f_3(column, item)); }; }, f_5: function (this$Grid, item) { return function () { Kotlin.modules['stdlib'].kotlin.forEach_5wd4f$(this$Grid.columns, _.net.yested.bootstrap.Grid.f_4(item, this)); }; }, f_6: function (this$Grid, this$) { return function (item) { this$.tr_idqsqk$(_.net.yested.bootstrap.Grid.f_5(this$Grid, item)); }; }, f_7: function (values, this$Grid) { return function () { Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(values, _.net.yested.bootstrap.Grid.f_6(this$Grid, this)); }; }, displayData$f: function (this$Grid) { return function (it) { var tmp$0, tmp$1; var values = this$Grid.sortColumn_xix3o5$ != null ? this$Grid.sortData((tmp$0 = this$Grid.dataList_chk18h$) != null ? tmp$0 : Kotlin.throwNPE()) : (tmp$1 = this$Grid.dataList_chk18h$) != null ? tmp$1 : Kotlin.throwNPE(); this$Grid.add_5f0h2k$(_.net.yested.tbody_rj77wk$(_.net.yested.bootstrap.Grid.f_7(values, this$Grid))); }; } }), InputElement: Kotlin.createTrait(null), TextInput: Kotlin.createClass(function () { return [_.net.yested.bootstrap.InputElement, _.net.yested.ParentComponent]; }, function $fun(placeholder) { if (placeholder === void 0) placeholder = null; $fun.baseInitializer.call(this, 'input'); this.onChangeListeners_gt5ey6$ = new Kotlin.ArrayList(); this.onChangeLiveListeners_tps6xq$ = new Kotlin.ArrayList(); this.element.setAttribute('class', 'form-control'); this.element.onchange = _.net.yested.bootstrap.TextInput.TextInput$f(this); this.element.onkeyup = _.net.yested.bootstrap.TextInput.TextInput$f_0(this); this.element.setAttribute('type', 'text'); if (placeholder != null) { this.element.setAttribute('placeholder', placeholder); } }, /** @lends _.net.yested.bootstrap.TextInput.prototype */ { value: { get: function () { return this.element.value; }, set: function (value) { this.element.value = value; } }, decorate_6taknv$: function (valid) { this.element.setAttribute('class', valid ? 'form-control' : 'form-control has-error'); }, addOnChangeListener_qshda6$: function (invoke) { this.onChangeListeners_gt5ey6$.add_za3rmp$(invoke); }, addOnChangeLiveListener_qshda6$: function (invoke) { this.onChangeLiveListeners_tps6xq$.add_za3rmp$(invoke); } }, /** @lends _.net.yested.bootstrap.TextInput */ { f: function (it) { it(); }, f_0: function (it) { it(); }, TextInput$f: function (this$TextInput) { return function () { Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this$TextInput.onChangeListeners_gt5ey6$, _.net.yested.bootstrap.TextInput.f); Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this$TextInput.onChangeLiveListeners_tps6xq$, _.net.yested.bootstrap.TextInput.f_0); }; }, f_1: function (it) { it(); }, TextInput$f_0: function (this$TextInput) { return function () { Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this$TextInput.onChangeLiveListeners_tps6xq$, _.net.yested.bootstrap.TextInput.f_1); }; } }), textInput_rha0js$: function ($receiver, placeholder, init) { var textInput = new _.net.yested.bootstrap.TextInput(placeholder); init.call(textInput); $receiver.add_5f0h2k$(textInput); }, CheckBox: Kotlin.createClass(function () { return [_.net.yested.bootstrap.InputElement, _.net.yested.ParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'input'); this.onChangeListeners_o7wbwq$ = new Kotlin.ArrayList(); this.onChangeLiveListeners_6q2boq$ = new Kotlin.ArrayList(); this.setAttribute_puj7f4$('type', 'checkbox'); this.getElement().onchange = _.net.yested.bootstrap.CheckBox.CheckBox$f(this); }, /** @lends _.net.yested.bootstrap.CheckBox.prototype */ { getElement: function () { return this.element; }, value: { get: function () { return this.getElement().checked; }, set: function (value) { this.getElement().checked = value; } }, decorate_6taknv$: function (valid) { }, addOnChangeListener_qshda6$: function (invoke) { this.onChangeListeners_o7wbwq$.add_za3rmp$(invoke); }, addOnChangeLiveListener_qshda6$: function (invoke) { this.onChangeLiveListeners_6q2boq$.add_za3rmp$(invoke); } }, /** @lends _.net.yested.bootstrap.CheckBox */ { f: function (it) { it(); }, f_0: function (it) { it(); }, CheckBox$f: function (this$CheckBox) { return function () { Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this$CheckBox.onChangeListeners_o7wbwq$, _.net.yested.bootstrap.CheckBox.f); Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this$CheckBox.onChangeLiveListeners_6q2boq$, _.net.yested.bootstrap.CheckBox.f_0); }; } }), SelectOption: Kotlin.createClass(null, function (tag, value) { this.tag = tag; this.value = value; }, /** @lends _.net.yested.bootstrap.SelectOption.prototype */ { component1: function () { return this.tag; }, component2: function () { return this.value; }, copy: function (tag, value) { return new _.net.yested.bootstrap.SelectOption(tag === void 0 ? this.tag : tag, value === void 0 ? this.value : value); }, toString: function () { return 'SelectOption(tag=' + Kotlin.toString(this.tag) + (', value=' + Kotlin.toString(this.value)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.tag) | 0; result = result * 31 + Kotlin.hashCode(this.value) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.tag, other.tag) && Kotlin.equals(this.value, other.value)))); } }), Select: Kotlin.createClass(function () { return [_.net.yested.ParentComponent]; }, function $fun(multiple, size, renderer) { if (multiple === void 0) multiple = false; if (size === void 0) size = 1; $fun.baseInitializer.call(this, 'select'); this.renderer = renderer; this.onChangeListeners_ufju29$ = new Kotlin.ArrayList(); this.selectedItemsInt_m31zmd$ = Kotlin.modules['stdlib'].kotlin.listOf(); this.dataInt_w7bdgc$ = null; this.optionTags_gajdrl$ = new Kotlin.ArrayList(); this.element.setAttribute('class', 'form-control'); this.element.setAttribute('size', size.toString()); if (multiple) { this.element.setAttribute('multiple', 'multiple'); } this.element.onchange = _.net.yested.bootstrap.Select.Select$f(this); }, /** @lends _.net.yested.bootstrap.Select.prototype */ { data: { get: function () { return this.dataInt_w7bdgc$; }, set: function (newData) { this.dataInt_w7bdgc$ = newData; this.regenerate(); this.changeSelected(); } }, selectedItems: { get: function () { return this.selectedItemsInt_m31zmd$; }, set: function (newData) { this.selectThese(newData); this.changeSelected(); } }, changeSelected: function () { var tmp$0, tmp$1; tmp$0 = Kotlin.modules['stdlib'].kotlin.filter_azvtw4$(this.optionTags_gajdrl$, _.net.yested.bootstrap.Select.changeSelected$f); tmp$1 = Kotlin.modules['stdlib'].kotlin.map_m3yiqg$(tmp$0, _.net.yested.bootstrap.Select.changeSelected$f_0); this.selectedItemsInt_m31zmd$ = tmp$1; Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this.onChangeListeners_ufju29$, _.net.yested.bootstrap.Select.changeSelected$f_1); }, selectThese: function (selectedItems) { Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this.optionTags_gajdrl$, _.net.yested.bootstrap.Select.selectThese$f(selectedItems)); }, regenerate: function () { var tmp$0; this.element.innerHTML = ''; this.optionTags_gajdrl$ = new Kotlin.ArrayList(); this.selectedItemsInt_m31zmd$ = Kotlin.modules['stdlib'].kotlin.listOf(); if (this.dataInt_w7bdgc$ != null) { (tmp$0 = this.dataInt_w7bdgc$) != null ? Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(tmp$0, _.net.yested.bootstrap.Select.regenerate$f(this)) : null; } }, addOnChangeListener_qshda6$: function (invoke) { this.onChangeListeners_ufju29$.add_za3rmp$(invoke); } }, /** @lends _.net.yested.bootstrap.Select */ { Select$f: function (this$Select) { return function () { this$Select.changeSelected(); }; }, changeSelected$f: function (it) { return it.tag.selected; }, changeSelected$f_0: function (it) { return it.value; }, changeSelected$f_1: function (it) { it(); }, selectThese$f: function (selectedItems) { return function (it) { it.tag.selected = selectedItems.contains_za3rmp$(it.value); }; }, f: function (this$Select, it) { return function () { this.plus_pdl1w0$(this$Select.renderer(it)); }; }, regenerate$f: function (this$Select) { return function (it) { var optionTag = _.net.yested.tag_hgkgkc$('option', _.net.yested.bootstrap.Select.f(this$Select, it)); var value = it; var selectOption = new _.net.yested.bootstrap.SelectOption(optionTag.element, value); this$Select.optionTags_gajdrl$.add_za3rmp$(selectOption); this$Select.add_5f0h2k$(optionTag); }; } }), f: function (prefix) { return function () { this.plus_pdl1w0$(prefix != null ? prefix : Kotlin.throwNPE()); }; }, f_0: function (prefix, this$) { return function (it) { return this$.div_5rsex9$(void 0, 'input-group-addon', _.net.yested.bootstrap.f(prefix)); }; }, f_1: function (suffix) { return function () { this.plus_pdl1w0$(suffix != null ? suffix : Kotlin.throwNPE()); }; }, f_2: function (suffix, this$) { return function (it) { return this$.div_5rsex9$(void 0, 'input-group-addon', _.net.yested.bootstrap.f_1(suffix)); }; }, inputAddOn_lzeodb$f: function (prefix, textInput, suffix) { return function () { prefix != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(prefix, _.net.yested.bootstrap.f_0(prefix, this)) : null; this.plus_pv6laa$(textInput); suffix != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(suffix, _.net.yested.bootstrap.f_2(suffix, this)) : null; }; }, inputAddOn_lzeodb$: function ($receiver, prefix, suffix, textInput) { if (prefix === void 0) prefix = null; if (suffix === void 0) suffix = null; $receiver.add_5f0h2k$($receiver.div_5rsex9$(void 0, 'input-group', _.net.yested.bootstrap.inputAddOn_lzeodb$f(prefix, textInput, suffix))); }, Row: Kotlin.createClass(function () { return [_.net.yested.ParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'div'); this.setAttribute_puj7f4$('class', 'row'); }, /** @lends _.net.yested.bootstrap.Row.prototype */ { col_6i15na$: function (modifiers, init) { this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Row.col_6i15na$f(modifiers, init))); } }, /** @lends _.net.yested.bootstrap.Row */ { f: function (it) { return it.toString(); }, col_6i15na$f: function (modifiers, init) { return function () { this.clazz = Kotlin.modules['stdlib'].kotlin.join_raq5lb$(Kotlin.modules['stdlib'].kotlin.map_rie7ol$(modifiers, _.net.yested.bootstrap.Row.f), ' '); init.call(this); }; } }), Page: Kotlin.createClass(null, function (element) { this.element = element; }, /** @lends _.net.yested.bootstrap.Page.prototype */ { topMenu_tx5hdt$: function (navbar) { this.element.appendChild(navbar.element); }, content_mfnzi$: function (init) { this.element.appendChild(_.net.yested.div_5rsex9$(void 0, void 0, _.net.yested.bootstrap.Page.content_mfnzi$f(init)).element); }, footer_mfnzi$: function (init) { this.element.appendChild(_.net.yested.div_5rsex9$(void 0, void 0, _.net.yested.bootstrap.Page.footer_mfnzi$f(init)).element); } }, /** @lends _.net.yested.bootstrap.Page */ { content_mfnzi$f: function (init) { return function () { this.rangeTo_94jgcu$('class', 'container theme-showcase'); this.rangeTo_94jgcu$('role', 'main'); init.call(this); }; }, f: function () { }, f_0: function (init) { return function () { this.tag_hgkgkc$('hr', _.net.yested.bootstrap.Page.f); init.call(this); }; }, footer_mfnzi$f: function (init) { return function () { this.div_5rsex9$(void 0, 'container', _.net.yested.bootstrap.Page.f_0(init)); }; } }), PageHeader: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'div'); this.clazz = 'page-header'; }), pageHeader_91b1uj$: function ($receiver, init) { var pageHeader = new _.net.yested.bootstrap.PageHeader(); init.call(pageHeader); $receiver.add_5f0h2k$(pageHeader); }, row_siz32v$: function ($receiver, init) { var row = new _.net.yested.bootstrap.Row(); init.call(row); $receiver.add_5f0h2k$(row); return row; }, page_xauh4t$f: function (init) { return function () { init.call(this); }; }, page_xauh4t$: function (placeholderElementId, init) { _.net.yested.with_owvm91$(new _.net.yested.bootstrap.Page(_.net.yested.el(placeholderElementId)), _.net.yested.bootstrap.page_xauh4t$f(init)); }, MediaAlign: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(className) { $fun.baseInitializer.call(this); this.className = className; }, function () { return { Left: new _.net.yested.bootstrap.MediaAlign('pull-left'), Right: new _.net.yested.bootstrap.MediaAlign('pull-right') }; }), MediaBody: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'div'); this.heading_5cm9rd$ = _.net.yested.with_owvm91$(new _.net.yested.HTMLParentComponent('h4'), _.net.yested.bootstrap.MediaBody.MediaBody$f); this.setAttribute_puj7f4$('class', 'media-body'); }, /** @lends _.net.yested.bootstrap.MediaBody.prototype */ { heading_mfnzi$: function (init) { init.call(this.heading_5cm9rd$); this.add_5f0h2k$(this.heading_5cm9rd$); }, content_8cdto9$: function (init) { init.call(this); } }, /** @lends _.net.yested.bootstrap.MediaBody */ { MediaBody$f: function () { this.clazz = 'media-heading'; } }), MediaObject: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun(align) { $fun.baseInitializer.call(this, 'div'); this.media_ni72hk$ = _.net.yested.with_owvm91$(new _.net.yested.Anchor(), _.net.yested.bootstrap.MediaObject.MediaObject$f(align)); this.body_vbc7dq$ = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.MediaBody(), _.net.yested.bootstrap.MediaObject.MediaObject$f_0); this.setAttribute_puj7f4$('class', 'media'); this.add_5f0h2k$(this.media_ni72hk$); this.add_5f0h2k$(this.body_vbc7dq$); }, /** @lends _.net.yested.bootstrap.MediaObject.prototype */ { media_mfnzi$: function (init) { var tmp$0; init.call(this.media_ni72hk$); var childElement = this.media_ni72hk$.element.firstChild; var clazz = (tmp$0 = childElement.getAttribute('class')) != null ? tmp$0 : ''; childElement.setAttribute('class', clazz + ' media-object'); }, content_tq11g4$: function (init) { init.call(this.body_vbc7dq$); } }, /** @lends _.net.yested.bootstrap.MediaObject */ { MediaObject$f: function (align) { return function () { this.clazz = align.className; this.href = '#'; }; }, MediaObject$f_0: function () { } }), mediaObject_xpcv5y$: function ($receiver, align, init) { var mediaObject = new _.net.yested.bootstrap.MediaObject(align); init.call(mediaObject); $receiver.add_5f0h2k$(mediaObject); }, NavbarPosition: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { STATIC_TOP: new _.net.yested.bootstrap.NavbarPosition('static-top'), FIXED_TOP: new _.net.yested.bootstrap.NavbarPosition('fixed-top'), FIXED_BOTTOM: new _.net.yested.bootstrap.NavbarPosition('fixed-bottom') }; }), NavbarLook: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { DEFAULT: new _.net.yested.bootstrap.NavbarLook('default'), INVERSE: new _.net.yested.bootstrap.NavbarLook('inverse') }; }), Navbar: Kotlin.createClass(function () { return [_.net.yested.ParentComponent]; }, function $fun(id, position, look) { if (position === void 0) position = null; if (look === void 0) look = _.net.yested.bootstrap.NavbarLook.object.DEFAULT; $fun.baseInitializer.call(this, 'nav'); this.ul_6lssbo$ = _.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.bootstrap.Navbar.Navbar$f); this.collapsible_lhbokj$ = _.net.yested.div_5rsex9$(id, 'navbar-collapse collapse', _.net.yested.bootstrap.Navbar.Navbar$f_0(this)); this.menuItems_2kpyr8$ = new Kotlin.ArrayList(); this.brandLink_f4xx9w$ = new _.net.yested.Anchor(); this.setAttribute_puj7f4$('class', 'navbar navbar-' + look.code + ' ' + (position != null ? 'navbar-' + position.code : '')); this.setAttribute_puj7f4$('role', 'navigation'); this.add_5f0h2k$(_.net.yested.div_5rsex9$(void 0, 'container', _.net.yested.bootstrap.Navbar.Navbar$f_1(id, this))); }, /** @lends _.net.yested.bootstrap.Navbar.prototype */ { brand_hgkgkc$: function (href, init) { if (href === void 0) href = '/'; this.brandLink_f4xx9w$.href = href; this.brandLink_f4xx9w$.clazz = 'navbar-brand'; this.brandLink_f4xx9w$.replace_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Span(), _.net.yested.bootstrap.Navbar.brand_hgkgkc$f(init))); this.brandLink_f4xx9w$.onclick = _.net.yested.bootstrap.Navbar.brand_hgkgkc$f_0(this); }, item_b1t645$: function (href, onclick, init) { if (href === void 0) href = '#'; if (onclick === void 0) onclick = null; var li = new _.net.yested.Li(); var linkClicked = _.net.yested.bootstrap.Navbar.item_b1t645$linkClicked(this, li, onclick); _.net.yested.with_owvm91$(li, _.net.yested.bootstrap.Navbar.item_b1t645$f(href, linkClicked, init)); this.ul_6lssbo$.add_5f0h2k$(li); this.menuItems_2kpyr8$.add_za3rmp$(li); }, dropdown_vvlqvy$: function (label, init) { var dropdown = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.NavBarDropdown(_.net.yested.bootstrap.Navbar.dropdown_vvlqvy$f(this), label), _.net.yested.bootstrap.Navbar.dropdown_vvlqvy$f_0(init)); this.ul_6lssbo$.add_5f0h2k$(dropdown); this.menuItems_2kpyr8$.add_za3rmp$(dropdown); }, deselectAll: function () { Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this.menuItems_2kpyr8$, _.net.yested.bootstrap.Navbar.deselectAll$f); }, left_oe5uhj$: function (init) { this.collapsible_lhbokj$.add_5f0h2k$(_.net.yested.div_5rsex9$(void 0, 'navbar-left', _.net.yested.bootstrap.Navbar.left_oe5uhj$f(init))); }, right_oe5uhj$: function (init) { this.collapsible_lhbokj$.add_5f0h2k$(_.net.yested.div_5rsex9$(void 0, 'navbar-right', _.net.yested.bootstrap.Navbar.right_oe5uhj$f(init))); } }, /** @lends _.net.yested.bootstrap.Navbar */ { Navbar$f: function () { this.clazz = 'nav navbar-nav'; }, Navbar$f_0: function (this$Navbar) { return function () { this.plus_pv6laa$(this$Navbar.ul_6lssbo$); }; }, f: function () { this.plus_pdl1w0$('Toogle navigation'); }, f_0: function () { }, f_1: function () { }, f_2: function () { }, f_3: function (id) { return function () { this.rangeTo_94jgcu$('type', 'button'); this.rangeTo_94jgcu$('class', 'navbar-toggle collapsed'); this.rangeTo_94jgcu$('data-toggle', 'collapse'); this.rangeTo_94jgcu$('data-target', '#' + id); this.rangeTo_94jgcu$('aria-expanded', 'false'); this.rangeTo_94jgcu$('aria-controls', 'navbar'); this.span_dkuwo$('sr-only', _.net.yested.bootstrap.Navbar.f); this.span_dkuwo$('icon-bar', _.net.yested.bootstrap.Navbar.f_0); this.span_dkuwo$('icon-bar', _.net.yested.bootstrap.Navbar.f_1); this.span_dkuwo$('icon-bar', _.net.yested.bootstrap.Navbar.f_2); }; }, f_4: function (id, this$Navbar) { return function () { this.plus_pv6laa$(this.tag_hgkgkc$('button', _.net.yested.bootstrap.Navbar.f_3(id))); this.plus_pv6laa$(this$Navbar.brandLink_f4xx9w$); }; }, Navbar$f_1: function (id, this$Navbar) { return function () { this.div_5rsex9$(void 0, 'navbar-header', _.net.yested.bootstrap.Navbar.f_4(id, this$Navbar)); this.plus_pv6laa$(this$Navbar.collapsible_lhbokj$); }; }, brand_hgkgkc$f: function (init) { return function () { init.call(this); }; }, brand_hgkgkc$f_0: function (this$Navbar) { return function () { this$Navbar.deselectAll(); }; }, linkClicked$f: function (onclick) { return function (it) { (onclick != null ? onclick : Kotlin.throwNPE())(); }; }, item_b1t645$linkClicked: function (this$Navbar, li, onclick) { return function () { this$Navbar.deselectAll(); li.clazz = 'active'; onclick != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(onclick, _.net.yested.bootstrap.Navbar.linkClicked$f(onclick)) : null; }; }, item_b1t645$f: function (href, linkClicked, init) { return function () { this.a_b4th6h$(void 0, href, linkClicked, init); }; }, dropdown_vvlqvy$f: function (this$Navbar) { return function () { this$Navbar.deselectAll(); }; }, dropdown_vvlqvy$f_0: function (init) { return function () { init.call(this); }; }, deselectAll$f: function (it) { it.clazz = ''; }, left_oe5uhj$f: function (init) { return function () { init.call(this); }; }, right_oe5uhj$f: function (init) { return function () { init.call(this); }; } }), NavBarDropdown: Kotlin.createClass(function () { return [_.net.yested.Li]; }, function $fun(deselectFun, label) { $fun.baseInitializer.call(this); this.deselectFun_qdujve$ = deselectFun; this.ul_e2is7h$ = _.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.bootstrap.NavBarDropdown.NavBarDropdown$f); this.setAttribute_puj7f4$('class', 'dropdown'); this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Anchor(), _.net.yested.bootstrap.NavBarDropdown.NavBarDropdown$f_0(label))); this.add_5f0h2k$(this.ul_e2is7h$); }, /** @lends _.net.yested.bootstrap.NavBarDropdown.prototype */ { selectThis: function () { this.deselectFun_qdujve$(); this.setAttribute_puj7f4$('class', 'dropdown active'); }, item: function (href, onclick, init) { if (href === void 0) href = '#'; if (onclick === void 0) onclick = null; var li = _.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.NavBarDropdown.item$f(href, this, onclick, init)); this.ul_e2is7h$.add_5f0h2k$(li); }, divider: function () { this.ul_e2is7h$.add_5f0h2k$(this.tag_hgkgkc$('li', _.net.yested.bootstrap.NavBarDropdown.divider$f)); } }, /** @lends _.net.yested.bootstrap.NavBarDropdown */ { NavBarDropdown$f: function () { this.rangeTo_94jgcu$('class', 'dropdown-menu'); this.rangeTo_94jgcu$('role', 'menu'); }, f: function () { }, NavBarDropdown$f_0: function (label) { return function () { this.rangeTo_94jgcu$('class', 'dropdown-toggle'); this.rangeTo_94jgcu$('data-toggle', 'dropdown'); this.rangeTo_94jgcu$('role', 'button'); this.rangeTo_94jgcu$('aria-expanded', 'false'); this.href = '#'; label.call(this); this.span_dkuwo$('caret', _.net.yested.bootstrap.NavBarDropdown.f); }; }, f_0: function (this$) { return function (it) { this$.onclick(); }; }, f_1: function (this$NavBarDropdown, onclick, this$) { return function () { this$NavBarDropdown.selectThis(); onclick != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(onclick, _.net.yested.bootstrap.NavBarDropdown.f_0(this$)) : null; }; }, item$f: function (href, this$NavBarDropdown, onclick, init) { return function () { this.a_b4th6h$(void 0, href, _.net.yested.bootstrap.NavBarDropdown.f_1(this$NavBarDropdown, onclick, this), init); }; }, divider$f: function () { this.rangeTo_94jgcu$('class', 'divider'); } }), navbar_58rg2v$f: function (init) { return function () { init.call(this); }; }, navbar_58rg2v$: function ($receiver, id, position, look, init) { if (position === void 0) position = null; if (look === void 0) look = _.net.yested.bootstrap.NavbarLook.object.DEFAULT; $receiver.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Navbar(id, position, look), _.net.yested.bootstrap.navbar_58rg2v$f(init))); }, Pagination: Kotlin.createClass(function () { return [_.net.yested.HTMLParentComponent]; }, function $fun(count, defaultSelection, listener) { if (defaultSelection === void 0) defaultSelection = 1; $fun.baseInitializer.call(this, 'nav'); this.count = count; this.defaultSelection = defaultSelection; this.listener = listener; this.selectedItem_cr0avl$ = this.defaultSelection; this.list_z57r8f$ = _.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.bootstrap.Pagination.Pagination$f); this.items_o2ga03$ = Kotlin.modules['stdlib'].kotlin.arrayListOf_9mqe4v$([]); this.add_5f0h2k$(this.list_z57r8f$); this.replaceItems(); this.redisplay(this.selectedItem_cr0avl$); }, /** @lends _.net.yested.bootstrap.Pagination.prototype */ { selected: { get: function () { return this.selectedItem_cr0avl$; }, set: function (newValue) { this.selectedItem_cr0avl$ = newValue; this.redisplay(this.selectedItem_cr0avl$); } }, replaceItems: function () { this.items_o2ga03$ = this.generateItems(); this.list_z57r8f$.replace_61zpoe$(''); Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this.items_o2ga03$, _.net.yested.bootstrap.Pagination.replaceItems$f(this)); }, generateItems: function () { var tmp$0; var newList = new Kotlin.ArrayList(); newList.add_za3rmp$(_.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Pagination.generateItems$f(this))); tmp$0 = this.count; for (var i = 1; i <= tmp$0; i++) { newList.add_za3rmp$(_.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Pagination.generateItems$f_0(i, this))); } newList.add_za3rmp$(_.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Pagination.generateItems$f_1(this))); return newList; }, backward: function () { if (this.selectedItem_cr0avl$ > 1) { this.selectedItem_cr0avl$--; this.changeSelection(); } }, forward: function () { if (this.selectedItem_cr0avl$ < this.count) { this.selectedItem_cr0avl$++; this.changeSelection(); } }, select: function (newPosition) { if (newPosition !== this.selectedItem_cr0avl$) { this.selectedItem_cr0avl$ = newPosition; this.changeSelection(); } }, changeSelection: function () { this.redisplay(this.selectedItem_cr0avl$); this.listener(this.selectedItem_cr0avl$); }, redisplay: function (position) { var tmp$0; tmp$0 = this.count; for (var i = 1; i <= tmp$0; i++) { this.items_o2ga03$.get_za3lpa$(i).clazz = ''; } this.items_o2ga03$.get_za3lpa$(position).clazz = 'active'; this.items_o2ga03$.get_za3lpa$(0).clazz = position === 1 ? 'disabled' : ''; this.items_o2ga03$.get_za3lpa$(this.items_o2ga03$.size() - 1).clazz = position === this.count ? 'disabled' : ''; } }, /** @lends _.net.yested.bootstrap.Pagination */ { Pagination$f: function () { this.clazz = 'pagination'; }, replaceItems$f: function (this$Pagination) { return function (it) { this$Pagination.list_z57r8f$.add_5f0h2k$(it); }; }, f: function (this$Pagination) { return function () { this$Pagination.backward(); }; }, f_0: function () { this.plus_pdl1w0$('&laquo;'); }, f_1: function () { this.span_dkuwo$(void 0, _.net.yested.bootstrap.Pagination.f_0); }, generateItems$f: function (this$Pagination) { return function () { this.rangeTo_94jgcu$('style', 'cursor: pointer;'); this.a_b4th6h$(void 0, void 0, _.net.yested.bootstrap.Pagination.f(this$Pagination), _.net.yested.bootstrap.Pagination.f_1); }; }, f_2: function (i, this$Pagination) { return function () { this$Pagination.select(i); }; }, f_3: function (i) { return function () { this.plus_pdl1w0$(i.toString()); }; }, f_4: function (i) { return function () { this.rangeTo_94jgcu$('style', 'cursor: pointer;'); this.span_dkuwo$(void 0, _.net.yested.bootstrap.Pagination.f_3(i)); }; }, generateItems$f_0: function (i, this$Pagination) { return function () { this.a_b4th6h$(void 0, void 0, _.net.yested.bootstrap.Pagination.f_2(i, this$Pagination), _.net.yested.bootstrap.Pagination.f_4(i)); }; }, f_5: function (this$Pagination) { return function () { this$Pagination.forward(); }; }, f_6: function () { this.plus_pdl1w0$('&raquo;'); }, f_7: function () { this.span_dkuwo$(void 0, _.net.yested.bootstrap.Pagination.f_6); }, generateItems$f_1: function (this$Pagination) { return function () { this.rangeTo_94jgcu$('style', 'cursor: pointer;'); this.a_b4th6h$(void 0, void 0, _.net.yested.bootstrap.Pagination.f_5(this$Pagination), _.net.yested.bootstrap.Pagination.f_7); }; } }), pagination_kr3wm4$: function ($receiver, count, defaultSelection, listener) { if (defaultSelection === void 0) defaultSelection = 1; $receiver.add_5f0h2k$(new _.net.yested.bootstrap.Pagination(count, defaultSelection, listener)); }, PanelStyle: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { DEFAULT: new _.net.yested.bootstrap.PanelStyle('default'), PRIMARY: new _.net.yested.bootstrap.PanelStyle('primary'), SUCCESS: new _.net.yested.bootstrap.PanelStyle('success'), INFO: new _.net.yested.bootstrap.PanelStyle('info'), WARNING: new _.net.yested.bootstrap.PanelStyle('warning'), DANGER: new _.net.yested.bootstrap.PanelStyle('danger') }; }), Panel: Kotlin.createClass(function () { return [_.net.yested.ParentComponent]; }, function $fun(style) { if (style === void 0) style = _.net.yested.bootstrap.PanelStyle.object.DEFAULT; $fun.baseInitializer.call(this, 'div'); this.heading_6tzak9$ = _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Panel.Panel$f); this.body_fx0fel$ = _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Panel.Panel$f_0); this.footer_qhkwty$ = _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Panel.Panel$f_1); this.setAttribute_puj7f4$('class', 'panel panel-' + style.code); this.add_5f0h2k$(this.heading_6tzak9$); this.add_5f0h2k$(this.body_fx0fel$); }, /** @lends _.net.yested.bootstrap.Panel.prototype */ { heading_mfnzi$: function (init) { init.call(this.heading_6tzak9$); }, content_mfnzi$: function (init) { init.call(this.body_fx0fel$); }, footer_mfnzi$: function (init) { init.call(this.footer_qhkwty$); this.add_5f0h2k$(this.footer_qhkwty$); } }, /** @lends _.net.yested.bootstrap.Panel */ { Panel$f: function () { this.clazz = 'panel-heading'; }, Panel$f_0: function () { this.clazz = 'panel-body'; }, Panel$f_1: function () { this.clazz = 'panel-footer'; } }), panel_azd227$: function ($receiver, style, init) { if (style === void 0) style = _.net.yested.bootstrap.PanelStyle.object.DEFAULT; var panel = new _.net.yested.bootstrap.Panel(style); init.call(panel); $receiver.add_5f0h2k$(panel); }, Tabs: Kotlin.createClass(function () { return [_.net.yested.ParentComponent]; }, function $fun() { $fun.baseInitializer.call(this, 'div'); this.bar_83ssd0$ = _.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.bootstrap.Tabs.Tabs$f); this.content_9tda2$ = _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Tabs.Tabs$f_0); this.anchorsLi_g1z45g$ = new Kotlin.ArrayList(); this.tabsRendered_rgvx82$ = new Kotlin.PrimitiveNumberHashMap(); this.index_nuub59$ = 0; this.element.setAttribute('role', 'tabpanel'); this.add_5f0h2k$(this.bar_83ssd0$); this.add_5f0h2k$(this.content_9tda2$); }, /** @lends _.net.yested.bootstrap.Tabs.prototype */ { renderContent: function (tabId, init) { var tmp$0; if (this.tabsRendered_rgvx82$.containsKey_za3rmp$(tabId)) { return (tmp$0 = this.tabsRendered_rgvx82$.get_za3rmp$(tabId)) != null ? tmp$0 : Kotlin.throwNPE(); } else { var div = _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Tabs.renderContent$f(init)); this.tabsRendered_rgvx82$.put_wn2jw4$(tabId, div); return div; } }, activateTab: function (li, tabId, onSelect, init) { var tmp$0; li.clazz = 'active'; tmp$0 = Kotlin.modules['stdlib'].kotlin.filter_azvtw4$(this.anchorsLi_g1z45g$, _.net.yested.bootstrap.Tabs.activateTab$f(li)); Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(tmp$0, _.net.yested.bootstrap.Tabs.activateTab$f_0); this.content_9tda2$.fade_suy7ya$(this.renderContent(tabId, init)); if (onSelect != null) { onSelect(); } }, tab_jcws7d$: function (active, header, onSelect, init) { if (active === void 0) active = false; if (onSelect === void 0) onSelect = null; var tabId = this.index_nuub59$++; var a = _.net.yested.with_owvm91$(new _.net.yested.Anchor(), _.net.yested.bootstrap.Tabs.tab_jcws7d$f(header)); var li = this.bar_83ssd0$.li_8y48wp$(_.net.yested.bootstrap.Tabs.tab_jcws7d$f_0(a)); a.onclick = _.net.yested.bootstrap.Tabs.tab_jcws7d$f_1(li, tabId, onSelect, init, this); this.bar_83ssd0$.add_5f0h2k$(li); this.anchorsLi_g1z45g$.add_za3rmp$(li); if (active) { this.activateTab(li, tabId, onSelect, init); } } }, /** @lends _.net.yested.bootstrap.Tabs */ { Tabs$f: function () { this.role = 'tablist'; this.clazz = 'nav nav-tabs'; }, Tabs$f_0: function () { this.clazz = 'tab-content'; }, renderContent$f: function (init) { return function () { this.rangeTo_94jgcu$('class', 'fade in'); init.call(this); }; }, activateTab$f: function (li) { return function (it) { return !Kotlin.equals(it, li); }; }, activateTab$f_0: function (it) { it.clazz = ''; }, tab_jcws7d$f: function (header) { return function () { this.rangeTo_94jgcu$('role', 'tab'); this.rangeTo_94jgcu$('style', 'cursor: pointer;'); header.call(this); }; }, tab_jcws7d$f_0: function (a) { return function () { this.plus_pv6laa$(a); this.role = 'presentation'; }; }, tab_jcws7d$f_1: function (li, tabId, onSelect, init, this$Tabs) { return function () { this$Tabs.activateTab(li, tabId, onSelect, init); }; } }), tabs_1nc3b1$: function ($receiver, init) { var tabs = new _.net.yested.bootstrap.Tabs(); init.call(tabs); $receiver.add_5f0h2k$(tabs); }, TextAlign: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(code) { $fun.baseInitializer.call(this); this.code = code; }, function () { return { LEFT: new _.net.yested.bootstrap.TextAlign('left'), CENTER: new _.net.yested.bootstrap.TextAlign('center'), RIGHT: new _.net.yested.bootstrap.TextAlign('right'), JUSTIFY: new _.net.yested.bootstrap.TextAlign('justify'), NOWRAP: new _.net.yested.bootstrap.TextAlign('nowrap') }; }), aligned_fsjrrw$f: function (align, init) { return function () { this.clazz = 'text-' + align.code; init.call(this); }; }, aligned_fsjrrw$: function ($receiver, align, init) { $receiver.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.P(), _.net.yested.bootstrap.aligned_fsjrrw$f(align, init))); }, addSpan$f: function (clazz, init) { return function () { this.clazz = clazz; init.call(this); }; }, addSpan: function (parent, clazz, init) { parent.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Span(), _.net.yested.bootstrap.addSpan$f(clazz, init))); }, uppercase_sxtqq7$: function ($receiver, init) { _.net.yested.bootstrap.addSpan($receiver, 'text-uppercase', init); }, lowercase_sxtqq7$: function ($receiver, init) { _.net.yested.bootstrap.addSpan($receiver, 'text-lowercase', init); }, capitalize_sxtqq7$: function ($receiver, init) { _.net.yested.bootstrap.addSpan($receiver, 'text-capitalize', init); } }), spin: Kotlin.definePackage(null, /** @lends _.net.yested.spin */ { SpinnerOptions: Kotlin.createClass(null, function (lines, length, width, radius, corners, rotate, direction, color, speed, trail, shadow, hwaccel, className, zIndex, top, left) { if (lines === void 0) lines = 13; if (length === void 0) length = 20; if (width === void 0) width = 10; if (radius === void 0) radius = 30; if (corners === void 0) corners = 1; if (rotate === void 0) rotate = 0; if (direction === void 0) direction = 1; if (color === void 0) color = '#000'; if (speed === void 0) speed = 1; if (trail === void 0) trail = 60; if (shadow === void 0) shadow = false; if (hwaccel === void 0) hwaccel = false; if (className === void 0) className = 'spinner'; if (zIndex === void 0) zIndex = 2.0E9; if (top === void 0) top = '50%'; if (left === void 0) left = '50%'; this.lines = lines; this.length = length; this.width = width; this.radius = radius; this.corners = corners; this.rotate = rotate; this.direction = direction; this.color = color; this.speed = speed; this.trail = trail; this.shadow = shadow; this.hwaccel = hwaccel; this.className = className; this.zIndex = zIndex; this.top = top; this.left = left; }, /** @lends _.net.yested.spin.SpinnerOptions.prototype */ { component1: function () { return this.lines; }, component2: function () { return this.length; }, component3: function () { return this.width; }, component4: function () { return this.radius; }, component5: function () { return this.corners; }, component6: function () { return this.rotate; }, component7: function () { return this.direction; }, component8: function () { return this.color; }, component9: function () { return this.speed; }, component10: function () { return this.trail; }, component11: function () { return this.shadow; }, component12: function () { return this.hwaccel; }, component13: function () { return this.className; }, component14: function () { return this.zIndex; }, component15: function () { return this.top; }, component16: function () { return this.left; }, copy: function (lines, length, width, radius, corners, rotate, direction, color, speed, trail, shadow, hwaccel, className, zIndex, top, left) { return new _.net.yested.spin.SpinnerOptions(lines === void 0 ? this.lines : lines, length === void 0 ? this.length : length, width === void 0 ? this.width : width, radius === void 0 ? this.radius : radius, corners === void 0 ? this.corners : corners, rotate === void 0 ? this.rotate : rotate, direction === void 0 ? this.direction : direction, color === void 0 ? this.color : color, speed === void 0 ? this.speed : speed, trail === void 0 ? this.trail : trail, shadow === void 0 ? this.shadow : shadow, hwaccel === void 0 ? this.hwaccel : hwaccel, className === void 0 ? this.className : className, zIndex === void 0 ? this.zIndex : zIndex, top === void 0 ? this.top : top, left === void 0 ? this.left : left); }, toString: function () { return 'SpinnerOptions(lines=' + Kotlin.toString(this.lines) + (', length=' + Kotlin.toString(this.length)) + (', width=' + Kotlin.toString(this.width)) + (', radius=' + Kotlin.toString(this.radius)) + (', corners=' + Kotlin.toString(this.corners)) + (', rotate=' + Kotlin.toString(this.rotate)) + (', direction=' + Kotlin.toString(this.direction)) + (', color=' + Kotlin.toString(this.color)) + (', speed=' + Kotlin.toString(this.speed)) + (', trail=' + Kotlin.toString(this.trail)) + (', shadow=' + Kotlin.toString(this.shadow)) + (', hwaccel=' + Kotlin.toString(this.hwaccel)) + (', className=' + Kotlin.toString(this.className)) + (', zIndex=' + Kotlin.toString(this.zIndex)) + (', top=' + Kotlin.toString(this.top)) + (', left=' + Kotlin.toString(this.left)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.lines) | 0; result = result * 31 + Kotlin.hashCode(this.length) | 0; result = result * 31 + Kotlin.hashCode(this.width) | 0; result = result * 31 + Kotlin.hashCode(this.radius) | 0; result = result * 31 + Kotlin.hashCode(this.corners) | 0; result = result * 31 + Kotlin.hashCode(this.rotate) | 0; result = result * 31 + Kotlin.hashCode(this.direction) | 0; result = result * 31 + Kotlin.hashCode(this.color) | 0; result = result * 31 + Kotlin.hashCode(this.speed) | 0; result = result * 31 + Kotlin.hashCode(this.trail) | 0; result = result * 31 + Kotlin.hashCode(this.shadow) | 0; result = result * 31 + Kotlin.hashCode(this.hwaccel) | 0; result = result * 31 + Kotlin.hashCode(this.className) | 0; result = result * 31 + Kotlin.hashCode(this.zIndex) | 0; result = result * 31 + Kotlin.hashCode(this.top) | 0; result = result * 31 + Kotlin.hashCode(this.left) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.lines, other.lines) && Kotlin.equals(this.length, other.length) && Kotlin.equals(this.width, other.width) && Kotlin.equals(this.radius, other.radius) && Kotlin.equals(this.corners, other.corners) && Kotlin.equals(this.rotate, other.rotate) && Kotlin.equals(this.direction, other.direction) && Kotlin.equals(this.color, other.color) && Kotlin.equals(this.speed, other.speed) && Kotlin.equals(this.trail, other.trail) && Kotlin.equals(this.shadow, other.shadow) && Kotlin.equals(this.hwaccel, other.hwaccel) && Kotlin.equals(this.className, other.className) && Kotlin.equals(this.zIndex, other.zIndex) && Kotlin.equals(this.top, other.top) && Kotlin.equals(this.left, other.left)))); } }), Spinner: Kotlin.createClass(function () { return [_.net.yested.Component]; }, function (options) { if (options === void 0) options = new _.net.yested.spin.SpinnerOptions(); this.options = options; this.jsSpinnerElement_vuqxo$ = new Spinner(this.createOptions()).spin().el; }, /** @lends _.net.yested.spin.Spinner.prototype */ { createOptions: function () { return _.net.yested.spin.Spinner.createOptions$f(this); }, element: { get: function () { return this.jsSpinnerElement_vuqxo$; } } }, /** @lends _.net.yested.spin.Spinner */ { createOptions$f: function (this$Spinner) { return Kotlin.createObject(null, function () { this.lines = this$Spinner.options.lines; this.length = this$Spinner.options.length; this.width = this$Spinner.options.width; this.radius = this$Spinner.options.radius; this.corners = this$Spinner.options.corners; this.rotate = this$Spinner.options.rotate; this.direction = this$Spinner.options.direction; this.color = this$Spinner.options.color; this.speed = this$Spinner.options.speed; this.trail = this$Spinner.options.trail; this.shadow = this$Spinner.options.shadow; this.hwaccel = this$Spinner.options.hwaccel; this.className = this$Spinner.options.className; this.zIndex = this$Spinner.options.zIndex; this.top = this$Spinner.options.top; this.left = this$Spinner.options.left; }); } }), spinner_oyolqv$: function ($receiver, options) { if (options === void 0) options = new _.net.yested.spin.SpinnerOptions(); $receiver.add_5f0h2k$(new _.net.yested.spin.Spinner(options)); } }) }) }), f: function () { this.plus_pdl1w0$('Yested'); }, f_0: function () { this.plus_pdl1w0$('Getting Started'); }, f_1: function () { this.plus_pdl1w0$('Examples'); }, f_2: function () { this.plus_pdl1w0$('Basic HTML'); }, f_3: function () { this.plus_pdl1w0$('Twitter Bootstrap'); }, f_4: function () { this.plus_pdl1w0$('Ajax Call'); }, f_5: function () { this.plus_pdl1w0$('Master/Detail'); }, f_6: function () { this.plus_pdl1w0$('Spinner'); }, f_7: function () { this.item('#html', void 0, _.f_2); this.item('#bootstrapComponents', void 0, _.f_3); this.item('#ajax', void 0, _.f_4); this.item('#masterdetail', void 0, _.f_5); this.item('#spinner', void 0, _.f_6); }, main$f: function () { this.brand_hgkgkc$('#', _.f); this.item_b1t645$('#gettingstarted', void 0, _.f_0); this.dropdown_vvlqvy$(_.f_1, _.f_7); }, main$f_0: function () { }, main$f_1: function (divContainer) { return function (hash) { var tmp$0; tmp$0 = hash[0]; if (tmp$0 === '#' || tmp$0 === '') divContainer.fade_suy7ya$(_.basics.basicPage()); else if (tmp$0 === '#gettingstarted') divContainer.fade_suy7ya$(_.gettingstarted.gettingStartedSection()); else if (tmp$0 === '#html') divContainer.fade_suy7ya$(_.html.htmlPage()); else if (tmp$0 === '#bootstrapComponents') { if (hash.length === 1) { divContainer.fade_suy7ya$(_.bootstrap.bootstrapPage()); } } else if (tmp$0 === '#ajax') divContainer.fade_suy7ya$(_.ajax.ajaxPage()); else if (tmp$0 === '#masterdetail') divContainer.fade_suy7ya$(_.complex.masterDetail()); else if (tmp$0 === '#spinner') divContainer.fade_suy7ya$(_.complex.createSpinner()); }; }, f_8: function (divContainer) { return function () { this.br(); this.br(); this.plus_pv6laa$(divContainer); }; }, f_9: function (divContainer) { return function () { this.div_5rsex9$(void 0, void 0, _.f_8(divContainer)); }; }, f_10: function () { this.plus_pdl1w0$('Contact: '); }, f_11: function () { this.plus_pdl1w0$('[email protected]'); }, f_12: function () { this.emph_mfnzi$(_.f_10); this.a_b4th6h$(void 0, 'mailto:[email protected]', void 0, _.f_11); }, f_13: function () { this.small_mfnzi$(_.f_12); this.br(); this.br(); }, main$f_2: function (navbar, divContainer) { return function () { this.topMenu_tx5hdt$(navbar); this.content_mfnzi$(_.f_9(divContainer)); this.footer_mfnzi$(_.f_13); }; }, main: function (args) { var navbar = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.Navbar('appMenuBar', _.net.yested.bootstrap.NavbarPosition.object.FIXED_TOP, _.net.yested.bootstrap.NavbarLook.object.INVERSE), _.main$f); var divContainer = _.net.yested.div_5rsex9$(void 0, void 0, _.main$f_0); _.net.yested.registerHashChangeListener_owl47g$(void 0, _.main$f_1(divContainer)); _.net.yested.bootstrap.page_xauh4t$('page', _.main$f_2(navbar, divContainer)); }, ajax: Kotlin.definePackage(null, /** @lends _.ajax */ { ajaxPage$f: function () { this.plus_pv6laa$(_.ajax.createAjaxGetSection()); }, ajaxPage: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.ajax.ajaxPage$f); }, createAjaxGetSection$f: function (it) { return it.length > 2; }, f: function () { this.plus_pdl1w0$('Celcius'); }, f_0: function () { this.plus_pdl1w0$('Fahrenheit'); }, createAjaxGetSection$f_0: function () { this.button_mtl9nq$('metric', void 0, _.ajax.f); this.button_mtl9nq$('imperial', void 0, _.ajax.f_0); }, f_1: function (weatherData) { return function () { this.plus_pdl1w0$('Temperature in ' + Kotlin.toString(weatherData.name)); }; }, f_2: function (weatherData) { return function () { var tmp$0; this.plus_pdl1w0$(((tmp$0 = weatherData.main) != null ? tmp$0 : Kotlin.throwNPE()).temp.toString()); }; }, f_3: function (weatherData) { return function () { this.emph_mfnzi$(_.ajax.f_2(weatherData)); }; }, f_4: function (weatherData) { return function () { this.heading_mfnzi$(_.ajax.f_1(weatherData)); this.content_mfnzi$(_.ajax.f_3(weatherData)); }; }, f_5: function () { this.plus_pdl1w0$('Location not found'); }, fetchWeather$f: function (temperatureSpan) { return function (weatherData) { if (weatherData != null && weatherData.main != null) { temperatureSpan.fade_suy7ya$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Panel(_.net.yested.bootstrap.PanelStyle.object.SUCCESS), _.ajax.f_4(weatherData))); } else { temperatureSpan.replace_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Alert(_.net.yested.bootstrap.AlertStyle.object.DANGER), _.ajax.f_5)); } }; }, createAjaxGetSection$fetchWeather: function (validator, textInput, btnGroup, temperatureSpan) { return function () { if (validator.isValid()) { _.net.yested.ajaxGet_435vpa$('http://api.openweathermap.org/data/2.5/weather?q=' + textInput.value + '&units=' + Kotlin.toString(btnGroup.value), _.ajax.fetchWeather$f(temperatureSpan)); } }; }, f_6: function () { this.plus_pdl1w0$('Ajax Get'); }, f_7: function () { this.h3_mfnzi$(_.ajax.f_6); }, f_8: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.ajax.f_7); }, f_9: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.ajax.f_8); }, f_10: function () { this.plus_pdl1w0$('Yested provides JQuery Ajax wrappers:'); this.code_puj7f4$('kotlin', 'ajaxGet&lt;ResponseType&gt;(url) {\n response -> do something with response\n}'); this.br(); this.plus_pdl1w0$('ResponseType is a native trait. It is a special Kotlin interface.\n Kotlin data classes cannot be used here as JQuery returns simple JS object parsed from JSON response.'); this.code_puj7f4$('kotlin', 'native trait Coordinates {\n val lon : Double\n val lat : Double\n}\n'); }, f_11: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.ajax.f_10); }, f_12: function () { this.plus_pdl1w0$('Demo'); }, f_13: function () { this.h4_mfnzi$(_.ajax.f_12); }, f_14: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.ajax.f_13); }, f_15: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.ajax.f_14); }, f_16: function () { this.plus_pdl1w0$('Location'); }, f_17: function (textInput) { return function () { this.plus_pv6laa$(textInput); }; }, f_18: function () { this.plus_pdl1w0$('Units'); }, f_19: function (btnGroup) { return function () { this.plus_pv6laa$(btnGroup); }; }, f_20: function () { }, f_21: function () { this.plus_pdl1w0$('Get Weather'); }, f_22: function (fetchWeather) { return function () { fetchWeather(); }; }, f_23: function (fetchWeather) { return function () { _.net.yested.bootstrap.btsButton_j2rvkn$(this, _.net.yested.ButtonType.object.SUBMIT, _.ajax.f_21, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, void 0, void 0, _.ajax.f_22(fetchWeather)); }; }, f_24: function (validator, textInput, btnGroup, fetchWeather) { return function () { this.item_2xyzwi$(void 0, _.ajax.f_16, validator, _.ajax.f_17(textInput)); this.item_2xyzwi$(void 0, _.ajax.f_18, void 0, _.ajax.f_19(btnGroup)); this.item_2xyzwi$(void 0, _.ajax.f_20, void 0, _.ajax.f_23(fetchWeather)); }; }, f_25: function (validator, textInput, btnGroup, fetchWeather) { return function () { _.net.yested.bootstrap.btsForm_nas0k3$(this, 'col-sm-4', 'col-sm-8', _.ajax.f_24(validator, textInput, btnGroup, fetchWeather)); }; }, f_26: function (temperatureSpan) { return function () { this.plus_pv6laa$(temperatureSpan); }; }, f_27: function (temperatureSpan) { return function () { this.p_omdg96$(_.ajax.f_26(temperatureSpan)); }; }, f_28: function (validator, textInput, btnGroup, fetchWeather, temperatureSpan) { return function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.ajax.f_25(validator, textInput, btnGroup, fetchWeather)); this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.ajax.f_27(temperatureSpan)); }; }, f_29: function () { this.plus_pdl1w0$('Source for demo'); }, f_30: function () { this.h4_mfnzi$(_.ajax.f_29); }, f_31: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.ajax.f_30); this.code_puj7f4$('kotlin', '//definition of response, just fragment\nnative trait Main {\n val temp : Double\n val pressure : Int\n val humidity: Int\n val temp_min : Double\n val temp_max : Double\n}\n\nnative trait WeatherData {\n ...\n val base: String?\n val main : Main?\n val wind : Wind?\n ...\n}\n\n...\nval textInput = TextInput(placeholder = "Type city name and press Enter")\nval validator = Validator(inputElement = textInput, errorText = "Enter at least 3 characters", validator = { it.length() > 2})\nval temperatureSpan = Div()\n\nval btnGroup = ButtonGroup() with {\n button("metric", label = { + "Celcius"})\n button("imperial", label = { + "Fahrenheit"})\n}\nbtnGroup.select("metric")\n\nfun fetchWeather() {\n if (validator.isValid()) {\n ajaxGet&lt;WeatherData&gt;("http://api.openweathermap.org/data/2.5/weather?q=$\\{textInput.value}&units=$\\{btnGroup.value}") {\n weatherData ->\n if (weatherData != null && weatherData.main != null) {\n temperatureSpan.replace(\n Panel(panelStyle = PanelStyle.SUCCESS) with {\n heading { +"Temperature in $\\{weatherData.name}" }\n content { emph { +"$\\{weatherData.main!!.temp}"} }\n })\n } else {\n temperatureSpan.replace("Location not found")\n }\n }\n }\n}\n...\ndiv {\n form(labelDef = "col-sm-4", inputDef = "col-sm-8") {\n item(label = { +"Location"}, validator = validator) {\n +textInput\n }\n item(label = { +"Units"}) {\n +btnGroup\n }\n item(label = { }) {\n btsButton(type = ButtonType.SUBMIT, label = { +"Get Weather"}, look = ButtonLook.PRIMARY) {\n fetchWeather()\n }\n }\n }\n}\n'); }, f_32: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.ajax.f_31); }, createAjaxGetSection$f_1: function (validator, textInput, btnGroup, fetchWeather, temperatureSpan) { return function () { _.net.yested.bootstrap.row_siz32v$(this, _.ajax.f_9); _.net.yested.bootstrap.row_siz32v$(this, _.ajax.f_11); _.net.yested.bootstrap.row_siz32v$(this, _.ajax.f_15); _.net.yested.bootstrap.row_siz32v$(this, _.ajax.f_28(validator, textInput, btnGroup, fetchWeather, temperatureSpan)); _.net.yested.bootstrap.row_siz32v$(this, _.ajax.f_32); }; }, createAjaxGetSection: function () { var textInput = new _.net.yested.bootstrap.TextInput('Type city name and press Enter'); var validator = new _.net.yested.bootstrap.Validator(textInput, 'Enter at least 3 characters', _.ajax.createAjaxGetSection$f); var temperatureSpan = new _.net.yested.Div(); var btnGroup = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.ButtonGroup(), _.ajax.createAjaxGetSection$f_0); btnGroup.select_61zpoe$('metric'); var fetchWeather = _.ajax.createAjaxGetSection$fetchWeather(validator, textInput, btnGroup, temperatureSpan); return _.net.yested.div_5rsex9$(void 0, void 0, _.ajax.createAjaxGetSection$f_1(validator, textInput, btnGroup, fetchWeather, temperatureSpan)); } }), basics: Kotlin.definePackage(function () { this.latestVersion = '0.0.4'; }, /** @lends _.basics */ { f: function () { this.plus_pdl1w0$('What is Yested'); }, f_0: function () { this.h3_mfnzi$(_.basics.f); }, f_1: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.basics.f_0); }, f_2: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.basics.f_1); }, f_3: function () { this.plus_pdl1w0$('Yested is a Kotlin framework for building single-page web applications in Javascript.'); }, f_4: function () { this.plus_pdl1w0$('Check the source code for this site here!'); }, f_5: function () { this.plus_pdl1w0$('This page is developed in Yested framework'); this.br(); this.a_b4th6h$(void 0, 'https://github.com/jean79/yested/tree/master/src/main/docsite', void 0, _.basics.f_4); }, f_6: function () { _.net.yested.bootstrap.alert(this, _.net.yested.bootstrap.AlertStyle.object.SUCCESS, _.basics.f_5); }, f_7: function () { this.plus_pdl1w0$('Main features'); }, f_8: function () { this.plus_pdl1w0$('Strongly typed development of Web applications'); }, f_9: function () { this.plus_pdl1w0$('Minimalistic code'); }, f_10: function () { this.plus_pdl1w0$('DSL for layout construction'); }, f_11: function () { this.plus_pdl1w0$('Debugging within browser'); }, f_12: function () { this.plus_pdl1w0$('Component style of development'); }, f_13: function () { this.plus_pdl1w0$('Simple re-use of 3rd party Javascript libraries'); }, f_14: function () { this.plus_pdl1w0$('Simple creation and re-use of custom components'); }, f_15: function () { this.plus_pdl1w0$('Built-in support for Twitter Bootstrap for a quick start'); }, f_16: function () { this.li_8y48wp$(_.basics.f_8); this.li_8y48wp$(_.basics.f_9); this.li_8y48wp$(_.basics.f_10); this.li_8y48wp$(_.basics.f_11); this.li_8y48wp$(_.basics.f_12); this.li_8y48wp$(_.basics.f_13); this.li_8y48wp$(_.basics.f_14); this.li_8y48wp$(_.basics.f_15); }, f_17: function () { this.h4_mfnzi$(_.basics.f_7); this.ul_8qfrsd$(_.basics.f_16); }, f_18: function () { this.plus_pdl1w0$('What is missing'); }, f_19: function () { this.plus_pdl1w0$('Data binding'); }, f_20: function () { this.plus_pdl1w0$('HTML templates'); }, f_21: function () { this.plus_pdl1w0$("Let's wait for web components to do the difficult job for us. "); this.plus_pdl1w0$('Fortunately DSL way of layout coding is almost as comfortable is HTML coding.'); }, f_22: function () { this.li_8y48wp$(_.basics.f_19); this.li_8y48wp$(_.basics.f_20); this.p_omdg96$(_.basics.f_21); }, f_23: function () { this.h4_mfnzi$(_.basics.f_18); this.ul_8qfrsd$(_.basics.f_22); }, f_24: function () { this.p_omdg96$(_.basics.f_3); this.p_omdg96$(_.basics.f_6); this.p_omdg96$(_.basics.f_17); this.br(); this.p_omdg96$(_.basics.f_23); }, f_25: function () { this.div_5rsex9$(void 0, void 0, _.basics.f_24); }, f_26: function () { this.plus_pdl1w0$('Get on GitHub'); }, f_27: function () { _.net.yested.bootstrap.btsAnchor_ydi2fr$(this, 'https://github.com/jean79/yested', _.net.yested.bootstrap.ButtonLook.object.PRIMARY, _.net.yested.bootstrap.ButtonSize.object.LARGE, void 0, _.basics.f_26); }, f_28: function () { this.plus_pdl1w0$('Binaries: '); }, f_29: function () { this.plus_pdl1w0$('Yested-0.0.4.jar'); }, f_30: function () { this.emph_mfnzi$(_.basics.f_28); this.a_b4th6h$(void 0, 'http://jankovar.net:8081/nexus/content/repositories/releases/net/yested/Yested/0.0.4/Yested-0.0.4.jar', void 0, _.basics.f_29); }, f_31: function () { this.plus_pdl1w0$('Maven Repository'); }, f_32: function () { this.h4_mfnzi$(_.basics.f_31); this.code_puj7f4$('xml', '<repository>\n <id>Yested<\/id>\n <url>http://jankovar.net:8081/nexus/content/repositories/releases/<\/url>\n<\/repository>\n\n<dependency>\n <groupId>net.yested<\/groupId>\n <artifactId>Yested<\/artifactId>\n <version>0.0.4<\/version>\n<\/dependency>\n'); }, f_33: function () { this.p_omdg96$(_.basics.f_27); this.p_omdg96$(_.basics.f_30); this.p_omdg96$(_.basics.f_32); }, f_34: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.basics.f_25); this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.basics.f_33); }, aboutSection$f: function () { _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_2); _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_34); }, aboutSection: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.basics.aboutSection$f); }, basicPage$f: function () { this.plus_pv6laa$(_.basics.aboutSection()); this.plus_pv6laa$(_.basics.kotlinSection()); this.plus_pv6laa$(_.basics.howItWorksSection()); }, basicPage: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.basics.basicPage$f); }, f_35: function () { this.plus_pdl1w0$('Fundamentals of Framework'); }, f_36: function () { this.h3_mfnzi$(_.basics.f_35); }, f_37: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.basics.f_36); }, f_38: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.basics.f_37); }, f_39: function () { this.plus_pdl1w0$('Just a single interface'); }, f_40: function () { this.plus_pdl1w0$('All framework components are just simple wrappers around HTMLElement.<br />\n Then they provide usefull methods for manipulation with HTML. I.e. attribute settings or DOM subtree manipulatio.<br />\n All components have to implement trait (interface) Component.'); }, f_41: function () { this.h4_mfnzi$(_.basics.f_39); this.div_5rsex9$(void 0, void 0, _.basics.f_40); }, f_42: function () { this.nbsp_za3lpa$(); }, f_43: function () { this.h4_mfnzi$(_.basics.f_42); this.code_puj7f4$('kotlin', 'trait Component {\n val element : HTMLElement\n}'); }, f_44: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_41); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_43); }, f_45: function () { this.plus_pdl1w0$('Component creation'); }, f_46: function () { this.plus_pdl1w0$('Typicaly components extend HTMLParentComponent'); }, f_47: function () { this.h4_mfnzi$(_.basics.f_45); this.div_5rsex9$(void 0, void 0, _.basics.f_46); }, f_48: function () { this.nbsp_za3lpa$(); }, f_49: function () { this.h4_mfnzi$(_.basics.f_48); this.code_puj7f4$('kotlin', 'class Anchor() : HTMLParentComponent("a") {\n\n public var href : String by Attribute()\n\n}'); }, f_50: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_47); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_49); }, f_51: function () { this.plus_pdl1w0$('Yested application initialization'); }, f_52: function () { this.plus_pdl1w0$('You need to have a DIV in your html page with id "page". Then Yested app will be renderred into this div using command on the right.'); }, f_53: function () { this.h4_mfnzi$(_.basics.f_51); this.div_5rsex9$(void 0, void 0, _.basics.f_52); }, f_54: function () { this.nbsp_za3lpa$(); }, f_55: function () { this.h4_mfnzi$(_.basics.f_54); this.code_puj7f4$('kotlin', 'page("page") {\n topMenu(navbar)\n content {\n div {\n a(href="http://www.yested.net") { +"Yested homepage" }\n }\n }\n }'); }, f_56: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_53); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_55); }, f_57: function () { this.plus_pdl1w0$('DSL for layout construction'); }, f_58: function () { this.plus_pdl1w0$('To understand the DSL please take look at <a href="http://kotlinlang.org/docs/reference/type-safe-builders.html">Kotlin HTML builder<\/a>.\n Have you got it? Then Yested is written in the same DSL way but each object wraps a single HTML element and manipulates with it in a runtime.\n '); }, f_59: function () { this.h4_mfnzi$(_.basics.f_57); this.div_5rsex9$(void 0, void 0, _.basics.f_58); }, f_60: function () { this.nbsp_za3lpa$(); }, f_61: function () { this.h4_mfnzi$(_.basics.f_60); this.code_puj7f4$('kotlin', 'div {\n p {\n h5 { +"Demo list" }\n ul {\n li { a(href="http://www.yested.net") { +"Yested" } }\n li { emph { +"Bold text" }\n li { colorized(color="#778822") { +"Colorized text" } }\n }\n }\n}'); }, f_62: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_59); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_61); }, howItWorksSection$f: function () { _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_38); _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_44); this.br(); _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_50); this.br(); _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_56); _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_62); }, howItWorksSection: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.basics.howItWorksSection$f); }, f_63: function () { this.plus_pdl1w0$('Kotlin to Javascript Compiler'); }, f_64: function () { this.h3_mfnzi$(_.basics.f_63); }, f_65: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.basics.f_64); }, f_66: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.basics.f_65); }, f_67: function () { this.plus_pdl1w0$('Kotlin'); }, f_68: function () { this.a_b4th6h$(void 0, 'http://kotlinlang.org', void 0, _.basics.f_67); this.plus_pdl1w0$(' is a language created by JetBrains company. It compiles to JVM or to Javascript.'); }, f_69: function () { this.plus_pdl1w0$('Main method (see example on the right) will be executed when HTML page is loaded.\n '); }, f_70: function () { this.plus_pdl1w0$('Kotlin to Javascript compiler allows you to simply call Javascript functions, allowing\n us to create a simple strongly typed wrappers.\n '); }, f_71: function () { this.p_omdg96$(_.basics.f_68); this.p_omdg96$(_.basics.f_69); this.p_omdg96$(_.basics.f_70); }, f_72: function () { this.div_5rsex9$(void 0, void 0, _.basics.f_71); }, f_73: function () { this.plus_pdl1w0$('Simplest Kotlin Code'); }, f_74: function () { this.h4_mfnzi$(_.basics.f_73); this.code_puj7f4$('kotlin', 'fun main(args: Array<String>) {\n println("This will be printed into a Javascript console.")\n}'); }, f_75: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_72); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_74); }, kotlinSection$f: function () { _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_66); _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_75); }, kotlinSection: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.basics.kotlinSection$f); } }), bootstrap: Kotlin.definePackage(null, /** @lends _.bootstrap */ { f: function () { this.plus_pdl1w0$('Twitter Bootstrap wrappers'); }, f_0: function () { this.h3_mfnzi$(_.bootstrap.f); }, f_1: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_0); this.plus_pdl1w0$('Yested Framework provides simple wrappers for some Twitter Boootstrap components.'); }, f_2: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_1); }, f_3: function () { this.plus_pv6laa$(_.bootstrap.createButtons('bootstrapComponents_Buttons')); this.plus_pv6laa$(_.bootstrap.createTypographySection('bootstrapComponents_Typography')); this.plus_pv6laa$(_.bootstrap.buttonGroupsSection('bootstrapComponents_ButtonGroups')); this.plus_pv6laa$(_.bootstrap.createForm('bootstrapComponents_Form')); this.plus_pv6laa$(_.bootstrap.createSelectSection('bootstrapComponents_Select')); this.plus_pv6laa$(_.bootstrap.createInputs('bootstrapComponents_Inputs')); this.plus_pv6laa$(_.bootstrap.createGrid('bootstrapComponents_Grid')); this.plus_pv6laa$(_.bootstrap.createTabs('bootstrapComponents_Tabs')); this.plus_pv6laa$(_.bootstrap.createPanelSection('bootstrapComponents_Panel')); this.plus_pv6laa$(_.bootstrap.createDialogs('bootstrapComponents_Dialogs')); this.plus_pv6laa$(_.bootstrap.createMediaObjectSection('bootstrapComponents_MediaObject')); this.plus_pv6laa$(_.bootstrap.createPaginationSection('bootstrapComponents_Pagination')); this.plus_pv6laa$(_.bootstrap.createNavbarSection('bootstrapComponents_Navbar')); }, f_4: function () { this.plus_pdl1w0$('Buttons'); }, f_5: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Buttons', void 0, _.bootstrap.f_4); this.clazz = 'active'; }, f_6: function () { this.plus_pdl1w0$('Typography'); }, f_7: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Typography', void 0, _.bootstrap.f_6); }, f_8: function () { this.plus_pdl1w0$('Button Group'); }, f_9: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_ButtonGroups', void 0, _.bootstrap.f_8); }, f_10: function () { this.plus_pdl1w0$('Form'); }, f_11: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Form', void 0, _.bootstrap.f_10); }, f_12: function () { this.plus_pdl1w0$('Select'); }, f_13: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Select', void 0, _.bootstrap.f_12); }, f_14: function () { this.plus_pdl1w0$('Text Input with Validation'); }, f_15: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Inputs', void 0, _.bootstrap.f_14); }, f_16: function () { this.plus_pdl1w0$('Grid'); }, f_17: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Grid', void 0, _.bootstrap.f_16); }, f_18: function () { this.plus_pdl1w0$('Tabs'); }, f_19: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Tabs', void 0, _.bootstrap.f_18); }, f_20: function () { this.plus_pdl1w0$('Panels'); }, f_21: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Panel', void 0, _.bootstrap.f_20); }, f_22: function () { this.plus_pdl1w0$('Dialogs'); }, f_23: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Dialogs', void 0, _.bootstrap.f_22); }, f_24: function () { this.plus_pdl1w0$('Media Object'); }, f_25: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_MediaObject', void 0, _.bootstrap.f_24); }, f_26: function () { this.plus_pdl1w0$('Pagination'); }, f_27: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Pagination', void 0, _.bootstrap.f_26); }, f_28: function () { this.plus_pdl1w0$('Navbar'); }, f_29: function () { this.a_b4th6h$(void 0, '#bootstrapComponents_Navbar', void 0, _.bootstrap.f_28); }, f_30: function () { this.clazz = 'nav nav-pills nav-stacked affix'; this.li_8y48wp$(_.bootstrap.f_5); this.li_8y48wp$(_.bootstrap.f_7); this.li_8y48wp$(_.bootstrap.f_9); this.li_8y48wp$(_.bootstrap.f_11); this.li_8y48wp$(_.bootstrap.f_13); this.li_8y48wp$(_.bootstrap.f_15); this.li_8y48wp$(_.bootstrap.f_17); this.li_8y48wp$(_.bootstrap.f_19); this.li_8y48wp$(_.bootstrap.f_21); this.li_8y48wp$(_.bootstrap.f_23); this.li_8y48wp$(_.bootstrap.f_25); this.li_8y48wp$(_.bootstrap.f_27); this.li_8y48wp$(_.bootstrap.f_29); }, f_31: function () { this.id = 'bootstrapNavbar'; this.ul_8qfrsd$(_.bootstrap.f_30); }, f_32: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_31); }, f_33: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(10)], _.bootstrap.f_3); this.col_6i15na$([new _.net.yested.bootstrap.Medium(2)], _.bootstrap.f_32); }, f_34: function (this$) { return function () { _.net.yested.bootstrap.row_siz32v$(this$, _.bootstrap.f_2); _.net.yested.bootstrap.row_siz32v$(this$, _.bootstrap.f_33); }; }, bootstrapPage$f: function () { _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_34(this)); }, bootstrapPage: function () { _.net.yested.bootstrap.enableScrollSpy_61zpoe$('bootstrapNavbar'); return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.bootstrapPage$f); }, buttonGroupsSection$f: function (span) { return function (value) { span.replace_61zpoe$('Selected: ' + value); }; }, f_35: function () { this.plus_pdl1w0$('Option 1'); }, f_36: function () { this.plus_pdl1w0$('Option 2'); }, buttonGroupsSection$f_0: function () { this.button_mtl9nq$('1', void 0, _.bootstrap.f_35); this.button_mtl9nq$('2', void 0, _.bootstrap.f_36); }, f_37: function () { this.plus_pdl1w0$('Button Group'); }, f_38: function () { this.h3_mfnzi$(_.bootstrap.f_37); }, f_39: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_38); }, f_40: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_39); }, f_41: function () { this.plus_pdl1w0$('Refer to Bootstrap buttons groups. Yested version\n in addition offers a way to get selected value (via btnGroup.value)'); }, f_42: function () { this.plus_pdl1w0$('Demo'); }, f_43: function (btnGroup, span) { return function () { this.plus_pv6laa$(btnGroup); this.br(); this.plus_pv6laa$(span); }; }, f_44: function (btnGroup, span) { return function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_41); this.br(); this.h4_mfnzi$(_.bootstrap.f_42); this.div_5rsex9$(void 0, void 0, _.bootstrap.f_43(btnGroup, span)); }; }, f_45: function () { this.plus_pdl1w0$('Code'); }, f_46: function () { this.h4_mfnzi$(_.bootstrap.f_45); this.code_puj7f4$('kotlin', 'val span = Span()\nval btnGroup =\n ButtonGroup(\n size = ButtonSize.DEFAULT,\n onSelect = { value -> span.replace("Selected: $\\{value}")}\n ) with {\n button(value = "1", label = { + "Option 1"})\n button(value = "2", label = { + "Option 2"})\n }'); }, f_47: function (btnGroup, span) { return function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_44(btnGroup, span)); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_46); }; }, buttonGroupsSection$f_1: function (id, btnGroup, span) { return function () { this.id = id; _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_40); _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_47(btnGroup, span)); }; }, buttonGroupsSection: function (id) { var span = new _.net.yested.Span(); var btnGroup = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.ButtonGroup(_.net.yested.bootstrap.ButtonSize.object.DEFAULT, _.bootstrap.buttonGroupsSection$f(span)), _.bootstrap.buttonGroupsSection$f_0); return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.buttonGroupsSection$f_1(id, btnGroup, span)); }, f_48: function () { this.plus_pdl1w0$('Buttons'); }, f_49: function () { this.h3_mfnzi$(_.bootstrap.f_48); }, f_50: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_49); }, f_51: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_50); }, f_52: function () { this.plus_pdl1w0$('\nRefer to Bootstrap buttons.\n'); }, f_53: function () { this.plus_pdl1w0$('Demo'); }, f_54: function () { this.plus_pdl1w0$('Primary'); }, f_55: function () { Kotlin.println('First Button pressed.'); }, f_56: function () { this.plus_pdl1w0$('Success'); }, f_57: function () { Kotlin.println('Second Button pressed.'); }, f_58: function () { _.net.yested.bootstrap.btsButton_j2rvkn$(this, _.net.yested.ButtonType.object.BUTTON, _.bootstrap.f_54, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, _.net.yested.bootstrap.ButtonSize.object.LARGE, void 0, _.bootstrap.f_55); this.nbsp_za3lpa$(); _.net.yested.bootstrap.btsButton_j2rvkn$(this, _.net.yested.ButtonType.object.BUTTON, _.bootstrap.f_56, _.net.yested.bootstrap.ButtonLook.object.SUCCESS, _.net.yested.bootstrap.ButtonSize.object.LARGE, void 0, _.bootstrap.f_57); }, f_59: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_52); this.br(); this.h4_mfnzi$(_.bootstrap.f_53); this.div_5rsex9$(void 0, void 0, _.bootstrap.f_58); }, f_60: function () { this.plus_pdl1w0$('Code'); }, f_61: function () { this.h4_mfnzi$(_.bootstrap.f_60); this.code_puj7f4$('kotlin', 'div {\n btsButton(\n type = ButtonType.BUTTON,\n label = { +"Primary" },\n look = ButtonLook.PRIMARY,\n size = ButtonSize.LARGE,\n onclick = { println("First Button pressed.") })\n nbsp()\n btsButton(\n type = ButtonType.BUTTON,\n label = { +"Success" },\n look = ButtonLook.SUCCESS,\n size = ButtonSize.LARGE,\n onclick = { println("Second Button pressed.") })\n}'); }, f_62: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_59); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_61); }, createButtons$f: function (id) { return function () { this.id = id; _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_51); _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_62); }; }, createButtons: function (id) { return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createButtons$f(id)); }, f_63: function () { this.plus_pdl1w0$('This is dialog with text input'); }, f_64: function () { this.plus_pdl1w0$('Name'); }, f_65: function () { this.id = 'nameId'; }, f_66: function () { _.net.yested.bootstrap.textInput_rha0js$(this, 'Name', _.bootstrap.f_65); }, f_67: function () { this.item_2xyzwi$('nameId', _.bootstrap.f_64, void 0, _.bootstrap.f_66); }, f_68: function () { _.net.yested.bootstrap.btsForm_nas0k3$(this, void 0, void 0, _.bootstrap.f_67); }, f_69: function () { this.plus_pdl1w0$('Submit'); }, f_70: function (dialog) { return function () { dialog.close(); }; }, f_71: function (dialog) { return function () { _.net.yested.bootstrap.btsButton_j2rvkn$(this, _.net.yested.ButtonType.object.SUBMIT, _.bootstrap.f_69, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, void 0, void 0, _.bootstrap.f_70(dialog)); }; }, createDialogs$f: function (dialog) { return function () { this.header_1(_.bootstrap.f_63); this.body_1(_.bootstrap.f_68); this.footer_1(_.bootstrap.f_71(dialog)); }; }, f_72: function () { this.plus_pdl1w0$('Dialogs'); }, f_73: function () { this.h3_mfnzi$(_.bootstrap.f_72); }, f_74: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_73); }, f_75: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_74); }, f_76: function () { this.plus_pdl1w0$('This is a wrapper around Bootstrap dialogs.'); }, f_77: function () { this.plus_pdl1w0$('Demo'); }, f_78: function () { this.plus_pdl1w0$('Open dialog'); }, f_79: function (dialog) { return function () { dialog.open(); }; }, f_80: function (dialog) { return function () { _.net.yested.bootstrap.btsButton_j2rvkn$(this, void 0, _.bootstrap.f_78, void 0, void 0, void 0, _.bootstrap.f_79(dialog)); }; }, f_81: function (dialog) { return function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_76); this.h4_mfnzi$(_.bootstrap.f_77); this.div_5rsex9$(void 0, void 0, _.bootstrap.f_80(dialog)); }; }, f_82: function () { this.plus_pdl1w0$('Code'); }, f_83: function () { this.h4_mfnzi$(_.bootstrap.f_82); this.code_puj7f4$('kotlin', 'val dialog = Dialog()\n\ndialog with {\n header { + "This is dialog with text input" }\n body {\n btsForm {\n item(forId = "nameId", label = { + "Name" }) {\n textInput(placeholder = "Name") { id = "nameId"}\n }\n }\n }\n footer {\n btsButton(\n type = ButtonType.SUBMIT,\n look = ButtonLook.PRIMARY,\n label = { +"Submit"},\n onclick = { dialog.close() })\n\n }\n}\n\n//somewhere in a dom tree:\ndiv {\n btsButton(label = { +"Open dialog" }, onclick = { dialog.open() })\n}'); }, f_84: function (dialog) { return function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_81(dialog)); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_83); }; }, createDialogs$f_0: function (id, dialog) { return function () { this.id = id; _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_75); _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_84(dialog)); }; }, createDialogs: function (id) { var dialog = new _.net.yested.bootstrap.Dialog(); _.net.yested.with_owvm91$(dialog, _.bootstrap.createDialogs$f(dialog)); return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createDialogs$f_0(id, dialog)); }, f_85: function () { this.plus_pdl1w0$('Form'); }, f_86: function () { this.h3_mfnzi$(_.bootstrap.f_85); }, f_87: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_86); }, f_88: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_87); }, f_89: function () { this.plus_pdl1w0$('\n'); }, f_90: function () { this.plus_pdl1w0$('Demo'); }, f_91: function () { this.plus_pdl1w0$('Username'); }, f_92: function () { }, f_93: function () { _.net.yested.bootstrap.textInput_rha0js$(this, 'Enter your username', _.bootstrap.f_92); }, f_94: function () { this.plus_pdl1w0$('Salary'); }, f_95: function () { _.net.yested.bootstrap.inputAddOn_lzeodb$(this, '$', '.00', new _.net.yested.bootstrap.TextInput('Your expectation')); }, f_96: function () { this.item_2xyzwi$(void 0, _.bootstrap.f_91, void 0, _.bootstrap.f_93); this.item_2xyzwi$(void 0, _.bootstrap.f_94, void 0, _.bootstrap.f_95); }, f_97: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_89); this.br(); this.h4_mfnzi$(_.bootstrap.f_90); _.net.yested.bootstrap.btsForm_nas0k3$(this, 'col-sm-4', 'col-sm-8', _.bootstrap.f_96); }, f_98: function () { this.plus_pdl1w0$('Code'); }, f_99: function () { this.h4_mfnzi$(_.bootstrap.f_98); this.code_puj7f4$('kotlin', 'btsForm(labelDef = "col-sm-4", inputDef = "col-sm-8") {\n item(label = { +"Username"}) {\n textInput(placeholder = "Enter your username") { }\n }\n item(label = { +"Salary" }) {\n inputAddOn(prefix = "$", suffix = ".00", textInput = TextInput(placeholder = "Your expectation") )\n }\n}'); }, f_100: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_97); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_99); }, createForm$f: function (id) { return function () { this.id = id; _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_88); _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_100); }; }, createForm: function (id) { return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createForm$f(id)); }, Person: Kotlin.createClass(null, function (name, age) { this.name = name; this.age = age; }, /** @lends _.bootstrap.Person.prototype */ { component1: function () { return this.name; }, component2: function () { return this.age; }, copy: function (name, age) { return new _.bootstrap.Person(name === void 0 ? this.name : name, age === void 0 ? this.age : age); }, toString: function () { return 'Person(name=' + Kotlin.toString(this.name) + (', age=' + Kotlin.toString(this.age)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.name) | 0; result = result * 31 + Kotlin.hashCode(this.age) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.name, other.name) && Kotlin.equals(this.age, other.age)))); } }), compareBy$f: function (get) { return function (l, r) { return Kotlin.modules['stdlib'].kotlin.compareValues_cj5vqg$(get(l), get(r)); }; }, compareBy: function (get) { return _.bootstrap.compareBy$f(get); }, createGrid$f: function (it) { this.plus_pdl1w0$(it.name); }, createGrid$f_0: function (l, r) { return Kotlin.modules['stdlib'].kotlin.compareValues_cj5vqg$(l.name, r.name); }, createGrid$f_1: function (it) { this.plus_pdl1w0$(it.age.toString()); }, createGrid$f_2: function (it) { return it.age; }, f_101: function () { this.plus_pdl1w0$('Grid'); }, f_102: function () { this.h3_mfnzi$(_.bootstrap.f_101); }, f_103: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_102); }, f_104: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_103); }, f_105: function () { this.plus_pdl1w0$('\nGrid is simply a renderred HTML Table element. It is not suitable for too many rows.\n'); }, f_106: function () { this.plus_pdl1w0$('Demo'); }, f_107: function (grid) { return function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_105); this.br(); this.h4_mfnzi$(_.bootstrap.f_106); this.plus_pv6laa$(grid); }; }, f_108: function () { this.plus_pdl1w0$('Code'); }, f_109: function () { this.h4_mfnzi$(_.bootstrap.f_108); this.code_puj7f4$('kotlin', 'data class Person(val name:String, val age:Int)\nval data = listOf(Person("Jan", 15), Person("Peter", 30), Person("Martin", 31))\n\nval grid = Grid(columns = array(\n Column(\n label = text("Name"),\n render = { +it.name },\n sortFunction = {(l,r) -> compareValues(l.name, r.name)}),\n Column(\n label = text("Age "),\n render = { +"\\$\\{it.age}" },\n sortFunction = compareBy<Person,Int> { it.age },\n defaultSort = true,\n defaultSortOrderAsc = true)\n))\n\ngrid.list = data;\n'); }, f_110: function (grid) { return function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_107(grid)); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_109); }; }, createGrid$f_3: function (id, grid) { return function () { this.id = id; _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_104); _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_110(grid)); }; }, createGrid: function (id) { var data = Kotlin.modules['stdlib'].kotlin.listOf_9mqe4v$([new _.bootstrap.Person('Jan', 15), new _.bootstrap.Person('Peter', 30), new _.bootstrap.Person('Martin', 31)]); var grid = new _.net.yested.bootstrap.Grid([new _.net.yested.bootstrap.Column(_.net.yested.text_61zpoe$('Name'), _.bootstrap.createGrid$f, _.bootstrap.createGrid$f_0), new _.net.yested.bootstrap.Column(_.net.yested.text_61zpoe$('Age '), _.bootstrap.createGrid$f_1, _.bootstrap.compareBy(_.bootstrap.createGrid$f_2), void 0, true, true)]); grid.list = data; return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createGrid$f_3(id, grid)); }, createInputs$f: function (value) { return value.length > 2; }, createInputs$submit: function (validator) { return function () { if (validator.isValid()) { Kotlin.println('submit'); } }; }, createInputs$f_0: function () { this.plus_pdl1w0$('Send'); }, f_111: function () { this.plus_pdl1w0$('Text Input with Validation'); }, f_112: function () { this.h3_mfnzi$(_.bootstrap.f_111); }, f_113: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_112); }, f_114: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_113); }, f_115: function () { this.plus_pdl1w0$('\nThis example demonstrates simple text input with custom validation.\nPlease note that validator is also attached to form item.\n'); }, f_116: function () { this.plus_pdl1w0$('Demo'); }, f_117: function () { this.plus_pdl1w0$('Name'); }, f_118: function (textInput) { return function () { this.plus_pv6laa$(textInput); }; }, f_119: function () { }, f_120: function (button) { return function () { this.plus_pv6laa$(button); }; }, f_121: function (validator, textInput, button) { return function () { this.item_2xyzwi$(void 0, _.bootstrap.f_117, validator, _.bootstrap.f_118(textInput)); this.item_2xyzwi$(void 0, _.bootstrap.f_119, void 0, _.bootstrap.f_120(button)); }; }, f_122: function (validator, textInput, button) { return function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_115); this.br(); this.h4_mfnzi$(_.bootstrap.f_116); _.net.yested.bootstrap.btsForm_nas0k3$(this, 'col-sm-3', 'col-sm-9', _.bootstrap.f_121(validator, textInput, button)); }; }, f_123: function () { this.plus_pdl1w0$('Code'); }, f_124: function () { this.h4_mfnzi$(_.bootstrap.f_123); this.code_puj7f4$('kotlin', 'val textInput = TextInput(placeholder = "Mandatory field")\n\nval validator = Validator(textInput, errorText = "At least 3 chars!!") { value -> value.size > 2 }\n\nfun submit() {\n if (validator.isValid()) {\n println("submit")\n }\n}\n\nval button = BtsButton(label = { +"Send"}, onclick = ::submit)\n\nform(labelDef = "col-sm-3", inputDef = "col-sm-9") {\n item(label = { +"Name"}, validator = validator) {\n +textInput\n }\n item(label = {}) {\n +button\n }\n}\n'); }, f_125: function (validator, textInput, button) { return function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_122(validator, textInput, button)); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_124); }; }, createInputs$f_1: function (id, validator, textInput, button) { return function () { this.id = id; _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_114); _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_125(validator, textInput, button)); }; }, createInputs: function (id) { var textInput = new _.net.yested.bootstrap.TextInput('Mandatory field'); var validator = new _.net.yested.bootstrap.Validator(textInput, 'At least 3 chars!!', _.bootstrap.createInputs$f); var submit = _.bootstrap.createInputs$submit(validator); var button = new _.net.yested.bootstrap.BtsButton(void 0, _.bootstrap.createInputs$f_0, void 0, void 0, void 0, submit); return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createInputs$f_1(id, validator, textInput, button)); }, f_126: function () { this.plus_pdl1w0$('Media Object'); }, f_127: function () { this.h3_mfnzi$(_.bootstrap.f_126); }, f_128: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_127); }, f_129: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_128); }, f_130: function () { this.plus_pdl1w0$('Media object is used for creating components that should contain left- or rightaligned\n\t\t\t\t\t\tmedia (image, video, or audio) alongside some textual content. It is best\n\t\t\t\t\t\tsuited for creating features such as a comments section, displaying tweets, or\n\t\t\t\t\t\tshowing product details where a product image is present.'); }, f_131: function () { this.plus_pdl1w0$('Demo'); }, f_132: function () { this.img_puj7f4$('demo-site/img/leaf.gif'); }, f_133: function () { this.plus_pdl1w0$('Media Object'); }, f_134: function () { this.plus_pdl1w0$('Media object is used for creating components that should contain left- or rightaligned\n\t\t\t\t\t\t\tmedia (image, video, or audio) alongside some textual content. It is best\n\t\t\t\t\t\t\tsuited for creating features such as a comments section, displaying tweets, or\n\t\t\t\t\t\t\tshowing product details where a product image is present.'); }, f_135: function () { this.img_puj7f4$('demo-site/img/leaf.gif'); }, f_136: function () { this.plus_pdl1w0$('Nested Media Object'); }, f_137: function () { this.plus_pdl1w0$(' Nested Text'); }, f_138: function (this$) { return function () { this$.p_omdg96$(_.bootstrap.f_137); }; }, f_139: function () { this.heading_mfnzi$(_.bootstrap.f_136); this.content_8cdto9$(_.bootstrap.f_138(this)); }, f_140: function () { this.media_mfnzi$(_.bootstrap.f_135); this.content_tq11g4$(_.bootstrap.f_139); }, f_141: function (this$) { return function () { this$.p_omdg96$(_.bootstrap.f_134); _.net.yested.bootstrap.mediaObject_xpcv5y$(this$, _.net.yested.bootstrap.MediaAlign.object.Left, _.bootstrap.f_140); }; }, f_142: function () { this.heading_mfnzi$(_.bootstrap.f_133); this.content_8cdto9$(_.bootstrap.f_141(this)); }, f_143: function () { this.media_mfnzi$(_.bootstrap.f_132); this.content_tq11g4$(_.bootstrap.f_142); }, f_144: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_130); this.br(); this.h4_mfnzi$(_.bootstrap.f_131); _.net.yested.bootstrap.mediaObject_xpcv5y$(this, _.net.yested.bootstrap.MediaAlign.object.Left, _.bootstrap.f_143); }, f_145: function () { this.plus_pdl1w0$('Code'); }, f_146: function () { this.h4_mfnzi$(_.bootstrap.f_145); this.code_puj7f4$('kotlin', '\nmediaObject(MediaAlign.Left) {\n\tmedia {\n\t\timg(src = "demo-site/img/leaf.gif")\n\t}\n\tcontent {\n\t\theading {\n\t\t\t+ "Media Object"\n\t\t}\n\t\tcontent {\n\t\t\t+ p { "Media object is used ..." }\n\t\t\tmediaObject(MediaAlign.Left) {\n\t\t\t\tmedia {\n\t\t\t\t\timg(src = "demo-site/img/leaf.gif")\n\t\t\t\t}\n\t\t\t\tcontent {\n\t\t\t\t\theading {\n\t\t\t\t\t\t+ "Nested Media Object"\n\t\t\t\t\t}\n\t\t\t\t\tcontent {\n\t\t\t\t\t\t+ p { "Nested Text" }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\t\t\t\t'); }, f_147: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_144); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_146); }, createMediaObjectSection$f: function (id) { return function () { this.id = id; _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_129); _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_147); }; }, createMediaObjectSection: function (id) { return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createMediaObjectSection$f(id)); }, f_148: function () { this.plus_pdl1w0$('Navbar'); }, f_149: function () { this.h3_mfnzi$(_.bootstrap.f_148); }, f_150: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_149); }, f_151: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_150); }, f_152: function () { this.plus_pdl1w0$('http://getbootstrap.com/components/#navbar'); }, f_153: function () { this.plus_pdl1w0$('Features:'); }, f_154: function () { this.plus_pdl1w0$('Navbar collapses on mobile screens.'); }, f_155: function () { this.plus_pdl1w0$('Once clicked on menu item, it stays selected.'); }, f_156: function () { this.plus_pdl1w0$('You can set hrefs of menu items or capture onclick events.'); }, f_157: function () { this.li_8y48wp$(_.bootstrap.f_154); this.li_8y48wp$(_.bootstrap.f_155); this.li_8y48wp$(_.bootstrap.f_156); }, f_158: function () { this.plus_pdl1w0$('Please note!'); }, f_159: function () { this.plus_pdl1w0$('Set correct Bootrsap classes to forms/text you use in header (see in the example below)'); }, f_160: function () { this.plus_pdl1w0$('Keep the order of the elements as specified by Bootstrap'); }, f_161: function () { this.plus_pdl1w0$('Set different IDs if you have multiple navbars in one application'); }, f_162: function () { this.li_8y48wp$(_.bootstrap.f_159); this.li_8y48wp$(_.bootstrap.f_160); this.li_8y48wp$(_.bootstrap.f_161); }, f_163: function () { this.plus_pdl1w0$('Complete implementation of Twitter Bootstrap Navbar. Please see: '); this.a_b4th6h$(void 0, 'http://getbootstrap.com/components/#navbar', void 0, _.bootstrap.f_152); this.br(); this.br(); this.emph_mfnzi$(_.bootstrap.f_153); this.ul_8qfrsd$(_.bootstrap.f_157); this.br(); this.emph_mfnzi$(_.bootstrap.f_158); this.ul_8qfrsd$(_.bootstrap.f_162); this.br(); }, f_164: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_163); }, f_165: function () { this.plus_pdl1w0$("Navbar Positions (parameter 'position'):"); }, f_166: function () { this.plus_pdl1w0$('Empty - Navbar will render in the current element'); }, f_167: function () { this.plus_pdl1w0$('FIXED_TOP - Navbar will be at the top and always visible'); }, f_168: function () { this.plus_pdl1w0$('FIXED_BOTTOM - Navbar will be at the bottom and always visiblet'); }, f_169: function () { this.plus_pdl1w0$('STATIC_TOP - Navbar will be at the top and will scroll out'); }, f_170: function () { this.li_8y48wp$(_.bootstrap.f_166); this.li_8y48wp$(_.bootstrap.f_167); this.li_8y48wp$(_.bootstrap.f_168); this.li_8y48wp$(_.bootstrap.f_169); }, f_171: function () { this.plus_pdl1w0$("Navbar Look (parameter 'look'):"); }, f_172: function () { this.plus_pdl1w0$('DEFAULT - Default look (light)'); }, f_173: function () { this.plus_pdl1w0$('INVERSE - Inversed colours (dark)'); }, f_174: function () { this.li_8y48wp$(_.bootstrap.f_172); this.li_8y48wp$(_.bootstrap.f_173); }, f_175: function () { this.plus_pdl1w0$('Navbar features (DSL functions):'); }, f_176: function () { this.plus_pdl1w0$('brand - Page title/logo (Anchor) (optional, once)'); }, f_177: function () { this.plus_pdl1w0$('item - Top menu item (Anchor) (optional, many times)'); }, f_178: function () { this.plus_pdl1w0$('dropdown - Top menu item (Anchor) (optional, many times)'); }, f_179: function () { this.plus_pdl1w0$('left - Content will be position on the left (after last menu link)'); }, f_180: function () { this.plus_pdl1w0$('right - Content will be position on the right'); }, f_181: function () { this.li_8y48wp$(_.bootstrap.f_176); this.li_8y48wp$(_.bootstrap.f_177); this.li_8y48wp$(_.bootstrap.f_178); this.li_8y48wp$(_.bootstrap.f_179); this.li_8y48wp$(_.bootstrap.f_180); }, f_182: function () { this.emph_mfnzi$(_.bootstrap.f_165); this.ul_8qfrsd$(_.bootstrap.f_170); this.br(); this.emph_mfnzi$(_.bootstrap.f_171); this.ul_8qfrsd$(_.bootstrap.f_174); this.br(); this.emph_mfnzi$(_.bootstrap.f_175); this.ul_8qfrsd$(_.bootstrap.f_181); }, f_183: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_182); }, f_184: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.bootstrap.f_164); this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.bootstrap.f_183); }, f_185: function () { this.plus_pdl1w0$('Demo'); }, f_186: function () { _.net.yested.bootstrap.glyphicon_a53mlj$(this, 'home'); this.nbsp_za3lpa$(); this.plus_pdl1w0$('Home'); }, f_187: function () { this.plus_pdl1w0$('Some Link 1'); }, f_188: function () { Kotlin.println('clicked'); }, f_189: function () { this.plus_pdl1w0$('Some Link 2'); }, f_190: function () { this.plus_pdl1w0$('Dropdown'); }, f_191: function () { Kotlin.println('clicked'); }, f_192: function () { this.plus_pdl1w0$('Link 1'); }, f_193: function () { Kotlin.println('clicked'); }, f_194: function () { this.plus_pdl1w0$('Link 2'); }, f_195: function () { Kotlin.println('clicked'); }, f_196: function () { this.plus_pdl1w0$('Link 3'); }, f_197: function () { this.item('#bootstrapComponents', _.bootstrap.f_191, _.bootstrap.f_192); this.item('#bootstrapComponents', _.bootstrap.f_193, _.bootstrap.f_194); this.divider(); this.item('#bootstrapComponents', _.bootstrap.f_195, _.bootstrap.f_196); }, f_198: function () { }, f_199: function () { _.net.yested.bootstrap.textInput_rha0js$(this, 'username', _.bootstrap.f_198); }, f_200: function () { this.plus_pdl1w0$('Login'); }, f_201: function () { }, f_202: function () { this.rangeTo_94jgcu$('class', 'navbar-form'); this.div_5rsex9$(void 0, 'form-group', _.bootstrap.f_199); _.net.yested.bootstrap.btsButton_j2rvkn$(this, _.net.yested.ButtonType.object.SUBMIT, _.bootstrap.f_200, void 0, void 0, void 0, _.bootstrap.f_201); }, f_203: function () { this.form_mfnzi$(_.bootstrap.f_202); }, f_204: function () { this.plus_pdl1w0$('On the right1'); }, f_205: function () { this.span_dkuwo$('navbar-text', _.bootstrap.f_204); }, f_206: function () { this.brand_hgkgkc$('#bootstrapComponents', _.bootstrap.f_186); this.item_b1t645$('#bootstrapComponents', void 0, _.bootstrap.f_187); this.item_b1t645$('#bootstrapComponents', _.bootstrap.f_188, _.bootstrap.f_189); this.dropdown_vvlqvy$(_.bootstrap.f_190, _.bootstrap.f_197); this.left_oe5uhj$(_.bootstrap.f_203); this.right_oe5uhj$(_.bootstrap.f_205); }, f_207: function () { this.h4_mfnzi$(_.bootstrap.f_185); _.net.yested.bootstrap.navbar_58rg2v$(this, 'navbarDemo', void 0, _.net.yested.bootstrap.NavbarLook.object.INVERSE, _.bootstrap.f_206); }, f_208: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_207); }, f_209: function () { this.plus_pdl1w0$('Code'); }, f_210: function () { this.h4_mfnzi$(_.bootstrap.f_209); this.code_puj7f4$('kotlin', 'navbar(id = "navbarDemo", look = NavbarLook.INVERSE) {\n brand(href = "#bootstrapComponents") {glyphicon(icon = "home"); nbsp(); +" Home" }\n item(href = "#bootstrapComponents") { +"Some Link 1" }\n item(href = "#bootstrapComponents", onclick = { println("clicked")}) { +"Some Link 2" }\n dropdown(label = { +"Dropdown"}) {\n item(href = "#bootstrapComponents", onclick = { println("clicked")}) { +"Link 1" }\n item(href = "#bootstrapComponents", onclick = { println("clicked")}) { +"Link 2" }\n divider()\n item(href = "#bootstrapComponents", onclick = { println("clicked")}) { +"Link 3" }\n }\n left {\n form { "class".."navbar-form"\n div(clazz = "form-group") {\n textInput(placeholder = "username") {}\n }\n btsButton(type = ButtonType.SUBMIT, label = { +"Login"}) {}\n }\n }\n right {\n span(clazz = "navbar-text") {\n +"On the right1"\n }\n }\n}'); }, f_211: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_210); }, createNavbarSection$f: function (id) { return function () { this.id = id; _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_151); _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_184); _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_208); _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_211); }; }, createNavbarSection: function (id) { return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createNavbarSection$f(id)); }, f_212: function () { this.plus_pdl1w0$('Pagination'); }, f_213: function () { this.h3_mfnzi$(_.bootstrap.f_212); }, f_214: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_213); }, f_215: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_214); }, f_216: function () { this.plus_pdl1w0$('\nPagination from Bootstrap.\n'); }, f_217: function () { this.plus_pdl1w0$('Demo'); }, f_218: function (result) { return function (it) { result.replace_61zpoe$('Selected: ' + it); }; }, f_219: function (result) { return function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_216); this.br(); this.h4_mfnzi$(_.bootstrap.f_217); _.net.yested.bootstrap.pagination_kr3wm4$(this, 6, 2, _.bootstrap.f_218(result)); this.plus_pv6laa$(result); }; }, f_220: function () { this.plus_pdl1w0$('Code'); }, f_221: function () { this.h4_mfnzi$(_.bootstrap.f_220); this.code_puj7f4$('kotlin', 'val result = Span()\n...\ndiv {\n pagination(count = 6, defaultSelection = 2) { result.replace("Selected: $\\{it}")}\n +result\n}\n'); }, f_222: function (result) { return function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_219(result)); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_221); }; }, createPaginationSection$f: function (id, result) { return function () { this.id = id; _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_215); _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_222(result)); }; }, createPaginationSection: function (id) { var result = new _.net.yested.Span(); return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createPaginationSection$f(id, result)); }, f_223: function () { this.plus_pdl1w0$('Panels'); }, f_224: function () { this.h3_mfnzi$(_.bootstrap.f_223); }, f_225: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_224); }, f_226: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_225); }, f_227: function () { this.plus_pdl1w0$('\nPlease refer to Bootstrap Panels\n'); }, f_228: function () { this.plus_pdl1w0$('Demo'); }, f_229: function () { this.plus_pdl1w0$('Panel Header'); }, f_230: function () { this.plus_pdl1w0$('This site'); }, f_231: function () { this.a_b4th6h$(void 0, 'http://www.yested.net', void 0, _.bootstrap.f_230); }, f_232: function () { this.plus_pdl1w0$('Panel Footer'); }, f_233: function () { this.heading_mfnzi$(_.bootstrap.f_229); this.content_mfnzi$(_.bootstrap.f_231); this.footer_mfnzi$(_.bootstrap.f_232); }, f_234: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_227); this.br(); this.h4_mfnzi$(_.bootstrap.f_228); _.net.yested.bootstrap.panel_azd227$(this, _.net.yested.bootstrap.PanelStyle.object.SUCCESS, _.bootstrap.f_233); }, f_235: function () { this.plus_pdl1w0$('Code'); }, f_236: function () { this.h4_mfnzi$(_.bootstrap.f_235); this.code_puj7f4$('kotlin', 'panel {\n heading { +"Panel Header" }\n content {\n a(href="http://www.yested.net") { + "This site"}\n }\n footer { +"Panel Footer" }\n}'); }, f_237: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_234); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_236); }, createPanelSection$f: function (id) { return function () { this.id = id; _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_226); _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_237); }; }, createPanelSection: function (id) { return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createPanelSection$f(id)); }, Car: Kotlin.createClass(null, function (model, color) { this.model = model; this.color = color; }, /** @lends _.bootstrap.Car.prototype */ { component1: function () { return this.model; }, component2: function () { return this.color; }, copy: function (model, color) { return new _.bootstrap.Car(model === void 0 ? this.model : model, color === void 0 ? this.color : color); }, toString: function () { return 'Car(model=' + Kotlin.toString(this.model) + (', color=' + Kotlin.toString(this.color)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.model) | 0; result = result * 31 + Kotlin.hashCode(this.color) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.model, other.model) && Kotlin.equals(this.color, other.color)))); } }), createSelectSection$f: function (it) { return it.model + ' (' + it.color + ')'; }, createSelectSection$f_0: function (resultSingleSelect, singleSelect) { return function () { resultSingleSelect.replace_61zpoe$('Selected: ' + Kotlin.modules['stdlib'].kotlin.first_fvq2g0$(singleSelect.selectedItems).model); }; }, createSelectSection$f_1: function (it) { return it.model + ' (' + it.color + ')'; }, f_238: function (it) { return it.model; }, createSelectSection$f_2: function (resultMultiSelect, multiSelect) { return function () { var tmp$0; tmp$0 = Kotlin.modules['stdlib'].kotlin.map_m3yiqg$(multiSelect.selectedItems, _.bootstrap.f_238); resultMultiSelect.replace_61zpoe$('Selected: ' + Kotlin.modules['stdlib'].kotlin.join_raq5lb$(tmp$0, ' and ')); }; }, createSelectSection$f_3: function () { this.plus_pdl1w0$('Select Skoda and Ford'); }, f_239: function (it) { return Kotlin.equals(it.model, 'Skoda') || Kotlin.equals(it.model, 'Ford'); }, createSelectSection$f_4: function (someData, multiSelect) { return function () { var tmp$0, tmp$1; tmp$1 = multiSelect; tmp$0 = Kotlin.modules['stdlib'].kotlin.filter_azvtw4$(someData, _.bootstrap.f_239); tmp$1.selectedItems = tmp$0; }; }, f_240: function () { this.plus_pdl1w0$('Select'); }, f_241: function () { this.h3_mfnzi$(_.bootstrap.f_240); }, f_242: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_241); }, f_243: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_242); }, f_244: function () { this.plus_pdl1w0$('HTML Select demo with listener.'); }, f_245: function () { this.plus_pdl1w0$('Demo'); }, f_246: function (singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn) { return function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_244); this.br(); this.h4_mfnzi$(_.bootstrap.f_245); this.plus_pv6laa$(singleSelect); this.plus_pv6laa$(resultSingleSelect); this.br(); this.br(); this.plus_pv6laa$(multiSelect); this.plus_pv6laa$(resultMultiSelect); this.br(); this.plus_pv6laa$(btn); }; }, f_247: function () { this.plus_pdl1w0$('Code'); }, f_248: function () { this.h4_mfnzi$(_.bootstrap.f_247); this.code_puj7f4$('kotlin', 'val someData = listOf(\n Car("Ford", "Black"),\n Car("Skoda", "White"),\n Car("Renault", "Red"),\n Car("Citroen", "Purple"))\n\nval resultSingleSelect = Div()\nval singleSelect = Select<Car>(renderer = { "$\\{it.model} ($\\{it.color})" })\nsingleSelect.data = someData\nsingleSelect.addOnChangeListener {\n resultSingleSelect.replace( "Selected: $\\{singleSelect.selectedItems.first().model}")\n}\n\nval resultMultiSelect = Div()\nval multiSelect = Select<Car>(multiple = true, size = 4, renderer = { "$\\{it.model} ($\\{it.color})" })\nmultiSelect.data = someData\nmultiSelect.addOnChangeListener {\n resultMultiSelect.replace( "Selected: " + multiSelect.selectedItems.map { "$\\{it.model}" }.join(" and "))\n}\n\nval btn = BtsButton(label = { +"Select Skoda and Ford" }) {\n multiSelect.selectedItems = someData.filter { it.model == "Skoda" || it.model == "Ford"}\n}\n\n...\ndiv {\n + singleSelect\n + resultSingleSelect\n br()\n br()\n + multiSelect\n + resultMultiSelect\n br()\n + btn\n}'); }, f_249: function (singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn) { return function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_246(singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn)); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_248); }; }, createSelectSection$f_5: function (id, singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn) { return function () { this.id = id; _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_243); _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_249(singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn)); }; }, createSelectSection: function (id) { var someData = Kotlin.modules['stdlib'].kotlin.listOf_9mqe4v$([new _.bootstrap.Car('Ford', 'Black'), new _.bootstrap.Car('Skoda', 'White'), new _.bootstrap.Car('Renault', 'Red'), new _.bootstrap.Car('Citroen', 'Purple')]); var resultSingleSelect = new _.net.yested.Div(); var singleSelect = new _.net.yested.bootstrap.Select(void 0, void 0, _.bootstrap.createSelectSection$f); singleSelect.data = someData; singleSelect.addOnChangeListener_qshda6$(_.bootstrap.createSelectSection$f_0(resultSingleSelect, singleSelect)); var resultMultiSelect = new _.net.yested.Div(); var multiSelect = new _.net.yested.bootstrap.Select(true, 4, _.bootstrap.createSelectSection$f_1); multiSelect.data = someData; multiSelect.addOnChangeListener_qshda6$(_.bootstrap.createSelectSection$f_2(resultMultiSelect, multiSelect)); var btn = new _.net.yested.bootstrap.BtsButton(void 0, _.bootstrap.createSelectSection$f_3, void 0, void 0, void 0, _.bootstrap.createSelectSection$f_4(someData, multiSelect)); return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createSelectSection$f_5(id, singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn)); }, f_250: function () { this.plus_pdl1w0$('Tabs'); }, f_251: function () { this.h3_mfnzi$(_.bootstrap.f_250); }, f_252: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_251); }, f_253: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_252); }, f_254: function () { this.plus_pdl1w0$('\nTabs are based on Bootstrap Tabs.\nContent of tab is rendedered upon click on a tab link. When clicking on anoother link, content is preserved.\n'); }, f_255: function () { this.plus_pdl1w0$('Demo'); }, f_256: function () { }, f_257: function () { _.net.yested.bootstrap.textInput_rha0js$(this, 'Placeholder 1', _.bootstrap.f_256); }, f_258: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_257); }, f_259: function () { this.plus_pdl1w0$('This tab is selected by default.'); }, f_260: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_259); }, f_261: function () { this.plus_pdl1w0$('Wikipedia'); }, f_262: function () { this.a_b4th6h$(void 0, 'http://www.wikipedia.org', void 0, _.bootstrap.f_261); }, f_263: function () { this.tab_jcws7d$(void 0, _.net.yested.text_61zpoe$('First'), void 0, _.bootstrap.f_258); this.tab_jcws7d$(true, _.net.yested.text_61zpoe$('Second'), void 0, _.bootstrap.f_260); this.tab_jcws7d$(void 0, _.net.yested.text_61zpoe$('Third'), void 0, _.bootstrap.f_262); }, f_264: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_254); this.br(); this.h4_mfnzi$(_.bootstrap.f_255); _.net.yested.bootstrap.tabs_1nc3b1$(this, _.bootstrap.f_263); }, f_265: function () { this.plus_pdl1w0$('Code'); }, f_266: function () { this.h4_mfnzi$(_.bootstrap.f_265); this.code_puj7f4$('kotlin', 'tabs {\n tab(header = text("First")) {\n div {\n textInput(placeholder = "Placeholder 1") { }\n }\n }\n tab(active = true, header = text("Second")) {\n div {\n +"This tab is selected by default."\n }\n }\n tab(header = text("Third")) {\n a(href = "http://www.wikipedia.org") { +"Wikipedia"}\n }\n}'); }, f_267: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_264); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_266); }, createTabs$f: function (id) { return function () { this.id = id; _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_253); _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_267); }; }, createTabs: function (id) { return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createTabs$f(id)); }, f_268: function () { this.plus_pdl1w0$('Typography'); }, f_269: function () { this.h3_mfnzi$(_.bootstrap.f_268); }, f_270: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_269); }, f_271: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_270); }, f_272: function () { this.plus_pdl1w0$('\nSimple Typography support.\n'); }, f_273: function () { this.plus_pdl1w0$('Demo'); }, f_274: function () { this.plus_pdl1w0$('Right Align'); }, f_275: function () { this.plus_pdl1w0$('Left Align'); }, f_276: function () { this.plus_pdl1w0$('Center'); }, f_277: function () { this.plus_pdl1w0$('Justify'); }, f_278: function () { this.plus_pdl1w0$('No wrap'); }, f_279: function () { this.plus_pdl1w0$('all is upercase'); }, f_280: function () { _.net.yested.bootstrap.uppercase_sxtqq7$(this, _.bootstrap.f_279); }, f_281: function () { this.plus_pdl1w0$('ALL IS lowerCase'); }, f_282: function () { _.net.yested.bootstrap.lowercase_sxtqq7$(this, _.bootstrap.f_281); }, f_283: function () { this.plus_pdl1w0$('capitalized'); }, f_284: function () { _.net.yested.bootstrap.capitalize_sxtqq7$(this, _.bootstrap.f_283); }, f_285: function () { this.div_5rsex9$(void 0, void 0, _.bootstrap.f_272); this.br(); this.h4_mfnzi$(_.bootstrap.f_273); _.net.yested.bootstrap.aligned_fsjrrw$(this, _.net.yested.bootstrap.TextAlign.object.RIGHT, _.bootstrap.f_274); _.net.yested.bootstrap.aligned_fsjrrw$(this, _.net.yested.bootstrap.TextAlign.object.LEFT, _.bootstrap.f_275); _.net.yested.bootstrap.aligned_fsjrrw$(this, _.net.yested.bootstrap.TextAlign.object.CENTER, _.bootstrap.f_276); _.net.yested.bootstrap.aligned_fsjrrw$(this, _.net.yested.bootstrap.TextAlign.object.JUSTIFY, _.bootstrap.f_277); _.net.yested.bootstrap.aligned_fsjrrw$(this, _.net.yested.bootstrap.TextAlign.object.NOWRAP, _.bootstrap.f_278); this.p_omdg96$(_.bootstrap.f_280); this.p_omdg96$(_.bootstrap.f_282); this.p_omdg96$(_.bootstrap.f_284); }, f_286: function () { this.plus_pdl1w0$('Code'); }, f_287: function () { this.h4_mfnzi$(_.bootstrap.f_286); this.code_puj7f4$('kotlin', 'aligned(TextAlign.RIGHT) { +"Right Align"}\naligned(TextAlign.LEFT) { +"Left Align"}\naligned(TextAlign.CENTER) { +"Center"}\naligned(TextAlign.JUSTIFY) { +"Justify"}\naligned(TextAlign.NOWRAP) { +"No wrap"}\np { uppercase { +"all is upercase" }}\np { lowercase { +"ALL IS lowerCase" }}\np { capitalize { +"capitalized" }}'); }, f_288: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_285); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_287); }, createTypographySection$f: function (id) { return function () { this.id = id; _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_271); _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_288); }; }, createTypographySection: function (id) { return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createTypographySection$f(id)); } }), complex: Kotlin.definePackage(null, /** @lends _.complex */ { Continent: Kotlin.createEnumClass(function () { return [Kotlin.Enum]; }, function $fun(label) { $fun.baseInitializer.call(this); this.label = label; }, function () { return { EUROPE: new _.complex.Continent('Europe'), AMERICA: new _.complex.Continent('America'), ASIA: new _.complex.Continent('Asia'), AFRICA: new _.complex.Continent('Africa') }; }), City: Kotlin.createClass(null, function (name, continent) { this.name = name; this.continent = continent; }, /** @lends _.complex.City.prototype */ { component1: function () { return this.name; }, component2: function () { return this.continent; }, copy: function (name, continent) { return new _.complex.City(name === void 0 ? this.name : name, continent === void 0 ? this.continent : continent); }, toString: function () { return 'City(name=' + Kotlin.toString(this.name) + (', continent=' + Kotlin.toString(this.continent)) + ')'; }, hashCode: function () { var result = 0; result = result * 31 + Kotlin.hashCode(this.name) | 0; result = result * 31 + Kotlin.hashCode(this.continent) | 0; return result; }, equals_za3rmp$: function (other) { return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && (Kotlin.equals(this.name, other.name) && Kotlin.equals(this.continent, other.continent)))); } }), MasterDetail: Kotlin.createClass(null, function () { this.placeholder = new _.net.yested.Div(); this.list = Kotlin.modules['stdlib'].kotlin.arrayListOf_9mqe4v$([new _.complex.City('Prague', _.complex.Continent.object.EUROPE), new _.complex.City('London', _.complex.Continent.object.EUROPE), new _.complex.City('New York', _.complex.Continent.object.AMERICA)]); this.grid = new _.net.yested.bootstrap.Grid([new _.net.yested.bootstrap.Column(_.complex.MasterDetail.MasterDetail$f, _.complex.MasterDetail.MasterDetail$f_0, _.bootstrap.compareBy(_.complex.MasterDetail.MasterDetail$f_1), void 0, true), new _.net.yested.bootstrap.Column(_.complex.MasterDetail.MasterDetail$f_2, _.complex.MasterDetail.MasterDetail$f_3, _.bootstrap.compareBy(_.complex.MasterDetail.MasterDetail$f_4)), new _.net.yested.bootstrap.Column(_.complex.MasterDetail.MasterDetail$f_5, _.complex.MasterDetail.MasterDetail$f_6(this), _.bootstrap.compareBy(_.complex.MasterDetail.MasterDetail$f_7)), new _.net.yested.bootstrap.Column(_.complex.MasterDetail.MasterDetail$f_8, _.complex.MasterDetail.MasterDetail$f_9(this), _.bootstrap.compareBy(_.complex.MasterDetail.MasterDetail$f_10))]); }, /** @lends _.complex.MasterDetail.prototype */ { delete: function (city) { this.list.remove_za3rmp$(city); this.grid.list = this.list; }, edit: function (editedCity) { if (editedCity === void 0) editedCity = null; var textInput = new _.net.yested.bootstrap.TextInput('City name'); var validator = new _.net.yested.bootstrap.Validator(textInput, 'Name is mandatory', _.complex.MasterDetail.edit$f); var select = new _.net.yested.bootstrap.Select(void 0, void 0, _.complex.MasterDetail.edit$f_0); select.data = Kotlin.modules['stdlib'].kotlin.toList_eg9ybj$(_.complex.Continent.values()); var close = _.complex.MasterDetail.edit$close(this); var save = _.complex.MasterDetail.edit$save(validator, editedCity, this, textInput, select, close); if (editedCity != null) { textInput.value = editedCity.name; select.selectedItems = Kotlin.modules['stdlib'].kotlin.listOf_9mqe4v$([editedCity.continent]); } this.placeholder.fade_suy7ya$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Form('col-sm-4', 'col-sm-8'), _.complex.MasterDetail.edit$f_1(validator, textInput, select, save, close))); }, createMasterView: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.complex.MasterDetail.createMasterView$f(this)); }, createDiv: function () { this.placeholder.fade_suy7ya$(this.createMasterView()); this.grid.list = this.list; return _.net.yested.div_5rsex9$(void 0, void 0, _.complex.MasterDetail.createDiv$f(this)); } }, /** @lends _.complex.MasterDetail */ { MasterDetail$f: function () { this.plus_pdl1w0$('City name'); }, MasterDetail$f_0: function (it) { this.plus_pdl1w0$(it.name); }, MasterDetail$f_1: function (it) { return it.name; }, MasterDetail$f_2: function () { this.plus_pdl1w0$('Continent'); }, MasterDetail$f_3: function (it) { this.plus_pdl1w0$(it.continent.label); }, MasterDetail$f_4: function (it) { return it.continent.label; }, MasterDetail$f_5: function () { }, f: function () { this.plus_pdl1w0$('Edit'); }, f_0: function (it, this$MasterDetail) { return function () { this$MasterDetail.edit(it); }; }, MasterDetail$f_6: function (this$MasterDetail) { return function (it) { _.net.yested.bootstrap.btsButton_j2rvkn$(this, void 0, _.complex.MasterDetail.f, void 0, _.net.yested.bootstrap.ButtonSize.object.EXTRA_SMALL, void 0, _.complex.MasterDetail.f_0(it, this$MasterDetail)); }; }, MasterDetail$f_7: function (it) { return it.name; }, MasterDetail$f_8: function () { }, f_1: function () { this.plus_pdl1w0$('Delete'); }, f_2: function (it, this$MasterDetail) { return function () { this$MasterDetail.delete(it); }; }, MasterDetail$f_9: function (this$MasterDetail) { return function (it) { _.net.yested.bootstrap.btsButton_j2rvkn$(this, void 0, _.complex.MasterDetail.f_1, _.net.yested.bootstrap.ButtonLook.object.DANGER, _.net.yested.bootstrap.ButtonSize.object.EXTRA_SMALL, void 0, _.complex.MasterDetail.f_2(it, this$MasterDetail)); }; }, MasterDetail$f_10: function (it) { return it.name; }, edit$f: function (it) { return it.length > 3; }, edit$f_0: function (it) { return it.label; }, edit$close: function (this$MasterDetail) { return function () { this$MasterDetail.placeholder.fade_suy7ya$(this$MasterDetail.createMasterView()); }; }, edit$save: function (validator, editedCity, this$MasterDetail, textInput, select, close) { return function () { if (validator.isValid()) { if (editedCity != null) { this$MasterDetail.list.remove_za3rmp$(editedCity); } this$MasterDetail.list.add_za3rmp$(new _.complex.City(textInput.value, Kotlin.modules['stdlib'].kotlin.first_fvq2g0$(select.selectedItems))); this$MasterDetail.grid.list = this$MasterDetail.list; close(); } }; }, f_3: function () { this.plus_pdl1w0$('City name'); }, f_4: function (textInput) { return function () { this.plus_pv6laa$(textInput); }; }, f_5: function () { this.plus_pdl1w0$('Continent'); }, f_6: function (select) { return function () { this.plus_pv6laa$(select); }; }, f_7: function () { }, f_8: function () { this.plus_pdl1w0$('Save'); }, f_9: function () { this.plus_pdl1w0$('Cancel'); }, f_10: function (save, close) { return function () { _.net.yested.bootstrap.btsButton_j2rvkn$(this, _.net.yested.ButtonType.object.SUBMIT, _.complex.MasterDetail.f_8, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, void 0, void 0, save); _.net.yested.bootstrap.btsButton_j2rvkn$(this, void 0, _.complex.MasterDetail.f_9, void 0, void 0, void 0, close); }; }, f_11: function (save, close) { return function () { this.div_5rsex9$(void 0, void 0, _.complex.MasterDetail.f_10(save, close)); }; }, edit$f_1: function (validator, textInput, select, save, close) { return function () { this.item_2xyzwi$(void 0, _.complex.MasterDetail.f_3, validator, _.complex.MasterDetail.f_4(textInput)); this.item_2xyzwi$(void 0, _.complex.MasterDetail.f_5, void 0, _.complex.MasterDetail.f_6(select)); this.item_2xyzwi$(void 0, _.complex.MasterDetail.f_7, void 0, _.complex.MasterDetail.f_11(save, close)); }; }, f_12: function () { this.plus_pdl1w0$('Add'); }, f_13: function (this$MasterDetail) { return function () { this$MasterDetail.edit(); }; }, createMasterView$f: function (this$MasterDetail) { return function () { this.plus_pv6laa$(this$MasterDetail.grid); _.net.yested.bootstrap.btsButton_j2rvkn$(this, void 0, _.complex.MasterDetail.f_12, void 0, void 0, void 0, _.complex.MasterDetail.f_13(this$MasterDetail)); }; }, f_14: function () { this.plus_pdl1w0$('Master / Detail'); }, f_15: function () { this.h3_mfnzi$(_.complex.MasterDetail.f_14); }, f_16: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.complex.MasterDetail.f_15); }, f_17: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.complex.MasterDetail.f_16); }, f_18: function () { this.plus_pdl1w0$('Demo'); }, f_19: function (this$MasterDetail) { return function () { this.h4_mfnzi$(_.complex.MasterDetail.f_18); this.plus_pv6laa$(this$MasterDetail.placeholder); }; }, f_20: function () { this.plus_pdl1w0$('Source code'); }, f_21: function () { this.plus_pdl1w0$('Source code is deployed on GitHub'); }, f_22: function () { this.h4_mfnzi$(_.complex.MasterDetail.f_20); this.a_b4th6h$(void 0, 'https://github.com/jean79/yested/blob/master/src/main/docsite/complex/masterdetails.kt', void 0, _.complex.MasterDetail.f_21); }, f_23: function (this$MasterDetail) { return function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.complex.MasterDetail.f_19(this$MasterDetail)); this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.complex.MasterDetail.f_22); }; }, createDiv$f: function (this$MasterDetail) { return function () { _.net.yested.bootstrap.row_siz32v$(this, _.complex.MasterDetail.f_17); _.net.yested.bootstrap.row_siz32v$(this, _.complex.MasterDetail.f_23(this$MasterDetail)); }; } }), masterDetail: function () { return (new _.complex.MasterDetail()).createDiv(); }, f: function () { this.plus_pdl1w0$('Spinner'); }, f_0: function () { this.h3_mfnzi$(_.complex.f); }, f_1: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.complex.f_0); }, f_2: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.complex.f_1); }, f_3: function () { this.plus_pdl1w0$('http://fgnass.github.io/spin.js/'); }, f_4: function () { this.plus_pdl1w0$('\nThis spinner is based on Spinner library:\n'); this.a_b4th6h$(void 0, 'http://fgnass.github.io/spin.js/', void 0, _.complex.f_3); this.br(); this.plus_pdl1w0$('You need to include spin.js library in your html file.'); this.br(); this.plus_pdl1w0$('All spinner options are supported.'); }, f_5: function () { this.plus_pdl1w0$('Demo'); }, f_6: function () { this.style = 'height: 200px'; _.net.yested.spin.spinner_oyolqv$(this, new _.net.yested.spin.SpinnerOptions(void 0, 7)); }, f_7: function () { this.div_5rsex9$(void 0, void 0, _.complex.f_4); this.br(); this.h4_mfnzi$(_.complex.f_5); this.div_5rsex9$(void 0, void 0, _.complex.f_6); }, f_8: function () { this.plus_pdl1w0$('Code'); }, f_9: function () { this.h4_mfnzi$(_.complex.f_8); this.code_puj7f4$('kotlin', 'div {\n style = "height: 200px"\n spinner(SpinnerOptions(length = 7))\n}'); }, f_10: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.complex.f_7); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.complex.f_9); }, createSpinner$f: function () { _.net.yested.bootstrap.row_siz32v$(this, _.complex.f_2); _.net.yested.bootstrap.row_siz32v$(this, _.complex.f_10); }, createSpinner: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.complex.createSpinner$f); } }), gettingstarted: Kotlin.definePackage(null, /** @lends _.gettingstarted */ { f: function () { this.plus_pdl1w0$('Getting Started'); }, f_0: function () { this.h3_mfnzi$(_.gettingstarted.f); }, f_1: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.gettingstarted.f_0); }, f_2: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_1); }, f_3: function () { this.plus_pdl1w0$('1. Get Intellij Idea'); }, f_4: function () { this.plus_pdl1w0$('Get Intellij Idea 14 from JetBrains.'); }, f_5: function () { this.a_b4th6h$(void 0, 'https://www.jetbrains.com/idea/', void 0, _.gettingstarted.f_4); }, f_6: function () { this.h4_mfnzi$(_.gettingstarted.f_3); this.p_omdg96$(_.gettingstarted.f_5); }, f_7: function () { this.div_5rsex9$(void 0, void 0, _.gettingstarted.f_6); }, f_8: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.gettingstarted.f_7); }, f_9: function () { this.plus_pdl1w0$('2. Enable Kotlin Plugin'); }, f_10: function () { this.plus_pdl1w0$('Install JetBrains Kotlin plugin into Idea.'); this.img_puj7f4$('demo-site/img/plugin_install.png'); }, f_11: function () { this.h4_mfnzi$(_.gettingstarted.f_9); this.p_omdg96$(_.gettingstarted.f_10); }, f_12: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_11); }, f_13: function () { this.plus_pdl1w0$('3. Create Kotlin - Javascript project'); }, f_14: function () { this.plus_pdl1w0$("Call it 'YestedSample'"); }, f_15: function () { this.h4_mfnzi$(_.gettingstarted.f_13); this.p_omdg96$(_.gettingstarted.f_14); this.img_puj7f4$('demo-site/img/create_project.png'); }, f_16: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_15); }, f_17: function () { this.plus_pdl1w0$('4. Create Kotlin Javascript Library'); }, f_18: function () { this.h4_mfnzi$(_.gettingstarted.f_17); this.img_puj7f4$('demo-site/img/create_project_create_lib.png'); }, f_19: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_18); }, f_20: function () { this.plus_pdl1w0$('Copy to: lib'); }, f_21: function () { this.plus_pdl1w0$('Select:'); this.emph_mfnzi$(_.gettingstarted.f_20); }, f_22: function () { this.p_omdg96$(_.gettingstarted.f_21); this.img_puj7f4$('demo-site/img/create_library.png'); }, f_23: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_22); }, f_24: function () { this.plus_pdl1w0$('4. Add Yested Library dependency'); }, f_25: function () { this.h4_mfnzi$(_.gettingstarted.f_24); this.img_puj7f4$('demo-site/img/add_library_dependency.png'); }, f_26: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_25); }, f_27: function () { this.plus_pdl1w0$('5. Create index.html file'); }, f_28: function () { this.h4_mfnzi$(_.gettingstarted.f_27); this.plus_pdl1w0$("Create HTML wrapper for our Yested application. It is a simple HTML that contains placeholder div with id 'page',"); this.plus_pdl1w0$('Place index.html in the root of your project.'); this.plus_pdl1w0$('It mainly references Boostrap and JQuery libraries. If you are not going to use Boostrap, you can have empty index.html with just placeholder div.'); this.code_puj7f4$('html', '<!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <meta http-equiv="X-UA-Compatible" content="IE=edge">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <title>Yested Sample<\/title>\n\n <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">\n <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">\n\n <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn\'t work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"><\/script>\n <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"><\/script>\n <![endif]-->\n\n <\/head>\n\n <body role="document">\n\n <div id="page"><\/div>\n\n <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"><\/script>\n <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"><\/script>\n\n <script src="out/production/YestedSample/lib/kotlin.js"><\/script>\n <script src="out/production/YestedSample/lib/Yested.js"><\/script>\n <script src="out/production/YestedSample/YestedSample.js"><\/script>\n\n <\/body>\n <\/html>\n '); }, f_29: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_28); }, f_30: function () { this.plus_pdl1w0$('6. Create basic Yested application'); }, f_31: function () { this.h4_mfnzi$(_.gettingstarted.f_30); }, f_32: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_31); }, f_33: function () { this.plus_pdl1w0$('Create file sample.kt in src/main/kotlin and insert content on the right.<br />\n Kotlin Javascript calls this main function when page is loaded.\n '); }, f_34: function () { this.code_puj7f4$('kotlin', 'import net.yested.bootstrap.page\n\nfun main(args: Array<String>) {\n page("page") {\n content {\n +"Hello World"\n br()\n a(href = "http://www.yested.net") { +"link to yested.net"}\n ol {\n li { +"First item" }\n li { +"Second item" }\n }\n }\n }\n}\n'); }, f_35: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.gettingstarted.f_33); this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.gettingstarted.f_34); }, f_36: function () { this.plus_pdl1w0$('7. Build Project'); }, f_37: function () { this.plus_pdl1w0$("Build -> Make Module 'YestedSample'"); this.br(); this.plus_pdl1w0$('It should generate all javascript libraries into out/production/YestedSample.'); this.plus_pdl1w0$('We reference these files in our index.html file.'); }, f_38: function () { this.h4_mfnzi$(_.gettingstarted.f_36); this.p_omdg96$(_.gettingstarted.f_37); }, f_39: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_38); }, f_40: function () { this.plus_pdl1w0$('8. Create build configuration'); }, f_41: function () { this.plus_pdl1w0$('Create build configuration - Kotlin - Javascript. '); this.plus_pdl1w0$('Set correct path to our index.html'); this.img_puj7f4$('demo-site/img/build.png'); }, f_42: function () { this.h4_mfnzi$(_.gettingstarted.f_40); this.p_omdg96$(_.gettingstarted.f_41); }, f_43: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_42); }, f_44: function () { this.plus_pdl1w0$('9. Run It!'); }, f_45: function () { this.h4_mfnzi$(_.gettingstarted.f_44); }, f_46: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_45); }, gettingStartedSection$f: function () { _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_2); _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_8); _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_12); _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_16); _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_19); _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_23); _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_26); _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_29); _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_32); _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_35); _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_39); _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_43); _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_46); }, gettingStartedSection: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.gettingstarted.gettingStartedSection$f); } }), html: Kotlin.definePackage(null, /** @lends _.html */ { htmlPage$f: function () { this.plus_pv6laa$(_.html.htmlSection()); }, htmlPage: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.html.htmlPage$f); }, f: function () { this.plus_pdl1w0$('HTML'); }, f_0: function () { this.h3_mfnzi$(_.html.f); }, f_1: function () { _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.html.f_0); }, f_2: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.html.f_1); }, f_3: function () { this.plus_pdl1w0$('Yested provides basic DSL for construction of HTML page from HTML basic elements.<br /><br />\n This DSL can be easily enhanced with your custom or built-in Bootstrap components via Kotlin Extension methods.'); }, f_4: function () { this.div_5rsex9$(void 0, void 0, _.html.f_3); }, f_5: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.html.f_4); }, f_6: function () { this.plus_pdl1w0$('Demo'); }, f_7: function () { this.plus_pdl1w0$('Yested'); }, f_8: function () { this.plus_pdl1w0$('Text in span which is in div'); }, f_9: function () { this.span_dkuwo$(void 0, _.html.f_8); }, f_10: function () { this.plus_pdl1w0$('Text in Paragraph'); }, f_11: function () { this.plus_pdl1w0$('Strikethrough text'); }, f_12: function () { this.plus_pdl1w0$('Deleted text'); }, f_13: function () { this.plus_pdl1w0$('Marked text'); }, f_14: function () { this.plus_pdl1w0$('Inserted text'); }, f_15: function () { this.plus_pdl1w0$('Underlined text'); }, f_16: function () { this.plus_pdl1w0$('Small text'); }, f_17: function () { this.plus_pdl1w0$('Strong text'); }, f_18: function () { this.plus_pdl1w0$('Italicized text.'); }, f_19: function () { this.plus_pdl1w0$('blockquote'); }, f_20: function () { this.plus_pdl1w0$('First column'); }, f_21: function () { this.plus_pdl1w0$('Second column'); }, f_22: function () { this.th_mfnzi$(_.html.f_20); this.th_mfnzi$(_.html.f_21); }, f_23: function () { this.tr_l9w0g6$(_.html.f_22); }, f_24: function () { this.plus_pdl1w0$('Cell 1'); }, f_25: function () { this.plus_pdl1w0$('Cell 2'); }, f_26: function () { this.td_mfnzi$(_.html.f_24); this.td_mfnzi$(_.html.f_25); }, f_27: function () { this.plus_pdl1w0$('Cell 1'); }, f_28: function () { this.plus_pdl1w0$('Cell 2'); }, f_29: function () { this.td_mfnzi$(_.html.f_27); this.td_mfnzi$(_.html.f_28); }, f_30: function () { this.tr_idqsqk$(_.html.f_26); this.tr_idqsqk$(_.html.f_29); }, f_31: function () { this.border = '1'; this.thead_3ua0vu$(_.html.f_23); this.tbody_rj77wk$(_.html.f_30); }, f_32: function () { this.plus_pdl1w0$('bold text'); }, f_33: function () { this.plus_pdl1w0$('H1'); }, f_34: function () { this.plus_pdl1w0$('H2'); }, f_35: function () { this.plus_pdl1w0$('H3'); }, f_36: function () { this.plus_pdl1w0$('H4'); }, f_37: function () { this.plus_pdl1w0$('H5'); }, f_38: function () { this.plus_pdl1w0$('Press me'); }, f_39: function () { Kotlin.println('Check console!'); }, f_40: function () { this.plus_pdl1w0$('List item 1'); }, f_41: function () { this.plus_pdl1w0$('List item 2'); }, f_42: function () { this.plus_pdl1w0$('List item 3'); }, f_43: function () { this.plus_pdl1w0$('List item 4'); }, f_44: function () { this.li_8y48wp$(_.html.f_40); this.li_8y48wp$(_.html.f_41); this.li_8y48wp$(_.html.f_42); this.li_8y48wp$(_.html.f_43); }, f_45: function () { this.plus_pdl1w0$('List item 1'); }, f_46: function () { this.plus_pdl1w0$('List item 2'); }, f_47: function () { this.plus_pdl1w0$('List item 3'); }, f_48: function () { this.plus_pdl1w0$('List item 4'); }, f_49: function () { this.li_8y48wp$(_.html.f_45); this.li_8y48wp$(_.html.f_46); this.li_8y48wp$(_.html.f_47); this.li_8y48wp$(_.html.f_48); }, f_50: function () { this.plus_pdl1w0$('Term 1'); }, f_51: function () { this.plus_pdl1w0$('Definition'); }, f_52: function () { this.plus_pdl1w0$('Term 2'); }, f_53: function () { this.plus_pdl1w0$('Definition'); }, f_54: function () { this.clazz = 'dl-horizontal'; this.item_b459qs$(_.html.f_50, _.html.f_51); this.item_b459qs$(_.html.f_52, _.html.f_53); }, f_55: function () { this.plus_pdl1w0$('cd'); }, f_56: function () { this.a_b4th6h$(void 0, 'http://www.yested.net', void 0, _.html.f_7); this.br(); this.div_5rsex9$(void 0, void 0, _.html.f_9); this.p_omdg96$(_.html.f_10); this.s_mfnzi$(_.html.f_11); this.nbsp_za3lpa$(); this.del_mfnzi$(_.html.f_12); this.nbsp_za3lpa$(); this.mark_mfnzi$(_.html.f_13); this.nbsp_za3lpa$(); this.ins_mfnzi$(_.html.f_14); this.nbsp_za3lpa$(); this.u_mfnzi$(_.html.f_15); this.nbsp_za3lpa$(); this.small_mfnzi$(_.html.f_16); this.nbsp_za3lpa$(); this.strong_mfnzi$(_.html.f_17); this.nbsp_za3lpa$(); this.em_mfnzi$(_.html.f_18); this.br(); this.br(); this.blockquote_mfnzi$(_.html.f_19); this.table_or8fdg$(_.html.f_31); this.img_puj7f4$('demo-site/img/sample_img.jpg', 'bla'); this.emph_mfnzi$(_.html.f_32); this.h1_mfnzi$(_.html.f_33); this.h2_mfnzi$(_.html.f_34); this.h3_mfnzi$(_.html.f_35); this.h4_mfnzi$(_.html.f_36); this.h5_mfnzi$(_.html.f_37); this.button_mqmp2n$(_.html.f_38, _.net.yested.ButtonType.object.BUTTON, _.html.f_39); this.ul_8qfrsd$(_.html.f_44); this.ol_t3splz$(_.html.f_49); this.dl_79d1z0$(_.html.f_54); this.kbd_mfnzi$(_.html.f_55); }, f_57: function () { this.h4_mfnzi$(_.html.f_6); this.div_5rsex9$(void 0, void 0, _.html.f_56); }, f_58: function () { this.plus_pdl1w0$('Code'); }, f_59: function () { this.h4_mfnzi$(_.html.f_58); this.code_puj7f4$('kotlin', '\na(href="http://www.yested.net") { +"Yested"}\nbr()\ndiv {\n span { +"Text in span which is in div"}\n}\np { +"Text in Paragraph" }\ns { +"Strikethrough text" }\nnbsp()\ndel { +"Deleted text" }\nnbsp()\nmark { +"Marked text" }\nnbsp()\nins { +"Inserted text" }\nnbsp()\nu { +"Underlined text" }\nnbsp()\nsmall { +"Small text" }\nnbsp()\nstrong { +"Strong text" }\nnbsp()\nem { +"Italicized text." }\nbr()\nbr()\nblockquote { +"blockquote" }\ntable { border = "1"\n thead {\n tr {\n th { +"First column" }\n th { +"Second column"}\n }\n }\n tbody {\n tr {\n td { +"Cell 1"}\n td { +"Cell 2"}\n }\n tr {\n td { +"Cell 1"}\n td { +"Cell 2"}\n }\n }\n}\nimg(src = "demo-site/img/sample_img.jpg", alt = "bla") {}\nemph { +"bold text" }\nh1 { +"H1" }\nh2 { +"H2" }\nh3 { +"H3" }\nh4 { +"H4" }\nh5 { +"H5" }\nbutton(label = { +"Press me"},\n type = ButtonType.BUTTON,\n onclick = { println("Check console!")})\nul {\n li { +"List item 1"}\n li { +"List item 2"}\n li { +"List item 3"}\n li { +"List item 4"}\n}\n\nol {\n li { +"List item 1" }\n li { +"List item 2" }\n li { +"List item 3" }\n li { +"List item 4" }\n}\n\ndl {\n clazz = "dl-horizontal"\n item(dt = { +"Term 1"}) { +"Definition"}\n item(dt = { +"Term 2"}) { +"Definition"}\n}\n\nkbd { +"cd" }\n\n'); }, f_60: function () { this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.html.f_57); this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.html.f_59); }, htmlSection$f: function () { _.net.yested.bootstrap.row_siz32v$(this, _.html.f_2); _.net.yested.bootstrap.row_siz32v$(this, _.html.f_5); _.net.yested.bootstrap.row_siz32v$(this, _.html.f_60); }, htmlSection: function () { return _.net.yested.div_5rsex9$(void 0, void 0, _.html.htmlSection$f); } }) }); Kotlin.defineModule('Yested', _); _.main([]); }(Kotlin)); //@ sourceMappingURL=Yested.js.map
updated demo site
demo-site/js/Yested.js
updated demo site
<ide><path>emo-site/js/Yested.js <ide> 'use strict'; <ide> var _ = Kotlin.defineRootPackage(null, /** @lends _ */ { <ide> net: Kotlin.definePackage(null, /** @lends _.net */ { <del> yested: Kotlin.definePackage(null, /** @lends _.net.yested */ { <add> yested: Kotlin.definePackage(function () { <add> this.DURATION_huuymz$ = 200; <add> this.SLIDE_DURATION_ip8yfn$ = _.net.yested.DURATION_huuymz$ * 2; <add> }, /** @lends _.net.yested */ { <ide> AjaxRequest: Kotlin.createClass(null, function (url, type, data, contentType, dataType, success) { <ide> if (type === void 0) <ide> type = 'POST'; <ide> return new Chart(this.getContext_61zpoe$('2d')).Line(data, options); <ide> } <ide> }), <add> Effect: Kotlin.createTrait(null), <add> BiDirectionEffect: Kotlin.createTrait(null), <add> call$f: function (function_0) { <add> return function (it) { <add> (function_0 != null ? function_0 : Kotlin.throwNPE())(); <add> }; <add> }, <add> call: function (function_0) { <add> function_0 != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(function_0, _.net.yested.call$f(function_0)) : null; <add> }, <add> SlideUp: Kotlin.createClass(function () { <add> return [_.net.yested.Effect]; <add> }, null, /** @lends _.net.yested.SlideUp.prototype */ { <add> apply_suy7ya$: function (component, callback) { <add> if (callback === void 0) <add> callback = null; <add> $(component.element).slideUp(_.net.yested.SLIDE_DURATION_ip8yfn$, _.net.yested.SlideUp.apply_suy7ya$f(callback)); <add> } <add> }, /** @lends _.net.yested.SlideUp */ { <add> apply_suy7ya$f: function (callback) { <add> return function () { <add> _.net.yested.call(callback); <add> }; <add> } <add> }), <add> SlideDown: Kotlin.createClass(function () { <add> return [_.net.yested.Effect]; <add> }, null, /** @lends _.net.yested.SlideDown.prototype */ { <add> apply_suy7ya$: function (component, callback) { <add> if (callback === void 0) <add> callback = null; <add> $(component.element).slideDown(_.net.yested.SLIDE_DURATION_ip8yfn$, _.net.yested.SlideDown.apply_suy7ya$f(callback)); <add> } <add> }, /** @lends _.net.yested.SlideDown */ { <add> apply_suy7ya$f: function (callback) { <add> return function () { <add> _.net.yested.call(callback); <add> }; <add> } <add> }), <add> FadeOut: Kotlin.createClass(function () { <add> return [_.net.yested.Effect]; <add> }, null, /** @lends _.net.yested.FadeOut.prototype */ { <add> apply_suy7ya$: function (component, callback) { <add> if (callback === void 0) <add> callback = null; <add> $(component.element).fadeOut(_.net.yested.DURATION_huuymz$, _.net.yested.FadeOut.apply_suy7ya$f(callback)); <add> } <add> }, /** @lends _.net.yested.FadeOut */ { <add> apply_suy7ya$f: function (callback) { <add> return function () { <add> _.net.yested.call(callback); <add> }; <add> } <add> }), <add> FadeIn: Kotlin.createClass(function () { <add> return [_.net.yested.Effect]; <add> }, null, /** @lends _.net.yested.FadeIn.prototype */ { <add> apply_suy7ya$: function (component, callback) { <add> if (callback === void 0) <add> callback = null; <add> $(component.element).fadeIn(_.net.yested.DURATION_huuymz$, _.net.yested.FadeIn.apply_suy7ya$f(callback)); <add> } <add> }, /** @lends _.net.yested.FadeIn */ { <add> apply_suy7ya$f: function (callback) { <add> return function () { <add> _.net.yested.call(callback); <add> }; <add> } <add> }), <add> Fade: Kotlin.createClass(function () { <add> return [_.net.yested.BiDirectionEffect]; <add> }, null, /** @lends _.net.yested.Fade.prototype */ { <add> applyIn_suy7ya$: function (component, callback) { <add> if (callback === void 0) <add> callback = null; <add> (new _.net.yested.FadeIn()).apply_suy7ya$(component, callback); <add> }, <add> applyOut_suy7ya$: function (component, callback) { <add> if (callback === void 0) <add> callback = null; <add> (new _.net.yested.FadeOut()).apply_suy7ya$(component, callback); <add> } <add> }), <add> Slide: Kotlin.createClass(function () { <add> return [_.net.yested.BiDirectionEffect]; <add> }, null, /** @lends _.net.yested.Slide.prototype */ { <add> applyIn_suy7ya$: function (component, callback) { <add> if (callback === void 0) <add> callback = null; <add> (new _.net.yested.SlideDown()).apply_suy7ya$(component, callback); <add> }, <add> applyOut_suy7ya$: function (component, callback) { <add> if (callback === void 0) <add> callback = null; <add> (new _.net.yested.SlideUp()).apply_suy7ya$(component, callback); <add> } <add> }), <ide> replaceAll_ex0kps$: function ($receiver, regex, with_0) { <ide> return $receiver.replace(new RegExp(regex, 'g'), with_0); <ide> }, <ide> return 'rgba(' + $receiver.red + ',' + $receiver.green + ',' + $receiver.blue + ',' + $receiver.alpha + ')'; <ide> }, <ide> Colorized: Kotlin.createClass(function () { <del> return [_.net.yested.Span]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun(color, backgroundColor, init) { <ide> if (color === void 0) <ide> color = null; <ide> if (backgroundColor === void 0) <ide> backgroundColor = null; <del> $fun.baseInitializer.call(this); <add> $fun.baseInitializer.call(this, 'span'); <ide> this.style = (color != null ? 'color: ' + _.net.yested.toHTMLColor_p73cws$(color) + ';' : '') + (backgroundColor != null ? 'background-color: ' + _.net.yested.toHTMLColor_p73cws$(backgroundColor) + ';' : ''); <ide> init.call(this); <ide> }), <del> Attribute: Kotlin.createClass(null, null, /** @lends _.net.yested.Attribute.prototype */ { <add> Attribute: Kotlin.createClass(null, function (attributeName) { <add> if (attributeName === void 0) <add> attributeName = null; <add> this.attributeName = attributeName; <add> }, /** @lends _.net.yested.Attribute.prototype */ { <ide> get_262zbl$: function (thisRef, prop) { <del> return (thisRef != null ? thisRef : Kotlin.throwNPE()).element.getAttribute(prop.name); <add> var tmp$0; <add> return (thisRef != null ? thisRef : Kotlin.throwNPE()).element.getAttribute((tmp$0 = this.attributeName) != null ? tmp$0 : prop.name); <ide> }, <ide> set_ujvi5f$: function (thisRef, prop, value) { <del> (thisRef != null ? thisRef : Kotlin.throwNPE()).element.setAttribute(prop.name, value); <add> var tmp$0; <add> (thisRef != null ? thisRef : Kotlin.throwNPE()).element.setAttribute((tmp$0 = this.attributeName) != null ? tmp$0 : prop.name, value); <ide> } <ide> }), <del> Component: Kotlin.createTrait(null, /** @lends _.net.yested.Component.prototype */ { <del> clazz: { <del> get: function () { <del> return this.element.getAttribute('class'); <del> }, <del> set: function (value) { <del> this.element.setAttribute('class', value); <del> } <add> Component: Kotlin.createTrait(null), <add> createElement_61zpoe$: function (name) { <add> return document.createElement(name); <add> }, <add> appendComponent_c36dq0$: function ($receiver, component) { <add> $receiver.appendChild(component.element); <add> }, <add> removeChildByName_thdyg2$: function ($receiver, childElementName) { <add> var child = Kotlin.modules['stdlib'].kotlin.dom.get_first_d3eamn$($receiver.getElementsByTagName(childElementName)); <add> if (child != null) { <add> $receiver.removeChild(child); <ide> } <del> }), <del> ParentComponent: Kotlin.createClass(function () { <add> }, <add> HTMLComponent: Kotlin.createClass(function () { <ide> return [_.net.yested.Component]; <ide> }, function (tagName) { <del> this.$element_jz8lgw$ = document.createElement(tagName); <add> this.$element_7lm5ox$ = _.net.yested.createElement_61zpoe$(tagName); <add> this.role$delegate = new _.net.yested.Attribute(); <add> this.style$delegate = new _.net.yested.Attribute(); <ide> this.id$delegate = new _.net.yested.Attribute(); <del> }, /** @lends _.net.yested.ParentComponent.prototype */ { <add> this.clazz$delegate = new _.net.yested.Attribute('class'); <add> }, /** @lends _.net.yested.HTMLComponent.prototype */ { <ide> element: { <ide> get: function () { <del> return this.$element_jz8lgw$; <add> return this.$element_7lm5ox$; <add> }, <add> set: function (element) { <add> this.$element_7lm5ox$ = element; <add> } <add> }, <add> role: { <add> get: function () { <add> return this.role$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('role')); <add> }, <add> set: function (role) { <add> this.role$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('role'), role); <add> } <add> }, <add> style: { <add> get: function () { <add> return this.style$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('style')); <add> }, <add> set: function (style) { <add> this.style$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('style'), style); <ide> } <ide> }, <ide> id: { <ide> this.id$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('id'), id); <ide> } <ide> }, <del> setAttribute_puj7f4$: function (name, value) { <del> this.element.setAttribute(name, value); <del> }, <del> getAttribute_61zpoe$: function (name) { <del> return this.element.getAttribute(name); <del> }, <del> add_5f0h2k$: function (component) { <del> this.element.appendChild(component.element); <del> }, <del> add_61zpoe$: function (text) { <del> this.element.innerHTML = this.element.innerHTML + text; <del> }, <del> removeChild_61zpoe$: function (childElementName) { <del> var child = Kotlin.modules['stdlib'].kotlin.dom.get_first_d3eamn$(this.element.getElementsByTagName(childElementName)); <del> if (child != null) { <del> this.element.removeChild(child); <del> } <del> } <del> }), <del> HTMLParentComponent: Kotlin.createClass(function () { <del> return [_.net.yested.ParentComponent]; <del> }, function $fun(tagName) { <del> $fun.baseInitializer.call(this, tagName); <del> this.role$delegate = new _.net.yested.Attribute(); <del> this.style$delegate = new _.net.yested.Attribute(); <del> }, /** @lends _.net.yested.HTMLParentComponent.prototype */ { <del> role: { <add> clazz: { <ide> get: function () { <del> return this.role$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('role')); <del> }, <del> set: function (role) { <del> this.role$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('role'), role); <del> } <del> }, <del> style: { <del> get: function () { <del> return this.style$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('style')); <del> }, <del> set: function (style) { <del> this.style$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('style'), style); <add> return this.clazz$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('clazz')); <add> }, <add> set: function (clazz) { <add> this.clazz$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('clazz'), clazz); <ide> } <ide> }, <ide> rangeTo_94jgcu$: function ($receiver, value) { <ide> this.element.setAttribute($receiver, value); <ide> }, <ide> plus_pdl1w0$: function ($receiver) { <del> this.add_61zpoe$($receiver); <add> this.element.innerHTML = this.element.innerHTML + $receiver; <ide> }, <ide> plus_pv6laa$: function ($receiver) { <del> this.add_5f0h2k$($receiver); <del> }, <del> add_5f0h2k$: function (component) { <del> _.net.yested.ParentComponent.prototype.add_5f0h2k$.call(this, component); <del> }, <del> add_61zpoe$: function (text) { <del> _.net.yested.ParentComponent.prototype.add_61zpoe$.call(this, text); <del> }, <del> replace_61zpoe$: function (text) { <add> this.appendChild_5f0h2k$($receiver); <add> }, <add> appendChild_5f0h2k$: function (component) { <add> _.net.yested.appendComponent_c36dq0$(this.element, component); <add> }, <add> setContent_61zpoe$: function (text) { <ide> this.element.innerHTML = text; <ide> }, <del> replace_5f0h2k$: function (component) { <add> setChild_5f0h2k$: function (component) { <ide> this.element.innerHTML = ''; <ide> this.element.appendChild(component.element); <ide> }, <del> fade_suy7ya$: function (component, callback) { <add> setChild_hu5ove$: function (content, effect, callback) { <ide> if (callback === void 0) <del> callback = _.net.yested.HTMLParentComponent.fade_suy7ya$f; <del> $(this.element).fadeOut(200, _.net.yested.HTMLParentComponent.fade_suy7ya$f_0(this, component, callback)); <add> callback = null; <add> effect.applyOut_suy7ya$(this, _.net.yested.HTMLComponent.setChild_hu5ove$f(content, this, effect, callback)); <ide> }, <ide> onclick: { <ide> get: function () { <ide> if (onclick === void 0) <ide> onclick = null; <ide> if (init === void 0) <del> init = _.net.yested.HTMLParentComponent.a_b4th6h$f; <add> init = _.net.yested.HTMLComponent.a_b4th6h$f; <ide> var anchor = new _.net.yested.Anchor(); <ide> if (href != null) { <ide> anchor.href = href; <ide> anchor.clazz = clazz; <ide> } <ide> init.call(anchor); <del> this.add_5f0h2k$(anchor); <add> _.net.yested.appendComponent_c36dq0$(this.element, anchor); <ide> }, <ide> div_5rsex9$: function (id, clazz, init) { <ide> if (id === void 0) <ide> if (id != null) { <ide> div.id = id; <ide> } <del> this.add_5f0h2k$(div); <add> _.net.yested.appendComponent_c36dq0$(this.element, div); <ide> return div; <ide> }, <ide> span_dkuwo$: function (clazz, init) { <ide> clazz = null; <ide> var span = new _.net.yested.Span(); <ide> init.call(span); <del> clazz != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(clazz, _.net.yested.HTMLParentComponent.span_dkuwo$f(clazz, span)) : null; <del> this.add_5f0h2k$(span); <add> clazz != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(clazz, _.net.yested.HTMLComponent.span_dkuwo$f(clazz, span)) : null; <add> _.net.yested.appendComponent_c36dq0$(this.element, span); <ide> return span; <ide> }, <ide> img_puj7f4$: function (src, alt) { <ide> if (alt === void 0) <ide> alt = null; <del> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.Image(), _.net.yested.HTMLParentComponent.img_puj7f4$f(src, alt))); <add> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.Image(), _.net.yested.HTMLComponent.img_puj7f4$f(src, alt))); <ide> }, <ide> p_omdg96$: function (init) { <del> var p = new _.net.yested.P(); <del> init.call(p); <del> this.add_5f0h2k$(p); <del> }, <del> tag_hgkgkc$: function (tagName, init) { <del> var tag = new _.net.yested.HTMLParentComponent(tagName); <del> init.call(tag); <del> this.add_5f0h2k$(tag); <del> return tag; <add> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.P(), _.net.yested.HTMLComponent.p_omdg96$f(init))); <add> }, <add> tag_s8xvdm$: function (tagName, init) { <add> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.HTMLComponent(tagName), _.net.yested.HTMLComponent.tag_s8xvdm$f(init))); <ide> }, <ide> table_or8fdg$: function (init) { <del> var table = new _.net.yested.Table(); <del> init.call(table); <del> this.add_5f0h2k$(table); <del> }, <del> button_mqmp2n$: function (label, type, onclick) { <add> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.Table(), _.net.yested.HTMLComponent.table_or8fdg$f(init))); <add> }, <add> button_fpm6mz$: function (label, type, onclick) { <ide> if (type === void 0) <ide> type = _.net.yested.ButtonType.object.BUTTON; <del> this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Button(type), _.net.yested.HTMLParentComponent.button_mqmp2n$f(label, onclick))); <add> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.Button(type), _.net.yested.HTMLComponent.button_fpm6mz$f(label, onclick))); <ide> }, <ide> code_puj7f4$: function (lang, content) { <ide> if (lang === void 0) <ide> lang = 'javascript'; <del> this.add_5f0h2k$(this.tag_hgkgkc$('pre', _.net.yested.HTMLParentComponent.code_puj7f4$f(content))); <add> this.tag_s8xvdm$('pre', _.net.yested.HTMLComponent.code_puj7f4$f(content)); <ide> }, <ide> ul_8qfrsd$: function (init) { <del> this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.HTMLParentComponent.ul_8qfrsd$f(init))); <add> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.HTMLComponent.ul_8qfrsd$f(init))); <ide> }, <ide> ol_t3splz$: function (init) { <del> this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.OL(), _.net.yested.HTMLParentComponent.ol_t3splz$f(init))); <add> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.OL(), _.net.yested.HTMLComponent.ol_t3splz$f(init))); <ide> }, <ide> dl_79d1z0$: function (init) { <del> this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.DL(), _.net.yested.HTMLParentComponent.dl_79d1z0$f(init))); <add> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.DL(), _.net.yested.HTMLComponent.dl_79d1z0$f(init))); <ide> }, <ide> nbsp_za3lpa$: function (times) { <ide> var tmp$0; <ide> if (times === void 0) <ide> times = 1; <del> tmp$0 = Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(new Kotlin.NumberRange(1, times), _.net.yested.HTMLParentComponent.nbsp_za3lpa$f(this)); <add> tmp$0 = Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(new Kotlin.NumberRange(1, times), _.net.yested.HTMLComponent.nbsp_za3lpa$f(this)); <ide> tmp$0; <ide> }, <del> addTag_hgkgkc$: function (tagName, init) { <del> this.add_5f0h2k$(this.tag_hgkgkc$(tagName, _.net.yested.HTMLParentComponent.addTag_hgkgkc$f(init))); <del> }, <del> h1_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('h1', init); <del> }, <del> h2_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('h2', init); <del> }, <del> h3_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('h3', init); <del> }, <del> h4_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('h4', init); <del> }, <del> h5_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('h5', init); <del> }, <del> emph_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('strong', init); <del> }, <del> small_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('small', init); <del> }, <del> mark_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('mark', init); <del> }, <del> del_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('del', init); <del> }, <del> s_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('s', init); <del> }, <del> ins_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('ins', init); <del> }, <del> u_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('u', init); <del> }, <del> strong_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('strong', init); <del> }, <del> em_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('em', init); <del> }, <del> b_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('b', init); <del> }, <del> i_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('i', init); <del> }, <del> kbd_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('kbd', init); <del> }, <del> variable_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('var', init); <del> }, <del> samp_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('samp', init); <del> }, <del> blockquote_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('blockquote', init); <del> }, <del> form_mfnzi$: function (init) { <del> this.addTag_hgkgkc$('form', init); <del> }, <del> textArea_20433s$: function (rows, init) { <add> h1_kv1miw$: function (init) { <add> this.tag_s8xvdm$('h1', init); <add> }, <add> h2_kv1miw$: function (init) { <add> this.tag_s8xvdm$('h2', init); <add> }, <add> h3_kv1miw$: function (init) { <add> this.tag_s8xvdm$('h3', init); <add> }, <add> h4_kv1miw$: function (init) { <add> this.tag_s8xvdm$('h4', init); <add> }, <add> h5_kv1miw$: function (init) { <add> this.tag_s8xvdm$('h5', init); <add> }, <add> emph_kv1miw$: function (init) { <add> this.tag_s8xvdm$('strong', init); <add> }, <add> small_kv1miw$: function (init) { <add> this.tag_s8xvdm$('small', init); <add> }, <add> mark_kv1miw$: function (init) { <add> this.tag_s8xvdm$('mark', init); <add> }, <add> del_kv1miw$: function (init) { <add> this.tag_s8xvdm$('del', init); <add> }, <add> s_kv1miw$: function (init) { <add> this.tag_s8xvdm$('s', init); <add> }, <add> ins_kv1miw$: function (init) { <add> this.tag_s8xvdm$('ins', init); <add> }, <add> u_kv1miw$: function (init) { <add> this.tag_s8xvdm$('u', init); <add> }, <add> strong_kv1miw$: function (init) { <add> this.tag_s8xvdm$('strong', init); <add> }, <add> em_kv1miw$: function (init) { <add> this.tag_s8xvdm$('em', init); <add> }, <add> b_kv1miw$: function (init) { <add> this.tag_s8xvdm$('b', init); <add> }, <add> i_kv1miw$: function (init) { <add> this.tag_s8xvdm$('i', init); <add> }, <add> kbd_kv1miw$: function (init) { <add> this.tag_s8xvdm$('kbd', init); <add> }, <add> variable_kv1miw$: function (init) { <add> this.tag_s8xvdm$('var', init); <add> }, <add> samp_kv1miw$: function (init) { <add> this.tag_s8xvdm$('samp', init); <add> }, <add> blockquote_kv1miw$: function (init) { <add> this.tag_s8xvdm$('blockquote', init); <add> }, <add> form_kv1miw$: function (init) { <add> this.tag_s8xvdm$('form', init); <add> }, <add> textArea_tt6the$: function (rows, init) { <ide> if (rows === void 0) <ide> rows = 3; <del> this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.HTMLParentComponent('textarea'), _.net.yested.HTMLParentComponent.textArea_20433s$f(rows, init))); <del> }, <del> abbr_hgkgkc$: function (title, init) { <del> this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.HTMLParentComponent('abbr'), _.net.yested.HTMLParentComponent.abbr_hgkgkc$f(title, init))); <add> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('textarea'), _.net.yested.HTMLComponent.textArea_tt6the$f(rows, init))); <add> }, <add> abbr_s8xvdm$: function (title, init) { <add> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('abbr'), _.net.yested.HTMLComponent.abbr_s8xvdm$f(title, init))); <ide> }, <ide> br: function () { <del> this.addTag_hgkgkc$('br', _.net.yested.HTMLParentComponent.br$f); <del> }, <del> label_y7cemi$: function (forId, clazz, init) { <add> this.tag_s8xvdm$('br', _.net.yested.HTMLComponent.br$f); <add> }, <add> label_aisbro$: function (forId, clazz, init) { <ide> if (forId === void 0) <ide> forId = null; <ide> if (clazz === void 0) <ide> clazz = null; <del> var l = _.net.yested.with_owvm91$(new _.net.yested.HTMLParentComponent('label'), _.net.yested.HTMLParentComponent.label_y7cemi$f(forId, clazz, init)); <del> this.add_5f0h2k$(l); <add> var l = _.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('label'), _.net.yested.HTMLComponent.label_aisbro$f(forId, clazz, init)); <add> this.plus_pv6laa$(l); <ide> return l; <ide> } <del> }, /** @lends _.net.yested.HTMLParentComponent */ { <del> fade_suy7ya$f: function () { <del> }, <del> fade_suy7ya$f_0: function (this$HTMLParentComponent, component, callback) { <add> }, /** @lends _.net.yested.HTMLComponent */ { <add> f: function (callback) { <add> return function (it) { <add> (callback != null ? callback : Kotlin.throwNPE())(); <add> }; <add> }, <add> f_0: function (callback) { <ide> return function () { <del> this$HTMLParentComponent.element.innerHTML = ''; <del> this$HTMLParentComponent.element.appendChild(component.element); <del> $(this$HTMLParentComponent.element).fadeIn(200, callback); <add> callback != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(callback, _.net.yested.HTMLComponent.f(callback)) : null; <add> }; <add> }, <add> setChild_hu5ove$f: function (content, this$HTMLComponent, effect, callback) { <add> return function () { <add> this$HTMLComponent.setChild_5f0h2k$(content); <add> effect.applyIn_suy7ya$(this$HTMLComponent, _.net.yested.HTMLComponent.f_0(callback)); <ide> }; <ide> }, <ide> a_b4th6h$f: function () { <ide> this.alt = alt != null ? alt : ''; <ide> }; <ide> }, <del> button_mqmp2n$f: function (label, onclick) { <add> p_omdg96$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <add> }, <add> tag_s8xvdm$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <add> }, <add> table_or8fdg$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <add> }, <add> button_fpm6mz$f: function (label, onclick) { <ide> return function () { <ide> label.call(this); <ide> this.element.onclick = onclick; <ide> }; <ide> }, <del> f: function (content) { <add> f_1: function (content) { <ide> return function () { <ide> this.plus_pdl1w0$(_.net.yested.printMarkup(content)); <ide> }; <ide> }, <ide> code_puj7f4$f: function (content) { <ide> return function () { <del> this.tag_hgkgkc$('code', _.net.yested.HTMLParentComponent.f(content)); <add> this.tag_s8xvdm$('code', _.net.yested.HTMLComponent.f_1(content)); <ide> }; <ide> }, <ide> ul_8qfrsd$f: function (init) { <ide> init.call(this); <ide> }; <ide> }, <del> nbsp_za3lpa$f: function (this$HTMLParentComponent) { <add> nbsp_za3lpa$f: function (this$HTMLComponent) { <ide> return function (it) { <del> this$HTMLParentComponent.add_61zpoe$('&nbsp;'); <del> }; <del> }, <del> addTag_hgkgkc$f: function (init) { <add> this$HTMLComponent.plus_pdl1w0$('&nbsp;'); <add> }; <add> }, <add> textArea_tt6the$f: function (rows, init) { <ide> return function () { <add> this.element.setAttribute('rows', rows.toString()); <ide> init.call(this); <ide> }; <ide> }, <del> textArea_20433s$f: function (rows, init) { <add> abbr_s8xvdm$f: function (title, init) { <ide> return function () { <del> this.setAttribute_puj7f4$('rows', rows.toString()); <add> this.element.setAttribute('title', title); <ide> init.call(this); <ide> }; <ide> }, <del> abbr_hgkgkc$f: function (title, init) { <del> return function () { <del> this.setAttribute_puj7f4$('title', title); <del> init.call(this); <del> }; <del> }, <ide> br$f: function () { <ide> }, <del> f_0: function (forId, this$) { <add> f_2: function (forId, this$) { <ide> return function (it) { <ide> this$.rangeTo_94jgcu$('for', forId != null ? forId : Kotlin.throwNPE()); <ide> }; <ide> }, <del> f_1: function (clazz, this$) { <add> f_3: function (clazz, this$) { <ide> return function (it) { <ide> this$.rangeTo_94jgcu$('class', clazz != null ? clazz : Kotlin.throwNPE()); <ide> }; <ide> }, <del> label_y7cemi$f: function (forId, clazz, init) { <add> label_aisbro$f: function (forId, clazz, init) { <ide> return function () { <del> forId != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(forId, _.net.yested.HTMLParentComponent.f_0(forId, this)) : null; <del> clazz != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(clazz, _.net.yested.HTMLParentComponent.f_1(clazz, this)) : null; <add> forId != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(forId, _.net.yested.HTMLComponent.f_2(forId, this)) : null; <add> clazz != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(clazz, _.net.yested.HTMLComponent.f_3(clazz, this)) : null; <ide> init.call(this); <ide> }; <ide> } <ide> }), <ide> Table: Kotlin.createClass(function () { <del> return [_.net.yested.ParentComponent]; <del> }, function $fun() { <del> $fun.baseInitializer.call(this, 'table'); <add> return [_.net.yested.Component]; <add> }, function () { <add> this.$element_47ilv9$ = _.net.yested.createElement_61zpoe$('table'); <ide> this.border$delegate = new _.net.yested.Attribute(); <ide> }, /** @lends _.net.yested.Table.prototype */ { <add> element: { <add> get: function () { <add> return this.$element_47ilv9$; <add> }, <add> set: function (element) { <add> this.$element_47ilv9$ = element; <add> } <add> }, <ide> border: { <ide> get: function () { <ide> return this.border$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('border')); <ide> } <ide> }, <ide> thead_3ua0vu$: function (init) { <del> var thead = new _.net.yested.THead(); <del> init.call(thead); <del> this.add_5f0h2k$(thead); <add> _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.THead(), _.net.yested.Table.thead_3ua0vu$f(init))); <ide> }, <ide> tbody_rj77wk$: function (init) { <del> var tbody = new _.net.yested.TBody(); <del> init.call(tbody); <del> this.add_5f0h2k$(tbody); <add> _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.TBody(), _.net.yested.Table.tbody_rj77wk$f(init))); <add> } <add> }, /** @lends _.net.yested.Table */ { <add> thead_3ua0vu$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <add> }, <add> tbody_rj77wk$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <ide> } <ide> }), <ide> THead: Kotlin.createClass(function () { <del> return [_.net.yested.ParentComponent]; <del> }, function $fun() { <del> $fun.baseInitializer.call(this, 'thead'); <add> return [_.net.yested.Component]; <add> }, function () { <add> this.$element_a26vm7$ = _.net.yested.createElement_61zpoe$('thead'); <ide> }, /** @lends _.net.yested.THead.prototype */ { <add> element: { <add> get: function () { <add> return this.$element_a26vm7$; <add> }, <add> set: function (element) { <add> this.$element_a26vm7$ = element; <add> } <add> }, <ide> tr_l9w0g6$: function (init) { <del> var tr = new _.net.yested.TRHead(); <del> init.call(tr); <del> this.add_5f0h2k$(tr); <add> _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.TRHead(), _.net.yested.THead.tr_l9w0g6$f(init))); <add> } <add> }, /** @lends _.net.yested.THead */ { <add> tr_l9w0g6$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <ide> } <ide> }), <ide> TBody: Kotlin.createClass(function () { <del> return [_.net.yested.ParentComponent]; <del> }, function $fun() { <del> $fun.baseInitializer.call(this, 'tbody'); <add> return [_.net.yested.Component]; <add> }, function () { <add> this.$element_y4rphp$ = _.net.yested.createElement_61zpoe$('tbody'); <ide> }, /** @lends _.net.yested.TBody.prototype */ { <add> element: { <add> get: function () { <add> return this.$element_y4rphp$; <add> }, <add> set: function (element) { <add> this.$element_y4rphp$ = element; <add> } <add> }, <ide> tr_idqsqk$: function (init) { <del> var tr = new _.net.yested.TRBody(); <del> init.call(tr); <del> this.add_5f0h2k$(tr); <add> _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.TRBody(), _.net.yested.TBody.tr_idqsqk$f(init))); <add> } <add> }, /** @lends _.net.yested.TBody */ { <add> tr_idqsqk$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <ide> } <ide> }), <ide> TRHead: Kotlin.createClass(function () { <del> return [_.net.yested.ParentComponent]; <del> }, function $fun() { <del> $fun.baseInitializer.call(this, 'tr'); <add> return [_.net.yested.Component]; <add> }, function () { <add> this.$element_59289p$ = _.net.yested.createElement_61zpoe$('tr'); <ide> }, /** @lends _.net.yested.TRHead.prototype */ { <del> th_mfnzi$: function (init) { <del> var th = new _.net.yested.HTMLParentComponent('th'); <del> init.call(th); <del> this.add_5f0h2k$(th); <del> return th; <add> element: { <add> get: function () { <add> return this.$element_59289p$; <add> }, <add> set: function (element) { <add> this.$element_59289p$ = element; <add> } <add> }, <add> th_kv1miw$: function (init) { <add> _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('th'), _.net.yested.TRHead.th_kv1miw$f(init))); <add> } <add> }, /** @lends _.net.yested.TRHead */ { <add> th_kv1miw$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <ide> } <ide> }), <ide> TRBody: Kotlin.createClass(function () { <del> return [_.net.yested.ParentComponent]; <del> }, function $fun() { <del> $fun.baseInitializer.call(this, 'tr'); <add> return [_.net.yested.Component]; <add> }, function () { <add> this.$element_itillt$ = _.net.yested.createElement_61zpoe$('tr'); <ide> }, /** @lends _.net.yested.TRBody.prototype */ { <del> td_mfnzi$: function (init) { <del> var td = new _.net.yested.HTMLParentComponent('td'); <del> init.call(td); <del> this.add_5f0h2k$(td); <add> element: { <add> get: function () { <add> return this.$element_itillt$; <add> }, <add> set: function (element) { <add> this.$element_itillt$ = element; <add> } <add> }, <add> td_kv1miw$: function (init) { <add> _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('td'), _.net.yested.TRBody.td_kv1miw$f(init))); <add> } <add> }, /** @lends _.net.yested.TRBody */ { <add> td_kv1miw$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <ide> } <ide> }), <ide> OL: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun() { <ide> $fun.baseInitializer.call(this, 'ol'); <ide> }, /** @lends _.net.yested.OL.prototype */ { <ide> li_8y48wp$: function (init) { <del> var li = new _.net.yested.Li(); <del> init.call(li); <del> this.add_5f0h2k$(li); <del> return li; <add> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.OL.li_8y48wp$f(init))); <add> } <add> }, /** @lends _.net.yested.OL */ { <add> li_8y48wp$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <ide> } <ide> }), <ide> UL: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun() { <ide> $fun.baseInitializer.call(this, 'ul'); <ide> }, /** @lends _.net.yested.UL.prototype */ { <ide> li_8y48wp$: function (init) { <del> var li = new _.net.yested.Li(); <del> init.call(li); <del> this.add_5f0h2k$(li); <del> return li; <add> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.UL.li_8y48wp$f(init))); <add> } <add> }, /** @lends _.net.yested.UL */ { <add> li_8y48wp$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <ide> } <ide> }), <ide> DL: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun() { <ide> $fun.baseInitializer.call(this, 'dl'); <ide> }, /** @lends _.net.yested.DL.prototype */ { <del> item_b459qs$: function (dt, dd) { <del> this.add_5f0h2k$(this.tag_hgkgkc$('dt', dt)); <del> this.add_5f0h2k$(this.tag_hgkgkc$('dd', dd)); <add> item_z5xo0k$: function (dt, dd) { <add> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('dt'), _.net.yested.DL.item_z5xo0k$f(dt))); <add> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('dd'), _.net.yested.DL.item_z5xo0k$f_0(dd))); <add> } <add> }, /** @lends _.net.yested.DL */ { <add> item_z5xo0k$f: function (dt) { <add> return function () { <add> dt.call(this); <add> }; <add> }, <add> item_z5xo0k$f_0: function (dd) { <add> return function () { <add> dd.call(this); <add> }; <ide> } <ide> }), <ide> Canvas: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun(width, height) { <ide> $fun.baseInitializer.call(this, 'canvas'); <ide> this.width = width; <ide> this.height = height; <del> this.setAttribute_puj7f4$('width', this.width.toString()); <del> this.setAttribute_puj7f4$('height', this.height.toString()); <add> this.element.setAttribute('width', this.width.toString()); <add> this.element.setAttribute('height', this.height.toString()); <ide> }, /** @lends _.net.yested.Canvas.prototype */ { <ide> getContext_61zpoe$: function (id) { <ide> return this.element.getContext(id); <ide> } <ide> }), <ide> Div: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun() { <ide> $fun.baseInitializer.call(this, 'div'); <ide> }), <ide> Span: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun() { <ide> $fun.baseInitializer.call(this, 'span'); <ide> }), <ide> }; <ide> }), <ide> Button: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun(type) { <ide> if (type === void 0) <ide> type = _.net.yested.ButtonType.object.BUTTON; <ide> $fun.baseInitializer.call(this, 'button'); <del> this.setAttribute_puj7f4$('type', type.code); <add> this.element.setAttribute('type', type.code); <ide> }), <ide> Image: Kotlin.createClass(function () { <del> return [_.net.yested.ParentComponent]; <del> }, function $fun() { <del> $fun.baseInitializer.call(this, 'img'); <add> return [_.net.yested.Component]; <add> }, function () { <add> this.$element_lb4lns$ = _.net.yested.createElement_61zpoe$('img'); <ide> this.src$delegate = new _.net.yested.Attribute(); <ide> this.alt$delegate = new _.net.yested.Attribute(); <ide> }, /** @lends _.net.yested.Image.prototype */ { <add> element: { <add> get: function () { <add> return this.$element_lb4lns$; <add> } <add> }, <ide> src: { <ide> get: function () { <ide> return this.src$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('src')); <ide> } <ide> }), <ide> P: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun() { <ide> $fun.baseInitializer.call(this, 'p'); <ide> }), <ide> Li: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun() { <ide> $fun.baseInitializer.call(this, 'li'); <ide> }), <ide> Anchor: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun() { <ide> $fun.baseInitializer.call(this, 'a'); <ide> this.href$delegate = new _.net.yested.Attribute(); <ide> } <ide> return div; <ide> }, <del> thead_3ua0vu$: function (init) { <del> var thead = new _.net.yested.THead(); <del> init.call(thead); <del> return thead; <del> }, <del> tbody_rj77wk$: function (init) { <del> var tbody = new _.net.yested.TBody(); <del> init.call(tbody); <del> return tbody; <del> }, <del> tag_hgkgkc$f: function (init) { <del> return function () { <del> init.call(this); <del> }; <del> }, <del> tag_hgkgkc$: function (tagName, init) { <del> return _.net.yested.with_owvm91$(new _.net.yested.HTMLParentComponent(tagName), _.net.yested.tag_hgkgkc$f(init)); <del> }, <ide> text_61zpoe$f: function (text) { <ide> return function () { <ide> this.plus_pdl1w0$(text); <ide> }; <ide> }), <ide> Alert: Kotlin.createClass(function () { <del> return [_.net.yested.Div]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun(style) { <del> $fun.baseInitializer.call(this); <add> $fun.baseInitializer.call(this, 'div'); <ide> this.clazz = 'alert alert-' + style.code; <ide> }, /** @lends _.net.yested.bootstrap.Alert.prototype */ { <ide> a_b4th6h$: function (clazz, href, onclick, init) { <ide> onclick = null; <ide> if (init === void 0) <ide> init = _.net.yested.bootstrap.Alert.a_b4th6h$f; <del> _.net.yested.Div.prototype.a_b4th6h$.call(this, clazz != null ? clazz : 'alert-link', href, onclick, init); <add> _.net.yested.HTMLComponent.prototype.a_b4th6h$.call(this, clazz != null ? clazz : 'alert-link', href, onclick, init); <ide> } <ide> }, /** @lends _.net.yested.bootstrap.Alert */ { <ide> a_b4th6h$f: function () { <ide> }; <ide> }, <ide> alert: function ($receiver, style, init) { <del> $receiver.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Alert(style), _.net.yested.bootstrap.alert$f(init))); <add> $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Alert(style), _.net.yested.bootstrap.alert$f(init))); <ide> }, <ide> Breadcrumbs: Kotlin.createClass(function () { <del> return [_.net.yested.ParentComponent]; <del> }, function $fun() { <del> $fun.baseInitializer.call(this, 'ol'); <del> this.setAttribute_puj7f4$('class', 'breadcrumb'); <add> return [_.net.yested.Component]; <add> }, function () { <add> this.$element_atatgz$ = _.net.yested.createElement_61zpoe$('ol'); <add> this.element.setAttribute('class', 'breadcrumb'); <ide> }, /** @lends _.net.yested.bootstrap.Breadcrumbs.prototype */ { <add> element: { <add> get: function () { <add> return this.$element_atatgz$; <add> } <add> }, <ide> link: function (href, onclick, init) { <ide> if (href === void 0) <ide> href = null; <ide> if (onclick === void 0) <ide> onclick = null; <del> this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Breadcrumbs.link$f(href, onclick, init))); <add> _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Breadcrumbs.link$f(href, onclick, init))); <ide> }, <ide> selected: function (init) { <del> this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Breadcrumbs.selected$f(init))); <add> _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Breadcrumbs.selected$f(init))); <ide> } <ide> }, /** @lends _.net.yested.bootstrap.Breadcrumbs */ { <ide> link$f: function (href, onclick, init) { <ide> }; <ide> } <ide> }), <del> breadcrumbs_6bcd71$: function ($receiver, init) { <del> var breadcrumbs = new _.net.yested.bootstrap.Breadcrumbs(); <del> init.call(breadcrumbs); <del> $receiver.add_5f0h2k$(breadcrumbs); <add> breadcrumbs_3d8lml$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <add> }, <add> breadcrumbs_3d8lml$: function ($receiver, init) { <add> var breadcrumbs = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.Breadcrumbs(), _.net.yested.bootstrap.breadcrumbs_3d8lml$f(init)); <add> $receiver.plus_pv6laa$(breadcrumbs); <ide> return breadcrumbs; <ide> }, <ide> ButtonGroup: Kotlin.createClass(function () { <del> return [_.net.yested.ParentComponent]; <del> }, function $fun(size, onSelect) { <add> return [_.net.yested.Component]; <add> }, function (size, onSelect) { <ide> if (size === void 0) <ide> size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; <ide> if (onSelect === void 0) <ide> onSelect = null; <del> $fun.baseInitializer.call(this, 'div'); <ide> this.size = size; <ide> this.onSelect = onSelect; <add> this.$element_t6mq6u$ = _.net.yested.createElement_61zpoe$('div'); <ide> this.buttons_2b2nvz$ = new Kotlin.DefaultPrimitiveHashMap(); <del> this.setAttribute_puj7f4$('class', 'btn-group'); <del> this.setAttribute_puj7f4$('role', 'group'); <add> this.element.setAttribute('class', 'btn-group'); <add> this.element.setAttribute('role', 'group'); <ide> this.value = null; <ide> }, /** @lends _.net.yested.bootstrap.ButtonGroup.prototype */ { <add> element: { <add> get: function () { <add> return this.$element_t6mq6u$; <add> } <add> }, <ide> select_61zpoe$: function (selectValue) { <ide> var tmp$0, tmp$2; <ide> this.value = selectValue; <ide> tmp$2 = Kotlin.modules['stdlib'].kotlin.iterator_acfufl$(this.buttons_2b2nvz$); <ide> while (tmp$2.hasNext()) { <ide> var tmp$1 = tmp$2.next() <del> , key = Kotlin.modules['stdlib'].kotlin.component1_mxmdx1$(tmp$1) <del> , button = Kotlin.modules['stdlib'].kotlin.component2_mxmdx1$(tmp$1); <add> , key = Kotlin.modules['stdlib'].kotlin.component1_mxmdx1$(tmp$1) <add> , button = Kotlin.modules['stdlib'].kotlin.component2_mxmdx1$(tmp$1); <ide> if (Kotlin.equals(key, selectValue)) { <ide> button.active = true; <ide> } <del> else { <add> else { <ide> button.active = false; <ide> } <ide> } <ide> }, <del> button_mtl9nq$: function (value, look, label) { <add> button_ubg574$: function (value, look, label) { <ide> if (look === void 0) <ide> look = _.net.yested.bootstrap.ButtonLook.object.DEFAULT; <del> var button = new _.net.yested.bootstrap.BtsButton(void 0, label, look, this.size, void 0, _.net.yested.bootstrap.ButtonGroup.button_mtl9nq$f(value, this)); <del> this.add_5f0h2k$(button); <add> var button = new _.net.yested.bootstrap.BtsButton(void 0, label, look, this.size, void 0, _.net.yested.bootstrap.ButtonGroup.button_ubg574$f(value, this)); <add> _.net.yested.appendComponent_c36dq0$(this.element, button); <ide> this.buttons_2b2nvz$.put_wn2jw4$(value, button); <ide> } <ide> }, /** @lends _.net.yested.bootstrap.ButtonGroup */ { <del> button_mtl9nq$f: function (value, this$ButtonGroup) { <add> button_ubg574$f: function (value, this$ButtonGroup) { <ide> return function () { <ide> this$ButtonGroup.select_61zpoe$(value); <ide> }; <ide> } <ide> }), <add> buttonGroup_wnptsr$: function ($receiver, size, onSelect, init) { <add> if (size === void 0) <add> size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; <add> if (onSelect === void 0) <add> onSelect = null; <add> $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.ButtonGroup(size, onSelect), init)); <add> }, <ide> ButtonLook: Kotlin.createEnumClass(function () { <ide> return [Kotlin.Enum]; <ide> }, function $fun(code) { <ide> }; <ide> }), <ide> BtsButton: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun(type, label, look, size, block, onclick) { <ide> if (type === void 0) <ide> type = _.net.yested.ButtonType.object.BUTTON; <ide> this.block = block; <ide> this.buttonActive_nol8t8$ = false; <ide> this.setClass(); <del> this.setAttribute_puj7f4$('type', type.code); <add> this.element.setAttribute('type', type.code); <ide> label.call(this); <ide> this.onclick = onclick; <ide> }, /** @lends _.net.yested.bootstrap.BtsButton.prototype */ { <ide> } <ide> }, <ide> setClass: function () { <del> this.setAttribute_puj7f4$('class', 'btn btn-' + this.look.code + ' btn-' + this.size.code + ' ' + (this.block ? 'btn-block' : '') + ' ' + (this.buttonActive_nol8t8$ ? 'active' : '')); <add> this.element.setAttribute('class', 'btn btn-' + this.look.code + ' btn-' + this.size.code + ' ' + (this.block ? 'btn-block' : '') + ' ' + (this.buttonActive_nol8t8$ ? 'active' : '')); <ide> } <ide> }), <ide> BtsAnchor: Kotlin.createClass(function () { <del> return [_.net.yested.Anchor]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun(href, look, size, block) { <ide> if (look === void 0) <ide> look = _.net.yested.bootstrap.ButtonLook.object.DEFAULT; <ide> size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; <ide> if (block === void 0) <ide> block = false; <del> $fun.baseInitializer.call(this); <add> $fun.baseInitializer.call(this, 'a'); <add> this.href$delegate = new _.net.yested.Attribute(); <ide> this.href = href; <del> this.setAttribute_puj7f4$('class', 'btn btn-' + look.code + ' btn-' + size.code + ' ' + (block ? 'btn-block' : '')); <add> this.element.setAttribute('class', 'btn btn-' + look.code + ' btn-' + size.code + ' ' + (block ? 'btn-block' : '')); <add> }, /** @lends _.net.yested.bootstrap.BtsAnchor.prototype */ { <add> href: { <add> get: function () { <add> return this.href$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('href')); <add> }, <add> set: function (href) { <add> this.href$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('href'), href); <add> } <add> } <ide> }), <del> btsButton_j2rvkn$: function ($receiver, type, label, look, size, block, onclick) { <add> btsButton_adnmfr$: function ($receiver, type, label, look, size, block, onclick) { <ide> if (type === void 0) <ide> type = _.net.yested.ButtonType.object.BUTTON; <ide> if (look === void 0) <ide> size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; <ide> if (block === void 0) <ide> block = false; <del> var btn = new _.net.yested.bootstrap.BtsButton(type, label, look, size, block, onclick); <del> $receiver.add_5f0h2k$(btn); <del> }, <del> btsAnchor_ydi2fr$: function ($receiver, href, look, size, block, init) { <add> $receiver.plus_pv6laa$(new _.net.yested.bootstrap.BtsButton(type, label, look, size, block, onclick)); <add> }, <add> btsAnchor_2ak3uo$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <add> }, <add> btsAnchor_2ak3uo$: function ($receiver, href, look, size, block, init) { <ide> if (look === void 0) <ide> look = _.net.yested.bootstrap.ButtonLook.object.DEFAULT; <ide> if (size === void 0) <ide> size = _.net.yested.bootstrap.ButtonSize.object.DEFAULT; <ide> if (block === void 0) <ide> block = false; <del> var btn = new _.net.yested.bootstrap.BtsAnchor(href, look, size, block); <del> init.call(btn); <del> $receiver.add_5f0h2k$(btn); <add> $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.BtsAnchor(href, look, size, block), _.net.yested.bootstrap.btsAnchor_2ak3uo$f(init))); <ide> }, <ide> Device: Kotlin.createEnumClass(function () { <ide> return [Kotlin.Enum]; <ide> f_2: function () { <ide> this.clazz = 'modal-title'; <ide> }, <del> f_3: function (init) { <add> f_3: function (init, this$) { <ide> return function () { <del> init.call(this); <add> init.call(this$); <ide> }; <ide> }, <ide> header_1$f: function (init) { <ide> return function () { <del> this.tag_hgkgkc$('button', _.net.yested.bootstrap.Dialog.f_1); <del> _.net.yested.with_owvm91$(this.tag_hgkgkc$('h4', _.net.yested.bootstrap.Dialog.f_2), _.net.yested.bootstrap.Dialog.f_3(init)); <add> this.tag_s8xvdm$('button', _.net.yested.bootstrap.Dialog.f_1); <add> _.net.yested.with_owvm91$(this.tag_s8xvdm$('h4', _.net.yested.bootstrap.Dialog.f_2), _.net.yested.bootstrap.Dialog.f_3(init, this)); <ide> }; <ide> }, <ide> f_4: function (this$Dialog, this$) { <ide> } <ide> }), <ide> Form: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun(labelDef, inputDef) { <ide> if (labelDef === void 0) <ide> labelDef = 'col-sm-2'; <ide> this.role = 'form'; <ide> this.element.setAttribute('onsubmit', 'return false'); <ide> }, /** @lends _.net.yested.bootstrap.Form.prototype */ { <del> item_2xyzwi$: function (forId, label, validator, content) { <add> item_gthhqa$: function (forId, label, validator, content) { <ide> if (forId === void 0) <ide> forId = ''; <ide> if (validator === void 0) <ide> validator = null; <del> var spanErrMsg = _.net.yested.with_owvm91$(new _.net.yested.Span(), _.net.yested.bootstrap.Form.item_2xyzwi$f); <del> var divInput = _.net.yested.with_owvm91$(this.div_5rsex9$(void 0, this.inputDef_mlmxkk$, content), _.net.yested.bootstrap.Form.item_2xyzwi$f_0(spanErrMsg)); <del> var divFormGroup = this.div_5rsex9$(void 0, 'form-group', _.net.yested.bootstrap.Form.item_2xyzwi$f_1(forId, this, label, divInput)); <del> validator != null ? validator.onchange_ra2fzg$(_.net.yested.bootstrap.Form.item_2xyzwi$f_2(divFormGroup, spanErrMsg, validator)) : null; <add> var spanErrMsg = _.net.yested.with_owvm91$(new _.net.yested.Span(), _.net.yested.bootstrap.Form.item_gthhqa$f); <add> var divInput = _.net.yested.with_owvm91$(this.div_5rsex9$(void 0, this.inputDef_mlmxkk$, content), _.net.yested.bootstrap.Form.item_gthhqa$f_0(spanErrMsg)); <add> var divFormGroup = this.div_5rsex9$(void 0, 'form-group', _.net.yested.bootstrap.Form.item_gthhqa$f_1(forId, this, label, divInput)); <add> validator != null ? validator.onchange_ra2fzg$(_.net.yested.bootstrap.Form.item_gthhqa$f_2(divFormGroup, spanErrMsg, validator)) : null; <ide> } <ide> }, /** @lends _.net.yested.bootstrap.Form */ { <del> item_2xyzwi$f: function () { <add> item_gthhqa$f: function () { <ide> this.clazz = 'help-block'; <ide> }, <del> item_2xyzwi$f_0: function (spanErrMsg) { <add> item_gthhqa$f_0: function (spanErrMsg) { <ide> return function () { <ide> this.plus_pv6laa$(spanErrMsg); <ide> }; <ide> }, <del> item_2xyzwi$f_1: function (forId, this$Form, label, divInput) { <add> item_gthhqa$f_1: function (forId, this$Form, label, divInput) { <ide> return function () { <del> this.label_y7cemi$(forId, this$Form.labelDef_hl3t2u$ + ' control-label', label); <add> this.label_aisbro$(forId, this$Form.labelDef_hl3t2u$ + ' control-label', label); <ide> this.plus_pv6laa$(divInput); <ide> }; <ide> }, <del> item_2xyzwi$f_2: function (divFormGroup, spanErrMsg, validator) { <add> item_gthhqa$f_2: function (divFormGroup, spanErrMsg, validator) { <ide> return function (isValid) { <ide> divFormGroup.clazz = isValid ? 'form-group' : 'form-group has-error'; <del> spanErrMsg.replace_61zpoe$(isValid ? '' : (validator != null ? validator : Kotlin.throwNPE()).errorText); <add> spanErrMsg.setContent_61zpoe$(isValid ? '' : (validator != null ? validator : Kotlin.throwNPE()).errorText); <ide> }; <ide> } <ide> }), <del> btsForm_nas0k3$: function ($receiver, labelDef, inputDef, init) { <add> btsForm_iz33rd$: function ($receiver, labelDef, inputDef, init) { <ide> if (labelDef === void 0) <ide> labelDef = 'col-sm-2'; <ide> if (inputDef === void 0) <ide> inputDef = 'col-sm-10'; <ide> var form = new _.net.yested.bootstrap.Form(labelDef, inputDef); <ide> init.call(form); <del> $receiver.add_5f0h2k$(form); <add> $receiver.plus_pv6laa$(form); <ide> }, <ide> Glyphicon: Kotlin.createClass(function () { <del> return [_.net.yested.Span]; <del> }, function $fun(icon) { <del> $fun.baseInitializer.call(this); <del> this.clazz = 'glyphicon glyphicon-' + icon; <add> return [_.net.yested.Component]; <add> }, function (icon) { <add> this.$element_bxaorm$ = _.net.yested.createElement_61zpoe$('span'); <add> this.element.className = 'glyphicon glyphicon-' + icon; <add> }, /** @lends _.net.yested.bootstrap.Glyphicon.prototype */ { <add> element: { <add> get: function () { <add> return this.$element_bxaorm$; <add> } <add> } <ide> }), <del> glyphicon_a53mlj$: function ($receiver, icon) { <del> var glyphicon = new _.net.yested.bootstrap.Glyphicon(icon); <del> $receiver.add_5f0h2k$(glyphicon); <del> return glyphicon; <add> glyphicon_8jxlbl$: function ($receiver, icon) { <add> $receiver.plus_pv6laa$(new _.net.yested.bootstrap.Glyphicon(icon)); <ide> }, <ide> Column: Kotlin.createClass(null, function (label, render, sortFunction, align, defaultSort, defaultSortOrderAsc) { <ide> if (align === void 0) <ide> component6: function () { <ide> return this.defaultSortOrderAsc; <ide> }, <del> copy_cd4ud1$: function (label, render, sortFunction, align, defaultSort, defaultSortOrderAsc) { <add> copy_66o9md$: function (label, render, sortFunction, align, defaultSort, defaultSortOrderAsc) { <ide> return new _.net.yested.bootstrap.Column(label === void 0 ? this.label : label, render === void 0 ? this.render : render, sortFunction === void 0 ? this.sortFunction : sortFunction, align === void 0 ? this.align : align, defaultSort === void 0 ? this.defaultSort : defaultSort, defaultSortOrderAsc === void 0 ? this.defaultSortOrderAsc : defaultSortOrderAsc); <ide> }, <ide> toString: function () { <ide> } <ide> }), <ide> ColumnHeader: Kotlin.createClass(function () { <del> return [_.net.yested.Span]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun(column, sortFunction) { <del> $fun.baseInitializer.call(this); <add> $fun.baseInitializer.call(this, 'span'); <ide> this.column = column; <ide> this.sortOrderAsc = this.column.defaultSortOrderAsc; <ide> this.arrowPlaceholder = new _.net.yested.Span(); <del> this.setAttribute_puj7f4$('style', 'cursor: pointer;'); <add> this.element.setAttribute('style', 'cursor: pointer;'); <ide> this.column.label.call(this); <ide> this.plus_pv6laa$(this.arrowPlaceholder); <ide> this.onclick = _.net.yested.bootstrap.ColumnHeader.ColumnHeader$f(sortFunction, this); <ide> }, /** @lends _.net.yested.bootstrap.ColumnHeader.prototype */ { <ide> updateSorting: function (sorteByColumn, sortAscending) { <ide> if (!Kotlin.equals(sorteByColumn, this.column)) { <del> this.arrowPlaceholder.replace_61zpoe$(''); <add> this.arrowPlaceholder.setContent_61zpoe$(''); <ide> } <del> else { <del> this.arrowPlaceholder.replace_5f0h2k$(_.net.yested.bootstrap.glyphicon_a53mlj$(this, 'arrow-' + (sortAscending ? 'up' : 'down'))); <add> else { <add> this.arrowPlaceholder.setChild_5f0h2k$(new _.net.yested.bootstrap.Glyphicon('arrow-' + (sortAscending ? 'up' : 'down'))); <ide> } <ide> } <ide> }, /** @lends _.net.yested.bootstrap.ColumnHeader */ { <ide> } <ide> }), <ide> Grid: Kotlin.createClass(function () { <del> return [_.net.yested.ParentComponent]; <del> }, function $fun(columns) { <add> return [_.net.yested.Component]; <add> }, function (columns) { <ide> var tmp$0, tmp$1, tmp$2, tmp$3; <del> $fun.baseInitializer.call(this, 'table'); <ide> this.columns = columns; <add> this.$element_88h9vf$ = _.net.yested.createElement_61zpoe$('table'); <ide> this.sortColumn_xix3o5$ = null; <ide> this.asc_s2pzui$ = true; <ide> this.arrowsPlaceholders_39i6vz$ = new Kotlin.ArrayList(); <ide> this.setSortingArrow(); <ide> this.dataList_chk18h$ = null; <ide> }, /** @lends _.net.yested.bootstrap.Grid.prototype */ { <add> element: { <add> get: function () { <add> return this.$element_88h9vf$; <add> } <add> }, <ide> list: { <ide> get: function () { <ide> return this.dataList_chk18h$; <ide> if (Kotlin.equals(column, this.sortColumn_xix3o5$)) { <ide> this.asc_s2pzui$ = !this.asc_s2pzui$; <ide> } <del> else { <add> else { <ide> this.asc_s2pzui$ = true; <ide> this.sortColumn_xix3o5$ = column; <ide> } <ide> this.setSortingArrow(); <ide> }, <ide> renderHeader: function () { <del> this.add_5f0h2k$(_.net.yested.thead_3ua0vu$(_.net.yested.bootstrap.Grid.renderHeader$f(this))); <add> _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.THead(), _.net.yested.bootstrap.Grid.renderHeader$f(this))); <ide> }, <ide> sortData: function (toSort) { <ide> return Kotlin.modules['stdlib'].kotlin.sortBy_r48qxn$(toSort, _.net.yested.bootstrap.Grid.sortData$f(this)); <ide> }, <ide> displayData: function () { <ide> var tmp$0; <del> this.removeChild_61zpoe$('tbody'); <add> _.net.yested.removeChildByName_thdyg2$(this.element, 'tbody'); <ide> (tmp$0 = this.dataList_chk18h$) != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(tmp$0, _.net.yested.bootstrap.Grid.displayData$f(this)) : null; <ide> } <ide> }, /** @lends _.net.yested.bootstrap.Grid */ { <ide> }, <ide> f_1: function (this$) { <ide> return function (columnHeader) { <del> this$.th_mfnzi$(_.net.yested.bootstrap.Grid.f_0(columnHeader)); <add> this$.th_kv1miw$(_.net.yested.bootstrap.Grid.f_0(columnHeader)); <ide> }; <ide> }, <ide> f_2: function (this$Grid) { <ide> }, <ide> f_4: function (item, this$) { <ide> return function (column) { <del> this$.td_mfnzi$(_.net.yested.bootstrap.Grid.f_3(column, item)); <add> this$.td_kv1miw$(_.net.yested.bootstrap.Grid.f_3(column, item)); <ide> }; <ide> }, <ide> f_5: function (this$Grid, item) { <ide> return function (it) { <ide> var tmp$0, tmp$1; <ide> var values = this$Grid.sortColumn_xix3o5$ != null ? this$Grid.sortData((tmp$0 = this$Grid.dataList_chk18h$) != null ? tmp$0 : Kotlin.throwNPE()) : (tmp$1 = this$Grid.dataList_chk18h$) != null ? tmp$1 : Kotlin.throwNPE(); <del> this$Grid.add_5f0h2k$(_.net.yested.tbody_rj77wk$(_.net.yested.bootstrap.Grid.f_7(values, this$Grid))); <add> _.net.yested.appendComponent_c36dq0$(this$Grid.element, _.net.yested.with_owvm91$(new _.net.yested.TBody(), _.net.yested.bootstrap.Grid.f_7(values, this$Grid))); <ide> }; <ide> } <ide> }), <ide> InputElement: Kotlin.createTrait(null), <ide> TextInput: Kotlin.createClass(function () { <del> return [_.net.yested.bootstrap.InputElement, _.net.yested.ParentComponent]; <del> }, function $fun(placeholder) { <add> return [_.net.yested.bootstrap.InputElement, _.net.yested.Component]; <add> }, function (placeholder) { <ide> if (placeholder === void 0) <ide> placeholder = null; <del> $fun.baseInitializer.call(this, 'input'); <add> this.$element_lks82i$ = _.net.yested.createElement_61zpoe$('input'); <add> this.id$delegate = new _.net.yested.Attribute(); <ide> this.onChangeListeners_gt5ey6$ = new Kotlin.ArrayList(); <ide> this.onChangeLiveListeners_tps6xq$ = new Kotlin.ArrayList(); <ide> this.element.setAttribute('class', 'form-control'); <ide> this.element.setAttribute('placeholder', placeholder); <ide> } <ide> }, /** @lends _.net.yested.bootstrap.TextInput.prototype */ { <add> element: { <add> get: function () { <add> return this.$element_lks82i$; <add> } <add> }, <add> id: { <add> get: function () { <add> return this.id$delegate.get_262zbl$(this, new Kotlin.PropertyMetadata('id')); <add> }, <add> set: function (id) { <add> this.id$delegate.set_ujvi5f$(this, new Kotlin.PropertyMetadata('id'), id); <add> } <add> }, <ide> value: { <ide> get: function () { <ide> return this.element.value; <ide> }; <ide> } <ide> }), <del> textInput_rha0js$: function ($receiver, placeholder, init) { <del> var textInput = new _.net.yested.bootstrap.TextInput(placeholder); <del> init.call(textInput); <del> $receiver.add_5f0h2k$(textInput); <add> textInput_ra92pu$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <add> }, <add> textInput_ra92pu$: function ($receiver, placeholder, init) { <add> $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.TextInput(placeholder), _.net.yested.bootstrap.textInput_ra92pu$f(init))); <ide> }, <ide> CheckBox: Kotlin.createClass(function () { <del> return [_.net.yested.bootstrap.InputElement, _.net.yested.ParentComponent]; <del> }, function $fun() { <del> $fun.baseInitializer.call(this, 'input'); <add> return [_.net.yested.bootstrap.InputElement, _.net.yested.Component]; <add> }, function () { <add> this.$element_k0miea$ = _.net.yested.createElement_61zpoe$('input'); <ide> this.onChangeListeners_o7wbwq$ = new Kotlin.ArrayList(); <ide> this.onChangeLiveListeners_6q2boq$ = new Kotlin.ArrayList(); <del> this.setAttribute_puj7f4$('type', 'checkbox'); <add> this.element.setAttribute('type', 'checkbox'); <ide> this.getElement().onchange = _.net.yested.bootstrap.CheckBox.CheckBox$f(this); <ide> }, /** @lends _.net.yested.bootstrap.CheckBox.prototype */ { <add> element: { <add> get: function () { <add> return this.$element_k0miea$; <add> } <add> }, <ide> getElement: function () { <ide> return this.element; <ide> }, <ide> } <ide> }), <ide> Select: Kotlin.createClass(function () { <del> return [_.net.yested.ParentComponent]; <del> }, function $fun(multiple, size, renderer) { <add> return [_.net.yested.Component]; <add> }, function (multiple, size, renderer) { <ide> if (multiple === void 0) <ide> multiple = false; <ide> if (size === void 0) <ide> size = 1; <del> $fun.baseInitializer.call(this, 'select'); <ide> this.renderer = renderer; <add> this.$element_cjfx6t$ = _.net.yested.createElement_61zpoe$('select'); <ide> this.onChangeListeners_ufju29$ = new Kotlin.ArrayList(); <ide> this.selectedItemsInt_m31zmd$ = Kotlin.modules['stdlib'].kotlin.listOf(); <ide> this.dataInt_w7bdgc$ = null; <ide> } <ide> this.element.onchange = _.net.yested.bootstrap.Select.Select$f(this); <ide> }, /** @lends _.net.yested.bootstrap.Select.prototype */ { <add> element: { <add> get: function () { <add> return this.$element_cjfx6t$; <add> } <add> }, <ide> data: { <ide> get: function () { <ide> return this.dataInt_w7bdgc$; <ide> }, <ide> regenerate$f: function (this$Select) { <ide> return function (it) { <del> var optionTag = _.net.yested.tag_hgkgkc$('option', _.net.yested.bootstrap.Select.f(this$Select, it)); <add> var optionTag = _.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('option'), _.net.yested.bootstrap.Select.f(this$Select, it)); <ide> var value = it; <ide> var selectOption = new _.net.yested.bootstrap.SelectOption(optionTag.element, value); <ide> this$Select.optionTags_gajdrl$.add_za3rmp$(selectOption); <del> this$Select.add_5f0h2k$(optionTag); <add> _.net.yested.appendComponent_c36dq0$(this$Select.element, optionTag); <ide> }; <ide> } <ide> }), <ide> return this$.div_5rsex9$(void 0, 'input-group-addon', _.net.yested.bootstrap.f_1(suffix)); <ide> }; <ide> }, <del> inputAddOn_lzeodb$f: function (prefix, textInput, suffix) { <add> inputAddOn_cc7g17$f: function (prefix, textInput, suffix) { <ide> return function () { <ide> prefix != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(prefix, _.net.yested.bootstrap.f_0(prefix, this)) : null; <ide> this.plus_pv6laa$(textInput); <ide> suffix != null ? Kotlin.modules['stdlib'].kotlin.let_7hr6ff$(suffix, _.net.yested.bootstrap.f_2(suffix, this)) : null; <ide> }; <ide> }, <del> inputAddOn_lzeodb$: function ($receiver, prefix, suffix, textInput) { <add> inputAddOn_cc7g17$: function ($receiver, prefix, suffix, textInput) { <ide> if (prefix === void 0) <ide> prefix = null; <ide> if (suffix === void 0) <ide> suffix = null; <del> $receiver.add_5f0h2k$($receiver.div_5rsex9$(void 0, 'input-group', _.net.yested.bootstrap.inputAddOn_lzeodb$f(prefix, textInput, suffix))); <add> $receiver.plus_pv6laa$($receiver.div_5rsex9$(void 0, 'input-group', _.net.yested.bootstrap.inputAddOn_cc7g17$f(prefix, textInput, suffix))); <ide> }, <ide> Row: Kotlin.createClass(function () { <del> return [_.net.yested.ParentComponent]; <del> }, function $fun() { <del> $fun.baseInitializer.call(this, 'div'); <del> this.setAttribute_puj7f4$('class', 'row'); <add> return [_.net.yested.Component]; <add> }, function () { <add> this.$element_njfknr$ = _.net.yested.createElement_61zpoe$('div'); <add> this.element.setAttribute('class', 'row'); <ide> }, /** @lends _.net.yested.bootstrap.Row.prototype */ { <del> col_6i15na$: function (modifiers, init) { <del> this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Row.col_6i15na$f(modifiers, init))); <add> element: { <add> get: function () { <add> return this.$element_njfknr$; <add> } <add> }, <add> col_zcukl0$: function (modifiers, init) { <add> _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Row.col_zcukl0$f(modifiers, init))); <ide> } <ide> }, /** @lends _.net.yested.bootstrap.Row */ { <ide> f: function (it) { <ide> return it.toString(); <ide> }, <del> col_6i15na$f: function (modifiers, init) { <add> col_zcukl0$f: function (modifiers, init) { <ide> return function () { <ide> this.clazz = Kotlin.modules['stdlib'].kotlin.join_raq5lb$(Kotlin.modules['stdlib'].kotlin.map_rie7ol$(modifiers, _.net.yested.bootstrap.Row.f), ' '); <ide> init.call(this); <ide> }; <ide> } <ide> }), <del> Page: Kotlin.createClass(null, function (element) { <add> ContainerLayout: Kotlin.createEnumClass(function () { <add> return [Kotlin.Enum]; <add> }, function $fun(code) { <add> $fun.baseInitializer.call(this); <add> this.code = code; <add> }, function () { <add> return { <add> DEFAULT: new _.net.yested.bootstrap.ContainerLayout('container'), <add> FLUID: new _.net.yested.bootstrap.ContainerLayout('container-fluid') <add> }; <add> }), <add> Page: Kotlin.createClass(null, function (element, layout) { <add> if (layout === void 0) <add> layout = _.net.yested.bootstrap.ContainerLayout.object.DEFAULT; <ide> this.element = element; <add> this.layout = layout; <ide> }, /** @lends _.net.yested.bootstrap.Page.prototype */ { <ide> topMenu_tx5hdt$: function (navbar) { <del> this.element.appendChild(navbar.element); <del> }, <del> content_mfnzi$: function (init) { <del> this.element.appendChild(_.net.yested.div_5rsex9$(void 0, void 0, _.net.yested.bootstrap.Page.content_mfnzi$f(init)).element); <del> }, <del> footer_mfnzi$: function (init) { <del> this.element.appendChild(_.net.yested.div_5rsex9$(void 0, void 0, _.net.yested.bootstrap.Page.footer_mfnzi$f(init)).element); <add> _.net.yested.appendComponent_c36dq0$(this.element, navbar); <add> }, <add> content_kv1miw$: function (init) { <add> this.element.appendChild(_.net.yested.div_5rsex9$(void 0, void 0, _.net.yested.bootstrap.Page.content_kv1miw$f(this, init)).element); <add> }, <add> footer_kv1miw$: function (init) { <add> this.element.appendChild(_.net.yested.div_5rsex9$(void 0, void 0, _.net.yested.bootstrap.Page.footer_kv1miw$f(init)).element); <ide> } <ide> }, /** @lends _.net.yested.bootstrap.Page */ { <del> content_mfnzi$f: function (init) { <add> content_kv1miw$f: function (this$Page, init) { <ide> return function () { <del> this.rangeTo_94jgcu$('class', 'container theme-showcase'); <del> this.rangeTo_94jgcu$('role', 'main'); <add> this.rangeTo_94jgcu$('class', this$Page.layout.code); <ide> init.call(this); <ide> }; <ide> }, <ide> }, <ide> f_0: function (init) { <ide> return function () { <del> this.tag_hgkgkc$('hr', _.net.yested.bootstrap.Page.f); <add> this.tag_s8xvdm$('hr', _.net.yested.bootstrap.Page.f); <ide> init.call(this); <ide> }; <ide> }, <del> footer_mfnzi$f: function (init) { <add> footer_kv1miw$f: function (init) { <ide> return function () { <ide> this.div_5rsex9$(void 0, 'container', _.net.yested.bootstrap.Page.f_0(init)); <ide> }; <ide> } <ide> }), <ide> PageHeader: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun() { <ide> $fun.baseInitializer.call(this, 'div'); <ide> this.clazz = 'page-header'; <ide> }), <del> pageHeader_91b1uj$: function ($receiver, init) { <del> var pageHeader = new _.net.yested.bootstrap.PageHeader(); <del> init.call(pageHeader); <del> $receiver.add_5f0h2k$(pageHeader); <del> }, <del> row_siz32v$: function ($receiver, init) { <del> var row = new _.net.yested.bootstrap.Row(); <del> init.call(row); <del> $receiver.add_5f0h2k$(row); <del> return row; <del> }, <del> page_xauh4t$f: function (init) { <add> pageHeader_kzm4yj$f: function (init) { <ide> return function () { <ide> init.call(this); <ide> }; <ide> }, <del> page_xauh4t$: function (placeholderElementId, init) { <del> _.net.yested.with_owvm91$(new _.net.yested.bootstrap.Page(_.net.yested.el(placeholderElementId)), _.net.yested.bootstrap.page_xauh4t$f(init)); <add> pageHeader_kzm4yj$: function ($receiver, init) { <add> $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.PageHeader(), _.net.yested.bootstrap.pageHeader_kzm4yj$f(init))); <add> }, <add> row_xnql8t$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <add> }, <add> row_xnql8t$: function ($receiver, init) { <add> $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Row(), _.net.yested.bootstrap.row_xnql8t$f(init))); <add> }, <add> page_uplc13$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <add> }, <add> page_uplc13$: function (placeholderElementId, layout, init) { <add> if (layout === void 0) <add> layout = _.net.yested.bootstrap.ContainerLayout.object.DEFAULT; <add> _.net.yested.with_owvm91$(new _.net.yested.bootstrap.Page(_.net.yested.el(placeholderElementId), layout), _.net.yested.bootstrap.page_uplc13$f(init)); <ide> }, <ide> MediaAlign: Kotlin.createEnumClass(function () { <ide> return [Kotlin.Enum]; <ide> }; <ide> }), <ide> MediaBody: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun() { <ide> $fun.baseInitializer.call(this, 'div'); <del> this.heading_5cm9rd$ = _.net.yested.with_owvm91$(new _.net.yested.HTMLParentComponent('h4'), _.net.yested.bootstrap.MediaBody.MediaBody$f); <del> this.setAttribute_puj7f4$('class', 'media-body'); <add> this.heading_5cm9rd$ = _.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('h4'), _.net.yested.bootstrap.MediaBody.MediaBody$f); <add> this.element.setAttribute('class', 'media-body'); <ide> }, /** @lends _.net.yested.bootstrap.MediaBody.prototype */ { <del> heading_mfnzi$: function (init) { <add> heading_kv1miw$: function (init) { <ide> init.call(this.heading_5cm9rd$); <del> this.add_5f0h2k$(this.heading_5cm9rd$); <del> }, <del> content_8cdto9$: function (init) { <add> this.plus_pv6laa$(this.heading_5cm9rd$); <add> }, <add> content_kv1miw$: function (init) { <ide> init.call(this); <ide> } <ide> }, /** @lends _.net.yested.bootstrap.MediaBody */ { <ide> } <ide> }), <ide> MediaObject: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun(align) { <ide> $fun.baseInitializer.call(this, 'div'); <ide> this.media_ni72hk$ = _.net.yested.with_owvm91$(new _.net.yested.Anchor(), _.net.yested.bootstrap.MediaObject.MediaObject$f(align)); <ide> this.body_vbc7dq$ = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.MediaBody(), _.net.yested.bootstrap.MediaObject.MediaObject$f_0); <del> this.setAttribute_puj7f4$('class', 'media'); <del> this.add_5f0h2k$(this.media_ni72hk$); <del> this.add_5f0h2k$(this.body_vbc7dq$); <add> this.element.setAttribute('class', 'media'); <add> this.appendChild_5f0h2k$(this.media_ni72hk$); <add> this.appendChild_5f0h2k$(this.body_vbc7dq$); <ide> }, /** @lends _.net.yested.bootstrap.MediaObject.prototype */ { <del> media_mfnzi$: function (init) { <add> media_kv1miw$: function (init) { <ide> var tmp$0; <ide> init.call(this.media_ni72hk$); <ide> var childElement = this.media_ni72hk$.element.firstChild; <ide> MediaObject$f_0: function () { <ide> } <ide> }), <del> mediaObject_xpcv5y$: function ($receiver, align, init) { <del> var mediaObject = new _.net.yested.bootstrap.MediaObject(align); <del> init.call(mediaObject); <del> $receiver.add_5f0h2k$(mediaObject); <add> mediaObject_wda2nk$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <add> }, <add> mediaObject_wda2nk$: function ($receiver, align, init) { <add> $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.MediaObject(align), _.net.yested.bootstrap.mediaObject_wda2nk$f(init))); <ide> }, <ide> NavbarPosition: Kotlin.createEnumClass(function () { <ide> return [Kotlin.Enum]; <ide> }; <ide> }), <ide> Navbar: Kotlin.createClass(function () { <del> return [_.net.yested.ParentComponent]; <del> }, function $fun(id, position, look) { <add> return [_.net.yested.Component]; <add> }, function (id, position, look) { <ide> if (position === void 0) <ide> position = null; <ide> if (look === void 0) <ide> look = _.net.yested.bootstrap.NavbarLook.object.DEFAULT; <del> $fun.baseInitializer.call(this, 'nav'); <add> this.$element_cd9gsv$ = _.net.yested.createElement_61zpoe$('nav'); <ide> this.ul_6lssbo$ = _.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.bootstrap.Navbar.Navbar$f); <ide> this.collapsible_lhbokj$ = _.net.yested.div_5rsex9$(id, 'navbar-collapse collapse', _.net.yested.bootstrap.Navbar.Navbar$f_0(this)); <ide> this.menuItems_2kpyr8$ = new Kotlin.ArrayList(); <ide> this.brandLink_f4xx9w$ = new _.net.yested.Anchor(); <del> this.setAttribute_puj7f4$('class', 'navbar navbar-' + look.code + ' ' + (position != null ? 'navbar-' + position.code : '')); <del> this.setAttribute_puj7f4$('role', 'navigation'); <del> this.add_5f0h2k$(_.net.yested.div_5rsex9$(void 0, 'container', _.net.yested.bootstrap.Navbar.Navbar$f_1(id, this))); <add> this.element.setAttribute('class', 'navbar navbar-' + look.code + ' ' + (position != null ? 'navbar-' + position.code : '')); <add> this.element.setAttribute('role', 'navigation'); <add> _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.div_5rsex9$(void 0, 'container', _.net.yested.bootstrap.Navbar.Navbar$f_1(id, this))); <ide> }, /** @lends _.net.yested.bootstrap.Navbar.prototype */ { <del> brand_hgkgkc$: function (href, init) { <add> element: { <add> get: function () { <add> return this.$element_cd9gsv$; <add> }, <add> set: function (element) { <add> this.$element_cd9gsv$ = element; <add> } <add> }, <add> brand_s8xvdm$: function (href, init) { <ide> if (href === void 0) <ide> href = '/'; <ide> this.brandLink_f4xx9w$.href = href; <ide> this.brandLink_f4xx9w$.clazz = 'navbar-brand'; <del> this.brandLink_f4xx9w$.replace_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Span(), _.net.yested.bootstrap.Navbar.brand_hgkgkc$f(init))); <del> this.brandLink_f4xx9w$.onclick = _.net.yested.bootstrap.Navbar.brand_hgkgkc$f_0(this); <add> this.brandLink_f4xx9w$.setChild_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Span(), _.net.yested.bootstrap.Navbar.brand_s8xvdm$f(init))); <add> this.brandLink_f4xx9w$.onclick = _.net.yested.bootstrap.Navbar.brand_s8xvdm$f_0(this); <ide> }, <ide> item_b1t645$: function (href, onclick, init) { <ide> if (href === void 0) <ide> var li = new _.net.yested.Li(); <ide> var linkClicked = _.net.yested.bootstrap.Navbar.item_b1t645$linkClicked(this, li, onclick); <ide> _.net.yested.with_owvm91$(li, _.net.yested.bootstrap.Navbar.item_b1t645$f(href, linkClicked, init)); <del> this.ul_6lssbo$.add_5f0h2k$(li); <add> this.ul_6lssbo$.appendChild_5f0h2k$(li); <ide> this.menuItems_2kpyr8$.add_za3rmp$(li); <ide> }, <ide> dropdown_vvlqvy$: function (label, init) { <ide> var dropdown = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.NavBarDropdown(_.net.yested.bootstrap.Navbar.dropdown_vvlqvy$f(this), label), _.net.yested.bootstrap.Navbar.dropdown_vvlqvy$f_0(init)); <del> this.ul_6lssbo$.add_5f0h2k$(dropdown); <add> this.ul_6lssbo$.appendChild_5f0h2k$(dropdown); <ide> this.menuItems_2kpyr8$.add_za3rmp$(dropdown); <ide> }, <ide> deselectAll: function () { <ide> Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this.menuItems_2kpyr8$, _.net.yested.bootstrap.Navbar.deselectAll$f); <ide> }, <ide> left_oe5uhj$: function (init) { <del> this.collapsible_lhbokj$.add_5f0h2k$(_.net.yested.div_5rsex9$(void 0, 'navbar-left', _.net.yested.bootstrap.Navbar.left_oe5uhj$f(init))); <add> this.collapsible_lhbokj$.appendChild_5f0h2k$(_.net.yested.div_5rsex9$(void 0, 'navbar-left', _.net.yested.bootstrap.Navbar.left_oe5uhj$f(init))); <ide> }, <ide> right_oe5uhj$: function (init) { <del> this.collapsible_lhbokj$.add_5f0h2k$(_.net.yested.div_5rsex9$(void 0, 'navbar-right', _.net.yested.bootstrap.Navbar.right_oe5uhj$f(init))); <add> this.collapsible_lhbokj$.appendChild_5f0h2k$(_.net.yested.div_5rsex9$(void 0, 'navbar-right', _.net.yested.bootstrap.Navbar.right_oe5uhj$f(init))); <ide> } <ide> }, /** @lends _.net.yested.bootstrap.Navbar */ { <ide> Navbar$f: function () { <ide> }, <ide> f_4: function (id, this$Navbar) { <ide> return function () { <del> this.plus_pv6laa$(this.tag_hgkgkc$('button', _.net.yested.bootstrap.Navbar.f_3(id))); <add> this.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('button'), _.net.yested.bootstrap.Navbar.f_3(id))); <ide> this.plus_pv6laa$(this$Navbar.brandLink_f4xx9w$); <ide> }; <ide> }, <ide> this.plus_pv6laa$(this$Navbar.collapsible_lhbokj$); <ide> }; <ide> }, <del> brand_hgkgkc$f: function (init) { <add> brand_s8xvdm$f: function (init) { <ide> return function () { <ide> init.call(this); <ide> }; <ide> }, <del> brand_hgkgkc$f_0: function (this$Navbar) { <add> brand_s8xvdm$f_0: function (this$Navbar) { <ide> return function () { <ide> this$Navbar.deselectAll(); <ide> }; <ide> } <ide> }), <ide> NavBarDropdown: Kotlin.createClass(function () { <del> return [_.net.yested.Li]; <add> return [_.net.yested.HTMLComponent]; <ide> }, function $fun(deselectFun, label) { <del> $fun.baseInitializer.call(this); <add> $fun.baseInitializer.call(this, 'li'); <ide> this.deselectFun_qdujve$ = deselectFun; <ide> this.ul_e2is7h$ = _.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.bootstrap.NavBarDropdown.NavBarDropdown$f); <del> this.setAttribute_puj7f4$('class', 'dropdown'); <del> this.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Anchor(), _.net.yested.bootstrap.NavBarDropdown.NavBarDropdown$f_0(label))); <del> this.add_5f0h2k$(this.ul_e2is7h$); <add> this.element.setAttribute('class', 'dropdown'); <add> _.net.yested.appendComponent_c36dq0$(this.element, _.net.yested.with_owvm91$(new _.net.yested.Anchor(), _.net.yested.bootstrap.NavBarDropdown.NavBarDropdown$f_0(label))); <add> _.net.yested.appendComponent_c36dq0$(this.element, this.ul_e2is7h$); <ide> }, /** @lends _.net.yested.bootstrap.NavBarDropdown.prototype */ { <ide> selectThis: function () { <ide> this.deselectFun_qdujve$(); <del> this.setAttribute_puj7f4$('class', 'dropdown active'); <add> this.element.setAttribute('class', 'dropdown active'); <ide> }, <ide> item: function (href, onclick, init) { <ide> if (href === void 0) <ide> if (onclick === void 0) <ide> onclick = null; <ide> var li = _.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.NavBarDropdown.item$f(href, this, onclick, init)); <del> this.ul_e2is7h$.add_5f0h2k$(li); <add> this.ul_e2is7h$.appendChild_5f0h2k$(li); <ide> }, <ide> divider: function () { <del> this.ul_e2is7h$.add_5f0h2k$(this.tag_hgkgkc$('li', _.net.yested.bootstrap.NavBarDropdown.divider$f)); <add> this.ul_e2is7h$.appendChild_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.HTMLComponent('li'), _.net.yested.bootstrap.NavBarDropdown.divider$f)); <ide> } <ide> }, /** @lends _.net.yested.bootstrap.NavBarDropdown */ { <ide> NavBarDropdown$f: function () { <ide> this.rangeTo_94jgcu$('class', 'divider'); <ide> } <ide> }), <del> navbar_58rg2v$f: function (init) { <add> navbar_x6lhct$f: function (init) { <ide> return function () { <ide> init.call(this); <ide> }; <ide> }, <del> navbar_58rg2v$: function ($receiver, id, position, look, init) { <add> navbar_x6lhct$: function ($receiver, id, position, look, init) { <ide> if (position === void 0) <ide> position = null; <ide> if (look === void 0) <ide> look = _.net.yested.bootstrap.NavbarLook.object.DEFAULT; <del> $receiver.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Navbar(id, position, look), _.net.yested.bootstrap.navbar_58rg2v$f(init))); <add> $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Navbar(id, position, look), _.net.yested.bootstrap.navbar_x6lhct$f(init))); <ide> }, <ide> Pagination: Kotlin.createClass(function () { <del> return [_.net.yested.HTMLParentComponent]; <del> }, function $fun(count, defaultSelection, listener) { <add> return [_.net.yested.Component]; <add> }, function (count, defaultSelection, listener) { <ide> if (defaultSelection === void 0) <ide> defaultSelection = 1; <del> $fun.baseInitializer.call(this, 'nav'); <ide> this.count = count; <ide> this.defaultSelection = defaultSelection; <ide> this.listener = listener; <add> this.$element_z5clzt$ = _.net.yested.createElement_61zpoe$('nav'); <ide> this.selectedItem_cr0avl$ = this.defaultSelection; <ide> this.list_z57r8f$ = _.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.bootstrap.Pagination.Pagination$f); <ide> this.items_o2ga03$ = Kotlin.modules['stdlib'].kotlin.arrayListOf_9mqe4v$([]); <del> this.add_5f0h2k$(this.list_z57r8f$); <add> _.net.yested.appendComponent_c36dq0$(this.element, this.list_z57r8f$); <ide> this.replaceItems(); <ide> this.redisplay(this.selectedItem_cr0avl$); <ide> }, /** @lends _.net.yested.bootstrap.Pagination.prototype */ { <add> element: { <add> get: function () { <add> return this.$element_z5clzt$; <add> } <add> }, <ide> selected: { <ide> get: function () { <ide> return this.selectedItem_cr0avl$; <ide> }, <ide> replaceItems: function () { <ide> this.items_o2ga03$ = this.generateItems(); <del> this.list_z57r8f$.replace_61zpoe$(''); <add> this.list_z57r8f$.setContent_61zpoe$(''); <ide> Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(this.items_o2ga03$, _.net.yested.bootstrap.Pagination.replaceItems$f(this)); <ide> }, <ide> generateItems: function () { <ide> }, <ide> replaceItems$f: function (this$Pagination) { <ide> return function (it) { <del> this$Pagination.list_z57r8f$.add_5f0h2k$(it); <add> this$Pagination.list_z57r8f$.appendChild_5f0h2k$(it); <ide> }; <ide> }, <ide> f: function (this$Pagination) { <ide> }; <ide> } <ide> }), <del> pagination_kr3wm4$: function ($receiver, count, defaultSelection, listener) { <add> pagination_vs56l6$: function ($receiver, count, defaultSelection, listener) { <ide> if (defaultSelection === void 0) <ide> defaultSelection = 1; <del> $receiver.add_5f0h2k$(new _.net.yested.bootstrap.Pagination(count, defaultSelection, listener)); <add> $receiver.plus_pv6laa$(new _.net.yested.bootstrap.Pagination(count, defaultSelection, listener)); <ide> }, <ide> PanelStyle: Kotlin.createEnumClass(function () { <ide> return [Kotlin.Enum]; <ide> }; <ide> }), <ide> Panel: Kotlin.createClass(function () { <del> return [_.net.yested.ParentComponent]; <del> }, function $fun(style) { <add> return [_.net.yested.Component]; <add> }, function (style) { <ide> if (style === void 0) <ide> style = _.net.yested.bootstrap.PanelStyle.object.DEFAULT; <del> $fun.baseInitializer.call(this, 'div'); <add> this.$element_njm3sx$ = _.net.yested.createElement_61zpoe$('div'); <ide> this.heading_6tzak9$ = _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Panel.Panel$f); <ide> this.body_fx0fel$ = _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Panel.Panel$f_0); <ide> this.footer_qhkwty$ = _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Panel.Panel$f_1); <del> this.setAttribute_puj7f4$('class', 'panel panel-' + style.code); <del> this.add_5f0h2k$(this.heading_6tzak9$); <del> this.add_5f0h2k$(this.body_fx0fel$); <add> this.element.setAttribute('class', 'panel panel-' + style.code); <add> _.net.yested.appendComponent_c36dq0$(this.element, this.heading_6tzak9$); <add> _.net.yested.appendComponent_c36dq0$(this.element, this.body_fx0fel$); <ide> }, /** @lends _.net.yested.bootstrap.Panel.prototype */ { <del> heading_mfnzi$: function (init) { <add> element: { <add> get: function () { <add> return this.$element_njm3sx$; <add> } <add> }, <add> heading_kv1miw$: function (init) { <ide> init.call(this.heading_6tzak9$); <ide> }, <del> content_mfnzi$: function (init) { <add> content_kv1miw$: function (init) { <ide> init.call(this.body_fx0fel$); <ide> }, <del> footer_mfnzi$: function (init) { <add> footer_kv1miw$: function (init) { <ide> init.call(this.footer_qhkwty$); <del> this.add_5f0h2k$(this.footer_qhkwty$); <add> _.net.yested.appendComponent_c36dq0$(this.element, this.footer_qhkwty$); <ide> } <ide> }, /** @lends _.net.yested.bootstrap.Panel */ { <ide> Panel$f: function () { <ide> this.clazz = 'panel-footer'; <ide> } <ide> }), <del> panel_azd227$: function ($receiver, style, init) { <add> panel_mkklid$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <add> }, <add> panel_mkklid$: function ($receiver, style, init) { <ide> if (style === void 0) <ide> style = _.net.yested.bootstrap.PanelStyle.object.DEFAULT; <del> var panel = new _.net.yested.bootstrap.Panel(style); <del> init.call(panel); <del> $receiver.add_5f0h2k$(panel); <add> $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Panel(style), _.net.yested.bootstrap.panel_mkklid$f(init))); <ide> }, <ide> Tabs: Kotlin.createClass(function () { <del> return [_.net.yested.ParentComponent]; <del> }, function $fun() { <del> $fun.baseInitializer.call(this, 'div'); <add> return [_.net.yested.Component]; <add> }, function () { <add> this.$element_s2egal$ = _.net.yested.createElement_61zpoe$('div'); <ide> this.bar_83ssd0$ = _.net.yested.with_owvm91$(new _.net.yested.UL(), _.net.yested.bootstrap.Tabs.Tabs$f); <ide> this.content_9tda2$ = _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Tabs.Tabs$f_0); <ide> this.anchorsLi_g1z45g$ = new Kotlin.ArrayList(); <ide> this.tabsRendered_rgvx82$ = new Kotlin.PrimitiveNumberHashMap(); <ide> this.index_nuub59$ = 0; <ide> this.element.setAttribute('role', 'tabpanel'); <del> this.add_5f0h2k$(this.bar_83ssd0$); <del> this.add_5f0h2k$(this.content_9tda2$); <add> _.net.yested.appendComponent_c36dq0$(this.element, this.bar_83ssd0$); <add> _.net.yested.appendComponent_c36dq0$(this.element, this.content_9tda2$); <ide> }, /** @lends _.net.yested.bootstrap.Tabs.prototype */ { <add> element: { <add> get: function () { <add> return this.$element_s2egal$; <add> } <add> }, <ide> renderContent: function (tabId, init) { <ide> var tmp$0; <ide> if (this.tabsRendered_rgvx82$.containsKey_za3rmp$(tabId)) { <ide> return (tmp$0 = this.tabsRendered_rgvx82$.get_za3rmp$(tabId)) != null ? tmp$0 : Kotlin.throwNPE(); <ide> } <del> else { <add> else { <ide> var div = _.net.yested.with_owvm91$(new _.net.yested.Div(), _.net.yested.bootstrap.Tabs.renderContent$f(init)); <ide> this.tabsRendered_rgvx82$.put_wn2jw4$(tabId, div); <ide> return div; <ide> li.clazz = 'active'; <ide> tmp$0 = Kotlin.modules['stdlib'].kotlin.filter_azvtw4$(this.anchorsLi_g1z45g$, _.net.yested.bootstrap.Tabs.activateTab$f(li)); <ide> Kotlin.modules['stdlib'].kotlin.forEach_p7e0bo$(tmp$0, _.net.yested.bootstrap.Tabs.activateTab$f_0); <del> this.content_9tda2$.fade_suy7ya$(this.renderContent(tabId, init)); <add> this.content_9tda2$.setChild_hu5ove$(this.renderContent(tabId, init), new _.net.yested.Fade()); <ide> if (onSelect != null) { <ide> onSelect(); <ide> } <ide> }, <del> tab_jcws7d$: function (active, header, onSelect, init) { <add> tab_l25lo7$: function (active, header, onSelect, init) { <ide> if (active === void 0) <ide> active = false; <ide> if (onSelect === void 0) <ide> onSelect = null; <ide> var tabId = this.index_nuub59$++; <del> var a = _.net.yested.with_owvm91$(new _.net.yested.Anchor(), _.net.yested.bootstrap.Tabs.tab_jcws7d$f(header)); <del> var li = this.bar_83ssd0$.li_8y48wp$(_.net.yested.bootstrap.Tabs.tab_jcws7d$f_0(a)); <del> a.onclick = _.net.yested.bootstrap.Tabs.tab_jcws7d$f_1(li, tabId, onSelect, init, this); <del> this.bar_83ssd0$.add_5f0h2k$(li); <add> var a = _.net.yested.with_owvm91$(new _.net.yested.Anchor(), _.net.yested.bootstrap.Tabs.tab_l25lo7$f(header)); <add> var li = _.net.yested.with_owvm91$(new _.net.yested.Li(), _.net.yested.bootstrap.Tabs.tab_l25lo7$f_0(a)); <add> this.bar_83ssd0$.appendChild_5f0h2k$(li); <add> a.onclick = _.net.yested.bootstrap.Tabs.tab_l25lo7$f_1(li, tabId, onSelect, init, this); <ide> this.anchorsLi_g1z45g$.add_za3rmp$(li); <ide> if (active) { <ide> this.activateTab(li, tabId, onSelect, init); <ide> activateTab$f_0: function (it) { <ide> it.clazz = ''; <ide> }, <del> tab_jcws7d$f: function (header) { <add> tab_l25lo7$f: function (header) { <ide> return function () { <ide> this.rangeTo_94jgcu$('role', 'tab'); <ide> this.rangeTo_94jgcu$('style', 'cursor: pointer;'); <ide> header.call(this); <ide> }; <ide> }, <del> tab_jcws7d$f_0: function (a) { <add> tab_l25lo7$f_0: function (a) { <ide> return function () { <ide> this.plus_pv6laa$(a); <ide> this.role = 'presentation'; <ide> }; <ide> }, <del> tab_jcws7d$f_1: function (li, tabId, onSelect, init, this$Tabs) { <add> tab_l25lo7$f_1: function (li, tabId, onSelect, init, this$Tabs) { <ide> return function () { <ide> this$Tabs.activateTab(li, tabId, onSelect, init); <ide> }; <ide> } <ide> }), <del> tabs_1nc3b1$: function ($receiver, init) { <del> var tabs = new _.net.yested.bootstrap.Tabs(); <del> init.call(tabs); <del> $receiver.add_5f0h2k$(tabs); <add> tabs_fe4fv1$f: function (init) { <add> return function () { <add> init.call(this); <add> }; <add> }, <add> tabs_fe4fv1$: function ($receiver, init) { <add> $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Tabs(), _.net.yested.bootstrap.tabs_fe4fv1$f(init))); <ide> }, <ide> TextAlign: Kotlin.createEnumClass(function () { <ide> return [Kotlin.Enum]; <ide> NOWRAP: new _.net.yested.bootstrap.TextAlign('nowrap') <ide> }; <ide> }), <del> aligned_fsjrrw$f: function (align, init) { <add> aligned_xlk53m$f: function (align, init) { <ide> return function () { <ide> this.clazz = 'text-' + align.code; <ide> init.call(this); <ide> }; <ide> }, <del> aligned_fsjrrw$: function ($receiver, align, init) { <del> $receiver.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.P(), _.net.yested.bootstrap.aligned_fsjrrw$f(align, init))); <add> aligned_xlk53m$: function ($receiver, align, init) { <add> $receiver.plus_pv6laa$(_.net.yested.with_owvm91$(new _.net.yested.P(), _.net.yested.bootstrap.aligned_xlk53m$f(align, init))); <ide> }, <ide> addSpan$f: function (clazz, init) { <ide> return function () { <ide> }; <ide> }, <ide> addSpan: function (parent, clazz, init) { <del> parent.add_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Span(), _.net.yested.bootstrap.addSpan$f(clazz, init))); <del> }, <del> uppercase_sxtqq7$: function ($receiver, init) { <add> parent.appendChild_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.Span(), _.net.yested.bootstrap.addSpan$f(clazz, init))); <add> }, <add> uppercase_71h449$: function ($receiver, init) { <ide> _.net.yested.bootstrap.addSpan($receiver, 'text-uppercase', init); <ide> }, <del> lowercase_sxtqq7$: function ($receiver, init) { <add> lowercase_71h449$: function ($receiver, init) { <ide> _.net.yested.bootstrap.addSpan($receiver, 'text-lowercase', init); <ide> }, <del> capitalize_sxtqq7$: function ($receiver, init) { <add> capitalize_71h449$: function ($receiver, init) { <ide> _.net.yested.bootstrap.addSpan($receiver, 'text-capitalize', init); <ide> } <ide> }), <ide> options = new _.net.yested.spin.SpinnerOptions(); <ide> this.options = options; <ide> this.jsSpinnerElement_vuqxo$ = new Spinner(this.createOptions()).spin().el; <add> this.$element_lzlbvw$ = this.jsSpinnerElement_vuqxo$; <ide> }, /** @lends _.net.yested.spin.Spinner.prototype */ { <ide> createOptions: function () { <ide> return _.net.yested.spin.Spinner.createOptions$f(this); <ide> }, <ide> element: { <ide> get: function () { <del> return this.jsSpinnerElement_vuqxo$; <add> return this.$element_lzlbvw$; <ide> } <ide> } <ide> }, /** @lends _.net.yested.spin.Spinner */ { <ide> }); <ide> } <ide> }), <del> spinner_oyolqv$: function ($receiver, options) { <add> spinner_4tyilv$: function ($receiver, options) { <ide> if (options === void 0) <ide> options = new _.net.yested.spin.SpinnerOptions(); <del> $receiver.add_5f0h2k$(new _.net.yested.spin.Spinner(options)); <add> $receiver.plus_pv6laa$(new _.net.yested.spin.Spinner(options)); <ide> } <ide> }) <ide> }) <ide> this.plus_pdl1w0$('Spinner'); <ide> }, <ide> f_7: function () { <add> this.plus_pdl1w0$('Effects'); <add> }, <add> f_8: function () { <ide> this.item('#html', void 0, _.f_2); <ide> this.item('#bootstrapComponents', void 0, _.f_3); <ide> this.item('#ajax', void 0, _.f_4); <ide> this.item('#masterdetail', void 0, _.f_5); <ide> this.item('#spinner', void 0, _.f_6); <add> this.item('#effects', void 0, _.f_7); <ide> }, <ide> main$f: function () { <del> this.brand_hgkgkc$('#', _.f); <add> this.brand_s8xvdm$('#', _.f); <ide> this.item_b1t645$('#gettingstarted', void 0, _.f_0); <del> this.dropdown_vvlqvy$(_.f_1, _.f_7); <add> this.dropdown_vvlqvy$(_.f_1, _.f_8); <ide> }, <ide> main$f_0: function () { <ide> }, <ide> var tmp$0; <ide> tmp$0 = hash[0]; <ide> if (tmp$0 === '#' || tmp$0 === '') <del> divContainer.fade_suy7ya$(_.basics.basicPage()); <add> divContainer.setChild_hu5ove$(_.basics.basicPage(), new _.net.yested.Fade()); <ide> else if (tmp$0 === '#gettingstarted') <del> divContainer.fade_suy7ya$(_.gettingstarted.gettingStartedSection()); <add> divContainer.setChild_hu5ove$(_.gettingstarted.gettingStartedSection(), new _.net.yested.Fade()); <ide> else if (tmp$0 === '#html') <del> divContainer.fade_suy7ya$(_.html.htmlPage()); <add> divContainer.setChild_hu5ove$(_.html.htmlPage(), new _.net.yested.Fade()); <ide> else if (tmp$0 === '#bootstrapComponents') { <ide> if (hash.length === 1) { <del> divContainer.fade_suy7ya$(_.bootstrap.bootstrapPage()); <add> divContainer.setChild_hu5ove$(_.bootstrap.bootstrapPage(), new _.net.yested.Fade()); <ide> } <ide> } <del> else if (tmp$0 === '#ajax') <del> divContainer.fade_suy7ya$(_.ajax.ajaxPage()); <add> else if (tmp$0 === '#ajax') <add> divContainer.setChild_hu5ove$(_.ajax.ajaxPage(), new _.net.yested.Fade()); <ide> else if (tmp$0 === '#masterdetail') <del> divContainer.fade_suy7ya$(_.complex.masterDetail()); <add> divContainer.setChild_hu5ove$(_.complex.masterDetail(), new _.net.yested.Fade()); <ide> else if (tmp$0 === '#spinner') <del> divContainer.fade_suy7ya$(_.complex.createSpinner()); <add> divContainer.setChild_hu5ove$(_.complex.createSpinner(), new _.net.yested.Fade()); <add> else if (tmp$0 === '#effects') <add> divContainer.setChild_hu5ove$(_.bootstrap.effectsPage(), new _.net.yested.Fade()); <ide> }; <ide> }, <del> f_8: function (divContainer) { <add> f_9: function (divContainer) { <ide> return function () { <ide> this.br(); <ide> this.br(); <ide> this.plus_pv6laa$(divContainer); <ide> }; <ide> }, <del> f_9: function (divContainer) { <add> f_10: function (divContainer) { <ide> return function () { <del> this.div_5rsex9$(void 0, void 0, _.f_8(divContainer)); <add> this.div_5rsex9$(void 0, void 0, _.f_9(divContainer)); <ide> }; <ide> }, <del> f_10: function () { <add> f_11: function () { <ide> this.plus_pdl1w0$('Contact: '); <ide> }, <del> f_11: function () { <add> f_12: function () { <ide> this.plus_pdl1w0$('[email protected]'); <ide> }, <del> f_12: function () { <del> this.emph_mfnzi$(_.f_10); <del> this.a_b4th6h$(void 0, 'mailto:[email protected]', void 0, _.f_11); <add> f_13: function () { <add> this.emph_kv1miw$(_.f_11); <add> this.a_b4th6h$(void 0, 'mailto:[email protected]', void 0, _.f_12); <ide> }, <del> f_13: function () { <del> this.small_mfnzi$(_.f_12); <add> f_14: function () { <add> this.small_kv1miw$(_.f_13); <ide> this.br(); <ide> this.br(); <ide> }, <ide> main$f_2: function (navbar, divContainer) { <ide> return function () { <ide> this.topMenu_tx5hdt$(navbar); <del> this.content_mfnzi$(_.f_9(divContainer)); <del> this.footer_mfnzi$(_.f_13); <add> this.content_kv1miw$(_.f_10(divContainer)); <add> this.footer_kv1miw$(_.f_14); <ide> }; <ide> }, <ide> main: function (args) { <ide> var navbar = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.Navbar('appMenuBar', _.net.yested.bootstrap.NavbarPosition.object.FIXED_TOP, _.net.yested.bootstrap.NavbarLook.object.INVERSE), _.main$f); <ide> var divContainer = _.net.yested.div_5rsex9$(void 0, void 0, _.main$f_0); <ide> _.net.yested.registerHashChangeListener_owl47g$(void 0, _.main$f_1(divContainer)); <del> _.net.yested.bootstrap.page_xauh4t$('page', _.main$f_2(navbar, divContainer)); <add> _.net.yested.bootstrap.page_uplc13$('page', void 0, _.main$f_2(navbar, divContainer)); <ide> }, <ide> ajax: Kotlin.definePackage(null, /** @lends _.ajax */ { <ide> ajaxPage$f: function () { <ide> this.plus_pdl1w0$('Fahrenheit'); <ide> }, <ide> createAjaxGetSection$f_0: function () { <del> this.button_mtl9nq$('metric', void 0, _.ajax.f); <del> this.button_mtl9nq$('imperial', void 0, _.ajax.f_0); <add> this.button_ubg574$('metric', void 0, _.ajax.f); <add> this.button_ubg574$('imperial', void 0, _.ajax.f_0); <ide> }, <ide> f_1: function (weatherData) { <ide> return function () { <ide> }, <ide> f_3: function (weatherData) { <ide> return function () { <del> this.emph_mfnzi$(_.ajax.f_2(weatherData)); <add> this.emph_kv1miw$(_.ajax.f_2(weatherData)); <ide> }; <ide> }, <ide> f_4: function (weatherData) { <ide> return function () { <del> this.heading_mfnzi$(_.ajax.f_1(weatherData)); <del> this.content_mfnzi$(_.ajax.f_3(weatherData)); <add> this.heading_kv1miw$(_.ajax.f_1(weatherData)); <add> this.content_kv1miw$(_.ajax.f_3(weatherData)); <ide> }; <ide> }, <ide> f_5: function () { <ide> fetchWeather$f: function (temperatureSpan) { <ide> return function (weatherData) { <ide> if (weatherData != null && weatherData.main != null) { <del> temperatureSpan.fade_suy7ya$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Panel(_.net.yested.bootstrap.PanelStyle.object.SUCCESS), _.ajax.f_4(weatherData))); <add> temperatureSpan.setChild_hu5ove$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Panel(_.net.yested.bootstrap.PanelStyle.object.SUCCESS), _.ajax.f_4(weatherData)), new _.net.yested.Fade()); <ide> } <del> else { <del> temperatureSpan.replace_5f0h2k$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Alert(_.net.yested.bootstrap.AlertStyle.object.DANGER), _.ajax.f_5)); <add> else { <add> temperatureSpan.setChild_hu5ove$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Alert(_.net.yested.bootstrap.AlertStyle.object.DANGER), _.ajax.f_5), new _.net.yested.Fade()); <ide> } <ide> }; <ide> }, <ide> this.plus_pdl1w0$('Ajax Get'); <ide> }, <ide> f_7: function () { <del> this.h3_mfnzi$(_.ajax.f_6); <add> this.h3_kv1miw$(_.ajax.f_6); <ide> }, <ide> f_8: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.ajax.f_7); <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.ajax.f_7); <ide> }, <ide> f_9: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.ajax.f_8); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.ajax.f_8); <ide> }, <ide> f_10: function () { <ide> this.plus_pdl1w0$('Yested provides JQuery Ajax wrappers:'); <ide> this.code_puj7f4$('kotlin', 'native trait Coordinates {\n val lon : Double\n val lat : Double\n}\n'); <ide> }, <ide> f_11: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.ajax.f_10); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.ajax.f_10); <ide> }, <ide> f_12: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> }, <ide> f_13: function () { <del> this.h4_mfnzi$(_.ajax.f_12); <add> this.h4_kv1miw$(_.ajax.f_12); <ide> }, <ide> f_14: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.ajax.f_13); <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.ajax.f_13); <ide> }, <ide> f_15: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.ajax.f_14); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.ajax.f_14); <ide> }, <ide> f_16: function () { <ide> this.plus_pdl1w0$('Location'); <ide> }, <ide> f_23: function (fetchWeather) { <ide> return function () { <del> _.net.yested.bootstrap.btsButton_j2rvkn$(this, _.net.yested.ButtonType.object.SUBMIT, _.ajax.f_21, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, void 0, void 0, _.ajax.f_22(fetchWeather)); <add> _.net.yested.bootstrap.btsButton_adnmfr$(this, _.net.yested.ButtonType.object.SUBMIT, _.ajax.f_21, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, void 0, void 0, _.ajax.f_22(fetchWeather)); <ide> }; <ide> }, <ide> f_24: function (validator, textInput, btnGroup, fetchWeather) { <ide> return function () { <del> this.item_2xyzwi$(void 0, _.ajax.f_16, validator, _.ajax.f_17(textInput)); <del> this.item_2xyzwi$(void 0, _.ajax.f_18, void 0, _.ajax.f_19(btnGroup)); <del> this.item_2xyzwi$(void 0, _.ajax.f_20, void 0, _.ajax.f_23(fetchWeather)); <add> this.item_gthhqa$(void 0, _.ajax.f_16, validator, _.ajax.f_17(textInput)); <add> this.item_gthhqa$(void 0, _.ajax.f_18, void 0, _.ajax.f_19(btnGroup)); <add> this.item_gthhqa$(void 0, _.ajax.f_20, void 0, _.ajax.f_23(fetchWeather)); <ide> }; <ide> }, <ide> f_25: function (validator, textInput, btnGroup, fetchWeather) { <ide> return function () { <del> _.net.yested.bootstrap.btsForm_nas0k3$(this, 'col-sm-4', 'col-sm-8', _.ajax.f_24(validator, textInput, btnGroup, fetchWeather)); <add> _.net.yested.bootstrap.btsForm_iz33rd$(this, 'col-sm-4', 'col-sm-8', _.ajax.f_24(validator, textInput, btnGroup, fetchWeather)); <ide> }; <ide> }, <ide> f_26: function (temperatureSpan) { <ide> }, <ide> f_28: function (validator, textInput, btnGroup, fetchWeather, temperatureSpan) { <ide> return function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.ajax.f_25(validator, textInput, btnGroup, fetchWeather)); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.ajax.f_27(temperatureSpan)); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.ajax.f_25(validator, textInput, btnGroup, fetchWeather)); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.ajax.f_27(temperatureSpan)); <ide> }; <ide> }, <ide> f_29: function () { <ide> this.plus_pdl1w0$('Source for demo'); <ide> }, <ide> f_30: function () { <del> this.h4_mfnzi$(_.ajax.f_29); <add> this.h4_kv1miw$(_.ajax.f_29); <ide> }, <ide> f_31: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.ajax.f_30); <del> this.code_puj7f4$('kotlin', '//definition of response, just fragment\nnative trait Main {\n val temp : Double\n val pressure : Int\n val humidity: Int\n val temp_min : Double\n val temp_max : Double\n}\n\nnative trait WeatherData {\n ...\n val base: String?\n val main : Main?\n val wind : Wind?\n ...\n}\n\n...\nval textInput = TextInput(placeholder = "Type city name and press Enter")\nval validator = Validator(inputElement = textInput, errorText = "Enter at least 3 characters", validator = { it.length() > 2})\nval temperatureSpan = Div()\n\nval btnGroup = ButtonGroup() with {\n button("metric", label = { + "Celcius"})\n button("imperial", label = { + "Fahrenheit"})\n}\nbtnGroup.select("metric")\n\nfun fetchWeather() {\n if (validator.isValid()) {\n ajaxGet&lt;WeatherData&gt;("http://api.openweathermap.org/data/2.5/weather?q=$\\{textInput.value}&units=$\\{btnGroup.value}") {\n weatherData ->\n if (weatherData != null && weatherData.main != null) {\n temperatureSpan.replace(\n Panel(panelStyle = PanelStyle.SUCCESS) with {\n heading { +"Temperature in $\\{weatherData.name}" }\n content { emph { +"$\\{weatherData.main!!.temp}"} }\n })\n } else {\n temperatureSpan.replace("Location not found")\n }\n }\n }\n}\n...\ndiv {\n form(labelDef = "col-sm-4", inputDef = "col-sm-8") {\n item(label = { +"Location"}, validator = validator) {\n +textInput\n }\n item(label = { +"Units"}) {\n +btnGroup\n }\n item(label = { }) {\n btsButton(type = ButtonType.SUBMIT, label = { +"Get Weather"}, look = ButtonLook.PRIMARY) {\n fetchWeather()\n }\n }\n }\n}\n'); <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.ajax.f_30); <add> this.code_puj7f4$('kotlin', '//definition of response, just fragment\nnative trait Main {\n val temp : Double\n val pressure : Int\n val humidity: Int\n val temp_min : Double\n val temp_max : Double\n}\n\nnative trait WeatherData {\n ...\n val base: String?\n val main : Main?\n val wind : Wind?\n ...\n}\n\n...\nval textInput = TextInput(placeholder = "Type city name and press Enter")\nval validator = Validator(inputElement = textInput, errorText = "Enter at least 3 characters", validator = { it.length() > 2})\nval temperatureSpan = Div()\n\nval btnGroup = ButtonGroup() with {\n button("metric", label = { + "Celcius"})\n button("imperial", label = { + "Fahrenheit"})\n}\nbtnGroup.select("metric")\n\nfun fetchWeather() {\n if (validator.isValid()) {\n ajaxGet&lt;WeatherData&gt;("http://api.openweathermap.org/data/2.5/weather?q=$\\{textInput.value}&units=$\\{btnGroup.value}") {\n weatherData ->\n if (weatherData != null && weatherData.main != null) {\n temperatureSpan.setChild(\n Panel(panelStyle = PanelStyle.SUCCESS) with {\n heading { +"Temperature in $\\{weatherData.name}" }\n content { emph { +"$\\{weatherData.main!!.temp}"} }\n }, Fade())\n } else {\n temperatureSpan.setChild("Location not found", Fade())\n }\n }\n }\n}\n...\ndiv {\n form(labelDef = "col-sm-4", inputDef = "col-sm-8") {\n item(label = { +"Location"}, validator = validator) {\n +textInput\n }\n item(label = { +"Units"}) {\n +btnGroup\n }\n item(label = { }) {\n btsButton(type = ButtonType.SUBMIT, label = { +"Get Weather"}, look = ButtonLook.PRIMARY) {\n fetchWeather()\n }\n }\n }\n}\n'); <ide> }, <ide> f_32: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.ajax.f_31); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.ajax.f_31); <ide> }, <ide> createAjaxGetSection$f_1: function (validator, textInput, btnGroup, fetchWeather, temperatureSpan) { <ide> return function () { <del> _.net.yested.bootstrap.row_siz32v$(this, _.ajax.f_9); <del> _.net.yested.bootstrap.row_siz32v$(this, _.ajax.f_11); <del> _.net.yested.bootstrap.row_siz32v$(this, _.ajax.f_15); <del> _.net.yested.bootstrap.row_siz32v$(this, _.ajax.f_28(validator, textInput, btnGroup, fetchWeather, temperatureSpan)); <del> _.net.yested.bootstrap.row_siz32v$(this, _.ajax.f_32); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.ajax.f_9); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.ajax.f_11); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.ajax.f_15); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.ajax.f_28(validator, textInput, btnGroup, fetchWeather, temperatureSpan)); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.ajax.f_32); <ide> }; <ide> }, <ide> createAjaxGetSection: function () { <ide> this.plus_pdl1w0$('What is Yested'); <ide> }, <ide> f_0: function () { <del> this.h3_mfnzi$(_.basics.f); <add> this.h3_kv1miw$(_.basics.f); <ide> }, <ide> f_1: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.basics.f_0); <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.basics.f_0); <ide> }, <ide> f_2: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.basics.f_1); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.basics.f_1); <ide> }, <ide> f_3: function () { <ide> this.plus_pdl1w0$('Yested is a Kotlin framework for building single-page web applications in Javascript.'); <ide> this.li_8y48wp$(_.basics.f_15); <ide> }, <ide> f_17: function () { <del> this.h4_mfnzi$(_.basics.f_7); <add> this.h4_kv1miw$(_.basics.f_7); <ide> this.ul_8qfrsd$(_.basics.f_16); <ide> }, <ide> f_18: function () { <ide> this.p_omdg96$(_.basics.f_21); <ide> }, <ide> f_23: function () { <del> this.h4_mfnzi$(_.basics.f_18); <add> this.h4_kv1miw$(_.basics.f_18); <ide> this.ul_8qfrsd$(_.basics.f_22); <ide> }, <ide> f_24: function () { <ide> this.plus_pdl1w0$('Get on GitHub'); <ide> }, <ide> f_27: function () { <del> _.net.yested.bootstrap.btsAnchor_ydi2fr$(this, 'https://github.com/jean79/yested', _.net.yested.bootstrap.ButtonLook.object.PRIMARY, _.net.yested.bootstrap.ButtonSize.object.LARGE, void 0, _.basics.f_26); <add> _.net.yested.bootstrap.btsAnchor_2ak3uo$(this, 'https://github.com/jean79/yested', _.net.yested.bootstrap.ButtonLook.object.PRIMARY, _.net.yested.bootstrap.ButtonSize.object.LARGE, void 0, _.basics.f_26); <ide> }, <ide> f_28: function () { <ide> this.plus_pdl1w0$('Binaries: '); <ide> this.plus_pdl1w0$('Yested-0.0.4.jar'); <ide> }, <ide> f_30: function () { <del> this.emph_mfnzi$(_.basics.f_28); <add> this.emph_kv1miw$(_.basics.f_28); <ide> this.a_b4th6h$(void 0, 'http://jankovar.net:8081/nexus/content/repositories/releases/net/yested/Yested/0.0.4/Yested-0.0.4.jar', void 0, _.basics.f_29); <ide> }, <ide> f_31: function () { <ide> this.plus_pdl1w0$('Maven Repository'); <ide> }, <ide> f_32: function () { <del> this.h4_mfnzi$(_.basics.f_31); <add> this.h4_kv1miw$(_.basics.f_31); <ide> this.code_puj7f4$('xml', '<repository>\n <id>Yested<\/id>\n <url>http://jankovar.net:8081/nexus/content/repositories/releases/<\/url>\n<\/repository>\n\n<dependency>\n <groupId>net.yested<\/groupId>\n <artifactId>Yested<\/artifactId>\n <version>0.0.4<\/version>\n<\/dependency>\n'); <ide> }, <ide> f_33: function () { <ide> this.p_omdg96$(_.basics.f_32); <ide> }, <ide> f_34: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.basics.f_25); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.basics.f_33); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.basics.f_25); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.basics.f_33); <ide> }, <ide> aboutSection$f: function () { <del> _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_2); <del> _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_34); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_2); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_34); <ide> }, <ide> aboutSection: function () { <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.basics.aboutSection$f); <ide> this.plus_pdl1w0$('Fundamentals of Framework'); <ide> }, <ide> f_36: function () { <del> this.h3_mfnzi$(_.basics.f_35); <add> this.h3_kv1miw$(_.basics.f_35); <ide> }, <ide> f_37: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.basics.f_36); <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.basics.f_36); <ide> }, <ide> f_38: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.basics.f_37); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.basics.f_37); <ide> }, <ide> f_39: function () { <ide> this.plus_pdl1w0$('Just a single interface'); <ide> this.plus_pdl1w0$('All framework components are just simple wrappers around HTMLElement.<br />\n Then they provide usefull methods for manipulation with HTML. I.e. attribute settings or DOM subtree manipulatio.<br />\n All components have to implement trait (interface) Component.'); <ide> }, <ide> f_41: function () { <del> this.h4_mfnzi$(_.basics.f_39); <add> this.h4_kv1miw$(_.basics.f_39); <ide> this.div_5rsex9$(void 0, void 0, _.basics.f_40); <ide> }, <ide> f_42: function () { <ide> this.nbsp_za3lpa$(); <ide> }, <ide> f_43: function () { <del> this.h4_mfnzi$(_.basics.f_42); <add> this.h4_kv1miw$(_.basics.f_42); <ide> this.code_puj7f4$('kotlin', 'trait Component {\n val element : HTMLElement\n}'); <ide> }, <ide> f_44: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_41); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_43); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_41); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_43); <ide> }, <ide> f_45: function () { <ide> this.plus_pdl1w0$('Component creation'); <ide> this.plus_pdl1w0$('Typicaly components extend HTMLParentComponent'); <ide> }, <ide> f_47: function () { <del> this.h4_mfnzi$(_.basics.f_45); <add> this.h4_kv1miw$(_.basics.f_45); <ide> this.div_5rsex9$(void 0, void 0, _.basics.f_46); <ide> }, <ide> f_48: function () { <ide> this.nbsp_za3lpa$(); <ide> }, <ide> f_49: function () { <del> this.h4_mfnzi$(_.basics.f_48); <add> this.h4_kv1miw$(_.basics.f_48); <ide> this.code_puj7f4$('kotlin', 'class Anchor() : HTMLParentComponent("a") {\n\n public var href : String by Attribute()\n\n}'); <ide> }, <ide> f_50: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_47); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_49); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_47); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_49); <ide> }, <ide> f_51: function () { <ide> this.plus_pdl1w0$('Yested application initialization'); <ide> this.plus_pdl1w0$('You need to have a DIV in your html page with id "page". Then Yested app will be renderred into this div using command on the right.'); <ide> }, <ide> f_53: function () { <del> this.h4_mfnzi$(_.basics.f_51); <add> this.h4_kv1miw$(_.basics.f_51); <ide> this.div_5rsex9$(void 0, void 0, _.basics.f_52); <ide> }, <ide> f_54: function () { <ide> this.nbsp_za3lpa$(); <ide> }, <ide> f_55: function () { <del> this.h4_mfnzi$(_.basics.f_54); <add> this.h4_kv1miw$(_.basics.f_54); <ide> this.code_puj7f4$('kotlin', 'page("page") {\n topMenu(navbar)\n content {\n div {\n a(href="http://www.yested.net") { +"Yested homepage" }\n }\n }\n }'); <ide> }, <ide> f_56: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_53); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_55); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_53); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_55); <ide> }, <ide> f_57: function () { <ide> this.plus_pdl1w0$('DSL for layout construction'); <ide> this.plus_pdl1w0$('To understand the DSL please take look at <a href="http://kotlinlang.org/docs/reference/type-safe-builders.html">Kotlin HTML builder<\/a>.\n Have you got it? Then Yested is written in the same DSL way but each object wraps a single HTML element and manipulates with it in a runtime.\n '); <ide> }, <ide> f_59: function () { <del> this.h4_mfnzi$(_.basics.f_57); <add> this.h4_kv1miw$(_.basics.f_57); <ide> this.div_5rsex9$(void 0, void 0, _.basics.f_58); <ide> }, <ide> f_60: function () { <ide> this.nbsp_za3lpa$(); <ide> }, <ide> f_61: function () { <del> this.h4_mfnzi$(_.basics.f_60); <add> this.h4_kv1miw$(_.basics.f_60); <ide> this.code_puj7f4$('kotlin', 'div {\n p {\n h5 { +"Demo list" }\n ul {\n li { a(href="http://www.yested.net") { +"Yested" } }\n li { emph { +"Bold text" }\n li { colorized(color="#778822") { +"Colorized text" } }\n }\n }\n}'); <ide> }, <ide> f_62: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_59); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_61); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_59); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_61); <ide> }, <ide> howItWorksSection$f: function () { <del> _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_38); <del> _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_44); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_38); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_44); <ide> this.br(); <del> _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_50); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_50); <ide> this.br(); <del> _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_56); <del> _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_62); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_56); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_62); <ide> }, <ide> howItWorksSection: function () { <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.basics.howItWorksSection$f); <ide> this.plus_pdl1w0$('Kotlin to Javascript Compiler'); <ide> }, <ide> f_64: function () { <del> this.h3_mfnzi$(_.basics.f_63); <add> this.h3_kv1miw$(_.basics.f_63); <ide> }, <ide> f_65: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.basics.f_64); <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.basics.f_64); <ide> }, <ide> f_66: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.basics.f_65); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.basics.f_65); <ide> }, <ide> f_67: function () { <ide> this.plus_pdl1w0$('Kotlin'); <ide> this.plus_pdl1w0$('Simplest Kotlin Code'); <ide> }, <ide> f_74: function () { <del> this.h4_mfnzi$(_.basics.f_73); <add> this.h4_kv1miw$(_.basics.f_73); <ide> this.code_puj7f4$('kotlin', 'fun main(args: Array<String>) {\n println("This will be printed into a Javascript console.")\n}'); <ide> }, <ide> f_75: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_72); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_74); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.basics.f_72); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.basics.f_74); <ide> }, <ide> kotlinSection$f: function () { <del> _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_66); <del> _.net.yested.bootstrap.row_siz32v$(this, _.basics.f_75); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_66); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.basics.f_75); <ide> }, <ide> kotlinSection: function () { <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.basics.kotlinSection$f); <ide> this.plus_pdl1w0$('Twitter Bootstrap wrappers'); <ide> }, <ide> f_0: function () { <del> this.h3_mfnzi$(_.bootstrap.f); <add> this.h3_kv1miw$(_.bootstrap.f); <ide> }, <ide> f_1: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_0); <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_0); <ide> this.plus_pdl1w0$('Yested Framework provides simple wrappers for some Twitter Boootstrap components.'); <ide> }, <ide> f_2: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_1); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_1); <ide> }, <ide> f_3: function () { <ide> this.plus_pv6laa$(_.bootstrap.createButtons('bootstrapComponents_Buttons')); <ide> this.plus_pv6laa$(_.bootstrap.createMediaObjectSection('bootstrapComponents_MediaObject')); <ide> this.plus_pv6laa$(_.bootstrap.createPaginationSection('bootstrapComponents_Pagination')); <ide> this.plus_pv6laa$(_.bootstrap.createNavbarSection('bootstrapComponents_Navbar')); <add> this.plus_pv6laa$(_.bootstrap.createBreadcrumbsSection('bootstrapComponents_Breadcrumbs')); <ide> }, <ide> f_4: function () { <ide> this.plus_pdl1w0$('Buttons'); <ide> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_31); <ide> }, <ide> f_33: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(10)], _.bootstrap.f_3); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(2)], _.bootstrap.f_32); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(10)], _.bootstrap.f_3); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(2)], _.bootstrap.f_32); <ide> }, <ide> f_34: function (this$) { <ide> return function () { <del> _.net.yested.bootstrap.row_siz32v$(this$, _.bootstrap.f_2); <del> _.net.yested.bootstrap.row_siz32v$(this$, _.bootstrap.f_33); <add> _.net.yested.bootstrap.row_xnql8t$(this$, _.bootstrap.f_2); <add> _.net.yested.bootstrap.row_xnql8t$(this$, _.bootstrap.f_33); <ide> }; <ide> }, <ide> bootstrapPage$f: function () { <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_34(this)); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_34(this)); <ide> }, <ide> bootstrapPage: function () { <ide> _.net.yested.bootstrap.enableScrollSpy_61zpoe$('bootstrapNavbar'); <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.bootstrapPage$f); <ide> }, <add> f_35: function () { <add> this.plus_pdl1w0$('Breadcrumbs'); <add> }, <add> f_36: function () { <add> this.h3_kv1miw$(_.bootstrap.f_35); <add> }, <add> f_37: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_36); <add> }, <add> f_38: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_37); <add> }, <add> f_39: function () { <add> this.plus_pdl1w0$('http://getbootstrap.com/components/#breadcrumbs'); <add> }, <add> f_40: function () { <add> this.plus_pdl1w0$('Refer to Bootstrap Breadcrumbs.'); <add> this.br(); <add> this.a_b4th6h$(void 0, 'http://getbootstrap.com/components/#breadcrumbs', void 0, _.bootstrap.f_39); <add> }, <add> f_41: function () { <add> this.plus_pdl1w0$('Demo'); <add> }, <add> f_42: function () { <add> }, <add> f_43: function () { <add> this.plus_pdl1w0$('Top'); <add> }, <add> f_44: function () { <add> }, <add> f_45: function () { <add> this.plus_pdl1w0$('Level 2'); <add> }, <add> f_46: function () { <add> }, <add> f_47: function () { <add> this.plus_pdl1w0$('Level 3'); <add> }, <add> f_48: function () { <add> this.plus_pdl1w0$('Current'); <add> }, <add> f_49: function () { <add> this.link('#bootstrapComponents_Breadcrumbs', _.bootstrap.f_42, _.bootstrap.f_43); <add> this.link('#bootstrapComponents_Breadcrumbs', _.bootstrap.f_44, _.bootstrap.f_45); <add> this.link('#bootstrapComponents_Breadcrumbs', _.bootstrap.f_46, _.bootstrap.f_47); <add> this.selected(_.bootstrap.f_48); <add> }, <add> f_50: function () { <add> _.net.yested.bootstrap.breadcrumbs_3d8lml$(this, _.bootstrap.f_49); <add> }, <add> f_51: function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_40); <add> this.br(); <add> this.h4_kv1miw$(_.bootstrap.f_41); <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_50); <add> }, <add> f_52: function () { <add> this.plus_pdl1w0$('Code'); <add> }, <add> f_53: function () { <add> this.h4_kv1miw$(_.bootstrap.f_52); <add> this.code_puj7f4$('kotlin', 'breadcrumbs {\n link(href = "#", onclick = {}) { +"Top" }\n link(href = "#", onclick = {}) { +"Level 2" }\n link(href = "#", onclick = {}) { +"Level 3" }\n selected { +"Current" }\n}'); <add> }, <add> f_54: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.bootstrap.f_51); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.bootstrap.f_53); <add> }, <add> createBreadcrumbsSection$f: function () { <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_38); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_54); <add> }, <add> createBreadcrumbsSection: function (id) { <add> return _.net.yested.div_5rsex9$(id, void 0, _.bootstrap.createBreadcrumbsSection$f); <add> }, <ide> buttonGroupsSection$f: function (span) { <ide> return function (value) { <del> span.replace_61zpoe$('Selected: ' + value); <del> }; <del> }, <del> f_35: function () { <add> span.setContent_61zpoe$('Selected: ' + value); <add> }; <add> }, <add> f_55: function () { <ide> this.plus_pdl1w0$('Option 1'); <ide> }, <del> f_36: function () { <add> f_56: function () { <ide> this.plus_pdl1w0$('Option 2'); <ide> }, <ide> buttonGroupsSection$f_0: function () { <del> this.button_mtl9nq$('1', void 0, _.bootstrap.f_35); <del> this.button_mtl9nq$('2', void 0, _.bootstrap.f_36); <del> }, <del> f_37: function () { <add> this.button_ubg574$('1', void 0, _.bootstrap.f_55); <add> this.button_ubg574$('2', void 0, _.bootstrap.f_56); <add> }, <add> f_57: function () { <ide> this.plus_pdl1w0$('Button Group'); <ide> }, <del> f_38: function () { <del> this.h3_mfnzi$(_.bootstrap.f_37); <del> }, <del> f_39: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_38); <del> }, <del> f_40: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_39); <del> }, <del> f_41: function () { <add> f_58: function () { <add> this.h3_kv1miw$(_.bootstrap.f_57); <add> }, <add> f_59: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_58); <add> }, <add> f_60: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_59); <add> }, <add> f_61: function () { <ide> this.plus_pdl1w0$('Refer to Bootstrap buttons groups. Yested version\n in addition offers a way to get selected value (via btnGroup.value)'); <ide> }, <del> f_42: function () { <add> f_62: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> }, <del> f_43: function (btnGroup, span) { <add> f_63: function (btnGroup, span) { <ide> return function () { <ide> this.plus_pv6laa$(btnGroup); <ide> this.br(); <ide> this.plus_pv6laa$(span); <ide> }; <ide> }, <del> f_44: function (btnGroup, span) { <del> return function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_41); <add> f_64: function (btnGroup, span) { <add> return function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_61); <ide> this.br(); <del> this.h4_mfnzi$(_.bootstrap.f_42); <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_43(btnGroup, span)); <del> }; <del> }, <del> f_45: function () { <add> this.h4_kv1miw$(_.bootstrap.f_62); <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_63(btnGroup, span)); <add> }; <add> }, <add> f_65: function () { <ide> this.plus_pdl1w0$('Code'); <ide> }, <del> f_46: function () { <del> this.h4_mfnzi$(_.bootstrap.f_45); <add> f_66: function () { <add> this.h4_kv1miw$(_.bootstrap.f_65); <ide> this.code_puj7f4$('kotlin', 'val span = Span()\nval btnGroup =\n ButtonGroup(\n size = ButtonSize.DEFAULT,\n onSelect = { value -> span.replace("Selected: $\\{value}")}\n ) with {\n button(value = "1", label = { + "Option 1"})\n button(value = "2", label = { + "Option 2"})\n }'); <ide> }, <del> f_47: function (btnGroup, span) { <del> return function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_44(btnGroup, span)); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_46); <add> f_67: function (btnGroup, span) { <add> return function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_64(btnGroup, span)); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_66); <ide> }; <ide> }, <ide> buttonGroupsSection$f_1: function (id, btnGroup, span) { <ide> return function () { <ide> this.id = id; <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_40); <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_47(btnGroup, span)); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_60); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_67(btnGroup, span)); <ide> }; <ide> }, <ide> buttonGroupsSection: function (id) { <ide> var btnGroup = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.ButtonGroup(_.net.yested.bootstrap.ButtonSize.object.DEFAULT, _.bootstrap.buttonGroupsSection$f(span)), _.bootstrap.buttonGroupsSection$f_0); <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.buttonGroupsSection$f_1(id, btnGroup, span)); <ide> }, <del> f_48: function () { <add> f_68: function () { <ide> this.plus_pdl1w0$('Buttons'); <ide> }, <del> f_49: function () { <del> this.h3_mfnzi$(_.bootstrap.f_48); <del> }, <del> f_50: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_49); <del> }, <del> f_51: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_50); <del> }, <del> f_52: function () { <add> f_69: function () { <add> this.h3_kv1miw$(_.bootstrap.f_68); <add> }, <add> f_70: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_69); <add> }, <add> f_71: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_70); <add> }, <add> f_72: function () { <ide> this.plus_pdl1w0$('\nRefer to Bootstrap buttons.\n'); <ide> }, <del> f_53: function () { <add> f_73: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> }, <del> f_54: function () { <add> f_74: function () { <ide> this.plus_pdl1w0$('Primary'); <ide> }, <del> f_55: function () { <add> f_75: function () { <ide> Kotlin.println('First Button pressed.'); <ide> }, <del> f_56: function () { <add> f_76: function () { <ide> this.plus_pdl1w0$('Success'); <ide> }, <del> f_57: function () { <add> f_77: function () { <ide> Kotlin.println('Second Button pressed.'); <ide> }, <del> f_58: function () { <del> _.net.yested.bootstrap.btsButton_j2rvkn$(this, _.net.yested.ButtonType.object.BUTTON, _.bootstrap.f_54, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, _.net.yested.bootstrap.ButtonSize.object.LARGE, void 0, _.bootstrap.f_55); <add> f_78: function () { <add> _.net.yested.bootstrap.btsButton_adnmfr$(this, _.net.yested.ButtonType.object.BUTTON, _.bootstrap.f_74, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, _.net.yested.bootstrap.ButtonSize.object.LARGE, void 0, _.bootstrap.f_75); <ide> this.nbsp_za3lpa$(); <del> _.net.yested.bootstrap.btsButton_j2rvkn$(this, _.net.yested.ButtonType.object.BUTTON, _.bootstrap.f_56, _.net.yested.bootstrap.ButtonLook.object.SUCCESS, _.net.yested.bootstrap.ButtonSize.object.LARGE, void 0, _.bootstrap.f_57); <del> }, <del> f_59: function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_52); <add> _.net.yested.bootstrap.btsButton_adnmfr$(this, _.net.yested.ButtonType.object.BUTTON, _.bootstrap.f_76, _.net.yested.bootstrap.ButtonLook.object.SUCCESS, _.net.yested.bootstrap.ButtonSize.object.LARGE, void 0, _.bootstrap.f_77); <add> }, <add> f_79: function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_72); <ide> this.br(); <del> this.h4_mfnzi$(_.bootstrap.f_53); <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_58); <del> }, <del> f_60: function () { <add> this.h4_kv1miw$(_.bootstrap.f_73); <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_78); <add> }, <add> f_80: function () { <ide> this.plus_pdl1w0$('Code'); <ide> }, <del> f_61: function () { <del> this.h4_mfnzi$(_.bootstrap.f_60); <add> f_81: function () { <add> this.h4_kv1miw$(_.bootstrap.f_80); <ide> this.code_puj7f4$('kotlin', 'div {\n btsButton(\n type = ButtonType.BUTTON,\n label = { +"Primary" },\n look = ButtonLook.PRIMARY,\n size = ButtonSize.LARGE,\n onclick = { println("First Button pressed.") })\n nbsp()\n btsButton(\n type = ButtonType.BUTTON,\n label = { +"Success" },\n look = ButtonLook.SUCCESS,\n size = ButtonSize.LARGE,\n onclick = { println("Second Button pressed.") })\n}'); <ide> }, <del> f_62: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_59); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_61); <add> f_82: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_79); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_81); <ide> }, <ide> createButtons$f: function (id) { <ide> return function () { <ide> this.id = id; <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_51); <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_62); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_71); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_82); <ide> }; <ide> }, <ide> createButtons: function (id) { <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createButtons$f(id)); <ide> }, <del> f_63: function () { <add> f_83: function () { <ide> this.plus_pdl1w0$('This is dialog with text input'); <ide> }, <del> f_64: function () { <add> f_84: function () { <ide> this.plus_pdl1w0$('Name'); <ide> }, <del> f_65: function () { <add> f_85: function () { <ide> this.id = 'nameId'; <ide> }, <del> f_66: function () { <del> _.net.yested.bootstrap.textInput_rha0js$(this, 'Name', _.bootstrap.f_65); <del> }, <del> f_67: function () { <del> this.item_2xyzwi$('nameId', _.bootstrap.f_64, void 0, _.bootstrap.f_66); <del> }, <del> f_68: function () { <del> _.net.yested.bootstrap.btsForm_nas0k3$(this, void 0, void 0, _.bootstrap.f_67); <del> }, <del> f_69: function () { <add> f_86: function () { <add> _.net.yested.bootstrap.textInput_ra92pu$(this, 'Name', _.bootstrap.f_85); <add> }, <add> f_87: function () { <add> this.item_gthhqa$('nameId', _.bootstrap.f_84, void 0, _.bootstrap.f_86); <add> }, <add> f_88: function () { <add> _.net.yested.bootstrap.btsForm_iz33rd$(this, void 0, void 0, _.bootstrap.f_87); <add> }, <add> f_89: function () { <ide> this.plus_pdl1w0$('Submit'); <ide> }, <del> f_70: function (dialog) { <add> f_90: function (dialog) { <ide> return function () { <ide> dialog.close(); <ide> }; <ide> }, <del> f_71: function (dialog) { <del> return function () { <del> _.net.yested.bootstrap.btsButton_j2rvkn$(this, _.net.yested.ButtonType.object.SUBMIT, _.bootstrap.f_69, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, void 0, void 0, _.bootstrap.f_70(dialog)); <add> f_91: function (dialog) { <add> return function () { <add> _.net.yested.bootstrap.btsButton_adnmfr$(this, _.net.yested.ButtonType.object.SUBMIT, _.bootstrap.f_89, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, void 0, void 0, _.bootstrap.f_90(dialog)); <ide> }; <ide> }, <ide> createDialogs$f: function (dialog) { <ide> return function () { <del> this.header_1(_.bootstrap.f_63); <del> this.body_1(_.bootstrap.f_68); <del> this.footer_1(_.bootstrap.f_71(dialog)); <del> }; <del> }, <del> f_72: function () { <add> this.header_1(_.bootstrap.f_83); <add> this.body_1(_.bootstrap.f_88); <add> this.footer_1(_.bootstrap.f_91(dialog)); <add> }; <add> }, <add> f_92: function () { <ide> this.plus_pdl1w0$('Dialogs'); <ide> }, <del> f_73: function () { <del> this.h3_mfnzi$(_.bootstrap.f_72); <del> }, <del> f_74: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_73); <del> }, <del> f_75: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_74); <del> }, <del> f_76: function () { <add> f_93: function () { <add> this.h3_kv1miw$(_.bootstrap.f_92); <add> }, <add> f_94: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_93); <add> }, <add> f_95: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_94); <add> }, <add> f_96: function () { <ide> this.plus_pdl1w0$('This is a wrapper around Bootstrap dialogs.'); <ide> }, <del> f_77: function () { <add> f_97: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> }, <del> f_78: function () { <add> f_98: function () { <ide> this.plus_pdl1w0$('Open dialog'); <ide> }, <del> f_79: function (dialog) { <add> f_99: function (dialog) { <ide> return function () { <ide> dialog.open(); <ide> }; <ide> }, <del> f_80: function (dialog) { <del> return function () { <del> _.net.yested.bootstrap.btsButton_j2rvkn$(this, void 0, _.bootstrap.f_78, void 0, void 0, void 0, _.bootstrap.f_79(dialog)); <del> }; <del> }, <del> f_81: function (dialog) { <del> return function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_76); <del> this.h4_mfnzi$(_.bootstrap.f_77); <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_80(dialog)); <del> }; <del> }, <del> f_82: function () { <add> f_100: function (dialog) { <add> return function () { <add> _.net.yested.bootstrap.btsButton_adnmfr$(this, void 0, _.bootstrap.f_98, void 0, void 0, void 0, _.bootstrap.f_99(dialog)); <add> }; <add> }, <add> f_101: function (dialog) { <add> return function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_96); <add> this.h4_kv1miw$(_.bootstrap.f_97); <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_100(dialog)); <add> }; <add> }, <add> f_102: function () { <ide> this.plus_pdl1w0$('Code'); <ide> }, <del> f_83: function () { <del> this.h4_mfnzi$(_.bootstrap.f_82); <add> f_103: function () { <add> this.h4_kv1miw$(_.bootstrap.f_102); <ide> this.code_puj7f4$('kotlin', 'val dialog = Dialog()\n\ndialog with {\n header { + "This is dialog with text input" }\n body {\n btsForm {\n item(forId = "nameId", label = { + "Name" }) {\n textInput(placeholder = "Name") { id = "nameId"}\n }\n }\n }\n footer {\n btsButton(\n type = ButtonType.SUBMIT,\n look = ButtonLook.PRIMARY,\n label = { +"Submit"},\n onclick = { dialog.close() })\n\n }\n}\n\n//somewhere in a dom tree:\ndiv {\n btsButton(label = { +"Open dialog" }, onclick = { dialog.open() })\n}'); <ide> }, <del> f_84: function (dialog) { <del> return function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_81(dialog)); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_83); <add> f_104: function (dialog) { <add> return function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_101(dialog)); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_103); <ide> }; <ide> }, <ide> createDialogs$f_0: function (id, dialog) { <ide> return function () { <ide> this.id = id; <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_75); <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_84(dialog)); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_95); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_104(dialog)); <ide> }; <ide> }, <ide> createDialogs: function (id) { <ide> _.net.yested.with_owvm91$(dialog, _.bootstrap.createDialogs$f(dialog)); <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createDialogs$f_0(id, dialog)); <ide> }, <del> f_85: function () { <add> f_105: function () { <ide> this.plus_pdl1w0$('Form'); <ide> }, <del> f_86: function () { <del> this.h3_mfnzi$(_.bootstrap.f_85); <del> }, <del> f_87: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_86); <del> }, <del> f_88: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_87); <del> }, <del> f_89: function () { <add> f_106: function () { <add> this.h3_kv1miw$(_.bootstrap.f_105); <add> }, <add> f_107: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_106); <add> }, <add> f_108: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_107); <add> }, <add> f_109: function () { <ide> this.plus_pdl1w0$('\n'); <ide> }, <del> f_90: function () { <add> f_110: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> }, <del> f_91: function () { <add> f_111: function () { <ide> this.plus_pdl1w0$('Username'); <ide> }, <del> f_92: function () { <del> }, <del> f_93: function () { <del> _.net.yested.bootstrap.textInput_rha0js$(this, 'Enter your username', _.bootstrap.f_92); <del> }, <del> f_94: function () { <add> f_112: function () { <add> }, <add> f_113: function () { <add> _.net.yested.bootstrap.textInput_ra92pu$(this, 'Enter your username', _.bootstrap.f_112); <add> }, <add> f_114: function () { <ide> this.plus_pdl1w0$('Salary'); <ide> }, <del> f_95: function () { <del> _.net.yested.bootstrap.inputAddOn_lzeodb$(this, '$', '.00', new _.net.yested.bootstrap.TextInput('Your expectation')); <del> }, <del> f_96: function () { <del> this.item_2xyzwi$(void 0, _.bootstrap.f_91, void 0, _.bootstrap.f_93); <del> this.item_2xyzwi$(void 0, _.bootstrap.f_94, void 0, _.bootstrap.f_95); <del> }, <del> f_97: function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_89); <add> f_115: function () { <add> _.net.yested.bootstrap.inputAddOn_cc7g17$(this, '$', '.00', new _.net.yested.bootstrap.TextInput('Your expectation')); <add> }, <add> f_116: function () { <add> this.item_gthhqa$(void 0, _.bootstrap.f_111, void 0, _.bootstrap.f_113); <add> this.item_gthhqa$(void 0, _.bootstrap.f_114, void 0, _.bootstrap.f_115); <add> }, <add> f_117: function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_109); <ide> this.br(); <del> this.h4_mfnzi$(_.bootstrap.f_90); <del> _.net.yested.bootstrap.btsForm_nas0k3$(this, 'col-sm-4', 'col-sm-8', _.bootstrap.f_96); <del> }, <del> f_98: function () { <add> this.h4_kv1miw$(_.bootstrap.f_110); <add> _.net.yested.bootstrap.btsForm_iz33rd$(this, 'col-sm-4', 'col-sm-8', _.bootstrap.f_116); <add> }, <add> f_118: function () { <ide> this.plus_pdl1w0$('Code'); <ide> }, <del> f_99: function () { <del> this.h4_mfnzi$(_.bootstrap.f_98); <add> f_119: function () { <add> this.h4_kv1miw$(_.bootstrap.f_118); <ide> this.code_puj7f4$('kotlin', 'btsForm(labelDef = "col-sm-4", inputDef = "col-sm-8") {\n item(label = { +"Username"}) {\n textInput(placeholder = "Enter your username") { }\n }\n item(label = { +"Salary" }) {\n inputAddOn(prefix = "$", suffix = ".00", textInput = TextInput(placeholder = "Your expectation") )\n }\n}'); <ide> }, <del> f_100: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_97); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_99); <add> f_120: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_117); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_119); <ide> }, <ide> createForm$f: function (id) { <ide> return function () { <ide> this.id = id; <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_88); <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_100); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_108); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_120); <ide> }; <ide> }, <ide> createForm: function (id) { <ide> createGrid$f_2: function (it) { <ide> return it.age; <ide> }, <del> f_101: function () { <add> f_121: function () { <ide> this.plus_pdl1w0$('Grid'); <ide> }, <del> f_102: function () { <del> this.h3_mfnzi$(_.bootstrap.f_101); <del> }, <del> f_103: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_102); <del> }, <del> f_104: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_103); <del> }, <del> f_105: function () { <add> f_122: function () { <add> this.h3_kv1miw$(_.bootstrap.f_121); <add> }, <add> f_123: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_122); <add> }, <add> f_124: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_123); <add> }, <add> f_125: function () { <ide> this.plus_pdl1w0$('\nGrid is simply a renderred HTML Table element. It is not suitable for too many rows.\n'); <ide> }, <del> f_106: function () { <add> f_126: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> }, <del> f_107: function (grid) { <del> return function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_105); <add> f_127: function (grid) { <add> return function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_125); <ide> this.br(); <del> this.h4_mfnzi$(_.bootstrap.f_106); <add> this.h4_kv1miw$(_.bootstrap.f_126); <ide> this.plus_pv6laa$(grid); <ide> }; <ide> }, <del> f_108: function () { <add> f_128: function () { <ide> this.plus_pdl1w0$('Code'); <ide> }, <del> f_109: function () { <del> this.h4_mfnzi$(_.bootstrap.f_108); <add> f_129: function () { <add> this.h4_kv1miw$(_.bootstrap.f_128); <ide> this.code_puj7f4$('kotlin', 'data class Person(val name:String, val age:Int)\nval data = listOf(Person("Jan", 15), Person("Peter", 30), Person("Martin", 31))\n\nval grid = Grid(columns = array(\n Column(\n label = text("Name"),\n render = { +it.name },\n sortFunction = {(l,r) -> compareValues(l.name, r.name)}),\n Column(\n label = text("Age "),\n render = { +"\\$\\{it.age}" },\n sortFunction = compareBy<Person,Int> { it.age },\n defaultSort = true,\n defaultSortOrderAsc = true)\n))\n\ngrid.list = data;\n'); <ide> }, <del> f_110: function (grid) { <del> return function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_107(grid)); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_109); <add> f_130: function (grid) { <add> return function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_127(grid)); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_129); <ide> }; <ide> }, <ide> createGrid$f_3: function (id, grid) { <ide> return function () { <ide> this.id = id; <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_104); <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_110(grid)); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_124); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_130(grid)); <ide> }; <ide> }, <ide> createGrid: function (id) { <ide> createInputs$f_0: function () { <ide> this.plus_pdl1w0$('Send'); <ide> }, <del> f_111: function () { <add> f_131: function () { <ide> this.plus_pdl1w0$('Text Input with Validation'); <ide> }, <del> f_112: function () { <del> this.h3_mfnzi$(_.bootstrap.f_111); <del> }, <del> f_113: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_112); <del> }, <del> f_114: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_113); <del> }, <del> f_115: function () { <add> f_132: function () { <add> this.h3_kv1miw$(_.bootstrap.f_131); <add> }, <add> f_133: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_132); <add> }, <add> f_134: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_133); <add> }, <add> f_135: function () { <ide> this.plus_pdl1w0$('\nThis example demonstrates simple text input with custom validation.\nPlease note that validator is also attached to form item.\n'); <ide> }, <del> f_116: function () { <add> f_136: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> }, <del> f_117: function () { <add> f_137: function () { <ide> this.plus_pdl1w0$('Name'); <ide> }, <del> f_118: function (textInput) { <add> f_138: function (textInput) { <ide> return function () { <ide> this.plus_pv6laa$(textInput); <ide> }; <ide> }, <del> f_119: function () { <del> }, <del> f_120: function (button) { <add> f_139: function () { <add> }, <add> f_140: function (button) { <ide> return function () { <ide> this.plus_pv6laa$(button); <ide> }; <ide> }, <del> f_121: function (validator, textInput, button) { <del> return function () { <del> this.item_2xyzwi$(void 0, _.bootstrap.f_117, validator, _.bootstrap.f_118(textInput)); <del> this.item_2xyzwi$(void 0, _.bootstrap.f_119, void 0, _.bootstrap.f_120(button)); <del> }; <del> }, <del> f_122: function (validator, textInput, button) { <del> return function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_115); <add> f_141: function (validator, textInput, button) { <add> return function () { <add> this.item_gthhqa$(void 0, _.bootstrap.f_137, validator, _.bootstrap.f_138(textInput)); <add> this.item_gthhqa$(void 0, _.bootstrap.f_139, void 0, _.bootstrap.f_140(button)); <add> }; <add> }, <add> f_142: function (validator, textInput, button) { <add> return function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_135); <ide> this.br(); <del> this.h4_mfnzi$(_.bootstrap.f_116); <del> _.net.yested.bootstrap.btsForm_nas0k3$(this, 'col-sm-3', 'col-sm-9', _.bootstrap.f_121(validator, textInput, button)); <del> }; <del> }, <del> f_123: function () { <add> this.h4_kv1miw$(_.bootstrap.f_136); <add> _.net.yested.bootstrap.btsForm_iz33rd$(this, 'col-sm-3', 'col-sm-9', _.bootstrap.f_141(validator, textInput, button)); <add> }; <add> }, <add> f_143: function () { <ide> this.plus_pdl1w0$('Code'); <ide> }, <del> f_124: function () { <del> this.h4_mfnzi$(_.bootstrap.f_123); <add> f_144: function () { <add> this.h4_kv1miw$(_.bootstrap.f_143); <ide> this.code_puj7f4$('kotlin', 'val textInput = TextInput(placeholder = "Mandatory field")\n\nval validator = Validator(textInput, errorText = "At least 3 chars!!") { value -> value.size > 2 }\n\nfun submit() {\n if (validator.isValid()) {\n println("submit")\n }\n}\n\nval button = BtsButton(label = { +"Send"}, onclick = ::submit)\n\nform(labelDef = "col-sm-3", inputDef = "col-sm-9") {\n item(label = { +"Name"}, validator = validator) {\n +textInput\n }\n item(label = {}) {\n +button\n }\n}\n'); <ide> }, <del> f_125: function (validator, textInput, button) { <del> return function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_122(validator, textInput, button)); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_124); <add> f_145: function (validator, textInput, button) { <add> return function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_142(validator, textInput, button)); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_144); <ide> }; <ide> }, <ide> createInputs$f_1: function (id, validator, textInput, button) { <ide> return function () { <ide> this.id = id; <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_114); <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_125(validator, textInput, button)); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_134); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_145(validator, textInput, button)); <ide> }; <ide> }, <ide> createInputs: function (id) { <ide> var button = new _.net.yested.bootstrap.BtsButton(void 0, _.bootstrap.createInputs$f_0, void 0, void 0, void 0, submit); <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createInputs$f_1(id, validator, textInput, button)); <ide> }, <del> f_126: function () { <add> f_146: function () { <ide> this.plus_pdl1w0$('Media Object'); <ide> }, <del> f_127: function () { <del> this.h3_mfnzi$(_.bootstrap.f_126); <del> }, <del> f_128: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_127); <del> }, <del> f_129: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_128); <del> }, <del> f_130: function () { <add> f_147: function () { <add> this.h3_kv1miw$(_.bootstrap.f_146); <add> }, <add> f_148: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_147); <add> }, <add> f_149: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_148); <add> }, <add> f_150: function () { <ide> this.plus_pdl1w0$('Media object is used for creating components that should contain left- or rightaligned\n\t\t\t\t\t\tmedia (image, video, or audio) alongside some textual content. It is best\n\t\t\t\t\t\tsuited for creating features such as a comments section, displaying tweets, or\n\t\t\t\t\t\tshowing product details where a product image is present.'); <ide> }, <del> f_131: function () { <add> f_151: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> }, <del> f_132: function () { <add> f_152: function () { <ide> this.img_puj7f4$('demo-site/img/leaf.gif'); <ide> }, <del> f_133: function () { <add> f_153: function () { <ide> this.plus_pdl1w0$('Media Object'); <ide> }, <del> f_134: function () { <add> f_154: function () { <ide> this.plus_pdl1w0$('Media object is used for creating components that should contain left- or rightaligned\n\t\t\t\t\t\t\tmedia (image, video, or audio) alongside some textual content. It is best\n\t\t\t\t\t\t\tsuited for creating features such as a comments section, displaying tweets, or\n\t\t\t\t\t\t\tshowing product details where a product image is present.'); <ide> }, <del> f_135: function () { <add> f_155: function () { <ide> this.img_puj7f4$('demo-site/img/leaf.gif'); <ide> }, <del> f_136: function () { <add> f_156: function () { <ide> this.plus_pdl1w0$('Nested Media Object'); <ide> }, <del> f_137: function () { <add> f_157: function () { <ide> this.plus_pdl1w0$(' Nested Text'); <ide> }, <del> f_138: function (this$) { <del> return function () { <del> this$.p_omdg96$(_.bootstrap.f_137); <del> }; <del> }, <del> f_139: function () { <del> this.heading_mfnzi$(_.bootstrap.f_136); <del> this.content_8cdto9$(_.bootstrap.f_138(this)); <del> }, <del> f_140: function () { <del> this.media_mfnzi$(_.bootstrap.f_135); <del> this.content_tq11g4$(_.bootstrap.f_139); <del> }, <del> f_141: function (this$) { <del> return function () { <del> this$.p_omdg96$(_.bootstrap.f_134); <del> _.net.yested.bootstrap.mediaObject_xpcv5y$(this$, _.net.yested.bootstrap.MediaAlign.object.Left, _.bootstrap.f_140); <del> }; <del> }, <del> f_142: function () { <del> this.heading_mfnzi$(_.bootstrap.f_133); <del> this.content_8cdto9$(_.bootstrap.f_141(this)); <del> }, <del> f_143: function () { <del> this.media_mfnzi$(_.bootstrap.f_132); <del> this.content_tq11g4$(_.bootstrap.f_142); <del> }, <del> f_144: function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_130); <add> f_158: function () { <add> this.p_omdg96$(_.bootstrap.f_157); <add> }, <add> f_159: function () { <add> this.heading_kv1miw$(_.bootstrap.f_156); <add> this.content_kv1miw$(_.bootstrap.f_158); <add> }, <add> f_160: function () { <add> this.media_kv1miw$(_.bootstrap.f_155); <add> this.content_tq11g4$(_.bootstrap.f_159); <add> }, <add> f_161: function () { <add> this.p_omdg96$(_.bootstrap.f_154); <add> _.net.yested.bootstrap.mediaObject_wda2nk$(this, _.net.yested.bootstrap.MediaAlign.object.Left, _.bootstrap.f_160); <add> }, <add> f_162: function () { <add> this.heading_kv1miw$(_.bootstrap.f_153); <add> this.content_kv1miw$(_.bootstrap.f_161); <add> }, <add> f_163: function () { <add> this.media_kv1miw$(_.bootstrap.f_152); <add> this.content_tq11g4$(_.bootstrap.f_162); <add> }, <add> f_164: function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_150); <ide> this.br(); <del> this.h4_mfnzi$(_.bootstrap.f_131); <del> _.net.yested.bootstrap.mediaObject_xpcv5y$(this, _.net.yested.bootstrap.MediaAlign.object.Left, _.bootstrap.f_143); <del> }, <del> f_145: function () { <add> this.h4_kv1miw$(_.bootstrap.f_151); <add> _.net.yested.bootstrap.mediaObject_wda2nk$(this, _.net.yested.bootstrap.MediaAlign.object.Left, _.bootstrap.f_163); <add> }, <add> f_165: function () { <ide> this.plus_pdl1w0$('Code'); <ide> }, <del> f_146: function () { <del> this.h4_mfnzi$(_.bootstrap.f_145); <add> f_166: function () { <add> this.h4_kv1miw$(_.bootstrap.f_165); <ide> this.code_puj7f4$('kotlin', '\nmediaObject(MediaAlign.Left) {\n\tmedia {\n\t\timg(src = "demo-site/img/leaf.gif")\n\t}\n\tcontent {\n\t\theading {\n\t\t\t+ "Media Object"\n\t\t}\n\t\tcontent {\n\t\t\t+ p { "Media object is used ..." }\n\t\t\tmediaObject(MediaAlign.Left) {\n\t\t\t\tmedia {\n\t\t\t\t\timg(src = "demo-site/img/leaf.gif")\n\t\t\t\t}\n\t\t\t\tcontent {\n\t\t\t\t\theading {\n\t\t\t\t\t\t+ "Nested Media Object"\n\t\t\t\t\t}\n\t\t\t\t\tcontent {\n\t\t\t\t\t\t+ p { "Nested Text" }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\t\t\t\t'); <ide> }, <del> f_147: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_144); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_146); <add> f_167: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_164); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_166); <ide> }, <ide> createMediaObjectSection$f: function (id) { <ide> return function () { <ide> this.id = id; <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_129); <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_147); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_149); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_167); <ide> }; <ide> }, <ide> createMediaObjectSection: function (id) { <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createMediaObjectSection$f(id)); <ide> }, <del> f_148: function () { <add> f_168: function () { <ide> this.plus_pdl1w0$('Navbar'); <ide> }, <del> f_149: function () { <del> this.h3_mfnzi$(_.bootstrap.f_148); <del> }, <del> f_150: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_149); <del> }, <del> f_151: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_150); <del> }, <del> f_152: function () { <add> f_169: function () { <add> this.h3_kv1miw$(_.bootstrap.f_168); <add> }, <add> f_170: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_169); <add> }, <add> f_171: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_170); <add> }, <add> f_172: function () { <ide> this.plus_pdl1w0$('http://getbootstrap.com/components/#navbar'); <ide> }, <del> f_153: function () { <add> f_173: function () { <ide> this.plus_pdl1w0$('Features:'); <ide> }, <del> f_154: function () { <add> f_174: function () { <ide> this.plus_pdl1w0$('Navbar collapses on mobile screens.'); <ide> }, <del> f_155: function () { <add> f_175: function () { <ide> this.plus_pdl1w0$('Once clicked on menu item, it stays selected.'); <ide> }, <del> f_156: function () { <add> f_176: function () { <ide> this.plus_pdl1w0$('You can set hrefs of menu items or capture onclick events.'); <ide> }, <del> f_157: function () { <del> this.li_8y48wp$(_.bootstrap.f_154); <del> this.li_8y48wp$(_.bootstrap.f_155); <del> this.li_8y48wp$(_.bootstrap.f_156); <del> }, <del> f_158: function () { <add> f_177: function () { <add> this.li_8y48wp$(_.bootstrap.f_174); <add> this.li_8y48wp$(_.bootstrap.f_175); <add> this.li_8y48wp$(_.bootstrap.f_176); <add> }, <add> f_178: function () { <ide> this.plus_pdl1w0$('Please note!'); <ide> }, <del> f_159: function () { <add> f_179: function () { <ide> this.plus_pdl1w0$('Set correct Bootrsap classes to forms/text you use in header (see in the example below)'); <ide> }, <del> f_160: function () { <add> f_180: function () { <ide> this.plus_pdl1w0$('Keep the order of the elements as specified by Bootstrap'); <ide> }, <del> f_161: function () { <add> f_181: function () { <ide> this.plus_pdl1w0$('Set different IDs if you have multiple navbars in one application'); <ide> }, <del> f_162: function () { <del> this.li_8y48wp$(_.bootstrap.f_159); <del> this.li_8y48wp$(_.bootstrap.f_160); <del> this.li_8y48wp$(_.bootstrap.f_161); <del> }, <del> f_163: function () { <add> f_182: function () { <add> this.li_8y48wp$(_.bootstrap.f_179); <add> this.li_8y48wp$(_.bootstrap.f_180); <add> this.li_8y48wp$(_.bootstrap.f_181); <add> }, <add> f_183: function () { <ide> this.plus_pdl1w0$('Complete implementation of Twitter Bootstrap Navbar. Please see: '); <del> this.a_b4th6h$(void 0, 'http://getbootstrap.com/components/#navbar', void 0, _.bootstrap.f_152); <add> this.a_b4th6h$(void 0, 'http://getbootstrap.com/components/#navbar', void 0, _.bootstrap.f_172); <ide> this.br(); <ide> this.br(); <del> this.emph_mfnzi$(_.bootstrap.f_153); <del> this.ul_8qfrsd$(_.bootstrap.f_157); <add> this.emph_kv1miw$(_.bootstrap.f_173); <add> this.ul_8qfrsd$(_.bootstrap.f_177); <ide> this.br(); <del> this.emph_mfnzi$(_.bootstrap.f_158); <del> this.ul_8qfrsd$(_.bootstrap.f_162); <add> this.emph_kv1miw$(_.bootstrap.f_178); <add> this.ul_8qfrsd$(_.bootstrap.f_182); <ide> this.br(); <ide> }, <del> f_164: function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_163); <del> }, <del> f_165: function () { <add> f_184: function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_183); <add> }, <add> f_185: function () { <ide> this.plus_pdl1w0$("Navbar Positions (parameter 'position'):"); <ide> }, <del> f_166: function () { <add> f_186: function () { <ide> this.plus_pdl1w0$('Empty - Navbar will render in the current element'); <ide> }, <del> f_167: function () { <add> f_187: function () { <ide> this.plus_pdl1w0$('FIXED_TOP - Navbar will be at the top and always visible'); <ide> }, <del> f_168: function () { <add> f_188: function () { <ide> this.plus_pdl1w0$('FIXED_BOTTOM - Navbar will be at the bottom and always visiblet'); <ide> }, <del> f_169: function () { <add> f_189: function () { <ide> this.plus_pdl1w0$('STATIC_TOP - Navbar will be at the top and will scroll out'); <ide> }, <del> f_170: function () { <del> this.li_8y48wp$(_.bootstrap.f_166); <del> this.li_8y48wp$(_.bootstrap.f_167); <del> this.li_8y48wp$(_.bootstrap.f_168); <del> this.li_8y48wp$(_.bootstrap.f_169); <del> }, <del> f_171: function () { <add> f_190: function () { <add> this.li_8y48wp$(_.bootstrap.f_186); <add> this.li_8y48wp$(_.bootstrap.f_187); <add> this.li_8y48wp$(_.bootstrap.f_188); <add> this.li_8y48wp$(_.bootstrap.f_189); <add> }, <add> f_191: function () { <ide> this.plus_pdl1w0$("Navbar Look (parameter 'look'):"); <ide> }, <del> f_172: function () { <add> f_192: function () { <ide> this.plus_pdl1w0$('DEFAULT - Default look (light)'); <ide> }, <del> f_173: function () { <add> f_193: function () { <ide> this.plus_pdl1w0$('INVERSE - Inversed colours (dark)'); <ide> }, <del> f_174: function () { <del> this.li_8y48wp$(_.bootstrap.f_172); <del> this.li_8y48wp$(_.bootstrap.f_173); <del> }, <del> f_175: function () { <add> f_194: function () { <add> this.li_8y48wp$(_.bootstrap.f_192); <add> this.li_8y48wp$(_.bootstrap.f_193); <add> }, <add> f_195: function () { <ide> this.plus_pdl1w0$('Navbar features (DSL functions):'); <ide> }, <del> f_176: function () { <add> f_196: function () { <ide> this.plus_pdl1w0$('brand - Page title/logo (Anchor) (optional, once)'); <ide> }, <del> f_177: function () { <add> f_197: function () { <ide> this.plus_pdl1w0$('item - Top menu item (Anchor) (optional, many times)'); <ide> }, <del> f_178: function () { <add> f_198: function () { <ide> this.plus_pdl1w0$('dropdown - Top menu item (Anchor) (optional, many times)'); <ide> }, <del> f_179: function () { <add> f_199: function () { <ide> this.plus_pdl1w0$('left - Content will be position on the left (after last menu link)'); <ide> }, <del> f_180: function () { <add> f_200: function () { <ide> this.plus_pdl1w0$('right - Content will be position on the right'); <ide> }, <del> f_181: function () { <del> this.li_8y48wp$(_.bootstrap.f_176); <del> this.li_8y48wp$(_.bootstrap.f_177); <del> this.li_8y48wp$(_.bootstrap.f_178); <del> this.li_8y48wp$(_.bootstrap.f_179); <del> this.li_8y48wp$(_.bootstrap.f_180); <del> }, <del> f_182: function () { <del> this.emph_mfnzi$(_.bootstrap.f_165); <del> this.ul_8qfrsd$(_.bootstrap.f_170); <add> f_201: function () { <add> this.li_8y48wp$(_.bootstrap.f_196); <add> this.li_8y48wp$(_.bootstrap.f_197); <add> this.li_8y48wp$(_.bootstrap.f_198); <add> this.li_8y48wp$(_.bootstrap.f_199); <add> this.li_8y48wp$(_.bootstrap.f_200); <add> }, <add> f_202: function () { <add> this.emph_kv1miw$(_.bootstrap.f_185); <add> this.ul_8qfrsd$(_.bootstrap.f_190); <ide> this.br(); <del> this.emph_mfnzi$(_.bootstrap.f_171); <del> this.ul_8qfrsd$(_.bootstrap.f_174); <add> this.emph_kv1miw$(_.bootstrap.f_191); <add> this.ul_8qfrsd$(_.bootstrap.f_194); <ide> this.br(); <del> this.emph_mfnzi$(_.bootstrap.f_175); <del> this.ul_8qfrsd$(_.bootstrap.f_181); <del> }, <del> f_183: function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_182); <del> }, <del> f_184: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.bootstrap.f_164); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.bootstrap.f_183); <del> }, <del> f_185: function () { <add> this.emph_kv1miw$(_.bootstrap.f_195); <add> this.ul_8qfrsd$(_.bootstrap.f_201); <add> }, <add> f_203: function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_202); <add> }, <add> f_204: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.bootstrap.f_184); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.bootstrap.f_203); <add> }, <add> f_205: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> }, <del> f_186: function () { <del> _.net.yested.bootstrap.glyphicon_a53mlj$(this, 'home'); <add> f_206: function () { <add> _.net.yested.bootstrap.glyphicon_8jxlbl$(this, 'home'); <ide> this.nbsp_za3lpa$(); <ide> this.plus_pdl1w0$('Home'); <ide> }, <del> f_187: function () { <add> f_207: function () { <ide> this.plus_pdl1w0$('Some Link 1'); <ide> }, <del> f_188: function () { <add> f_208: function () { <ide> Kotlin.println('clicked'); <ide> }, <del> f_189: function () { <add> f_209: function () { <ide> this.plus_pdl1w0$('Some Link 2'); <ide> }, <del> f_190: function () { <add> f_210: function () { <ide> this.plus_pdl1w0$('Dropdown'); <ide> }, <del> f_191: function () { <add> f_211: function () { <ide> Kotlin.println('clicked'); <ide> }, <del> f_192: function () { <add> f_212: function () { <ide> this.plus_pdl1w0$('Link 1'); <ide> }, <del> f_193: function () { <add> f_213: function () { <ide> Kotlin.println('clicked'); <ide> }, <del> f_194: function () { <add> f_214: function () { <ide> this.plus_pdl1w0$('Link 2'); <ide> }, <del> f_195: function () { <add> f_215: function () { <ide> Kotlin.println('clicked'); <ide> }, <del> f_196: function () { <add> f_216: function () { <ide> this.plus_pdl1w0$('Link 3'); <ide> }, <del> f_197: function () { <del> this.item('#bootstrapComponents', _.bootstrap.f_191, _.bootstrap.f_192); <del> this.item('#bootstrapComponents', _.bootstrap.f_193, _.bootstrap.f_194); <add> f_217: function () { <add> this.item('#bootstrapComponents', _.bootstrap.f_211, _.bootstrap.f_212); <add> this.item('#bootstrapComponents', _.bootstrap.f_213, _.bootstrap.f_214); <ide> this.divider(); <del> this.item('#bootstrapComponents', _.bootstrap.f_195, _.bootstrap.f_196); <del> }, <del> f_198: function () { <del> }, <del> f_199: function () { <del> _.net.yested.bootstrap.textInput_rha0js$(this, 'username', _.bootstrap.f_198); <del> }, <del> f_200: function () { <add> this.item('#bootstrapComponents', _.bootstrap.f_215, _.bootstrap.f_216); <add> }, <add> f_218: function () { <add> }, <add> f_219: function () { <add> _.net.yested.bootstrap.textInput_ra92pu$(this, 'username', _.bootstrap.f_218); <add> }, <add> f_220: function () { <ide> this.plus_pdl1w0$('Login'); <ide> }, <del> f_201: function () { <del> }, <del> f_202: function () { <add> f_221: function () { <add> }, <add> f_222: function () { <ide> this.rangeTo_94jgcu$('class', 'navbar-form'); <del> this.div_5rsex9$(void 0, 'form-group', _.bootstrap.f_199); <del> _.net.yested.bootstrap.btsButton_j2rvkn$(this, _.net.yested.ButtonType.object.SUBMIT, _.bootstrap.f_200, void 0, void 0, void 0, _.bootstrap.f_201); <del> }, <del> f_203: function () { <del> this.form_mfnzi$(_.bootstrap.f_202); <del> }, <del> f_204: function () { <add> this.div_5rsex9$(void 0, 'form-group', _.bootstrap.f_219); <add> _.net.yested.bootstrap.btsButton_adnmfr$(this, _.net.yested.ButtonType.object.SUBMIT, _.bootstrap.f_220, void 0, void 0, void 0, _.bootstrap.f_221); <add> }, <add> f_223: function () { <add> this.form_kv1miw$(_.bootstrap.f_222); <add> }, <add> f_224: function () { <ide> this.plus_pdl1w0$('On the right1'); <ide> }, <del> f_205: function () { <del> this.span_dkuwo$('navbar-text', _.bootstrap.f_204); <del> }, <del> f_206: function () { <del> this.brand_hgkgkc$('#bootstrapComponents', _.bootstrap.f_186); <del> this.item_b1t645$('#bootstrapComponents', void 0, _.bootstrap.f_187); <del> this.item_b1t645$('#bootstrapComponents', _.bootstrap.f_188, _.bootstrap.f_189); <del> this.dropdown_vvlqvy$(_.bootstrap.f_190, _.bootstrap.f_197); <del> this.left_oe5uhj$(_.bootstrap.f_203); <del> this.right_oe5uhj$(_.bootstrap.f_205); <del> }, <del> f_207: function () { <del> this.h4_mfnzi$(_.bootstrap.f_185); <del> _.net.yested.bootstrap.navbar_58rg2v$(this, 'navbarDemo', void 0, _.net.yested.bootstrap.NavbarLook.object.INVERSE, _.bootstrap.f_206); <del> }, <del> f_208: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_207); <del> }, <del> f_209: function () { <add> f_225: function () { <add> this.span_dkuwo$('navbar-text', _.bootstrap.f_224); <add> }, <add> f_226: function () { <add> this.brand_s8xvdm$('#bootstrapComponents', _.bootstrap.f_206); <add> this.item_b1t645$('#bootstrapComponents', void 0, _.bootstrap.f_207); <add> this.item_b1t645$('#bootstrapComponents', _.bootstrap.f_208, _.bootstrap.f_209); <add> this.dropdown_vvlqvy$(_.bootstrap.f_210, _.bootstrap.f_217); <add> this.left_oe5uhj$(_.bootstrap.f_223); <add> this.right_oe5uhj$(_.bootstrap.f_225); <add> }, <add> f_227: function () { <add> this.h4_kv1miw$(_.bootstrap.f_205); <add> _.net.yested.bootstrap.navbar_x6lhct$(this, 'navbarDemo', void 0, _.net.yested.bootstrap.NavbarLook.object.INVERSE, _.bootstrap.f_226); <add> }, <add> f_228: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_227); <add> }, <add> f_229: function () { <ide> this.plus_pdl1w0$('Code'); <ide> }, <del> f_210: function () { <del> this.h4_mfnzi$(_.bootstrap.f_209); <add> f_230: function () { <add> this.h4_kv1miw$(_.bootstrap.f_229); <ide> this.code_puj7f4$('kotlin', 'navbar(id = "navbarDemo", look = NavbarLook.INVERSE) {\n brand(href = "#bootstrapComponents") {glyphicon(icon = "home"); nbsp(); +" Home" }\n item(href = "#bootstrapComponents") { +"Some Link 1" }\n item(href = "#bootstrapComponents", onclick = { println("clicked")}) { +"Some Link 2" }\n dropdown(label = { +"Dropdown"}) {\n item(href = "#bootstrapComponents", onclick = { println("clicked")}) { +"Link 1" }\n item(href = "#bootstrapComponents", onclick = { println("clicked")}) { +"Link 2" }\n divider()\n item(href = "#bootstrapComponents", onclick = { println("clicked")}) { +"Link 3" }\n }\n left {\n form { "class".."navbar-form"\n div(clazz = "form-group") {\n textInput(placeholder = "username") {}\n }\n btsButton(type = ButtonType.SUBMIT, label = { +"Login"}) {}\n }\n }\n right {\n span(clazz = "navbar-text") {\n +"On the right1"\n }\n }\n}'); <ide> }, <del> f_211: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_210); <add> f_231: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_230); <ide> }, <ide> createNavbarSection$f: function (id) { <ide> return function () { <ide> this.id = id; <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_151); <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_184); <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_208); <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_211); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_171); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_204); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_228); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_231); <ide> }; <ide> }, <ide> createNavbarSection: function (id) { <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createNavbarSection$f(id)); <ide> }, <del> f_212: function () { <add> f_232: function () { <ide> this.plus_pdl1w0$('Pagination'); <ide> }, <del> f_213: function () { <del> this.h3_mfnzi$(_.bootstrap.f_212); <del> }, <del> f_214: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_213); <del> }, <del> f_215: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_214); <del> }, <del> f_216: function () { <add> f_233: function () { <add> this.h3_kv1miw$(_.bootstrap.f_232); <add> }, <add> f_234: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_233); <add> }, <add> f_235: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_234); <add> }, <add> f_236: function () { <ide> this.plus_pdl1w0$('\nPagination from Bootstrap.\n'); <ide> }, <del> f_217: function () { <add> f_237: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> }, <del> f_218: function (result) { <add> f_238: function (result) { <ide> return function (it) { <del> result.replace_61zpoe$('Selected: ' + it); <del> }; <del> }, <del> f_219: function (result) { <del> return function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_216); <add> result.setContent_61zpoe$('Selected: ' + it); <add> }; <add> }, <add> f_239: function (result) { <add> return function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_236); <ide> this.br(); <del> this.h4_mfnzi$(_.bootstrap.f_217); <del> _.net.yested.bootstrap.pagination_kr3wm4$(this, 6, 2, _.bootstrap.f_218(result)); <add> this.h4_kv1miw$(_.bootstrap.f_237); <add> _.net.yested.bootstrap.pagination_vs56l6$(this, 6, 2, _.bootstrap.f_238(result)); <ide> this.plus_pv6laa$(result); <ide> }; <ide> }, <del> f_220: function () { <add> f_240: function () { <ide> this.plus_pdl1w0$('Code'); <ide> }, <del> f_221: function () { <del> this.h4_mfnzi$(_.bootstrap.f_220); <add> f_241: function () { <add> this.h4_kv1miw$(_.bootstrap.f_240); <ide> this.code_puj7f4$('kotlin', 'val result = Span()\n...\ndiv {\n pagination(count = 6, defaultSelection = 2) { result.replace("Selected: $\\{it}")}\n +result\n}\n'); <ide> }, <del> f_222: function (result) { <del> return function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_219(result)); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_221); <add> f_242: function (result) { <add> return function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_239(result)); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_241); <ide> }; <ide> }, <ide> createPaginationSection$f: function (id, result) { <ide> return function () { <ide> this.id = id; <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_215); <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_222(result)); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_235); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_242(result)); <ide> }; <ide> }, <ide> createPaginationSection: function (id) { <ide> var result = new _.net.yested.Span(); <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createPaginationSection$f(id, result)); <ide> }, <del> f_223: function () { <add> f_243: function () { <ide> this.plus_pdl1w0$('Panels'); <ide> }, <del> f_224: function () { <del> this.h3_mfnzi$(_.bootstrap.f_223); <del> }, <del> f_225: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_224); <del> }, <del> f_226: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_225); <del> }, <del> f_227: function () { <add> f_244: function () { <add> this.h3_kv1miw$(_.bootstrap.f_243); <add> }, <add> f_245: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_244); <add> }, <add> f_246: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_245); <add> }, <add> f_247: function () { <ide> this.plus_pdl1w0$('\nPlease refer to Bootstrap Panels\n'); <ide> }, <del> f_228: function () { <add> f_248: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> }, <del> f_229: function () { <add> f_249: function () { <ide> this.plus_pdl1w0$('Panel Header'); <ide> }, <del> f_230: function () { <add> f_250: function () { <ide> this.plus_pdl1w0$('This site'); <ide> }, <del> f_231: function () { <del> this.a_b4th6h$(void 0, 'http://www.yested.net', void 0, _.bootstrap.f_230); <del> }, <del> f_232: function () { <add> f_251: function () { <add> this.a_b4th6h$(void 0, 'http://www.yested.net', void 0, _.bootstrap.f_250); <add> }, <add> f_252: function () { <ide> this.plus_pdl1w0$('Panel Footer'); <ide> }, <del> f_233: function () { <del> this.heading_mfnzi$(_.bootstrap.f_229); <del> this.content_mfnzi$(_.bootstrap.f_231); <del> this.footer_mfnzi$(_.bootstrap.f_232); <del> }, <del> f_234: function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_227); <add> f_253: function () { <add> this.heading_kv1miw$(_.bootstrap.f_249); <add> this.content_kv1miw$(_.bootstrap.f_251); <add> this.footer_kv1miw$(_.bootstrap.f_252); <add> }, <add> f_254: function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_247); <ide> this.br(); <del> this.h4_mfnzi$(_.bootstrap.f_228); <del> _.net.yested.bootstrap.panel_azd227$(this, _.net.yested.bootstrap.PanelStyle.object.SUCCESS, _.bootstrap.f_233); <del> }, <del> f_235: function () { <add> this.h4_kv1miw$(_.bootstrap.f_248); <add> _.net.yested.bootstrap.panel_mkklid$(this, _.net.yested.bootstrap.PanelStyle.object.SUCCESS, _.bootstrap.f_253); <add> }, <add> f_255: function () { <ide> this.plus_pdl1w0$('Code'); <ide> }, <del> f_236: function () { <del> this.h4_mfnzi$(_.bootstrap.f_235); <add> f_256: function () { <add> this.h4_kv1miw$(_.bootstrap.f_255); <ide> this.code_puj7f4$('kotlin', 'panel {\n heading { +"Panel Header" }\n content {\n a(href="http://www.yested.net") { + "This site"}\n }\n footer { +"Panel Footer" }\n}'); <ide> }, <del> f_237: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_234); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_236); <add> f_257: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_254); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_256); <ide> }, <ide> createPanelSection$f: function (id) { <ide> return function () { <ide> this.id = id; <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_226); <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_237); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_246); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_257); <ide> }; <ide> }, <ide> createPanelSection: function (id) { <ide> }, <ide> createSelectSection$f_0: function (resultSingleSelect, singleSelect) { <ide> return function () { <del> resultSingleSelect.replace_61zpoe$('Selected: ' + Kotlin.modules['stdlib'].kotlin.first_fvq2g0$(singleSelect.selectedItems).model); <add> resultSingleSelect.setContent_61zpoe$('Selected: ' + Kotlin.modules['stdlib'].kotlin.first_fvq2g0$(singleSelect.selectedItems).model); <ide> }; <ide> }, <ide> createSelectSection$f_1: function (it) { <ide> return it.model + ' (' + it.color + ')'; <ide> }, <del> f_238: function (it) { <add> f_258: function (it) { <ide> return it.model; <ide> }, <ide> createSelectSection$f_2: function (resultMultiSelect, multiSelect) { <ide> return function () { <ide> var tmp$0; <del> tmp$0 = Kotlin.modules['stdlib'].kotlin.map_m3yiqg$(multiSelect.selectedItems, _.bootstrap.f_238); <del> resultMultiSelect.replace_61zpoe$('Selected: ' + Kotlin.modules['stdlib'].kotlin.join_raq5lb$(tmp$0, ' and ')); <add> tmp$0 = Kotlin.modules['stdlib'].kotlin.map_m3yiqg$(multiSelect.selectedItems, _.bootstrap.f_258); <add> resultMultiSelect.setContent_61zpoe$('Selected: ' + Kotlin.modules['stdlib'].kotlin.join_raq5lb$(tmp$0, ' and ')); <ide> }; <ide> }, <ide> createSelectSection$f_3: function () { <ide> this.plus_pdl1w0$('Select Skoda and Ford'); <ide> }, <del> f_239: function (it) { <add> f_259: function (it) { <ide> return Kotlin.equals(it.model, 'Skoda') || Kotlin.equals(it.model, 'Ford'); <ide> }, <ide> createSelectSection$f_4: function (someData, multiSelect) { <ide> return function () { <ide> var tmp$0, tmp$1; <ide> tmp$1 = multiSelect; <del> tmp$0 = Kotlin.modules['stdlib'].kotlin.filter_azvtw4$(someData, _.bootstrap.f_239); <add> tmp$0 = Kotlin.modules['stdlib'].kotlin.filter_azvtw4$(someData, _.bootstrap.f_259); <ide> tmp$1.selectedItems = tmp$0; <ide> }; <ide> }, <del> f_240: function () { <add> f_260: function () { <ide> this.plus_pdl1w0$('Select'); <ide> }, <del> f_241: function () { <del> this.h3_mfnzi$(_.bootstrap.f_240); <del> }, <del> f_242: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_241); <del> }, <del> f_243: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_242); <del> }, <del> f_244: function () { <add> f_261: function () { <add> this.h3_kv1miw$(_.bootstrap.f_260); <add> }, <add> f_262: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_261); <add> }, <add> f_263: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_262); <add> }, <add> f_264: function () { <ide> this.plus_pdl1w0$('HTML Select demo with listener.'); <ide> }, <del> f_245: function () { <add> f_265: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> }, <del> f_246: function (singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn) { <del> return function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_244); <add> f_266: function (singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn) { <add> return function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_264); <ide> this.br(); <del> this.h4_mfnzi$(_.bootstrap.f_245); <add> this.h4_kv1miw$(_.bootstrap.f_265); <ide> this.plus_pv6laa$(singleSelect); <ide> this.plus_pv6laa$(resultSingleSelect); <ide> this.br(); <ide> this.plus_pv6laa$(btn); <ide> }; <ide> }, <del> f_247: function () { <add> f_267: function () { <ide> this.plus_pdl1w0$('Code'); <ide> }, <del> f_248: function () { <del> this.h4_mfnzi$(_.bootstrap.f_247); <add> f_268: function () { <add> this.h4_kv1miw$(_.bootstrap.f_267); <ide> this.code_puj7f4$('kotlin', 'val someData = listOf(\n Car("Ford", "Black"),\n Car("Skoda", "White"),\n Car("Renault", "Red"),\n Car("Citroen", "Purple"))\n\nval resultSingleSelect = Div()\nval singleSelect = Select<Car>(renderer = { "$\\{it.model} ($\\{it.color})" })\nsingleSelect.data = someData\nsingleSelect.addOnChangeListener {\n resultSingleSelect.replace( "Selected: $\\{singleSelect.selectedItems.first().model}")\n}\n\nval resultMultiSelect = Div()\nval multiSelect = Select<Car>(multiple = true, size = 4, renderer = { "$\\{it.model} ($\\{it.color})" })\nmultiSelect.data = someData\nmultiSelect.addOnChangeListener {\n resultMultiSelect.replace( "Selected: " + multiSelect.selectedItems.map { "$\\{it.model}" }.join(" and "))\n}\n\nval btn = BtsButton(label = { +"Select Skoda and Ford" }) {\n multiSelect.selectedItems = someData.filter { it.model == "Skoda" || it.model == "Ford"}\n}\n\n...\ndiv {\n + singleSelect\n + resultSingleSelect\n br()\n br()\n + multiSelect\n + resultMultiSelect\n br()\n + btn\n}'); <ide> }, <del> f_249: function (singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn) { <del> return function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_246(singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn)); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_248); <add> f_269: function (singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn) { <add> return function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_266(singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn)); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_268); <ide> }; <ide> }, <ide> createSelectSection$f_5: function (id, singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn) { <ide> return function () { <ide> this.id = id; <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_243); <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_249(singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn)); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_263); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_269(singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn)); <ide> }; <ide> }, <ide> createSelectSection: function (id) { <ide> var btn = new _.net.yested.bootstrap.BtsButton(void 0, _.bootstrap.createSelectSection$f_3, void 0, void 0, void 0, _.bootstrap.createSelectSection$f_4(someData, multiSelect)); <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createSelectSection$f_5(id, singleSelect, resultSingleSelect, multiSelect, resultMultiSelect, btn)); <ide> }, <del> f_250: function () { <add> f_270: function () { <ide> this.plus_pdl1w0$('Tabs'); <ide> }, <del> f_251: function () { <del> this.h3_mfnzi$(_.bootstrap.f_250); <del> }, <del> f_252: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_251); <del> }, <del> f_253: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_252); <del> }, <del> f_254: function () { <add> f_271: function () { <add> this.h3_kv1miw$(_.bootstrap.f_270); <add> }, <add> f_272: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_271); <add> }, <add> f_273: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_272); <add> }, <add> f_274: function () { <ide> this.plus_pdl1w0$('\nTabs are based on Bootstrap Tabs.\nContent of tab is rendedered upon click on a tab link. When clicking on anoother link, content is preserved.\n'); <ide> }, <del> f_255: function () { <add> f_275: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> }, <del> f_256: function () { <del> }, <del> f_257: function () { <del> _.net.yested.bootstrap.textInput_rha0js$(this, 'Placeholder 1', _.bootstrap.f_256); <del> }, <del> f_258: function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_257); <del> }, <del> f_259: function () { <add> f_276: function () { <add> }, <add> f_277: function () { <add> _.net.yested.bootstrap.textInput_ra92pu$(this, 'Placeholder 1', _.bootstrap.f_276); <add> }, <add> f_278: function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_277); <add> }, <add> f_279: function () { <ide> this.plus_pdl1w0$('This tab is selected by default.'); <ide> }, <del> f_260: function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_259); <del> }, <del> f_261: function () { <add> f_280: function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_279); <add> }, <add> f_281: function () { <ide> this.plus_pdl1w0$('Wikipedia'); <ide> }, <del> f_262: function () { <del> this.a_b4th6h$(void 0, 'http://www.wikipedia.org', void 0, _.bootstrap.f_261); <del> }, <del> f_263: function () { <del> this.tab_jcws7d$(void 0, _.net.yested.text_61zpoe$('First'), void 0, _.bootstrap.f_258); <del> this.tab_jcws7d$(true, _.net.yested.text_61zpoe$('Second'), void 0, _.bootstrap.f_260); <del> this.tab_jcws7d$(void 0, _.net.yested.text_61zpoe$('Third'), void 0, _.bootstrap.f_262); <del> }, <del> f_264: function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_254); <add> f_282: function () { <add> this.a_b4th6h$(void 0, 'http://www.wikipedia.org', void 0, _.bootstrap.f_281); <add> }, <add> f_283: function () { <add> this.tab_l25lo7$(void 0, _.net.yested.text_61zpoe$('First'), void 0, _.bootstrap.f_278); <add> this.tab_l25lo7$(true, _.net.yested.text_61zpoe$('Second'), void 0, _.bootstrap.f_280); <add> this.tab_l25lo7$(void 0, _.net.yested.text_61zpoe$('Third'), void 0, _.bootstrap.f_282); <add> }, <add> f_284: function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_274); <ide> this.br(); <del> this.h4_mfnzi$(_.bootstrap.f_255); <del> _.net.yested.bootstrap.tabs_1nc3b1$(this, _.bootstrap.f_263); <del> }, <del> f_265: function () { <add> this.h4_kv1miw$(_.bootstrap.f_275); <add> _.net.yested.bootstrap.tabs_fe4fv1$(this, _.bootstrap.f_283); <add> }, <add> f_285: function () { <ide> this.plus_pdl1w0$('Code'); <ide> }, <del> f_266: function () { <del> this.h4_mfnzi$(_.bootstrap.f_265); <add> f_286: function () { <add> this.h4_kv1miw$(_.bootstrap.f_285); <ide> this.code_puj7f4$('kotlin', 'tabs {\n tab(header = text("First")) {\n div {\n textInput(placeholder = "Placeholder 1") { }\n }\n }\n tab(active = true, header = text("Second")) {\n div {\n +"This tab is selected by default."\n }\n }\n tab(header = text("Third")) {\n a(href = "http://www.wikipedia.org") { +"Wikipedia"}\n }\n}'); <ide> }, <del> f_267: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_264); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_266); <add> f_287: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_284); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_286); <ide> }, <ide> createTabs$f: function (id) { <ide> return function () { <ide> this.id = id; <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_253); <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_267); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_273); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_287); <ide> }; <ide> }, <ide> createTabs: function (id) { <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createTabs$f(id)); <ide> }, <del> f_268: function () { <add> f_288: function () { <ide> this.plus_pdl1w0$('Typography'); <ide> }, <del> f_269: function () { <del> this.h3_mfnzi$(_.bootstrap.f_268); <del> }, <del> f_270: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.bootstrap.f_269); <del> }, <del> f_271: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_270); <del> }, <del> f_272: function () { <add> f_289: function () { <add> this.h3_kv1miw$(_.bootstrap.f_288); <add> }, <add> f_290: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_289); <add> }, <add> f_291: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_290); <add> }, <add> f_292: function () { <ide> this.plus_pdl1w0$('\nSimple Typography support.\n'); <ide> }, <del> f_273: function () { <add> f_293: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> }, <del> f_274: function () { <add> f_294: function () { <ide> this.plus_pdl1w0$('Right Align'); <ide> }, <del> f_275: function () { <add> f_295: function () { <ide> this.plus_pdl1w0$('Left Align'); <ide> }, <del> f_276: function () { <add> f_296: function () { <ide> this.plus_pdl1w0$('Center'); <ide> }, <del> f_277: function () { <add> f_297: function () { <ide> this.plus_pdl1w0$('Justify'); <ide> }, <del> f_278: function () { <add> f_298: function () { <ide> this.plus_pdl1w0$('No wrap'); <ide> }, <del> f_279: function () { <add> f_299: function () { <ide> this.plus_pdl1w0$('all is upercase'); <ide> }, <del> f_280: function () { <del> _.net.yested.bootstrap.uppercase_sxtqq7$(this, _.bootstrap.f_279); <del> }, <del> f_281: function () { <add> f_300: function () { <add> _.net.yested.bootstrap.uppercase_71h449$(this, _.bootstrap.f_299); <add> }, <add> f_301: function () { <ide> this.plus_pdl1w0$('ALL IS lowerCase'); <ide> }, <del> f_282: function () { <del> _.net.yested.bootstrap.lowercase_sxtqq7$(this, _.bootstrap.f_281); <del> }, <del> f_283: function () { <add> f_302: function () { <add> _.net.yested.bootstrap.lowercase_71h449$(this, _.bootstrap.f_301); <add> }, <add> f_303: function () { <ide> this.plus_pdl1w0$('capitalized'); <ide> }, <del> f_284: function () { <del> _.net.yested.bootstrap.capitalize_sxtqq7$(this, _.bootstrap.f_283); <del> }, <del> f_285: function () { <del> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_272); <add> f_304: function () { <add> _.net.yested.bootstrap.capitalize_71h449$(this, _.bootstrap.f_303); <add> }, <add> f_305: function () { <add> this.div_5rsex9$(void 0, void 0, _.bootstrap.f_292); <ide> this.br(); <del> this.h4_mfnzi$(_.bootstrap.f_273); <del> _.net.yested.bootstrap.aligned_fsjrrw$(this, _.net.yested.bootstrap.TextAlign.object.RIGHT, _.bootstrap.f_274); <del> _.net.yested.bootstrap.aligned_fsjrrw$(this, _.net.yested.bootstrap.TextAlign.object.LEFT, _.bootstrap.f_275); <del> _.net.yested.bootstrap.aligned_fsjrrw$(this, _.net.yested.bootstrap.TextAlign.object.CENTER, _.bootstrap.f_276); <del> _.net.yested.bootstrap.aligned_fsjrrw$(this, _.net.yested.bootstrap.TextAlign.object.JUSTIFY, _.bootstrap.f_277); <del> _.net.yested.bootstrap.aligned_fsjrrw$(this, _.net.yested.bootstrap.TextAlign.object.NOWRAP, _.bootstrap.f_278); <del> this.p_omdg96$(_.bootstrap.f_280); <del> this.p_omdg96$(_.bootstrap.f_282); <del> this.p_omdg96$(_.bootstrap.f_284); <del> }, <del> f_286: function () { <add> this.h4_kv1miw$(_.bootstrap.f_293); <add> _.net.yested.bootstrap.aligned_xlk53m$(this, _.net.yested.bootstrap.TextAlign.object.RIGHT, _.bootstrap.f_294); <add> _.net.yested.bootstrap.aligned_xlk53m$(this, _.net.yested.bootstrap.TextAlign.object.LEFT, _.bootstrap.f_295); <add> _.net.yested.bootstrap.aligned_xlk53m$(this, _.net.yested.bootstrap.TextAlign.object.CENTER, _.bootstrap.f_296); <add> _.net.yested.bootstrap.aligned_xlk53m$(this, _.net.yested.bootstrap.TextAlign.object.JUSTIFY, _.bootstrap.f_297); <add> _.net.yested.bootstrap.aligned_xlk53m$(this, _.net.yested.bootstrap.TextAlign.object.NOWRAP, _.bootstrap.f_298); <add> this.p_omdg96$(_.bootstrap.f_300); <add> this.p_omdg96$(_.bootstrap.f_302); <add> this.p_omdg96$(_.bootstrap.f_304); <add> }, <add> f_306: function () { <ide> this.plus_pdl1w0$('Code'); <ide> }, <del> f_287: function () { <del> this.h4_mfnzi$(_.bootstrap.f_286); <add> f_307: function () { <add> this.h4_kv1miw$(_.bootstrap.f_306); <ide> this.code_puj7f4$('kotlin', 'aligned(TextAlign.RIGHT) { +"Right Align"}\naligned(TextAlign.LEFT) { +"Left Align"}\naligned(TextAlign.CENTER) { +"Center"}\naligned(TextAlign.JUSTIFY) { +"Justify"}\naligned(TextAlign.NOWRAP) { +"No wrap"}\np { uppercase { +"all is upercase" }}\np { lowercase { +"ALL IS lowerCase" }}\np { capitalize { +"capitalized" }}'); <ide> }, <del> f_288: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_285); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_287); <add> f_308: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.bootstrap.f_305); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_307); <ide> }, <ide> createTypographySection$f: function (id) { <ide> return function () { <ide> this.id = id; <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_271); <del> _.net.yested.bootstrap.row_siz32v$(this, _.bootstrap.f_288); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_291); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_308); <ide> }; <ide> }, <ide> createTypographySection: function (id) { <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.createTypographySection$f(id)); <add> }, <add> f_309: function () { <add> this.plus_pdl1w0$('Effects'); <add> }, <add> f_310: function () { <add> this.h3_kv1miw$(_.bootstrap.f_309); <add> }, <add> f_311: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.bootstrap.f_310); <add> this.plus_pdl1w0$('Effects are applied to components. They must implement the Effect interface:'); <add> this.code_puj7f4$('kotlin', 'public trait Effect {\n fun apply(component:Component)\n}'); <add> this.plus_pdl1w0$('Effects are based on JQuery effects.'); <add> this.br(); <add> this.plus_pdl1w0$('Some effects can applied bidirectionaly - to hide and to show an element for example.'); <add> this.br(); <add> this.plus_pdl1w0$('These effects must implement BiDirectionalEffect interface:'); <add> this.code_puj7f4$('kotlin', 'public trait BiDirectionEffect {\n fun applyIn(component:Component, callback:Function0<Unit>? = null)\n fun applyOut(component:Component, callback:Function0<Unit>? = null)\n}'); <add> }, <add> f_312: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.bootstrap.f_311); <add> }, <add> f_313: function () { <add> this.plus_pv6laa$(_.effects.createEffectsSection()); <add> this.plus_pv6laa$(_.effects.createBidirectionalEffectsSection()); <add> }, <add> f_314: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.bootstrap.f_313); <add> }, <add> f_315: function (this$) { <add> return function () { <add> _.net.yested.bootstrap.row_xnql8t$(this$, _.bootstrap.f_312); <add> _.net.yested.bootstrap.row_xnql8t$(this$, _.bootstrap.f_314); <add> }; <add> }, <add> effectsPage$f: function () { <add> _.net.yested.bootstrap.row_xnql8t$(this, _.bootstrap.f_315(this)); <add> }, <add> effectsPage: function () { <add> return _.net.yested.div_5rsex9$(void 0, void 0, _.bootstrap.effectsPage$f); <ide> } <ide> }), <ide> complex: Kotlin.definePackage(null, /** @lends _.complex */ { <ide> textInput.value = editedCity.name; <ide> select.selectedItems = Kotlin.modules['stdlib'].kotlin.listOf_9mqe4v$([editedCity.continent]); <ide> } <del> this.placeholder.fade_suy7ya$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Form('col-sm-4', 'col-sm-8'), _.complex.MasterDetail.edit$f_1(validator, textInput, select, save, close))); <add> this.placeholder.setChild_hu5ove$(_.net.yested.with_owvm91$(new _.net.yested.bootstrap.Form('col-sm-4', 'col-sm-8'), _.complex.MasterDetail.edit$f_1(validator, textInput, select, save, close)), new _.net.yested.Fade()); <ide> }, <ide> createMasterView: function () { <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.complex.MasterDetail.createMasterView$f(this)); <ide> }, <ide> createDiv: function () { <del> this.placeholder.fade_suy7ya$(this.createMasterView()); <add> this.placeholder.setChild_hu5ove$(this.createMasterView(), new _.net.yested.Fade()); <ide> this.grid.list = this.list; <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.complex.MasterDetail.createDiv$f(this)); <ide> } <ide> }, <ide> MasterDetail$f_6: function (this$MasterDetail) { <ide> return function (it) { <del> _.net.yested.bootstrap.btsButton_j2rvkn$(this, void 0, _.complex.MasterDetail.f, void 0, _.net.yested.bootstrap.ButtonSize.object.EXTRA_SMALL, void 0, _.complex.MasterDetail.f_0(it, this$MasterDetail)); <add> _.net.yested.bootstrap.btsButton_adnmfr$(this, void 0, _.complex.MasterDetail.f, void 0, _.net.yested.bootstrap.ButtonSize.object.EXTRA_SMALL, void 0, _.complex.MasterDetail.f_0(it, this$MasterDetail)); <ide> }; <ide> }, <ide> MasterDetail$f_7: function (it) { <ide> }, <ide> MasterDetail$f_9: function (this$MasterDetail) { <ide> return function (it) { <del> _.net.yested.bootstrap.btsButton_j2rvkn$(this, void 0, _.complex.MasterDetail.f_1, _.net.yested.bootstrap.ButtonLook.object.DANGER, _.net.yested.bootstrap.ButtonSize.object.EXTRA_SMALL, void 0, _.complex.MasterDetail.f_2(it, this$MasterDetail)); <add> _.net.yested.bootstrap.btsButton_adnmfr$(this, void 0, _.complex.MasterDetail.f_1, _.net.yested.bootstrap.ButtonLook.object.DANGER, _.net.yested.bootstrap.ButtonSize.object.EXTRA_SMALL, void 0, _.complex.MasterDetail.f_2(it, this$MasterDetail)); <ide> }; <ide> }, <ide> MasterDetail$f_10: function (it) { <ide> }, <ide> edit$close: function (this$MasterDetail) { <ide> return function () { <del> this$MasterDetail.placeholder.fade_suy7ya$(this$MasterDetail.createMasterView()); <add> this$MasterDetail.placeholder.setChild_hu5ove$(this$MasterDetail.createMasterView(), new _.net.yested.Fade()); <ide> }; <ide> }, <ide> edit$save: function (validator, editedCity, this$MasterDetail, textInput, select, close) { <ide> }, <ide> f_10: function (save, close) { <ide> return function () { <del> _.net.yested.bootstrap.btsButton_j2rvkn$(this, _.net.yested.ButtonType.object.SUBMIT, _.complex.MasterDetail.f_8, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, void 0, void 0, save); <del> _.net.yested.bootstrap.btsButton_j2rvkn$(this, void 0, _.complex.MasterDetail.f_9, void 0, void 0, void 0, close); <add> _.net.yested.bootstrap.btsButton_adnmfr$(this, _.net.yested.ButtonType.object.SUBMIT, _.complex.MasterDetail.f_8, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, void 0, void 0, save); <add> _.net.yested.bootstrap.btsButton_adnmfr$(this, void 0, _.complex.MasterDetail.f_9, void 0, void 0, void 0, close); <ide> }; <ide> }, <ide> f_11: function (save, close) { <ide> }, <ide> edit$f_1: function (validator, textInput, select, save, close) { <ide> return function () { <del> this.item_2xyzwi$(void 0, _.complex.MasterDetail.f_3, validator, _.complex.MasterDetail.f_4(textInput)); <del> this.item_2xyzwi$(void 0, _.complex.MasterDetail.f_5, void 0, _.complex.MasterDetail.f_6(select)); <del> this.item_2xyzwi$(void 0, _.complex.MasterDetail.f_7, void 0, _.complex.MasterDetail.f_11(save, close)); <add> this.item_gthhqa$(void 0, _.complex.MasterDetail.f_3, validator, _.complex.MasterDetail.f_4(textInput)); <add> this.item_gthhqa$(void 0, _.complex.MasterDetail.f_5, void 0, _.complex.MasterDetail.f_6(select)); <add> this.item_gthhqa$(void 0, _.complex.MasterDetail.f_7, void 0, _.complex.MasterDetail.f_11(save, close)); <ide> }; <ide> }, <ide> f_12: function () { <ide> createMasterView$f: function (this$MasterDetail) { <ide> return function () { <ide> this.plus_pv6laa$(this$MasterDetail.grid); <del> _.net.yested.bootstrap.btsButton_j2rvkn$(this, void 0, _.complex.MasterDetail.f_12, void 0, void 0, void 0, _.complex.MasterDetail.f_13(this$MasterDetail)); <add> _.net.yested.bootstrap.btsButton_adnmfr$(this, void 0, _.complex.MasterDetail.f_12, void 0, void 0, void 0, _.complex.MasterDetail.f_13(this$MasterDetail)); <ide> }; <ide> }, <ide> f_14: function () { <ide> this.plus_pdl1w0$('Master / Detail'); <ide> }, <ide> f_15: function () { <del> this.h3_mfnzi$(_.complex.MasterDetail.f_14); <add> this.h3_kv1miw$(_.complex.MasterDetail.f_14); <ide> }, <ide> f_16: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.complex.MasterDetail.f_15); <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.complex.MasterDetail.f_15); <ide> }, <ide> f_17: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.complex.MasterDetail.f_16); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.complex.MasterDetail.f_16); <ide> }, <ide> f_18: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> }, <ide> f_19: function (this$MasterDetail) { <ide> return function () { <del> this.h4_mfnzi$(_.complex.MasterDetail.f_18); <add> this.h4_kv1miw$(_.complex.MasterDetail.f_18); <ide> this.plus_pv6laa$(this$MasterDetail.placeholder); <ide> }; <ide> }, <ide> this.plus_pdl1w0$('Source code is deployed on GitHub'); <ide> }, <ide> f_22: function () { <del> this.h4_mfnzi$(_.complex.MasterDetail.f_20); <add> this.h4_kv1miw$(_.complex.MasterDetail.f_20); <ide> this.a_b4th6h$(void 0, 'https://github.com/jean79/yested/blob/master/src/main/docsite/complex/masterdetails.kt', void 0, _.complex.MasterDetail.f_21); <ide> }, <ide> f_23: function (this$MasterDetail) { <ide> return function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.complex.MasterDetail.f_19(this$MasterDetail)); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.complex.MasterDetail.f_22); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.complex.MasterDetail.f_19(this$MasterDetail)); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.complex.MasterDetail.f_22); <ide> }; <ide> }, <ide> createDiv$f: function (this$MasterDetail) { <ide> return function () { <del> _.net.yested.bootstrap.row_siz32v$(this, _.complex.MasterDetail.f_17); <del> _.net.yested.bootstrap.row_siz32v$(this, _.complex.MasterDetail.f_23(this$MasterDetail)); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.complex.MasterDetail.f_17); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.complex.MasterDetail.f_23(this$MasterDetail)); <ide> }; <ide> } <ide> }), <ide> this.plus_pdl1w0$('Spinner'); <ide> }, <ide> f_0: function () { <del> this.h3_mfnzi$(_.complex.f); <add> this.h3_kv1miw$(_.complex.f); <ide> }, <ide> f_1: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.complex.f_0); <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.complex.f_0); <ide> }, <ide> f_2: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.complex.f_1); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.complex.f_1); <ide> }, <ide> f_3: function () { <ide> this.plus_pdl1w0$('http://fgnass.github.io/spin.js/'); <ide> }, <ide> f_6: function () { <ide> this.style = 'height: 200px'; <del> _.net.yested.spin.spinner_oyolqv$(this, new _.net.yested.spin.SpinnerOptions(void 0, 7)); <add> _.net.yested.spin.spinner_4tyilv$(this, new _.net.yested.spin.SpinnerOptions(void 0, 7)); <ide> }, <ide> f_7: function () { <ide> this.div_5rsex9$(void 0, void 0, _.complex.f_4); <ide> this.br(); <del> this.h4_mfnzi$(_.complex.f_5); <add> this.h4_kv1miw$(_.complex.f_5); <ide> this.div_5rsex9$(void 0, void 0, _.complex.f_6); <ide> }, <ide> f_8: function () { <ide> this.plus_pdl1w0$('Code'); <ide> }, <ide> f_9: function () { <del> this.h4_mfnzi$(_.complex.f_8); <add> this.h4_kv1miw$(_.complex.f_8); <ide> this.code_puj7f4$('kotlin', 'div {\n style = "height: 200px"\n spinner(SpinnerOptions(length = 7))\n}'); <ide> }, <ide> f_10: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.complex.f_7); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.complex.f_9); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.complex.f_7); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.complex.f_9); <ide> }, <ide> createSpinner$f: function () { <del> _.net.yested.bootstrap.row_siz32v$(this, _.complex.f_2); <del> _.net.yested.bootstrap.row_siz32v$(this, _.complex.f_10); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.complex.f_2); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.complex.f_10); <ide> }, <ide> createSpinner: function () { <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.complex.createSpinner$f); <add> } <add> }), <add> effects: Kotlin.definePackage(null, /** @lends _.effects */ { <add> f: function (n) { <add> return function () { <add> this.plus_pdl1w0$('Sample component ' + n); <add> }; <add> }, <add> f_0: function (n) { <add> return function () { <add> this.plus_pdl1w0$('Sample Text of component ' + n); <add> }; <add> }, <add> createPanel$f: function (n) { <add> return function () { <add> this.heading_kv1miw$(_.effects.f(n)); <add> this.content_kv1miw$(_.effects.f_0(n)); <add> }; <add> }, <add> createPanel: function (n) { <add> return _.net.yested.with_owvm91$(new _.net.yested.bootstrap.Panel(), _.effects.createPanel$f(n)); <add> }, <add> createBidirectionalEffectsSection$selectEffect: function (effect) { <add> return function (effectCode) { <add> var tmp$0; <add> if (effectCode === 'fade') <add> tmp$0 = new _.net.yested.Fade(); <add> else if (effectCode === 'slide') <add> tmp$0 = new _.net.yested.Slide(); <add> else <add> throw new Kotlin.Exception('Unknown effect.'); <add> effect.v = tmp$0; <add> }; <add> }, <add> createBidirectionalEffectsSection$toogleContent: function (container, panels, index, effect) { <add> return function () { <add> container.setChild_hu5ove$(panels[index.v++ % panels.length], effect.v); <add> }; <add> }, <add> f_1: function () { <add> this.plus_pdl1w0$('BiDirectional Effects'); <add> }, <add> f_2: function () { <add> this.h3_kv1miw$(_.effects.f_1); <add> }, <add> f_3: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.effects.f_2); <add> }, <add> f_4: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.effects.f_3); <add> }, <add> f_5: function () { <add> this.plus_pdl1w0$('Demo'); <add> }, <add> f_6: function () { <add> this.plus_pdl1w0$('Toogle it'); <add> }, <add> f_7: function (toogleContent) { <add> return function () { <add> _.net.yested.bootstrap.btsButton_adnmfr$(this, void 0, _.effects.f_6, _.net.yested.bootstrap.ButtonLook.object.PRIMARY, void 0, void 0, toogleContent); <add> }; <add> }, <add> f_8: function () { <add> this.plus_pdl1w0$('Fade Effect'); <add> }, <add> f_9: function () { <add> this.plus_pdl1w0$('Slide Effect'); <add> }, <add> f_10: function () { <add> this.button_ubg574$('fade', void 0, _.effects.f_8); <add> this.button_ubg574$('slide', void 0, _.effects.f_9); <add> this.select_61zpoe$('fade'); <add> }, <add> f_11: function (selectEffect) { <add> return function () { <add> _.net.yested.bootstrap.buttonGroup_wnptsr$(this, void 0, selectEffect, _.effects.f_10); <add> }; <add> }, <add> f_12: function (selectEffect) { <add> return function () { <add> _.net.yested.bootstrap.aligned_xlk53m$(this, _.net.yested.bootstrap.TextAlign.object.RIGHT, _.effects.f_11(selectEffect)); <add> }; <add> }, <add> f_13: function (toogleContent, selectEffect) { <add> return function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.ExtraSmall(4)], _.effects.f_7(toogleContent)); <add> this.col_zcukl0$([new _.net.yested.bootstrap.ExtraSmall(8)], _.effects.f_12(selectEffect)); <add> }; <add> }, <add> f_14: function (toogleContent, selectEffect, container) { <add> return function () { <add> this.plus_pdl1w0$('BiDirectonalEffects can be used to swap content of parent component like Div or Span'); <add> this.code_puj7f4$('kotlin', 'divOrSpan.setChild(anotherComponent, Fade())'); <add> this.h4_kv1miw$(_.effects.f_5); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.effects.f_13(toogleContent, selectEffect)); <add> this.plus_pv6laa$(container); <add> }; <add> }, <add> f_15: function () { <add> this.plus_pdl1w0$('Source code'); <add> }, <add> f_16: function () { <add> this.h4_kv1miw$(_.effects.f_15); <add> this.code_puj7f4$('kotlin', 'var index = 0\nval panels = array(createPanel(0), createPanel(1))\nval container = Div()\nvar effect: BiDirectionEffect = Fade()\n\nfun selectEffect(effectCode:String) {\n effect =\n when(effectCode) {\n "fade" -> Fade()\n "slide" -> Slide()\n else -> throw Exception("Unknown effect.")\n }\n}\n\nfun toogleContent() =\n container.setChild(panels.get(index++ % panels.size()), effect)\n\ntoogleContent()\n\n...\n\nrow {\n col(ExtraSmall(4)) {\n btsButton(look = ButtonLook.PRIMARY, label = { +"Toogle it" }, onclick = ::toogleContent)\n }\n col(ExtraSmall(8)) {\n aligned(align = TextAlign.RIGHT) {\n buttonGroup(onSelect = ::selectEffect) {\n button(value = "fade") { +"Fade Effect" }\n button(value = "slide") { +"Slide Effect" }\n select("fade")\n }\n }\n }\n}\n+container'); <add> }, <add> f_17: function (toogleContent, selectEffect, container) { <add> return function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.effects.f_14(toogleContent, selectEffect, container)); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.effects.f_16); <add> }; <add> }, <add> createBidirectionalEffectsSection$f: function (toogleContent, selectEffect, container) { <add> return function () { <add> _.net.yested.bootstrap.row_xnql8t$(this, _.effects.f_4); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.effects.f_17(toogleContent, selectEffect, container)); <add> }; <add> }, <add> createBidirectionalEffectsSection: function () { <add> var index = {v: 0}; <add> var panels = [_.effects.createPanel(0), _.effects.createPanel(1)]; <add> var container = new _.net.yested.Div(); <add> var effect = {v: new _.net.yested.Fade()}; <add> var selectEffect = _.effects.createBidirectionalEffectsSection$selectEffect(effect); <add> var toogleContent = _.effects.createBidirectionalEffectsSection$toogleContent(container, panels, index, effect); <add> toogleContent(); <add> return _.net.yested.div_5rsex9$(void 0, void 0, _.effects.createBidirectionalEffectsSection$f(toogleContent, selectEffect, container)); <add> }, <add> f_18: function () { <add> this.plus_pdl1w0$('Sample component'); <add> }, <add> f_19: function () { <add> this.plus_pdl1w0$('Some bolded text'); <add> }, <add> f_20: function () { <add> this.plus_pdl1w0$('Some link'); <add> }, <add> f_21: function () { <add> this.plus_pdl1w0$('Sample Text'); <add> this.br(); <add> this.emph_kv1miw$(_.effects.f_19); <add> this.br(); <add> this.a_b4th6h$(void 0, void 0, void 0, _.effects.f_20); <add> }, <add> createEffectsSection$f: function () { <add> this.heading_kv1miw$(_.effects.f_18); <add> this.content_kv1miw$(_.effects.f_21); <add> }, <add> f_22: function () { <add> this.plus_pdl1w0$('Slide Up/Down'); <add> }, <add> f_23: function () { <add> this.h3_kv1miw$(_.effects.f_22); <add> }, <add> f_24: function () { <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.effects.f_23); <add> }, <add> f_25: function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.effects.f_24); <add> }, <add> f_26: function () { <add> this.plus_pdl1w0$('Demo'); <add> }, <add> f_27: function () { <add> this.plus_pdl1w0$('Toogle it'); <add> }, <add> f_28: function (visible, target) { <add> return function () { <add> if (visible.v) { <add> (new _.net.yested.SlideUp()).apply_suy7ya$(target); <add> } <add> else { <add> (new _.net.yested.SlideDown()).apply_suy7ya$(target); <add> } <add> visible.v = !visible.v; <add> }; <add> }, <add> f_29: function (visible, target) { <add> return function () { <add> this.plus_pdl1w0$('Effects are applied directly on components:'); <add> this.code_puj7f4$('kotlin', 'SlideUp().apply(component)'); <add> this.h4_kv1miw$(_.effects.f_26); <add> _.net.yested.bootstrap.btsButton_adnmfr$(this, void 0, _.effects.f_27, void 0, void 0, void 0, _.effects.f_28(visible, target)); <add> this.br(); <add> this.br(); <add> this.plus_pv6laa$(target); <add> }; <add> }, <add> f_30: function () { <add> this.plus_pdl1w0$('Source code'); <add> }, <add> f_31: function () { <add> this.h4_kv1miw$(_.effects.f_30); <add> this.code_puj7f4$('kotlin', 'var visible: Boolean = true\n\nval target = Panel() with {\n heading { +"Sample component" }\n content {\n +"Sample Text"\n br()\n emph { +"Some bolded text" }\n br()\n br()\n a() { +"Some text" }\n }\n}\n\n...\n\ndiv {\n btsButton(label = { +"Toogle it" }) {\n if (visible) {\n SlideUp().apply(target)\n } else {\n SlideDown().apply(target)\n }\n visible = !visible\n }\n br()\n +target\n}'); <add> }, <add> f_32: function (visible, target) { <add> return function () { <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.effects.f_29(visible, target)); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.effects.f_31); <add> }; <add> }, <add> createEffectsSection$f_0: function (visible, target) { <add> return function () { <add> _.net.yested.bootstrap.row_xnql8t$(this, _.effects.f_25); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.effects.f_32(visible, target)); <add> }; <add> }, <add> createEffectsSection: function () { <add> var visible = {v: true}; <add> var target = _.net.yested.with_owvm91$(new _.net.yested.bootstrap.Panel(), _.effects.createEffectsSection$f); <add> return _.net.yested.div_5rsex9$(void 0, void 0, _.effects.createEffectsSection$f_0(visible, target)); <ide> } <ide> }), <ide> gettingstarted: Kotlin.definePackage(null, /** @lends _.gettingstarted */ { <ide> this.plus_pdl1w0$('Getting Started'); <ide> }, <ide> f_0: function () { <del> this.h3_mfnzi$(_.gettingstarted.f); <add> this.h3_kv1miw$(_.gettingstarted.f); <ide> }, <ide> f_1: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.gettingstarted.f_0); <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.gettingstarted.f_0); <ide> }, <ide> f_2: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_1); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_1); <ide> }, <ide> f_3: function () { <ide> this.plus_pdl1w0$('1. Get Intellij Idea'); <ide> this.a_b4th6h$(void 0, 'https://www.jetbrains.com/idea/', void 0, _.gettingstarted.f_4); <ide> }, <ide> f_6: function () { <del> this.h4_mfnzi$(_.gettingstarted.f_3); <add> this.h4_kv1miw$(_.gettingstarted.f_3); <ide> this.p_omdg96$(_.gettingstarted.f_5); <ide> }, <ide> f_7: function () { <ide> this.div_5rsex9$(void 0, void 0, _.gettingstarted.f_6); <ide> }, <ide> f_8: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.gettingstarted.f_7); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.gettingstarted.f_7); <ide> }, <ide> f_9: function () { <ide> this.plus_pdl1w0$('2. Enable Kotlin Plugin'); <ide> this.img_puj7f4$('demo-site/img/plugin_install.png'); <ide> }, <ide> f_11: function () { <del> this.h4_mfnzi$(_.gettingstarted.f_9); <add> this.h4_kv1miw$(_.gettingstarted.f_9); <ide> this.p_omdg96$(_.gettingstarted.f_10); <ide> }, <ide> f_12: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_11); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_11); <ide> }, <ide> f_13: function () { <ide> this.plus_pdl1w0$('3. Create Kotlin - Javascript project'); <ide> this.plus_pdl1w0$("Call it 'YestedSample'"); <ide> }, <ide> f_15: function () { <del> this.h4_mfnzi$(_.gettingstarted.f_13); <add> this.h4_kv1miw$(_.gettingstarted.f_13); <ide> this.p_omdg96$(_.gettingstarted.f_14); <ide> this.img_puj7f4$('demo-site/img/create_project.png'); <ide> }, <ide> f_16: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_15); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_15); <ide> }, <ide> f_17: function () { <ide> this.plus_pdl1w0$('4. Create Kotlin Javascript Library'); <ide> }, <ide> f_18: function () { <del> this.h4_mfnzi$(_.gettingstarted.f_17); <add> this.h4_kv1miw$(_.gettingstarted.f_17); <ide> this.img_puj7f4$('demo-site/img/create_project_create_lib.png'); <ide> }, <ide> f_19: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_18); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_18); <ide> }, <ide> f_20: function () { <ide> this.plus_pdl1w0$('Copy to: lib'); <ide> }, <ide> f_21: function () { <ide> this.plus_pdl1w0$('Select:'); <del> this.emph_mfnzi$(_.gettingstarted.f_20); <add> this.emph_kv1miw$(_.gettingstarted.f_20); <ide> }, <ide> f_22: function () { <ide> this.p_omdg96$(_.gettingstarted.f_21); <ide> this.img_puj7f4$('demo-site/img/create_library.png'); <ide> }, <ide> f_23: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_22); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_22); <ide> }, <ide> f_24: function () { <ide> this.plus_pdl1w0$('4. Add Yested Library dependency'); <ide> }, <ide> f_25: function () { <del> this.h4_mfnzi$(_.gettingstarted.f_24); <add> this.h4_kv1miw$(_.gettingstarted.f_24); <ide> this.img_puj7f4$('demo-site/img/add_library_dependency.png'); <ide> }, <ide> f_26: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_25); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_25); <ide> }, <ide> f_27: function () { <ide> this.plus_pdl1w0$('5. Create index.html file'); <ide> }, <ide> f_28: function () { <del> this.h4_mfnzi$(_.gettingstarted.f_27); <add> this.h4_kv1miw$(_.gettingstarted.f_27); <ide> this.plus_pdl1w0$("Create HTML wrapper for our Yested application. It is a simple HTML that contains placeholder div with id 'page',"); <ide> this.plus_pdl1w0$('Place index.html in the root of your project.'); <ide> this.plus_pdl1w0$('It mainly references Boostrap and JQuery libraries. If you are not going to use Boostrap, you can have empty index.html with just placeholder div.'); <ide> this.code_puj7f4$('html', '<!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <meta http-equiv="X-UA-Compatible" content="IE=edge">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <title>Yested Sample<\/title>\n\n <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">\n <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">\n\n <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn\'t work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"><\/script>\n <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"><\/script>\n <![endif]-->\n\n <\/head>\n\n <body role="document">\n\n <div id="page"><\/div>\n\n <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"><\/script>\n <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"><\/script>\n\n <script src="out/production/YestedSample/lib/kotlin.js"><\/script>\n <script src="out/production/YestedSample/lib/Yested.js"><\/script>\n <script src="out/production/YestedSample/YestedSample.js"><\/script>\n\n <\/body>\n <\/html>\n '); <ide> }, <ide> f_29: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_28); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_28); <ide> }, <ide> f_30: function () { <ide> this.plus_pdl1w0$('6. Create basic Yested application'); <ide> }, <ide> f_31: function () { <del> this.h4_mfnzi$(_.gettingstarted.f_30); <add> this.h4_kv1miw$(_.gettingstarted.f_30); <ide> }, <ide> f_32: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_31); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_31); <ide> }, <ide> f_33: function () { <ide> this.plus_pdl1w0$('Create file sample.kt in src/main/kotlin and insert content on the right.<br />\n Kotlin Javascript calls this main function when page is loaded.\n '); <ide> this.code_puj7f4$('kotlin', 'import net.yested.bootstrap.page\n\nfun main(args: Array<String>) {\n page("page") {\n content {\n +"Hello World"\n br()\n a(href = "http://www.yested.net") { +"link to yested.net"}\n ol {\n li { +"First item" }\n li { +"Second item" }\n }\n }\n }\n}\n'); <ide> }, <ide> f_35: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.gettingstarted.f_33); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(6)], _.gettingstarted.f_34); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.gettingstarted.f_33); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(6)], _.gettingstarted.f_34); <ide> }, <ide> f_36: function () { <ide> this.plus_pdl1w0$('7. Build Project'); <ide> this.plus_pdl1w0$('We reference these files in our index.html file.'); <ide> }, <ide> f_38: function () { <del> this.h4_mfnzi$(_.gettingstarted.f_36); <add> this.h4_kv1miw$(_.gettingstarted.f_36); <ide> this.p_omdg96$(_.gettingstarted.f_37); <ide> }, <ide> f_39: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_38); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_38); <ide> }, <ide> f_40: function () { <ide> this.plus_pdl1w0$('8. Create build configuration'); <ide> this.img_puj7f4$('demo-site/img/build.png'); <ide> }, <ide> f_42: function () { <del> this.h4_mfnzi$(_.gettingstarted.f_40); <add> this.h4_kv1miw$(_.gettingstarted.f_40); <ide> this.p_omdg96$(_.gettingstarted.f_41); <ide> }, <ide> f_43: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_42); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_42); <ide> }, <ide> f_44: function () { <ide> this.plus_pdl1w0$('9. Run It!'); <ide> }, <ide> f_45: function () { <del> this.h4_mfnzi$(_.gettingstarted.f_44); <add> this.h4_kv1miw$(_.gettingstarted.f_44); <ide> }, <ide> f_46: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_45); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.gettingstarted.f_45); <ide> }, <ide> gettingStartedSection$f: function () { <del> _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_2); <del> _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_8); <del> _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_12); <del> _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_16); <del> _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_19); <del> _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_23); <del> _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_26); <del> _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_29); <del> _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_32); <del> _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_35); <del> _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_39); <del> _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_43); <del> _.net.yested.bootstrap.row_siz32v$(this, _.gettingstarted.f_46); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_2); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_8); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_12); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_16); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_19); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_23); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_26); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_29); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_32); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_35); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_39); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_43); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.gettingstarted.f_46); <ide> }, <ide> gettingStartedSection: function () { <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.gettingstarted.gettingStartedSection$f); <ide> this.plus_pdl1w0$('HTML'); <ide> }, <ide> f_0: function () { <del> this.h3_mfnzi$(_.html.f); <add> this.h3_kv1miw$(_.html.f); <ide> }, <ide> f_1: function () { <del> _.net.yested.bootstrap.pageHeader_91b1uj$(this, _.html.f_0); <add> _.net.yested.bootstrap.pageHeader_kzm4yj$(this, _.html.f_0); <ide> }, <ide> f_2: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(12)], _.html.f_1); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(12)], _.html.f_1); <ide> }, <ide> f_3: function () { <ide> this.plus_pdl1w0$('Yested provides basic DSL for construction of HTML page from HTML basic elements.<br /><br />\n This DSL can be easily enhanced with your custom or built-in Bootstrap components via Kotlin Extension methods.'); <ide> this.div_5rsex9$(void 0, void 0, _.html.f_3); <ide> }, <ide> f_5: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.html.f_4); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.html.f_4); <ide> }, <ide> f_6: function () { <ide> this.plus_pdl1w0$('Demo'); <ide> this.plus_pdl1w0$('Second column'); <ide> }, <ide> f_22: function () { <del> this.th_mfnzi$(_.html.f_20); <del> this.th_mfnzi$(_.html.f_21); <add> this.th_kv1miw$(_.html.f_20); <add> this.th_kv1miw$(_.html.f_21); <ide> }, <ide> f_23: function () { <ide> this.tr_l9w0g6$(_.html.f_22); <ide> this.plus_pdl1w0$('Cell 2'); <ide> }, <ide> f_26: function () { <del> this.td_mfnzi$(_.html.f_24); <del> this.td_mfnzi$(_.html.f_25); <add> this.td_kv1miw$(_.html.f_24); <add> this.td_kv1miw$(_.html.f_25); <ide> }, <ide> f_27: function () { <ide> this.plus_pdl1w0$('Cell 1'); <ide> this.plus_pdl1w0$('Cell 2'); <ide> }, <ide> f_29: function () { <del> this.td_mfnzi$(_.html.f_27); <del> this.td_mfnzi$(_.html.f_28); <add> this.td_kv1miw$(_.html.f_27); <add> this.td_kv1miw$(_.html.f_28); <ide> }, <ide> f_30: function () { <ide> this.tr_idqsqk$(_.html.f_26); <ide> }, <ide> f_54: function () { <ide> this.clazz = 'dl-horizontal'; <del> this.item_b459qs$(_.html.f_50, _.html.f_51); <del> this.item_b459qs$(_.html.f_52, _.html.f_53); <add> this.item_z5xo0k$(_.html.f_50, _.html.f_51); <add> this.item_z5xo0k$(_.html.f_52, _.html.f_53); <ide> }, <ide> f_55: function () { <ide> this.plus_pdl1w0$('cd'); <ide> this.br(); <ide> this.div_5rsex9$(void 0, void 0, _.html.f_9); <ide> this.p_omdg96$(_.html.f_10); <del> this.s_mfnzi$(_.html.f_11); <add> this.s_kv1miw$(_.html.f_11); <ide> this.nbsp_za3lpa$(); <del> this.del_mfnzi$(_.html.f_12); <add> this.del_kv1miw$(_.html.f_12); <ide> this.nbsp_za3lpa$(); <del> this.mark_mfnzi$(_.html.f_13); <add> this.mark_kv1miw$(_.html.f_13); <ide> this.nbsp_za3lpa$(); <del> this.ins_mfnzi$(_.html.f_14); <add> this.ins_kv1miw$(_.html.f_14); <ide> this.nbsp_za3lpa$(); <del> this.u_mfnzi$(_.html.f_15); <add> this.u_kv1miw$(_.html.f_15); <ide> this.nbsp_za3lpa$(); <del> this.small_mfnzi$(_.html.f_16); <add> this.small_kv1miw$(_.html.f_16); <ide> this.nbsp_za3lpa$(); <del> this.strong_mfnzi$(_.html.f_17); <add> this.strong_kv1miw$(_.html.f_17); <ide> this.nbsp_za3lpa$(); <del> this.em_mfnzi$(_.html.f_18); <add> this.em_kv1miw$(_.html.f_18); <ide> this.br(); <ide> this.br(); <del> this.blockquote_mfnzi$(_.html.f_19); <add> this.blockquote_kv1miw$(_.html.f_19); <ide> this.table_or8fdg$(_.html.f_31); <ide> this.img_puj7f4$('demo-site/img/sample_img.jpg', 'bla'); <del> this.emph_mfnzi$(_.html.f_32); <del> this.h1_mfnzi$(_.html.f_33); <del> this.h2_mfnzi$(_.html.f_34); <del> this.h3_mfnzi$(_.html.f_35); <del> this.h4_mfnzi$(_.html.f_36); <del> this.h5_mfnzi$(_.html.f_37); <del> this.button_mqmp2n$(_.html.f_38, _.net.yested.ButtonType.object.BUTTON, _.html.f_39); <add> this.emph_kv1miw$(_.html.f_32); <add> this.h1_kv1miw$(_.html.f_33); <add> this.h2_kv1miw$(_.html.f_34); <add> this.h3_kv1miw$(_.html.f_35); <add> this.h4_kv1miw$(_.html.f_36); <add> this.h5_kv1miw$(_.html.f_37); <add> this.button_fpm6mz$(_.html.f_38, _.net.yested.ButtonType.object.BUTTON, _.html.f_39); <ide> this.ul_8qfrsd$(_.html.f_44); <ide> this.ol_t3splz$(_.html.f_49); <ide> this.dl_79d1z0$(_.html.f_54); <del> this.kbd_mfnzi$(_.html.f_55); <add> this.kbd_kv1miw$(_.html.f_55); <ide> }, <ide> f_57: function () { <del> this.h4_mfnzi$(_.html.f_6); <add> this.h4_kv1miw$(_.html.f_6); <ide> this.div_5rsex9$(void 0, void 0, _.html.f_56); <ide> }, <ide> f_58: function () { <ide> this.plus_pdl1w0$('Code'); <ide> }, <ide> f_59: function () { <del> this.h4_mfnzi$(_.html.f_58); <add> this.h4_kv1miw$(_.html.f_58); <ide> this.code_puj7f4$('kotlin', '\na(href="http://www.yested.net") { +"Yested"}\nbr()\ndiv {\n span { +"Text in span which is in div"}\n}\np { +"Text in Paragraph" }\ns { +"Strikethrough text" }\nnbsp()\ndel { +"Deleted text" }\nnbsp()\nmark { +"Marked text" }\nnbsp()\nins { +"Inserted text" }\nnbsp()\nu { +"Underlined text" }\nnbsp()\nsmall { +"Small text" }\nnbsp()\nstrong { +"Strong text" }\nnbsp()\nem { +"Italicized text." }\nbr()\nbr()\nblockquote { +"blockquote" }\ntable { border = "1"\n thead {\n tr {\n th { +"First column" }\n th { +"Second column"}\n }\n }\n tbody {\n tr {\n td { +"Cell 1"}\n td { +"Cell 2"}\n }\n tr {\n td { +"Cell 1"}\n td { +"Cell 2"}\n }\n }\n}\nimg(src = "demo-site/img/sample_img.jpg", alt = "bla") {}\nemph { +"bold text" }\nh1 { +"H1" }\nh2 { +"H2" }\nh3 { +"H3" }\nh4 { +"H4" }\nh5 { +"H5" }\nbutton(label = { +"Press me"},\n type = ButtonType.BUTTON,\n onclick = { println("Check console!")})\nul {\n li { +"List item 1"}\n li { +"List item 2"}\n li { +"List item 3"}\n li { +"List item 4"}\n}\n\nol {\n li { +"List item 1" }\n li { +"List item 2" }\n li { +"List item 3" }\n li { +"List item 4" }\n}\n\ndl {\n clazz = "dl-horizontal"\n item(dt = { +"Term 1"}) { +"Definition"}\n item(dt = { +"Term 2"}) { +"Definition"}\n}\n\nkbd { +"cd" }\n\n'); <ide> }, <ide> f_60: function () { <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(4)], _.html.f_57); <del> this.col_6i15na$([new _.net.yested.bootstrap.Medium(8)], _.html.f_59); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(4)], _.html.f_57); <add> this.col_zcukl0$([new _.net.yested.bootstrap.Medium(8)], _.html.f_59); <ide> }, <ide> htmlSection$f: function () { <del> _.net.yested.bootstrap.row_siz32v$(this, _.html.f_2); <del> _.net.yested.bootstrap.row_siz32v$(this, _.html.f_5); <del> _.net.yested.bootstrap.row_siz32v$(this, _.html.f_60); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.html.f_2); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.html.f_5); <add> _.net.yested.bootstrap.row_xnql8t$(this, _.html.f_60); <ide> }, <ide> htmlSection: function () { <ide> return _.net.yested.div_5rsex9$(void 0, void 0, _.html.htmlSection$f);
JavaScript
apache-2.0
8765f2289038f93c6a918b80b204722a56616f8f
0
tyler-travis/openstorefront,Jedwondle/openstorefront,skycow/openstorefront,jbottel/openstorefront,jbottel/openstorefront,tyler-travis/openstorefront,Razaltan/openstorefront,skycow/openstorefront,tyler-travis/openstorefront,Jedwondle/openstorefront,Razaltan/openstorefront,skycow/openstorefront,Jedwondle/openstorefront,tyler-travis/openstorefront,skycow/openstorefront,Jedwondle/openstorefront,Jedwondle/openstorefront,jbottel/openstorefront,Razaltan/openstorefront,Razaltan/openstorefront,Razaltan/openstorefront,skycow/openstorefront,jbottel/openstorefront,tyler-travis/openstorefront
/* * Copyright 2014 Space Dynamics Laboratory - Utah State University Research Foundation. * * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Code here will be linted with JSHint. /* jshint ignore:start */ // Code here will be linted with ignored by JSHint. var MOCKDATA2 = {}; MOCKDATA2.componentList = [ { "componentId" : 67, "guid" : "3a57b4c2-a90b-4098-8c56-916618afd8ee", "name" : "Central Authentication Service (CAS)", "description" : "The Central Authentication Service (CAS) is a single sign-on protocol for the web. Its purpose is to permit a user to access multiple applications while providing their credentials (such as userid and password) only once. It also allows web applications to authenticate users without gaining access to a user's security credentials, such as a password. The name CAS also refers to a software package that implements this protocol. <br> <br>CAS provides enterprise single sign-on service: <br>-An open and well-documented protocol <br>-An open-source Java server component <br>-A library of clients for Java, .Net, PHP, Perl, Apache, uPortal, and others <br>-Integrates with uPortal, Sakai, BlueSocket, TikiWiki, Mule, Liferay, Moodle and others <br>-Community documentation and implementation support <br>-An extensive community of adopters", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NRO", "releaseDate" : null, "version" : null, "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "david.treat", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405698045000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Are samples included? (SAMPLE)", "username" : "Abby TEST", "userType" : "Project Manager", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "answeredDate" : 1399961730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1398845730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1399961730000 } ] } ], "attributes" : [ { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "1.2.1", "codeDescription" : "Identity and Access Management", "important" : true, "codeLongDescription": "<strong>Description:</strong> IdAM includes services that provide criteria used in access decisions and the rules and requirements assessing each request against those criteria. Resources may include applications, services, networks, and computing devices.<br/> <strong>Definition:</strong> Identity and Access Management (IdAM) defines the set of services that manage permissions required to access each resource.", }, { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "LICTYPE", "typeDescription" : "License Type", "code" : "OPENSRC", "codeDescription" : "Open Source", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/CAS.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='http://www.jasig.org/cas' title='http://www.jasig.org/cas' target='_blank'> http://www.jasig.org/cas</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='http://www.jasig.org/cas/download' title='http://www.jasig.org/cas/download' target='_blank'> http://www.jasig.org/cas/download</a>" } ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "Developer", "comment" : "This is a great product however, it's missing what I think are critical features. Hopefully, they are working on it for future updates.", "rating" : 4, "title" : "Great but missing features (SAMPLE)", "usedTimeCode" : "< 1 year", "lastUsed" : 1381644930000, "updateDate" : 1399961730000, "organization" : "NSA", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Difficult Installation" } ] }, { "username" : "Cathy TEST", "userType" : "Project Manager", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 5, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1381644930000, "updateDate" : 1391537730000, "organization" : "NSA", "recommend" : false, "pros" : [ { "text" : "Well Tested" } ], "cons" : [ { "text" : "Poorly Tested" }, { "text" : "Bulky" } ] } ], "dependencies" : [ ] }, { "componentId" : 9, "guid" : "75718e9b-f650-4600-b949-cdebc5c179ec", "name" : "CLAVIN", "description" : "CLAVIN (Cartographic Location And Vicinity Indexer) is an open source software package for document geotagging and geoparsing that employs context-based geographic entity resolution. It extracts location names from unstructured text and resolves them against a gazetteer to produce data-rich geographic entities. CLAVIN uses heuristics to identify exactly which \"Portland\" (for example) was intended by the author, based on the context of the document. CLAVIN also employs fuzzy search to handle incorrectly-spelled location names, and it recognizes alternative names (e.g., \"Ivory Coast\" and \"Cete d'Ivoire\") as referring to the same geographic entity.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1398578400000, "version" : "see site for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1400005248000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : 1388769330000, "endDate" : 1393694130000, "currentLevelCode" : "LEVEL1", "reviewedVersion" : "1.0", "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "P" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ { "name" : "Discoverable", "score" : 3 }, { "name" : "Accessible", "score" : 4 }, { "name" : "Documentation", "score" : 3 }, { "name" : "Deployable", "score" : 4 }, { "name" : "Usable", "score" : 5 }, { "name" : "Error Handling", "score" : 2 }, { "name" : "Integrable", "score" : 1 }, { "name" : "I/O Validation", "score" : 2 }, { "name" : "Testing", "score" : 0 }, { "name" : "Monitoring", "score" : 2 }, { "name" : "Performance", "score" : 1 }, { "name" : "Scalability", "score" : 1 }, { "name" : "Security", "score" : 4 }, { "name" : "Maintainability", "score" : 3 }, { "name" : "Community", "score" : 3 }, { "name" : "Change Management", "score" : 2 }, { "name" : "CA", "score" : 3 }, { "name" : "Licensing", "score" : 4 }, { "name" : "Roadmap", "score" : 0 }, { "name" : "Willingness", "score" : 5 }, { "name" : "Architecture Alignment", "score" : 5 } ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL1", "codeDescription" : "Level 1 - Initial Reuse Analysis", "important" : true }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "FOSS", "codeDescription" : "FOSS", "important" : false } ], "tags" : [ { "text" : "Mapping" }, { "text" : "Reference" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/clavin_logo.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='http://clavin.bericotechnologies.com' title='http://clavin.bericotechnologies.com' target='_blank'> http://clavin.bericotechnologies.com</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://github.com/Berico-Technologies/CLAVIN' title='https://github.com/Berico-Technologies/CLAVIN' target='_blank'> https://github.com/Berico-Technologies/CLAVIN</a>" }, { "name" : "DI2E Framework Evaluation Report URL", "type" : "DI2E Framework Evaluation Report URL", "description" : null, "link" : "<a href='https://storefront.di2e.net/marketplace/public/Clavin_ChecklistReport_v1.0.docx' title='https://storefront.di2e.net/marketplace/public/Clavin_ChecklistReport_v1.0.docx' target='_blank'> https://storefront.di2e.net/marketplace/public/Clavin_ChecklistReport_v1.0.docx</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='http://clavin.bericotechnologies.com/' title='http://clavin.bericotechnologies.com/' target='_blank'> http://clavin.bericotechnologies.com/</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://github.com/Berico-Technologies/CLAVIN' title='https://github.com/Berico-Technologies/CLAVIN' target='_blank'> https://github.com/Berico-Technologies/CLAVIN</a>" } ], "reviews" : [ { "username" : "Abby TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 4, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "> 3 years", "lastUsed" : 1388769330000, "updateDate" : 1391537730000, "organization" : "DCGS Navy", "recommend" : false, "pros" : [ { "text" : "Well Tested" }, { "text" : "Compact" } ], "cons" : [ { "text" : "Poor Documentation" } ] } ], "dependencies" : [ ] }, { "componentId" : 10, "guid" : "23aa2f6b-1842-43d8-910f-f547f4696c0d", "name" : "Common Map API Javascript Library", "description" : "Core Map API is a library of JavaScript (JS) functions that hide the underlying Common Map Widget API so that developers only have to include the JS library and call the appropriate JS functions that way they are kept away from managing or interacting directly with the channels. <br> <br>Purpose/Goal of the Software: Core Map API hides the details on directly interacting with the Ozone Widget Framework (WOF) publish/subscribe channels. It is intended to insulate applications from changes in the underlying CMWAPI as they happen. <br> <br>Additional documentation can also be found here - <a href='https://confluence.di2e.net/download/attachments/14518881/cpce-map-api-jsDocs.zip?api=v2' title='https://confluence.di2e.net/download/attachments/14518881/cpce-map-api-jsDocs.zip?api=v2' target='_blank'> cpce-map-api-jsDocs.zip?api=v2</a> <br> <br>Target Audience: Developers", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DCGS-A", "releaseDate" : 1362812400000, "version" : "1.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485055000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : 1388769330000, "endDate" : 1393694130000, "currentLevelCode" : "LEVEL1", "reviewedVersion" : "1.0", "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : null, "actualCompletionDate" : 1392138930000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ { "name" : "Discoverable", "score" : 3 }, { "name" : "Accessible", "score" : 4 }, { "name" : "Documentation", "score" : 3 }, { "name" : "Deployable", "score" : 0 }, { "name" : "Usable", "score" : 1 }, { "name" : "Error Handling", "score" : 0 }, { "name" : "Integrable", "score" : 3 }, { "name" : "I/O Validation", "score" : 2 }, { "name" : "Testing", "score" : 1 }, { "name" : "Monitoring", "score" : 5 }, { "name" : "Performance", "score" : 0 }, { "name" : "Scalability", "score" : 5 }, { "name" : "Security", "score" : 3 }, { "name" : "Maintainability", "score" : 5 }, { "name" : "Community", "score" : 3 }, { "name" : "Change Management", "score" : 0 }, { "name" : "CA", "score" : 3 }, { "name" : "Licensing", "score" : 5 }, { "name" : "Roadmap", "score" : 3 }, { "name" : "Willingness", "score" : 4 }, { "name" : "Architecture Alignment", "score" : 3 } ] }, "questions" : [ { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1393834530000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "answeredDate" : 1398845730000 } ] }, { "question" : "Does this support the 2.0 specs? (SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "No, they planned to add support next Version(SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "answeredDate" : 1393834530000 }, { "response" : "Update: they backport support to version 1.6(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1398845730000 } ] }, { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1398845730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1399961730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL1", "codeDescription" : "Level 1 - Initial Reuse Analysis", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "PILOT", "codeDescription" : "Deployment Pilot", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/download/attachments/14518881/CP-CE%20COE%20v2%20Map%20API%20Developer%20Guide.pdf?api=v2' title='https://confluence.di2e.net/download/attachments/14518881/CP-CE%20COE%20v2%20Map%20API%20Developer%20Guide.pdf?api=v2' target='_blank'> https://confluence.di2e.net/download/attachments/14518881/CP-CE%20COE%20v2%20Map%20API%20Developer%20Guide.pdf?api=v2</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/download/attachments/14518881/cpce-map-api.war?api=v2' title='https://confluence.di2e.net/download/attachments/14518881/cpce-map-api.war?api=v2' target='_blank'> https://confluence.di2e.net/download/attachments/14518881/cpce-map-api.war?api=v2</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/EMP/repos/map-api/browse/js' title='https://stash.di2e.net/projects/EMP/repos/map-api/browse/js' target='_blank'> https://stash.di2e.net/projects/EMP/repos/map-api/browse/js</a>" }, { "name" : "DI2E Framework Evaluation Report URL", "type" : "DI2E Framework Evaluation Report URL", "description" : null, "link" : "<a href='https://storefront.di2e.net/marketplace/public/CMAPI-JavascriptLibrary_ChecklistReport_v1.0.docx' title='https://storefront.di2e.net/marketplace/public/CMAPI-JavascriptLibrary_ChecklistReport_v1.0.docx' target='_blank'> https://storefront.di2e.net/marketplace/public/CMAPI-JavascriptLibrary_ChecklistReport_v1.0.docx</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 11, "guid" : "4a1c06c7-c854-43db-a41b-5318a7012412", "name" : "Common Map Widget API", "description" : "Background <br>Many programs and projects create widgets that search for or manipulate data then present the results on a map. The desire is to be able to combine data search/manipulation widgets from any provider with map widgets from other providers. In order to accomplish this, a standard way for the data search/manipulation widgets to be able to communicate with the map widget is necessary. This Application Program Interface (API) is the codification of that standard. <br> <br>Overview <br>Using this API allows developers to focus on the problem domain rather than implementing a map widget themselves. It also allows the actual map implementation used to be chosen dynamically by the user at runtime rather than being chosen by the developer. Any map implementation that applies this API can be used. Currently, implementations using Google Earth, Google Maps V2, Google Maps V3, and OpenLayers APIs are available, and others can be written as needed. <br>Another benefit of this API is that it allows multiple widgets to collaboratively display data on a single map widget rather than forcing the user to have a separate map for each widget so the user does not have to learn a different map user interface for each widget. <br>The API uses the OZONE Widget Framework (OWF) inter-widget communication mechanism to allow client widgets to interact with the map. Messages are sent to the appropriate channels (defined below), and the map updates its state accordingly. Other widgets interested in knowing the current map state can subscribe to these messages as well. <br> <br>also available on <a href='https://software.forge.mil/sf/frs/do/viewRelease/projects.jc2cui/frs.common_map_widget.common_map_widget_api' title='https://software.forge.mil/sf/frs/do/viewRelease/projects.jc2cui/frs.common_map_widget.common_map_widget_api' target='_blank'> frs.common_map_widget.common_map...</a>", "parentComponent" : { "componentId" : 9, "name" : "CLAVIN" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E Framework", "releaseDate" : 1364364000000, "version" : "1.1", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "System", "updateDts" : 1404172800000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "Charting" } ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='http://www.cmapi.org/spec.html' title='http://www.cmapi.org/spec.html' target='_blank'> http://www.cmapi.org/spec.html</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='http://www.cmapi.org/spec.html' title='http://www.cmapi.org/spec.html' target='_blank'> http://www.cmapi.org/spec.html</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 12, "guid" : "bbf65a32-157c-4770-9cee-948bd48b3837", "name" : "Content Discovery and Retrieval Engine - Brokered Search Component", "description" : "Content Discovery and Retrieval functionality is based on the architecture, standards, and specifications being developed and maintained by the joint IC/DoD Content Discovery and Retrieval (CDR) Integrated Product Team (IPT). The components contained in this release are the 1.1 version of the reference implementation of the CDR components currently integrated within a system architecture that supports the Intelligence Community. <br> <br>The Brokered Search Component is an implementation of the capabilities and interfaces defined in the following CDR Brokered Search Service Specifications: <br><ul><li>IC/DoD CDR Brokered Search Service Specification for OpenSearch Implementations Version 1.0, 25 October 2010.</li> <br><li>IC/DoD CDR Brokered Search Service Specification for SOAP Implementations, Version 1.0, 26 October 2010.</li></ul> <br> <br>Generally speaking, the main thread of the Brokered Search Component is: <br>1.\tAccept a CDR 1.0 formatted brokered search request from a consumer <br>2.\tExtract routing criteria from the brokered search request <br>3.\tIdentify the correct search components to route the search request to based on the extracted routing criteria <br>4.\tRoute the search request to the identified search components <br>5.\tAggregate the metadata results from the separate search components into a single result stream and return the results to the consumer <br>It is important to note that a compatible service registry must be configured with Brokered Search, in order for the service to work as-implemented. Brokered Search queries the registry to get an accurate list of available endpoints.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E-F", "releaseDate" : 1329634800000, "version" : "n/a", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485057000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Does this support the 2.0 specs? (SAMPLE)", "username" : "Abby TEST", "userType" : "Project Manager", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "No, they planned to add support next Version(SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "answeredDate" : 1391447730000 }, { "response" : "Update: they backport support to version 1.6(SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "answeredDate" : 1391537730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "answeredDate" : 1393834530000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1393834530000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ { "text" : "Charting" }, { "text" : "Data Exchange" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/satellite-icon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' title='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' title='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/Content_Discovery_and_Retrieval_Brokered_Search_Service' title='https://intellipedia.intelink.gov/wiki/Content_Discovery_and_Retrieval_Brokered_Search_Service' target='_blank'> https://intellipedia.intelink.gov/wiki/Content_Discovery_and_Retrieval_Brokered_Search_Service</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 13, "guid" : "ccec2c4d-fa44-487f-9b34-ac7d10ec62ba", "name" : "Content Discovery and Retrieval Engine - Describe Component", "description" : "Content Discovery and Retrieval functionality is based on the architecture, standards, and specifications being developed and maintained by the joint IC/DoD Content Discovery and Retrieval (CDR) Integrated Product Team (IPT). The components contained in this release are the 1.1 version of the reference implementation of the CDR components currently integrated within a system architecture that supports the Intelligence Community. <br> <br>The Describe Service component supports machine-to-machine interactions to provide a service consumer with a list of available search components for which a Brokered Search Service may search. <br> <br>As a result of invoking the Describe Service component, the service consumer receives a list of search components that a broker may search. In any case, the results are returned in the format of an Atom feed.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E Framework", "releaseDate" : 1329894000000, "version" : "n/a", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485058000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "createDts" : 1367309730000, "updateDts" : 1367309730000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "answeredDate" : 1398845730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1398845730000 } ] }, { "question" : "Does this support the 2.0 specs? (SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "No, they planned to add support next Version(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1393834530000 }, { "response" : "Update: they backport support to version 1.6(SAMPLE)", "username" : "Cathy TEST", "userType" : "Project Manager", "answeredDate" : 1398845730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ { "text" : "Data Exchange" }, { "text" : "UDOP" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/satellite-icon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' title='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' title='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 14, "guid" : "2a5401d9-3e8b-4c7a-a75d-273953be24e6", "name" : "Content Discovery and Retrieval Engine - Retrieve Component", "description" : "The Retrieve Components are implementations of the capabilities and interfaces defined in IC/DoD CDR Retrieve Service Specification for SOAP Implementations DRAFT Version 1.0-20100331, March 31, 2010. Each Retrieve Component is a separately deployable component that provides access to a defined content provider/content collection. The main thread of a Retrieve Component is: <br> 1. Accept a CDR 1.0 formatted retrieve request from a consumer <br> 2. Transform the CDR 1.0 retrieve request to a provider-specific retrieve request and execute the request against the provider/content collection to obtain the provider content <br> 3. Package the provider content into a CDR 1.0 formatted retrieve result and return it to the consumer <br> <br>The ADL CDR Components include a programmer Software Development Kit (SDK). The SDK includes the framework, sample code, and test driver for developing Retrieve Components with a SOAP interface conforming to the Agency Data Layer CDR Components implementation of the CDR 1.0 Specifications. <br> <br>Note that this is an abstract service definition and it is expected that it will be instantiated multiple times on multiple networks and in multiple systems. Each of those instances will have their own concrete service description which will include endpoint, additional security information, etc. <br> <br>Also see the Agency Data Layer Overview in <a href='https://www.intelink.gov/inteldocs/browse.php?fFolderId=431781' title='https://www.intelink.gov/inteldocs/browse.php?fFolderId=431781' target='_blank'> browse.php?fFolderId=431781</a> for more general information about CDR.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E-F", "releaseDate" : 1329807600000, "version" : "n/a", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485059000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "createDts" : 1328379330000, "updateDts" : 1328379330000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1391447730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "answeredDate" : 1399961730000 } ] }, { "question" : "Does this support the 2.0 specs? (SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "No, they planned to add support next Version(SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "answeredDate" : 1393834530000 }, { "response" : "Update: they backport support to version 1.6(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1391537730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/satellite-icon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' title='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' title='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://www.intelink.gov/wiki/Content_Discovery_and_Retrieval_Retrieve_Service' title='https://www.intelink.gov/wiki/Content_Discovery_and_Retrieval_Retrieve_Service' target='_blank'> https://www.intelink.gov/wiki/Content_Discovery_and_Retrieval_Retrieve_Service</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 15, "guid" : "f8a744b0-39b1-4ee9-8dd4-daf5a6f931a2", "name" : "Cursor on Target Toolkit", "description" : "(U) Cursor on Target is a set of components focused on driving interoperability in message exchanges. Components include: <br>*An XML message schema <br> &nbsp;&nbsp;Basic (mandatory): what, when, where <br>&nbsp;&nbsp; Extensible (optional): add subschema to add details <br>\u0001*A standard <br>&nbsp;&nbsp; Established as USAF standard by SECAF memo April 2007 <br>&nbsp;&nbsp; Incorporated in USAF (SAF/XC) Enterprise Architecture <br>&nbsp;&nbsp; Registered by SAF/XC in DISROnline as a USAF Organizationally Unique Standard (OUS) <br>&nbsp;&nbsp; Foundation for UCore data model <br>&nbsp;&nbsp; On the way to becoming a MIL-STD <br>\u0001*A set of software plug-ins to enable systems, including VMF and Link 16, to input and output CoT messages <br>*A CoT message router (software) to facilitate publish/subscribe message routing <br>*A simple developer's tool kit", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "Air Force", "releaseDate" : 1230534000000, "version" : "1.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485060000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/CoTSS.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/CoTIcon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/projects/cot' title='https://software.forge.mil/sf/projects/cot' target='_blank'> https://software.forge.mil/sf/projects/cot</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/projects/cot' title='https://software.forge.mil/sf/projects/cot' target='_blank'> https://software.forge.mil/sf/projects/cot</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 16, "guid" : "8bfc523a-591c-4fb9-a3ff-6bf96ed02c99", "name" : "DCGS Discovery Metadata Guide", "description" : "This document provides information on DCGS metadata artifacts and guidance for populating DDMS and the DIB Metacard, using DDMS Schema Extensions, and creating new DDMS extension schemas. These guidelines should be used by developers and System Integrators building resource adapters and schemas to work with DIB v2.0 or later. <br> <br>DISTRIBUTION STATEMENT C - Distribution authorized to U.S. Government Agencies and their contractors (Critical Technology) Not ITAR restricted", "parentComponent" : null, "subComponents" : [ { "componentId" : 15, "name" : "Cursor on Target Toolkit" } ], "relatedComponents" : [ ], "organization" : "AFLCMC/HBBG", "releaseDate" : 1393830000000, "version" : "See site for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485060000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "answeredDate" : 1391537730000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1393834530000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "DOC", "codeDescription" : "Documentation", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : null, "codeDescription" : null, "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://wiki.macefusion.com/display/MMT/DCGS+Discovery+Metadata+Guide' title='https://wiki.macefusion.com/display/MMT/DCGS+Discovery+Metadata+Guide' target='_blank'> https://wiki.macefusion.com/display/MMT/DCGS+Discovery+Metadata+Guide</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 17, "guid" : "1687ab9a-f6de-4253-9887-f9dfcece10d5", "name" : "DCGS Enterprise Messaging Technical Profile", "description" : "DCGS Enterprise Services rely on asynchronous communications for sending messages so they can notify users when certain data is published or a particular event has occurred. Users may subscriber to a data source so they can be notified when a piece of intelligence has been published on a topic of interest. Enterprise Messaging is a key capability that supports the processing of messages between Web Services that are needed for an enterprise to function efficiently. As the number of Web Services deployed across an enterprise increases, the ability to effectively send and receive messages across an enterprise becomes critical for its success. This Technical Design Document (TDD) was created by the DCGS Enterprise Focus Team (EFT) to provide guidance for Enterprise Messaging for use by the DCGS Enterprise Community at large. DCGS Service Providers will use this guidance to support the Enterprise Standards for the DCGS Enterprise. <br> <br>Content of Enterprise Messaging (EM) CDP: <br> - Technical Design Document (TDD) <br> - Service Specification Package (SSP) <br> - Conformance Test Kit (CTK) <br> - Conformance Traceability Matrix (CTM) <br> - Test Procedure Document <br> - Test Request Messages <br> - Gold Data Set <br> - Conformance Checks Scripts", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DCGS EFT", "releaseDate" : 1278309600000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485061000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/q30MNpu' title='https://www.intelink.gov/go/q30MNpu' target='_blank'> https://www.intelink.gov/go/q30MNpu</a>" } ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "Developer", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 4, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1362298530000, "updateDate" : 1399961730000, "organization" : "Private Company", "recommend" : false, "pros" : [ { "text" : "Compact" }, { "text" : "Well Tested" } ], "cons" : [ ] }, { "username" : "Cathy TEST", "userType" : "End User", "comment" : "This wasn't quite what I thought it was.", "rating" : 2, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1381644930000, "updateDate" : 1391447730000, "organization" : "NGA", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Security Concerns" }, { "text" : "Difficult Installation" } ] } ], "dependencies" : [ ] }, { "componentId" : 18, "guid" : "fe190601-3d24-48fd-b7ca-09ea9b5ddd5f", "name" : "DCGS Enterprise OWF IdAM Technical Profile", "description" : "The Ozone Widget Framework is a web-application engine built around the concept of discrete, reusable web application interface components called widgets. Widgets may be composed into full applications by Ozone users or administrators. <br> <br> <br>The architecture of the Ozone framework allows widgets to be implemented and deployed in remote web application servers. This leads to the possibility of an enterprise Ozone architecture, where Ozone users may access widgets from multiple providers in the enterprise. <br> <br>An enterprise Ozone architecture will require a capability that can provide identity and access management services to Ozone and widget web applications and provide a single-sign-on experience to Ozone users. <br> <br>Content of Ozone Widget Framework Identity and Access Management CDP: <br>- Technical Design Document (TDD) <br>- Web Service Specification, Web Browser Single Sign On <br>- Conformance Test Kit (CTK) <br>- Conformance Traceability Matrix (CTM) <br>- Test Procedure Document <br>- Test Request Messages <br>- Gold Data Set <br>- Conformance Checks Scripts", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1382940000000, "version" : "draft", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399487595000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/jeYvHyO' title='https://www.intelink.gov/go/jeYvHyO' target='_blank'> https://www.intelink.gov/go/jeYvHyO</a>" } ], "reviews" : [ ], "dependencies" : [ { "dependency" : "Erlang", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 3.0" } ] }, { "componentId" : 19, "guid" : "346042fd-1e3c-4486-93a6-f3dc9acb71c1", "name" : "DCGS Integration Backbone (DIB)", "description" : "The Distributed Common Ground/Surface System (DCGS) Integration Backbone (DIB) is the enabler for DCGS enterprise interoperability. The DIB is a technical infrastructure, the foundation for sharing data across the ISR enterprise. More specifically the DIB is: <br>1) Standards-based set of software, services, documentation and metadata schema designed to enhance interoperability of ISR <br>2) Data sharing enabler for the ISR enterprise <br>3) Reduces development costs through component sharing and reuse. <br>DIB Provides timely information, with access to all enterprise intelligence dissemination nodes, containing terabytes of data, the ability to filter data to relevant results, and supports real-time Cross Domain ISR data query and retrieval across Coalition and/or Security domains", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DMO", "releaseDate" : 1383548400000, "version" : "4.0.2", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485063000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/DIBProjectLogo.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/go/proj1145' title='https://software.forge.mil/sf/go/proj1145' target='_blank'> https://software.forge.mil/sf/go/proj1145</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/go/proj1145' title='https://software.forge.mil/sf/go/proj1145' target='_blank'> https://software.forge.mil/sf/go/proj1145</a>" } ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "Project Manager", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 3, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "> 3 years", "lastUsed" : 1381644930000, "updateDate" : 1393834530000, "organization" : "NSA", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Poorly Tested" } ] }, { "username" : "Abby TEST", "userType" : "Project Manager", "comment" : "This wasn't quite what I thought it was.", "rating" : 1, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 6 Months", "lastUsed" : 1367309730000, "updateDate" : 1391537730000, "organization" : "DCGS Navy", "recommend" : false, "pros" : [ { "text" : "Well Tested" } ], "cons" : [ ] } ], "dependencies" : [ { "dependency" : "Ruby", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 2.0+" } ] }, { "componentId" : 20, "guid" : "4cd37f95-c98e-4a83-800b-887cd972c714", "name" : "DCGS-E Audit Log Management and Reporting Technical Profile", "description" : "This CDP provides the technical design description for the Audit and Accountability capability of the Distributed Common Ground/Surface System (DCGS) Enterprise Service Dial Tone (SDT) layer. It includes the capability architecture design details, conformance requirements, and implementation guidance. <br> <br>Certain user actions, performed within a limited time period and in certain patterns, can be signs of preparation or attempts to exploit system vulnerabilities that involve privileged access. Certain actions taken by the application server, in response to a perceived threat, are also potential signs of an attack. Taken individually, these events are not absolute indicators and any response to them could be premature. However, if the execution of the actions is not recorded, it becomes impossible to recognize later the pattern that confirms the occurrence of an attack. In a Service Oriented Architecture (SOA), Web services dynamically bind to one another, making it even more difficult to recognize these patterns across Web services and determine accountability in a service chain. Audit and Accountability is the capability that logs these events at each Web service so that these patterns can be identified, after the fact, and accountability enforced. <br> <br>In support of enterprise behavior within the DCGS Family of Systems (FoS), this technical design document was created by the DCGS Enterprise Focus Team (EFT) to provide guidance for audit and accountability of the DCGS Enterprise Service Dial Tone (SDT) layer for use by the DCGS Enterprise Community at large. It includes the capability architecture design details, conformance requirements, and implementation guidance. DCGS service providers will use this guidance to generate security audit logs to enforce accountability in a service chain. <br> <br>Content of Audit Logging (SOAP) CDP: <br> - Technical Design Document (TDD) <br> - Service Specification Package (SSP) for each service - Not applicable <br> - Conformance Test Kit (CTK) - Currently under development", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1330412400000, "version" : "Draft", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485064000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "UDOP" }, { "text" : "Charting" } ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/zsxM4al' title='https://www.intelink.gov/go/zsxM4al' target='_blank'> https://www.intelink.gov/go/zsxM4al</a>" } ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 2, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1362298530000, "updateDate" : 1398845730000, "organization" : "NSA", "recommend" : true, "pros" : [ { "text" : "Reliable" } ], "cons" : [ { "text" : "Poor Documentation" } ] }, { "username" : "Cathy TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 3, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "> 3 years", "lastUsed" : 1362298530000, "updateDate" : 1393834530000, "organization" : "NSA", "recommend" : false, "pros" : [ { "text" : "Well Tested" }, { "text" : "Open Source" } ], "cons" : [ { "text" : "Security Concerns" }, { "text" : "Bulky" } ] } ], "dependencies" : [ { "dependency" : "Tomcat", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 7 or 8" } ] }, { "componentId" : 21, "guid" : "74f8c854-d70d-45f7-ab74-f63c27abdf8f", "name" : "DCGS-E Domain Name System (DNS) Technical Profile", "description" : "(U) This CDP provides guidance for DNS for use by the DCGS Enterprise Community at large. DCGS Service Providers will use this guidance to make their services visibility and accessibility in the DCGS Enterprise SOA (DES). Several Intelligence Community/Department of Defense (IC/DoD) documents were incorporated to support the guidance provided. DNS is important to the DCGS Community because it supports visibility and accessibility of services hosted on their servers. <br> <br>(U//FOUO) This CDP provides a technical design description for the Domain Name System of the Distributed Common Ground/Surface System (DCGS) Enterprise Service Dial Tone (SDT). It includes the service architecture design details, conformance requirements, and implementation guidance. <br> <br>(U//FOUO) Domain names are meaningful identification labels for Internet addresses. The Domain Name System capability translates domain names into the numerical identifiers associated with networking equipment for the purpose of locating and addressing these devices across the globe. The Domain Name System capability makes it possible to assign domain names to groups of Internet users in a meaningful way, independent of each user's physical location. Because of this, World Wide Web (WWW) hyperlinks and Internet contact information can remain consistent and constant even if the current Internet routing arrangements change or the participant uses a mobile device. The Domain Name System (DNS) is the industry standard for domain name translation and will be utilized across the DCGS Enterprise as the DCGS Enterprise Domain Name System solution. <br> <br>(U//FOUO) In support of enterprise behavior within the DCGS Family of Systems (FoS), this technical design document was created by the DCGS Enterprise Focus Team (EFT) to provide guidance for the use of the Domain Name System capability by the DCGS Enterprise Community at large. DCGS service providers will use this guidance to make their services visible and accessible in the DCGS Enterprise SOA (DES). <br> <br>Content of Domain Name System (DNS) CDP: <br> - Technical Design Document (TDD) <br> - Service Specification Package (SSP) <br> - Conformance Test Kit (CTK) <br> - Conformance Traceability Matrix (CTM) <br> - Test Procedure Document <br> - Test Request Messages - N/A (DNS is a network infrastructure service) <br> - Gold Data Set - N/A (DNS is a network infrastructure service) <br> - Conformance Checks Scripts - N/A (DNS is a network infrastructure service)", "parentComponent" : { "componentId" : 19, "name" : "DCGS Integration Backbone (DIB)" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DCGS EFT", "releaseDate" : 1287640800000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485064000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Cathy TEST", "userType" : "End User", "answeredDate" : 1391537730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "answeredDate" : 1391537730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1391447730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1398845730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/J9qBGN9' title='https://www.intelink.gov/go/J9qBGN9' target='_blank'> https://www.intelink.gov/go/J9qBGN9</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 22, "guid" : "50ababb2-08e3-4f2a-98a5-068b261d9424", "name" : "DCGS-E Metrics Management Technical Profile", "description" : "**Previously titled Service Level Agreement/Quality of Service CDP** <br> <br>(U) This CDP provides guidance for Metrics Management for use by the DCGS Enterprise Community at large. DCGS Service Providers will use this guidance to make their services visibility and accessibility in the DCGS Enterprise SOA. Several Intelligence Community/Department of Defense (IC/DoD) documents were incorporated to support the guidance provided. <br> <br>(U//FOUO) Enterprise Management refers to the management techniques, metrics and related tools that DCGS programs of record can use to support their nodes and make strategic decisions to maintain the overall health of their services. The Metrics Management service family is a key capability that supports Enterprise Management. It is used to monitor the performance and operational status of services. <br> <br>(U//FOUO) Metrics Management measures what is actually delivered to the service consumer via a set of metrics (e.g. service performance and availability). As the number of service offerings deployed across an enterprise increases, the ability to effectively manage and monitor them becomes critical to ensure a successful implementation. Clearly defined metrics need to be collected and reported to determine if the service offerings are meeting their users? needs. <br> <br>(U//FOUO) In support of enterprise behavior within the DCGS Family of Systems (FoS), this technical design document was created by the DCGS Enterprise Focus Team (EFT) to provide guidance on metrics, service events, and service interfaces needed by the DCGS Enterprise Community at large to support Metrics Management. DCGS service providers will use this guidance to collect metrics measurements, calculate associated metrics, and report those metrics to interested parties. <br> <br>Content of Metrics Management (formerly known as QoS Management) CDP: <br> - Technical Design Document (TDD) <br> - Service Specification Package (SSP) <br> - Conformance Test Kit (CTK) <br> - Conformance Traceability Matrix (CTM) <br> - Test Procedure Document <br> - Test Request Messages <br> - Gold Data Set <br> - Conformance Checks Scripts", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DCGS EFT", "releaseDate" : 1278396000000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485065000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/CMpInl8' title='https://www.intelink.gov/go/CMpInl8' target='_blank'> https://www.intelink.gov/go/CMpInl8</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 23, "guid" : "a84fe52a-c964-4be1-b0b1-e00212417817", "name" : "DCGS-E Sensor Web Enablement (SWE) Technical Profile", "description" : "(U//FOUO) This CDP provides the technical design description for the SensorWeb capability of the Distributed Common Ground/Surface System (DCGS) Enterprise Intelligence, Surveillance and Reconnaissance (ISR) Common layer. <br> <br>(U//FOUO) SensorWeb is a development effort led by the Defense Intelligence Agency (DIA) National Measurement and Signature Intelligence (MASINT) Office (NMO) that aligns native sensor data output to open standard data formats in order to improve sensor data discoverability and to increase interoperability between sensor technologies, analytical tools, and Common Operating Environments (COE). <br> <br>(U//FOUO) SensorWeb architecture is based on the Open Geospatial Consortium (OGC) suite of Sensor Web Enablement (SWE) standards and practices: specifically, the Sensor Observation Service (SOS) Interface Standard 2.0 and the Sensor Planning Service (SPS) Interface Standard 2.0. This TDD outlines the SOS and SPS and describes how they are used in the SensorWeb reference implementation. <br>(U//FOUO) The SensorWeb reference implementation can be combined with other SOS servers to cover a wider range of sensor systems, or it can be used as a stand-alone to observe a limited area or slate of sensors. <br> <br>(U//FOUO) The objective of the SensorWeb is to leverage existing data standards and apply them to MASINT sensors and sensor systems. MASINT sensors cross a broad spectrum of collection types and techniques, including radar, sonar, directed energy weapons, and chemical, biological, radiological, and nuclear incident reporting. SensorWeb ingests sensor data from its earliest point of transmittal and aligns that raw sensor output to established data standards. SensorWeb outputs sensor data in Keyhole Markup Language (KML) format, making sensor data readily available in near real-time to systems that support KML, such as Google Earth. <br> <br>(U//FOUO) SensorWeb provides unified access and control of disparate sensor data and standardized services across the ISR Enterprise, as well as delivers Command and Control (C2)/ISR Battlespace Awareness through a visualization client(s). <br>(U//FOUO) The SensorWeb Service Oriented Architecture (SOA) ingests raw data from multiple sensor systems and then converts the data to OGC standardized schemas which allows for sensor discovery, observation, and dissemination using common, open source data exchange standards. <br> <br>(U//FOUO) SensorWeb was established to determine a method and means for collecting and translating MASINT sensor data output and aligning that output with open standards supported by the OGC, the Worldwide Web Consortium (W3C), the International Organization for Standardization (ISO), and the Institute of Electrical and Electronics Engineers (IEEE) directives. <br> <br>(U//FOUO) The models, encodings, and services of the SWE architecture enable implementation of interoperable and scalable service-oriented networks of heterogeneous sensor systems and client applications. In much the same way that Hypertext Markup Language (HTML) and Hypertext Transfer Protocol (HTTP) standards enable the exchange of any type of information on the Web, the OGC's SWE initiative is focused on developing standards to enable the discovery, exchange, and processing of sensor observations, as well as the tasking of sensor systems. <br> <br>Content of Sensor Web Enablement (SWE) CDP: <br> - Technical Design Document (TDD) <br> - Service Specification Package (SSP) <br> - Conformance Test Kit (CTK) <br> - Conformance Traceability Matrix (CTM) <br> - Test Procedure Document - Under development <br> - Test Request Messages - Under development <br> - Gold Data Set - Under development <br> - Conformance Checks Scripts - Under development", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1393225200000, "version" : "draft", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485066000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "answeredDate" : 1398845730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Abby TEST", "userType" : "Developer", "answeredDate" : 1391447730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "UDOP" } ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/N4Gma4M' title='https://www.intelink.gov/go/N4Gma4M' target='_blank'> https://www.intelink.gov/go/N4Gma4M</a>" } ], "reviews" : [ { "username" : "Cathy TEST", "userType" : "Project Manager", "comment" : "This is a great product however, it's missing what I think are critical features. Hopefully, they are working on it for future updates.", "rating" : 5, "title" : "Great but missing features (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1328379330000, "updateDate" : 1391537730000, "organization" : "NSA", "recommend" : true, "pros" : [ { "text" : "Open Source" }, { "text" : "Reliable" } ], "cons" : [ { "text" : "Poorly Tested" } ] }, { "username" : "Abby TEST", "userType" : "Project Manager", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 4, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1381644930000, "updateDate" : 1398845730000, "organization" : "DCGS Navy", "recommend" : false, "pros" : [ { "text" : "Compact" }, { "text" : "Well Tested" } ], "cons" : [ { "text" : "Security Concerns" } ] } ], "dependencies" : [ ] }, { "componentId" : 24, "guid" : "8f915029-78bb-4df2-944f-f6fc4a84eeec", "name" : "DCGS-E Service Registration and Discovery (SRD) Technical Profile", "description" : "(U//FOUO) Service discovery provides DCGS Enterprise consumers the ability to locate and invoke services to support a given task or requirement in a trusted and secure operational environment. By leveraging service discovery, existing DCGS Enterprise services will be published to a root service registry, which is searchable via keyword or taxonomy. This capability provides users and machines the ability to search and discover services or business offerings. The Service Discovery capability is a foundational building block allowing the DCGS programs of record to publish and discover service offerings allowing the DCGS Enterprise Community to share and reuse information in a common, proven, and standards-based manner. <br> <br>(U//FOUO) In support of enterprise behavior within the DCGS Family of Systems (FoS), this technical design document was created by the DCGS Enterprise Focus Team (EFT) to provide guidance for service discovery for use by the DCGS Enterprise Community at large. DCGS service providers will use this guidance to make their services discoverable within the DCGS Enterprise. <br> <br>Content of Service Registration and Discovery (SRD) CDP: <br> - Technical Design Document (TDD) <br> - Service Specification Package (SSP) <br> - Conformance Test Kit (CTK) <br> - Conformance Traceability Matrix (CTM) <br> - Test Procedure Document <br> - Test Request Messages <br> - Gold Data Set <br> - Conformance Checks Scripts", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DCGS EFT", "releaseDate" : 1278309600000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485067000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1398845730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "answeredDate" : 1391537730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ { "label" : "Provides Web Hooks via RPC service(SAMPLE)", "value" : "Yes" }, { "label" : "Available to public (SAMPLE)", "value" : "YES" } ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/bujBaGB' title='https://www.intelink.gov/go/bujBaGB' target='_blank'> https://www.intelink.gov/go/bujBaGB</a>" } ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 2, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 6 Months", "lastUsed" : 1381644930000, "updateDate" : 1393834530000, "organization" : "NGA", "recommend" : false, "pros" : [ ], "cons" : [ ] }, { "username" : "Cathy TEST", "userType" : "End User", "comment" : "This is a great product however, it's missing what I think are critical features. Hopefully, they are working on it for future updates.", "rating" : 2, "title" : "Great but missing features (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1388769330000, "updateDate" : 1391537730000, "organization" : "DCGS Army", "recommend" : false, "pros" : [ { "text" : "Reliable" } ], "cons" : [ { "text" : "Poor Documentation" } ] } ], "dependencies" : [ ] }, { "componentId" : 25, "guid" : "01724885-d2c1-4788-9aa0-ea0128fff805", "name" : "DCGS-E Time Synchronization (NTP) Technical Profile", "description" : "(U) This provides guidance for Network Time Protocol (NTP) for use by the DCGS Enterprise Community at large. DCGS Service Providers will use this guidance to make their services secure and interoperable in the DCGS Enterprise SOA <br> <br>(U//FOUO) Time synchronization is a critical service in any distributed system because it provides the frame of reference for time between all devices on the network. Time synchronization ensures that the system time on a machine located in, for example, San Francisco is the same as the time on a machine located in London before time zones are taken into account. As such, synchronized time is extremely important when performing any operations across a network. When it comes to security, it would be very hard to develop a reliable picture of an incident if logs between routers and other network devices cannot be compared successfully and accurately. Put simply, time synchronization enables security in a Net-centric environment. . <br> <br>Content of Time Synchronization (NTP) CDP: <br>- Technical Design Document (TDD) <br>- Service Specification Package (SSP) <br>- Conformance Test Kit (CTK) <br>- Conformance Traceability Matrix (CTM) <br>- Test Procedure Document <br>- Test Request Messages - N/A (NTP is a network infrastructure service) <br>- Gold Data Set - N/A (NTP is a network infrastructure service) <br>- Conformance Checks Scripts - N/A (NTP is a network infrastructure service", "parentComponent" : { "componentId" : 21, "name" : "DCGS-E Domain Name System (DNS) Technical Profile" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DCGS EFT", "releaseDate" : 1341208800000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485068000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "Access" }, { "text" : "Visualization" } ], "metadata" : [ { "label" : "Provides Web Hooks via RPC service(SAMPLE)", "value" : "Yes" }, { "label" : "Common Uses (SAMPLE)", "value" : "UDOP, Information Sharing, Research" }, { "label" : "Support Common Interface 2.1 (SAMPLE)", "value" : "No" } ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/x5UIJnv' title='https://www.intelink.gov/go/x5UIJnv' target='_blank'> https://www.intelink.gov/go/x5UIJnv</a>" } ], "reviews" : [ { "username" : "Cathy TEST", "userType" : "Project Manager", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 4, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1328379330000, "updateDate" : 1391447730000, "organization" : "DCGS Army", "recommend" : true, "pros" : [ { "text" : "Compact" } ], "cons" : [ ] } ], "dependencies" : [ { "dependency" : "Tomcat", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 7 or 8" } ] }, { "componentId" : 26, "guid" : "b2866715-764f-4266-868f-64cac88556fe", "name" : "DCGS-E Web Service Access Control Technical Profile", "description" : "Access Control incorporates an open framework and industry best practices/standards that leverage Web Services Security (WSS) [17] standards, also referred to as WS-Security, to create a common framework using Attribute Based Access Control (ABAC). The DCGS Enterprise advocates an ABAC model as the desired vision to provide policy compliance and accountability throughout the entire enterprise. To enforce ABAC, identification and authentication is executed on the service consumer and access control is enforced by the service provider. <br> <br>Identification is the process in which the identity of either a user or system is established. Authentication is the process by which an entity proves a claim regarding its identity to one or more other entities. Together, identification and authentication allows a system to securely communicate a service consumer's identity and related security attributes to a service provider. With increased sharing across programs of record and external partners, identification and authentication is crucial to ensure that services and data are secured. The successful authentication of a subject and the attributes assigned to that subject assist in the determination of whether or not a user will be allowed to access a particular service. <br> <br>Identification and authentication joined with access control enforcement provide for the Access Control capability, which is critical for meeting Information Assurance (IA) requirements for those services targeted for the Global Information Grid (GIG). Access control is the process that allows a system to control access to resources in an information system including services and data. Services, supporting the DCGS Enterprise, will be made available to users within and between nodes. It is important that these services and their resources are adequately protected in a consistent manner across the DCGS Enterprise. Services are intended to be accessible only to authorized requesters, thus requiring mechanisms to determine the rights of an authenticated user based on their attributes and enforce access based on its security policy.", "parentComponent" : { "componentId" : 14, "name" : "Content Discovery and Retrieval Engine - Retrieve Component" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : null, "releaseDate" : 1393311600000, "version" : "draft", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485068000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "1.2.1", "codeDescription" : "Identity and Access Management", "important" : true }, { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "Mapping" }, { "text" : "Communication" } ], "metadata" : [ { "label" : "Available to public (SAMPLE)", "value" : "YES" }, { "label" : "Support Common Interface 2.1 (SAMPLE)", "value" : "No" }, { "label" : "Provides Web Hooks via RPC service(SAMPLE)", "value" : "Yes" } ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/kcN4VyS' title='https://www.intelink.gov/go/kcN4VyS' target='_blank'> https://www.intelink.gov/go/kcN4VyS</a>" } ], "reviews" : [ { "username" : "Jack TEST", "userType" : "End User", "comment" : "I had issues trying to obtain the component and once I got it is very to difficult to install.", "rating" : 4, "title" : "Hassle (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1367309730000, "updateDate" : 1398845730000, "organization" : "DCGS Army", "recommend" : true, "pros" : [ { "text" : "Well Tested" } ], "cons" : [ ] } ], "dependencies" : [ { "dependency" : "Windows", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 8.1" } ] }, { "componentId" : 27, "guid" : "35d44bb5-adc5-42ca-9671-c58e257570d9", "name" : "DI2E Framework DIAS Simulator", "description" : "This package provides a basic simulator of the DoDIIS Identity and Authorization Service (DIAS) in a deployable web application using Apache CFX architecture. The DI2E Framework development team have used this when testing DIAS specific attribute access internally with Identity and Access Management functionality.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E Framework", "releaseDate" : 1397455200000, "version" : "1.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200707000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "DEV", "codeDescription" : "Development", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "GOTS", "codeDescription" : "GOTS", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/IdAMLogoMed-Size.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DIAS+Simulation' title='https://confluence.di2e.net/display/DI2E/DIAS+Simulation' target='_blank'> https://confluence.di2e.net/display/DI2E/DIAS+Simulation</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DIAS+Simulation' title='https://confluence.di2e.net/display/DI2E/DIAS+Simulation' target='_blank'> https://confluence.di2e.net/display/DI2E/DIAS+Simulation</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DIAS+Simulation' title='https://confluence.di2e.net/display/DI2E/DIAS+Simulation' target='_blank'> https://confluence.di2e.net/display/DI2E/DIAS+Simulation</a>" } ], "reviews" : [ ], "dependencies" : [ { "dependency" : "Linux", "version" : null, "dependencyReferenceLink" : null, "comment" : "Tested on CentOS 5 and Ubuntu Server 11.0" } ] }, { "componentId" : 28, "guid" : "bcd54d72-3f0d-4a72-b473-2390b42515d5", "name" : "DI2E Framework OpenAM", "description" : "The DI2E Framework IdAM solution provides a core OpenAM Web Single Sign-On implementation wrapped in a Master IdAM Administration Console for ease of configuration and deployment. Additionally, there are several enhancements to the core authentication functionality as well as external and local attribute access with support for Ozone Widget Framework implementations. Please review the Release Notes and associated documentation for further information.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E Framework", "releaseDate" : 1397455200000, "version" : "2.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "dan.stroud", "updateDts" : 1405308845000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "DEV", "codeDescription" : "Development", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "FOSS", "codeDescription" : "FOSS", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/IdAMLogoMed-Size.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download' title='https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download' target='_blank'> https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download' title='https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download' target='_blank'> https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download' title='https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download' target='_blank'> https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download</a>" } ], "reviews" : [ ], "dependencies" : [ { "dependency" : "Linux", "version" : null, "dependencyReferenceLink" : null, "comment" : "Tested on CentOS 5 and Ubuntu Server 11.0" } ] }, { "componentId" : 30, "guid" : "3a7e6bf2-bcc4-4c1e-bc33-296cc945e733", "name" : "DI2E Framework Reference Architecture", "description" : "The DI2E Framework reference Architecture provides a structural foundation for the DI2E requirements assessment. The DI2E Framework is specified using a level of abstraction that is not dependent on a specific technical solution, but can leverage the benefits of the latest technology advancements and make them readily accessible across the enterprise. <br> <br>The DI2E Framework architecture is modeled using DoD Architecture Framework (DoDAF) version 2.02. Below is a list of artifacts that are currently available for the DI2E Framework Reference Architecture. <br> <br>Artifact\tName / Purpose <br>OV-5a\tOperational Activity Model Node Tree. A breakdown of the fundamental activities performed by various actors within the DI2E Framework community. Built from both DCGS and JIOC operational models and includes related text descriptions for each activity. <br> <br>SV-1\tComponent (System) Interfaces. Diagrams that show the fundamental interface relationships among DI2E Framework components. <br> <br>SV-2\tComponent Resource Flows. Extends the SV-1 diagrams by highlighting the 'data-in-motion' that passes between components along their interfaces. <br> <br>SV-4\tComponent Functionality. A breakdown of DI2E Framework components, including a short description of their expected functionality. <br> <br>SV-5a\tActivity : Component Matrix. A mapping showing the alignment between DI2E Framework components and activities (and vice versa). <br> <br>SV-10c\tComponent Event Tract Diagrams. Example threads through the component architecture showcasing the interaction of various components relative to example operational scenarios. <br> <br>SvcV-3a\tComponents-Services Matrix. A mapping showing the alignment between DI2E Framework components and services <br> <br>SvcV-4\tServices. A breakdown of the architectures services, including service definitions, descriptions, and other relevant service metadata. <br> <br>StdV-1\tStandards Profile. Lists the various standards and specifications that will be applicable to DI2E Framework. <br> <br>SWDS\tSoftware Description Specification. Documents the basic structure for DI2E Framework component and service specification, then points to an EXCEL worksheet documenting the specifications & related metadata for DI2E Framework components and services. <br> <br>DIV-3\tData Model. A list of 'data-in-motion' Data Object Types (DOTs) that are applicable to the component architecture. <br> <br>DBDS\tDatabase Design Specification. A description of the approach and various data repository lists used to define the data model (DIV-3), along with a link to the defined data model. <br> <br>RVTM\tRequirements Verification Traceability Matrix. A list of DI2E Framework requirements including requirement ID #s, names, descriptions, alignment with the component and service architecture, and other related metadata. <br> <br>PDS\tProject Development Specification. A high level overview of the e DI2E Framework Reference Implementation (RI), and how the components of this RI relate with the overall component architecture and related DI2E Framework requirements. <br> <br>ICD\tInterface Control Document. A further breakdown of the PDS (see row above), showing how RI components relate with overall component specifications as documented in the SWDS.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NRO // DI2E Framework PMO", "releaseDate" : 1390028400000, "version" : "1.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200710000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "DOC", "codeDescription" : "Documentation", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "Reference" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/DI2E Framework RA.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DI2E+Framework+Reference+Architecture+files' title='https://confluence.di2e.net/display/DI2E/DI2E+Framework+Reference+Architecture+files' target='_blank'> https://confluence.di2e.net/display/DI2E/DI2E+Framework+Reference+Architecture+files</a>" }, { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://inteldocs.intelink.gov/inteldocs/page/repository#filter=path|/Group%20Folders/D/DI2E%20Framework/DI2E%20Framework%20Architecture&page=1' title='https://inteldocs.intelink.gov/inteldocs/page/repository#filter=path|/Group%20Folders/D/DI2E%20Framework/DI2E%20Framework%20Architecture&page=1' target='_blank'> https://inteldocs.intelink.gov/inteldocs/page/repository#filter=path|/Group%20Folders/D/DI2E%20Framework/DI2E%20Framework%20Architecture&page=1</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DI2E+Framework+Reference+Architecture+files' title='https://confluence.di2e.net/display/DI2E/DI2E+Framework+Reference+Architecture+files' target='_blank'> https://confluence.di2e.net/display/DI2E/DI2E+Framework+Reference+Architecture+files</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DI2E+Reference+Architecture' title='https://confluence.di2e.net/display/DI2E/DI2E+Reference+Architecture' target='_blank'> https://confluence.di2e.net/display/DI2E/DI2E+Reference+Architecture</a>" } ], "reviews" : [ { "username" : "Jack TEST", "userType" : "End User", "comment" : "This wasn't quite what I thought it was.", "rating" : 2, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 6 Months", "lastUsed" : 1328379330000, "updateDate" : 1391537730000, "organization" : "Private Company", "recommend" : false, "pros" : [ { "text" : "Well Tested" }, { "text" : "Compact" } ], "cons" : [ ] }, { "username" : "Colby TEST", "userType" : "Developer", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 4, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1388769330000, "updateDate" : 1391447730000, "organization" : "NSA", "recommend" : true, "pros" : [ ], "cons" : [ ] }, { "username" : "Cathy TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 2, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1388769330000, "updateDate" : 1393834530000, "organization" : "NSA", "recommend" : false, "pros" : [ ], "cons" : [ ] } ], "dependencies" : [ { "dependency" : "Erlang", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 3.0" } ] }, { "componentId" : 31, "guid" : "2f8ca98a-a935-4ebf-8504-82756b8ef81b", "name" : "DI2E RESTful CDR Search Technical Profile", "description" : "This profile provides the technical design description for the RESTful Search web service of Defense Intelligence Information Enterprise (DI2E). The profile includes capability architecture design details, implementation requirements and additional implementation guidance. DI2E Enterprise service providers and clients will use this design to support enterprise standards while creating search services within their nodes. <br> <br>This document extends the IC/DoD REST interface encoding specification for Content Discovery and Retrieval (CDR) Search [CDR-RS] . It defines an interface to which a search service implementation and a subsequent deployment must conform. <br> <br>The search service provides the ability to search for contents within the DI2E Enterprise with two primary functions: search and results paging. Analysts require the flexibility to search data stores in a myriad of combinations. For example, a user may perform a search for records with the keyword 'Paris' occurring between January 16, 2009 and January 21, 2009; a user may perform a search for records with the keyword 'airport' and a geo location. The previous examples highlight the three different types of queries that MUST be supported by a search service implementation: <br>- Keyword query with results containing the specified keyword or keyword combination <br>- Temporal query with results within the specified temporal range <br>- Geographic query with results within the specified geographic area <br> <br>The search service provides a standard interface for discovering information and returns a 'hit list' of items. A search service's results are generally resource discovery metadata rather than actual content resources. In the context of search, resource discovery metadata generally refers to a subset of a resource's available metadata, not the entire underlying record. Some of the information contained within each search result may provide the information necessary for a client to retrieve or otherwise use the referenced resource. Retrieval of the product resources associated with each entry in the 'hit list' is discussed in the DI2E RESTful Retrieve profile. <br> <br>Content of DI2E RESTful CDR Search Profile: <br> - Technical Design Document (TDD) <br> - Service Specification Package (SSP) for each service - Not applicable. Since this CDP only contains one service, contents of SSP are rolled into the TDD. <br> - Conformance Test Kit (CTK) <br> - Conformance Traceability Matrix <br> - Test Procedure Document <br> - Test Request Messages <br> - Gold Data Set <br> - Conformance Checks Scripts", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1392966000000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485073000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "Visualization" }, { "text" : "Access" } ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/zankYmq' title='https://www.intelink.gov/go/zankYmq' target='_blank'> https://www.intelink.gov/go/zankYmq</a>" } ], "reviews" : [ ], "dependencies" : [ { "dependency" : "Windows", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 8.1" } ] }, { "componentId" : 32, "guid" : "e299a3aa-585f-4bad-a4f1-009397b97b93", "name" : "Distributed Data Framework (DDF)", "description" : "DDF is a free and open source common data layer that abstracts services and business logic from the underlying data structures to enable rapid integration of new data sources.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1394002800000, "version" : "See Site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405694884000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "LICTYPE", "typeDescription" : "License Type", "code" : "OPENSRC", "codeDescription" : "Open Source", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "FOSS", "codeDescription" : "FOSS", "important" : false } ], "tags" : [ { "text" : "UDOP" } ], "metadata" : [ { "label" : "Extra Metadata (SAMPLE)", "value" : "Unfiltered" }, { "label" : "Provides Web Hooks via RPC service(SAMPLE)", "value" : "Yes" } ], "componentMedia" : [ { "link" : "images/oldsite/ddf-screenshot-lg.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/ddf-logo.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://tools.codice.org/wiki/display/DDF/DDF+Catalog+Application+Users+Guide' title='https://tools.codice.org/wiki/display/DDF/DDF+Catalog+Application+Users+Guide' target='_blank'> https://tools.codice.org/wiki/display/DDF/DDF+Catalog+Application+Users+Guide</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='http://ddf.codice.org' title='http://ddf.codice.org' target='_blank'> http://ddf.codice.org</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='http://ddf.codice.org' title='http://ddf.codice.org' target='_blank'> http://ddf.codice.org</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://github.com/codice/ddf' title='https://github.com/codice/ddf' target='_blank'> https://github.com/codice/ddf</a>" } ], "reviews" : [ { "username" : "Jack TEST", "userType" : "Developer", "comment" : "This wasn't quite what I thought it was.", "rating" : 2, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1362298530000, "updateDate" : 1399961730000, "organization" : "NGA", "recommend" : false, "pros" : [ ], "cons" : [ ] }, { "username" : "Colby TEST", "userType" : "Developer", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 5, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1367309730000, "updateDate" : 1393834530000, "organization" : "NGA", "recommend" : true, "pros" : [ { "text" : "Compact" } ], "cons" : [ { "text" : "Poor Documentation" }, { "text" : "Bulky" } ] } ], "dependencies" : [ ] }, { "componentId" : 57, "guid" : "79e51469-81b6-4cfb-b6b2-7b0be8065912", "name" : "Domain Name System (DNS) Guidebook for Linux/BIND", "description" : "This Guidebook focuses on those involved with the Domain Name System (DNS) in DI2E systems. Those building systems based on DI2E-offered components, running in a DI2E Framework. It provides guidance for two different roles - those who configure DNS, and those who rely on DNS in the development of distributed systems. <br> <br>The DNS service in both DI2E and the Distributed Common Ground/Surface System Enterprise (DCGS Enterprise) relies on the Berkeley Internet Name Domain software, commonly referred to as BIND. Requirements and policy guidance for DNS are provided in the \"Distributed Common Ground/Surface System Enterprise (DCGS Enterprise), Service Dial Tone Technical Design Document Domain Name System, Version 1.1 (Final) Jun 2012\" . This guidebook supplements the technical profile and describes how DNS capabilities must be acquired, built and deployed by DI2E programs.", "parentComponent" : null, "subComponents" : [ { "componentId" : 67, "name" : "Central Authentication Service (CAS)" } ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1396677600000, "version" : "2.1.1", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200713000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "DOC", "codeDescription" : "Documentation", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://storefront.di2e.net/marketplace/public/DNS_Guidebook_for' title='https://storefront.di2e.net/marketplace/public/DNS_Guidebook_for' target='_blank'> https://storefront.di2e.net/marketplace/public/DNS_Guidebook_for</a> Linux-BIND V2.1.1.doc" } ], "reviews" : [ { "username" : "Colby TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 5, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "> 3 years", "lastUsed" : 1367309730000, "updateDate" : 1391447730000, "organization" : "NGA", "recommend" : true, "pros" : [ ], "cons" : [ ] }, { "username" : "Abby TEST", "userType" : "End User", "comment" : "This wasn't quite what I thought it was.", "rating" : 5, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1362298530000, "updateDate" : 1391537730000, "organization" : "NSA", "recommend" : false, "pros" : [ { "text" : "Active Development" }, { "text" : "Well Tested" } ], "cons" : [ { "text" : "Legacy system" } ] }, { "username" : "Jack TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 1, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1388769330000, "updateDate" : 1393834530000, "organization" : "NSA", "recommend" : false, "pros" : [ { "text" : "Open Source" }, { "text" : "Well Tested" } ], "cons" : [ { "text" : "Poor Documentation" } ] } ], "dependencies" : [ { "dependency" : "Linux", "version" : null, "dependencyReferenceLink" : null, "comment" : "Tested on CentOS 5 and Ubuntu Server 11.0" } ] }, { "componentId" : 33, "guid" : "ef0eaf61-05e2-405e-934a-7c377cc61269", "name" : "eDIB", "description" : "(U) eDIB contains the eDIB 4.0 services (management VM and worker VM). eDIB 4.0 is a scalable, virtualized webservice architecture based on the DMO's DIB 4.0. eDIB provides GUIs for an administrator to manage/configure eDIB. An end-user interface is not provided. Different data stores are supported including Oracle and SOLR. <br> <br>(U) The eDIB provides an easily managed and scalable DIB deployment. The administration console allows for additional worker VMs to scale up to support additional ingest activities or additional query activities. This provides the ability to manage a dynamic workload with a minimum of resources. <br> <br>(U) The software and documentation are currently available on JWICS at GForge, or you can email the DI2E Framework team for access on unclass.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E Framework", "releaseDate" : 1355036400000, "version" : "4.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1405102845000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "Reference" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/eDibIcon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 34, "guid" : "b52b36b8-b556-4d24-a9fe-2597402c32f7", "name" : "Extensible Mapping Platform (EMP)", "description" : "The Extensible Mapping Platform (EMP) is a US Government Open Source project providing a framework for building robust OWF map widgets and map centric web applications. The EMP project is currently managed by US Army Tactical Mission Command (TMC) in partnership with DI2E, and developed by CECOM Software Engineering Center Tactical Solutions Directorate (SEC) . EMP is intended to be used and contributed to by any US Government organization that falls within the ITAR restrictions placed on the software hosted at this location. Current contributors include National Geospatial-Intelligence Agency (NGA), and ICITE-Cloud INSCOM/DCGS-A with growing interest across the defense and Intelligence communities. EMP evolved from the US Army Command Post Computing Environment (CPCE) initiative. The term CPCE is still used in many areas and there is a CPCE targeted build that is produced from EMP to meet the CPCE map widget and API requirements. The great news about EMP is that it is not limited to the CPCE specific build and feature set. EMP is designed to be customized and extended to meet the needs and schedule of any organization. <br> <br>Map Core: <br>The map core is pure HTML, CSS, and JavaScript that can be embedded in any web application. The primary target for this currently is an Ozone Widget Framework (OWF) map widget, however the core code will function outside of OWF and can be used in custom web applications. When running in OWF the map core can handle all CMWA 1.0 and 1.1 messages as well as the capabilities included in the EMP JavaScript API library. <br> <br>Additional Links <br> <a href='http://cmapi.org/' title='http://cmapi.org/' target='_blank'> </a> <br> <a href='https://project.forge.mil/sf/frs/do/viewRelease/projects.dcgsaozone/frs.cpce_mapping_components.sprint_18_cpce_infrastructure_er' title='https://project.forge.mil/sf/frs/do/viewRelease/projects.dcgsaozone/frs.cpce_mapping_components.sprint_18_cpce_infrastructure_er' target='_blank'> frs.cpce_mapping_components.spri...</a> ", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1393830000000, "version" : "See site for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200714000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : 1388769330000, "endDate" : 1393694130000, "currentLevelCode" : "LEVEL1", "reviewedVersion" : "1.0", "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : null, "actualCompletionDate" : 1392138930000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ { "name" : "Discoverable", "score" : 3 }, { "name" : "Accessible", "score" : 4 }, { "name" : "Documentation", "score" : 3 }, { "name" : "Deployable", "score" : 4 }, { "name" : "Usable", "score" : 5 }, { "name" : "Error Handling", "score" : 2 }, { "name" : "Integrable", "score" : 1 }, { "name" : "I/O Validation", "score" : 2 }, { "name" : "Testing", "score" : 3 }, { "name" : "Monitoring", "score" : 2 }, { "name" : "Performance", "score" : 0 }, { "name" : "Scalability", "score" : 1 }, { "name" : "Security", "score" : 4 }, { "name" : "Maintainability", "score" : 3 }, { "name" : "Community", "score" : 3 }, { "name" : "Change Management", "score" : 2 }, { "name" : "CA", "score" : 0 }, { "name" : "Licensing", "score" : 4 }, { "name" : "Roadmap", "score" : 0 }, { "name" : "Willingness", "score" : 5 }, { "name" : "Architecture Alignment", "score" : 5 } ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "WIDGET", "codeDescription" : "Widget", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL1", "codeDescription" : "Level 1 - Initial Reuse Analysis", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "DEV", "codeDescription" : "Development", "important" : false }, { "type" : "OWFCOMP", "typeDescription" : "OWF Compatible", "code" : "Y", "codeDescription" : "Yes", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "GOSS", "codeDescription" : "GOSS", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/core-map-api.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/EMP/repos/map-docs/browse' title='https://stash.di2e.net/projects/EMP/repos/map-docs/browse' target='_blank'> https://stash.di2e.net/projects/EMP/repos/map-docs/browse</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/EMP' title='https://stash.di2e.net/projects/EMP' target='_blank'> https://stash.di2e.net/projects/EMP</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/EMP' title='https://stash.di2e.net/projects/EMP' target='_blank'> https://stash.di2e.net/projects/EMP</a>" }, { "name" : "DI2E Framework Evaluation Report URL", "type" : "DI2E Framework Evaluation Report URL", "description" : null, "link" : "<a href='https://storefront.di2e.net/marketplace/public/Extensible_Mapping_Platform_Evaluation_Report.docx' title='https://storefront.di2e.net/marketplace/public/Extensible_Mapping_Platform_Evaluation_Report.docx' target='_blank'> https://storefront.di2e.net/marketplace/public/Extensible_Mapping_Platform_Evaluation_Report.docx</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/EMP/Extensible+Mapping+Platform+Home' title='https://confluence.di2e.net/display/EMP/Extensible+Mapping+Platform+Home' target='_blank'> https://confluence.di2e.net/display/EMP/Extensible+Mapping+Platform+Home</a>" } ], "reviews" : [ { "username" : "Abby TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. Its quite configurable without a lot of setup and it worked out of the box.", "rating" : 4, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "> 3 years", "lastUsed" : 1328379330000, "updateDate" : 1391537730000, "organization" : "DCGS Navy", "recommend" : true, "pros" : [ { "text": "Reliable" }, { "text": "Compact" }, { "text": "Well Tested" } ], "cons" : [ ] }, { "username" : "Colby TEST", "userType" : "Developer", "comment" : "This is a great product however, it's missing what I think are critical features. Hopefully, they are working on it for future updates.", "rating" : 2.5, "title" : "Great but missing features (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1328379330000, "updateDate" : 1391447730000, "organization" : "DCGS Navy", "recommend" : false, "pros" : [ { "text" : "Well Tested" } ], "cons" : [ { "text" : "Difficult Installation" }, { "text" : "Security Concerns" } ] } ], "dependencies" : [ ] }, { "componentId" : 73, "guid" : "9d61a682-3b5f-4756-96cd-41df323fb371", "name" : "GAPS - Data Catalog Service", "description" : "The GAPS Data Catalog Service provides a set of RESTful services to manage data sources accessible to GAPS applications. The catalog service offers RESTful interfaces for querying sources as XML or JSON structures. The service is a combination of two web services; the root service, and the metric service. This root service allows users to add, remove and update metadata about information sources. The metrics service offers the ability to capture and view metrics information associated with information sources. <br> <br> <br> <br>The Data Catalog Service provides integration with the GAPS KML Feeds to expose all of the KML sources that are registered with GAPS. Documentation states it provides the ability to integrate with OGC CSW catalog services to provide search capabilities that federate across one or more CSW catalogs. The services are also available via a number of OWF widgets that implement the Data Catalog Service API. <br> <br>Root Service <br>SIPR: <a href='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datacatalogservice.ashx' title='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datacatalogservice.ashx' target='_blank'> datacatalogservice.ashx</a> <br>JWICS: <a href='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datacatalogservice.ashx' title='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datacatalogservice.ashx' target='_blank'> datacatalogservice.ashx</a> <br> <br>Metrics Service <br>SIPR: <a href='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datasourcemetrics.ashx' title='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datasourcemetrics.ashx' target='_blank'> datasourcemetrics.ashx</a> <br>JWICS: <a href='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datasourcemetrics.ashx' title='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datasourcemetrics.ashx' target='_blank'> datasourcemetrics.ashx</a> <br> <br>Overview <br>Global Awareness Presentation Services (GAPS) is a web-based command-wide service created to provide analysts and other decision makers the capability to generate Net-Centric Situational Awareness (SA) visualization products from disparate and dispersed data services. GAPS is interoperable with ongoing Department of Defense (DoD) wide C4ISR infrastructure efforts such as FSR and SKIWEB. GAPS attempts to share this data/information of an event in a real-time basis on SIPRNET and JWICS. GAPS allows users at all organizational levels to define, customize, and refine their specific User Defined Operational Picture (UDOP) based on mission and task. GAPS middleware capabilities serve as the \"facilitator\" of authoritative data source information by hosting over 3,000 dynamic and static data feeds and provides metrics and status on those feeds. GAPS provides several Ozone Widget Framework (OWF) based components that offer UDOP service functionality inside of an OWF dashboard. <br> <br>GAPS exposes a number of core UDOP Services through SOAP/RESTful services. <br>-GAPS Gazetteer Services <br>-GAPS Data Catalog Services <br>-GAPS Scenario Services", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "STRATCOM J8", "releaseDate" : null, "version" : "2.5", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "david.treat", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405691893000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Are samples included? (SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "answeredDate" : 1399961730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "createDts" : 1328379330000, "updateDts" : 1328379330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1399961730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Cathy TEST", "userType" : "End User", "answeredDate" : 1391537730000 } ] }, { "question" : "Does this support the 2.0 specs? (SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "No, they planned to add support next Version(SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "answeredDate" : 1391447730000 }, { "response" : "Update: they backport support to version 1.6(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1391447730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ { "label" : "Available to public (SAMPLE)", "value" : "YES" }, { "label" : "Extra Metadata (SAMPLE)", "value" : "Unfiltered" } ], "componentMedia" : [ { "link" : "images/oldsite/GAPS.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "Project Manager", "comment" : "I had issues trying to obtain the component and once I got it is very to difficult to install.", "rating" : 2, "title" : "Hassle (SAMPLE)", "usedTimeCode" : "< 6 Months", "lastUsed" : 1381644930000, "updateDate" : 1393834530000, "organization" : "DCGS Navy", "recommend" : true, "pros" : [ { "text" : "Well Tested" } ], "cons" : [ ] }, { "username" : "Jack TEST", "userType" : "End User", "comment" : "This wasn't quite what I thought it was.", "rating" : 4, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 6 Months", "lastUsed" : 1381644930000, "updateDate" : 1391447730000, "organization" : "NGA", "recommend" : true, "pros" : [ { "text" : "Well Tested" }, { "text" : "Reliable" } ], "cons" : [ ] } ], "dependencies" : [ ] }, { "componentId" : 74, "guid" : "2e7cb2fb-8672-4d8f-9f68-b2243b523a2f", "name" : "GAPS - Gazetteer Service", "description" : "The GAPS Gazetteer Service offers a set of geographical dictionary services that allows users to search for city and military bases, retrieving accurate latitude and longitude values for those locations. The user may search based on name or location, with the gazetteer returning all entries that match the provided name or spatial area. The GAPS Gazetteer Service imports gazetteer services from other data sources including NGA, USGS, DAFIF, and DISDI. <br> <br>Current Service End-Points <br>SIPR: <br> <a href='https://gapsprod1.stratcom.smil.mil/gazetteers/NgaGnsGazetteerService.asmx' title='https://gapsprod1.stratcom.smil.mil/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a> (NGA Gazetteer) <br> <a href='https://gapsprod1.stratcom.smil.mil/gazetteers/UsgsGnisGazetteerService.asmx' title='https://gapsprod1.stratcom.smil.mil/gazetteers/UsgsGnisGazetteerService.asmx' target='_blank'> UsgsGnisGazetteerService.asmx</a> (USGS Gazetteer) <br> <br>JWICS: <br> <a href='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' title='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' target='_blank'> NgaGnsGazetteerService.asmx</a> (USGS Gazetteer) <br> <a href='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' title='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' target='_blank'> NgaGnsGazetteerService.asmx</a> (USGS Gazetteer) <br> <br>Overview <br>Global Awareness Presentation Services (GAPS) is a web-based command-wide service created to provide analysts and other decision makers the capability to generate Net-Centric Situational Awareness (SA) visualization products from disparate and dispersed data services. GAPS is interoperable with ongoing Department of Defense (DoD) wide C4ISR infrastructure efforts such as FSR and SKIWEB. GAPS attempts to share this data/information of an event in a real-time basis on SIPRNET and JWICS. GAPS allows users at all organizational levels to define, customize, and refine their specific User Defined Operational Picture (UDOP) based on mission and task. GAPS middleware capabilities serve as the \"facilitator\" of authoritative data source information by hosting over 3,000 dynamic and static data feeds and provides metrics and status on those feeds. GAPS provides several Ozone Widget Framework (OWF) based components that offer UDOP service functionality inside of an OWF dashboard. <br> <br>GAPS exposes a number of core UDOP Services through SOAP/RESTful services. <br>-GAPS Gazetteer Services <br>-GAPS Data Catalog Services <br>-GAPS Scenario Services", "parentComponent" : { "componentId" : 9, "name" : "CLAVIN" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "STRATCOM J8", "releaseDate" : null, "version" : "2.5", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "david.treat", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405691776000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ { "text" : "Reference" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/GAPS.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 72, "guid" : "6fcf0dc4-091d-4431-a066-d074b4fd63ea", "name" : "GAPS - Scenario Service", "description" : "The GAPS Scenario Service is a SOAP based interface into the GAPS UDOP creation, execution and publishing mechanism. The Scenario Service allows an external entity to perform Machine to Machine (M2M) calls in order to create and execute UDOPs. This interface can be used to integrate with other systems in order to provide geospatial visualization to give contextual SA to end users. <br> <br>GAPS Scenarios are defined as data packages which are stored within the GAPS Repository. The GAPS Repository Service is a SOAP based interface into the GAPS Repository which stores and maintains UDOP scenarios and geospatial products from GAPS data sources. The Repository Service additionally creates a series of DDMS metacards to describe all of the UDOPs and artifacts stored within the GAPS Repository. These metacards can be further published to other metadata catalogs to facilitate discovery of GAPS UDOPs and aggregated data products. <br> <br>A Scenario consists of a UDOP template document, products generated from a UDOP template and metadata gathered from data sources during the execution of a UDOP template. For example, a SKIWeb scenario would consist of a UDOP template that captures information about an event (location, time, description) and other data overlays to give it a spatio-temporal context, JPEG screenshots taken automatically at different view scales for the event on a globe, a movie file with animation for temporal data, a VDF file, a KML file to execute the UDOP in Google Earth, a timeline view and all of the metadata captured during the UDOP execution. <br> <br>The following are the Service Endpoints on SIPR and JWICS. GAPS does not have an UNCLASS instance: <br>SIPR: <br> scenario service: <a href='https://gapsprod1.stratcom.smil.mil/ScenarioService/ScenarioService.asmx' title='https://gapsprod1.stratcom.smil.mil/ScenarioService/ScenarioService.asmx' target='_blank'> ScenarioService.asmx</a> <br> repository service: <a href='https://gapsprod1.stratcom.smil.mil/VsaPortal/RespositoryService.asmx' title='https://gapsprod1.stratcom.smil.mil/VsaPortal/RespositoryService.asmx' target='_blank'> RespositoryService.asmx</a> <br>JWICS: <br> scenario service: <a href='http://jwicsgaps.usstratcom.ic.gov:8000/ScenarioService/ScenarioService.asmx' title='http://jwicsgaps.usstratcom.ic.gov:8000/ScenarioService/ScenarioService.asmx' target='_blank'> ScenarioService.asmx</a> <br> repository service: <a href='http://jwicsgaps.usstratcom.ic.gov:8000/VsaPortal/RepositoryService.asmx' title='http://jwicsgaps.usstratcom.ic.gov:8000/VsaPortal/RepositoryService.asmx' target='_blank'> RepositoryService.asmx</a> <br> <br>GAPS Overview <br>Global Awareness Presentation Services (GAPS) is a web-based command-wide service created to provide analysts and other decision makers the capability to generate Net-Centric Situational Awareness (SA) visualization products from disparate and dispersed data services. GAPS is interoperable with ongoing Department of Defense (DoD) wide C4ISR infrastructure efforts such as FSR and SKIWEB. GAPS attempts to share this data/information of an event in a real-time basis on SIPRNET and JWICS. GAPS allows users at all organizational levels to define, customize, and refine their specific User Defined Operational Picture (UDOP) based on mission and task. GAPS middleware capabilities serve as the \"facilitator\" of authoritative data source information by hosting over 3,000 dynamic and static data feeds and provides metrics and status on those feeds. GAPS provides several Ozone Widget Framework (OWF) based components that offer UDOP service functionality inside of an OWF dashboard. <br> <br>GAPS exposes a number of core UDOP Services through SOAP/RESTful services. <br>-GAPS Gazetteer Services <br>-GAPS Data Catalog Services <br>-GAPS Scenario Services", "parentComponent" : { "componentId" : 17, "name" : "DCGS Enterprise Messaging Technical Profile" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "STRATCOM J8", "releaseDate" : null, "version" : "2.5", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "david.treat", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405691317000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ { "text" : "Charting" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/GAPS.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 35, "guid" : "871e8252-1a22-4677-9a3d-fdd647d5d500", "name" : "GVS", "description" : "The National Geospatial-Intelligence Agency's (NGA) GEOINT Visualization Services is a suite of web-based capabilities that delivers geospatial visualization services to the Department of Defense (DoD) and Intelligence Community (IC) via classified and unclassified computer networks to provide visualization and data access services to the war fighter, intelligence officer, and the policy-maker. More information can be found on <br>Intelink-U: Wiki: <a href='https://www.intelink.gov/wiki/GVS' title='https://www.intelink.gov/wiki/GVS' target='_blank'> GVS</a> <br>Blog: <a href='https://www.intelink.gov/blogs/geoweb/' title='https://www.intelink.gov/blogs/geoweb/' target='_blank'> </a> Forge.mil <br>Dashboard GVS: <a href='https://community.forge.mil/content/geoint-visualization-services-gvs-program' title='https://community.forge.mil/content/geoint-visualization-services-gvs-program' target='_blank'> geoint-visualization-services-gv...</a> <br>Forge.mil Dashboard GVS/PalX3: <a href='https://community.forge.mil/content/geoint-visualization-services-gvs-palanterrax3' title='https://community.forge.mil/content/geoint-visualization-services-gvs-palanterrax3' target='_blank'> geoint-visualization-services-gv...</a>", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1361084400000, "version" : "1", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "chris.bashioum", "updateDts" : 1405612927000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/800px-GVS-4ShotMerge.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null }, { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/docman/do/listDocuments/projects.gvs' title='https://software.forge.mil/sf/docman/do/listDocuments/projects.gvs' target='_blank'> https://software.forge.mil/sf/docman/do/listDocuments/projects.gvs</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/Gvs' title='https://intellipedia.intelink.gov/wiki/Gvs' target='_blank'> https://intellipedia.intelink.gov/wiki/Gvs</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/Gvs' title='https://intellipedia.intelink.gov/wiki/Gvs' target='_blank'> https://intellipedia.intelink.gov/wiki/Gvs</a>" } ], "reviews" : [ ], "dependencies" : [ { "dependency" : "Tomcat", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 7 or 8" } ] }, { "componentId" : 58, "guid" : "cd86387e-08ae-4efe-b783-e8fddeb87021", "name" : "GVS - Base Maps - ESRi", "description" : "World Imagery Basemap is a global service that presents imagery from NGA holdings for Cache Scales from 1:147M - 1:282. This imagery includes various sources and resolutions spanning 15m to 75mm. The imagery sources are Buckeye, US/CAN/MX Border Imagery, Commercial Imagery, USGS High Resolution Orthos, Rampant Lion II, NAIP, CIB, Natural Vue data. Bathymetry data includes NOAA Coastal Relief Model and NGA DBED. This product undergoes bimonthly updates. <br> <br>GVS Overview: GVS has several core categories for developers of Geospatial products. These categories are reflected in the evaluation structure and content itself. <br>* Base Maps - Google Globe Google Maps, ArcGIS <br>* Features - MIDB, Intelink, CIDNE SIGACTS, GE shared products, WARP, NES <br>* Imagery - Commercial, WARP, NES <br>* Overlays - Streets, transportation, boundaries <br>* Discovery/Search - GeoQuery, Proximity Query, Google Earth, Globe Catalog, MapProxy, OMAR WCS <br>* Converters - GeoRSS to XML, XLS to KML, Shapefile to KML, KML to Shapefile, Coordinates <br>* Analytic Tools - Viewshed, Best Road Route <br>* Drawing Tools - Ellipse Generator, KML Styles, Custom Icons, Custom Placemarks, Mil Std 2525 Symbols <br>* Other - RSS Viewer, Network Link Generator, KML Report Creator", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1401861600000, "version" : "See site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200715000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/documentation' title='https://home.gvs.nga.mil/home/documentation' target='_blank'> https://home.gvs.nga.mil/home/documentation</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> https://intellipedia.intelink.gov/wiki/GVS</a>" } ], "reviews" : [ { "username" : "Jack TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 5, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1367309730000, "updateDate" : 1399961730000, "organization" : "NSA", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Bulky" }, { "text" : "Difficult Installation" } ] } ], "dependencies" : [ ] }, { "componentId" : 59, "guid" : "d10e748d-a555-4661-aec9-f192e2f131cc", "name" : "GVS - Base Maps - Google Globe - Summary Information", "description" : "GVS Google Earth Globe Services are constructed from DTED, CIB, Natural View, and Commercial Imagery. Vector data includes NGA standards such as VMAP, GeoNames, and GNIS. GVS recently added NavTeq Streets and Homeland Security Infrastructure data to the Google Globe over the United States. The Globes are continuously improved. <br> <br>The GVS Google Globe Imagery can also be accessed using a WMS/WMTS client at the following URLs: <br>*WMS - <a href='https://earth.gvs.nga.mil/wms/fusion_maps_wms.cgi' title='https://earth.gvs.nga.mil/wms/fusion_maps_wms.cgi' target='_blank'> fusion_maps_wms.cgi</a> <br>*WMS - AF/PK - <a href='https://earth.gvs.nga.mil/wms/afpk_map/fusion_maps_wms.cgi' title='https://earth.gvs.nga.mil/wms/afpk_map/fusion_maps_wms.cgi' target='_blank'> fusion_maps_wms.cgi</a> <br>*WMS - Natural View - <a href='https://earth.gvs.nga.mil/wms/nvue_map/fusion_maps_wms.cgi' title='https://earth.gvs.nga.mil/wms/nvue_map/fusion_maps_wms.cgi' target='_blank'> fusion_maps_wms.cgi</a> <br>*WMTS - <a href='https://earth.gvs.nga.mil/cgi-bin/ogc/service.py' title='https://earth.gvs.nga.mil/cgi-bin/ogc/service.py' target='_blank'> service.py</a> <br>*WMTS OpenLayers Example <br> <br>GVS Overview: GVS has several core categories for developers of Geospatial products. These categories are reflected in the evaluation structure and content itself. <br>* Base Maps - Google Globe Google Maps, ArcGIS <br>* Features - MIDB, Intelink, CIDNE SIGACTS, GE shared products, WARP, NES <br>* Imagery - Commercial, WARP, NES <br>* Overlays - Streets, transportation, boundaries <br>* Discovery/Search - GeoQuery, Proximity Query, Google Earth, Globe Catalog, MapProxy, OMAR WCS <br>* Converters - GeoRSS to XML, XLS to KML, Shapefile to KML, KML to Shapefile, Coordinates <br>* Analytic Tools - Viewshed, Best Road Route <br>* Drawing Tools - Ellipse Generator, KML Styles, Custom Icons, Custom Placemarks, Mil Std 2525 Symbols <br>* Other - RSS Viewer, Network Link Generator, KML Report Creator", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1401948000000, "version" : "See site for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200717000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/documentation' title='https://home.gvs.nga.mil/home/documentation' target='_blank'> https://home.gvs.nga.mil/home/documentation</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/google-earth' title='https://home.gvs.nga.mil/home/google-earth' target='_blank'> https://home.gvs.nga.mil/home/google-earth</a>" } ], "reviews" : [ { "username" : "Colby TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 4, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1328379330000, "updateDate" : 1398845730000, "organization" : "DCGS Army", "recommend" : true, "pros" : [ ], "cons" : [ ] } ], "dependencies" : [ ] }, { "componentId" : 60, "guid" : "134b6770-35f8-40fa-b11f-25e5c782d920", "name" : "GVS - Features - CIDNE SIGACTS", "description" : "The GVS CIDNE SIGACTS Data Layer provides a visualization-ready (KML 2.2 compliant formatted) result set for a query of SIGACTS, as obtained from the Combined Information Data Network Exchange (CIDNE) within a defined AOI (\"bounding box\", \"point/radius\", \"path buffer\"). <br> <br>To access the CIDNE SIGACTS Dynamic Data Layer use the base address: <br>SIPRNet: <a href='http://home.gvs.nga.smil.mil/CIDNE/SigactsServlet' title='http://home.gvs.nga.smil.mil/CIDNE/SigactsServlet' target='_blank'> SigactsServlet</a> <br>JWICs: <a href='http://home.gvs.nga.ic.gov/CIDNE/SigactsServlet' title='http://home.gvs.nga.ic.gov/CIDNE/SigactsServlet' target='_blank'> SigactsServlet</a> <br> <br>GVS Overview: GVS has several core categories for developers of Geospatial products. These categories are reflected in the evaluation structure and content itself. <br>* Base Maps - Google Globe Google Maps, ArcGIS <br>* Features - MIDB, Intelink, CIDNE SIGACTS, GE shared products, WARP, NES <br>* Imagery - Commercial, WARP, NES <br>* Overlays - Streets, transportation, boundaries <br>* Discovery/Search - GeoQuery, Proximity Query, Google Earth, Globe Catalog, MapProxy, OMAR WCS <br>* Converters - GeoRSS to XML, XLS to KML, Shapefile to KML, KML to Shapefile, Coordinates <br>* Analytic Tools - Viewshed, Best Road Route <br>* Drawing Tools - Ellipse Generator, KML Styles, Custom Icons, Custom Placemarks, Mil Std 2525 Symbols <br>* Other - RSS Viewer, Network Link Generator, KML Report Creator", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1401948000000, "version" : "See site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200718000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/documentation' title='https://home.gvs.nga.mil/home/documentation' target='_blank'> https://home.gvs.nga.mil/home/documentation</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/capabilities/queries/cidne_sigacts' title='https://home.gvs.nga.mil/home/capabilities/queries/cidne_sigacts' target='_blank'> https://home.gvs.nga.mil/home/capabilities/queries/cidne_sigacts</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> https://intellipedia.intelink.gov/wiki/GVS</a>" } ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 4, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1381644930000, "updateDate" : 1391537730000, "organization" : "NGA", "recommend" : true, "pros" : [ ], "cons" : [ ] } ], "dependencies" : [ ] }, { "componentId" : 61, "guid" : "f1fa43e1-b2bd-4636-bc86-0b050549c26f", "name" : "GVS - Features - GE Shared Products", "description" : "GVS Shared Product Query provides you with the ability to display geospatial information layers in a Google Earth client depicting data previously created and stored in the GVS Shared Product Buffer by other users. <br> <br>Home page: <a href='https://home.gvs.nga.mil/UPS/RSS' title='https://home.gvs.nga.mil/UPS/RSS' target='_blank'> RSS</a> for the manual query <a href='https://home.gvs.nga.mil/home/capabilities/queries/shared_products' title='https://home.gvs.nga.mil/home/capabilities/queries/shared_products' target='_blank'> shared_products</a> for the query tool <br>Wiki: A general GVS Wiki can be found here <a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> GVS</a> no specialized shared product wiki pages exist <br> <br>GVS Overview: GVS has several core categories for developers of Geospatial products. These categories are reflected in the evaluation structure and content itself. <br>* Base Maps - Google Globe Google Maps, ArcGIS <br>* Features - MIDB, Intelink, CIDNE SIGACTS, GE shared products, WARP, NES <br>* Imagery - Commercial, WARP, NES <br>* Overlays - Streets, transportation, boundaries <br>* Discovery/Search - GeoQuery, Proximity Query, Google Earth, Globe Catalog, MapProxy, OMAR WCS <br>* Converters - GeoRSS to XML, XLS to KML, Shapefile to KML, KML to Shapefile, Coordinates <br>* Analytic Tools - Viewshed, Best Road Route <br>* Drawing Tools - Ellipse Generator, KML Styles, Custom Icons, Custom Placemarks, Mil Std 2525 Symbols <br>* Other - RSS Viewer, Network Link Generator, KML Report Creator", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1401861600000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200719000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/documentation' title='https://home.gvs.nga.mil/home/documentation' target='_blank'> https://home.gvs.nga.mil/home/documentation</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/capabilities/queries/shared_products' title='https://home.gvs.nga.mil/home/capabilities/queries/shared_products' target='_blank'> https://home.gvs.nga.mil/home/capabilities/queries/shared_products</a> or <a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> https://intellipedia.intelink.gov/wiki/GVS</a>" } ], "reviews" : [ ], "dependencies" : [ { "dependency" : "Linux", "version" : null, "dependencyReferenceLink" : null, "comment" : "Tested on CentOS 5 and Ubuntu Server 11.0" } ] }, { "componentId" : 62, "guid" : "aa40dec7-efc9-4b4c-b29a-8eb51876e135", "name" : "GVS - Features - Intelink", "description" : "GVS - Features - Intelink: Provides the capability to perform a temporal keyword search for news items, Intellipedia data, and intelligence reporting and finished products found on Intelink. A list of geo-referenced locations in response to a query based on a filter. <br> <br>GVS INTELINK GEO SEARCH WFS INTERFACE (https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf) <br> <br>Interface Details: <br>* Access Protocol: HTTP WFS calls with URL-encoded parameters <br>* Base Address: <br>JWICS: <a href='http://home.gvs.nga.ic.gov/metacarta/wfs' title='http://home.gvs.nga.ic.gov/metacarta/wfs' target='_blank'> wfs</a> <br>SIPRNet: <a href='http://home.gvs.nga.smil.mil/metacarta/wfs' title='http://home.gvs.nga.smil.mil/metacarta/wfs' target='_blank'> wfs</a> <br> <br>GVS Overview: GVS has several core categories for developers of Geospatial products. These categories are reflected in the evaluation structure and content itself. <br>* Base Maps - Google Globe Google Maps, ArcGIS <br>* Features - MIDB, Intelink, CIDNE SIGACTS, GE shared products, WARP, NES <br>* Imagery - Commercial, WARP, NES <br>* Overlays - Streets, transportation, boundaries <br>* Discovery/Search - GeoQuery, Proximity Query, Google Earth, Globe Catalog, MapProxy, OMAR WCS <br>* Converters - GeoRSS to XML, XLS to KML, Shapefile to KML, KML to Shapefile, Coordinates <br>* Analytic Tools - Viewshed, Best Road Route <br>* Drawing Tools - Ellipse Generator, KML Styles, Custom Icons, Custom Placemarks, Mil Std 2525 Symbols <br>* Other - RSS Viewer, Network Link Generator, KML Report Creator", "parentComponent" : { "componentId" : 28, "name" : "DI2E Framework OpenAM" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1401861600000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200721000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/documentation' title='https://home.gvs.nga.mil/home/documentation' target='_blank'> https://home.gvs.nga.mil/home/documentation</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> https://intellipedia.intelink.gov/wiki/GVS</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 63, "guid" : "25dc2698-a99c-4f4e-b8c1-4e4734f0fbf5", "name" : "GVS - Features - MIDB", "description" : "GVS - Features - MIDB allows the user to query MIDB (Equipment) data within a defined AOI. User takes HTTP-Get parameters (Listed below the summary table and in the documentation) and builds a query. <br> <br>In the exposed Service Interfaces document MIDB services are covered in section 6.1 which is approximately page 73 in the current guide. <br> <br>Service URI <br>JWICS: <a href='http://home.gvs.nga.ic.gov/MIDB/wfs' title='http://home.gvs.nga.ic.gov/MIDB/wfs' target='_blank'> wfs</a> <br>SIPRNet: <a href='http://home.gvs.nga.smil.mil/MIDB/wfs' title='http://home.gvs.nga.smil.mil/MIDB/wfs' target='_blank'> wfs</a> <br> <br>GVS Documentation page <br>NIPRNet: <a href='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' title='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' target='_blank'> documentation</a> <br>SIPRNet: <a href='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' title='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' target='_blank'> documentation</a> <br>JWICs: <a href='https://home.gvs.nga.ic.gov/home/documentation' title='https://home.gvs.nga.ic.gov/home/documentation' target='_blank'> documentation</a> <br> <br>Exposed Service Interface Guide <br>NIPRNet: <a href='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> GVS_Exposed_Service_Interfaces.pdf</a> <br>SIPRNet: <a href='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> GVS_Exposed_Service_Interfaces.pdf</a> <br>JWICs: <a href='https://home.gvs.ic.gov/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.ic.gov/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> GVS_Exposed_Service_Interfaces.pdf</a> <br> <br>GVS Quick Reference Guide <br>NIPRNet: <a href='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' title='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' target='_blank'> GVS_Consolidated_QRG_Book_Reduce...</a> <br>SIPRNet: <a href='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' title='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' target='_blank'> GVS_Consolidated_QRG_Book_Reduce...</a> <br>JWICs: <a href='https://home.gvs.nga.ic.gov/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' title='https://home.gvs.nga.ic.gov/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' target='_blank'> GVS_Consolidated_QRG_Book_Reduce...</a> <br> <br> <br>GVS Overview: GVS has several core categories for developers of Geospatial products. These categories are reflected in the evaluation structure and content itself. <br>* Base Maps - Google Globe Google Maps, ArcGIS <br>* Features - MIDB, Intelink, CIDNE SIGACTS, GE shared products, WARP, NES <br>* Imagery - Commercial, WARP, NES <br>* Overlays - Streets, transportation, boundaries <br>* Discovery/Search - GeoQuery, Proximity Query, Google Earth, Globe Catalog, MapProxy, OMAR WCS <br>* Converters - GeoRSS to XML, XLS to KML, Shapefile to KML, KML to Shapefile, Coordinates <br>* Analytic Tools - Viewshed, Best Road Route <br>* Drawing Tools - Ellipse Generator, KML Styles, Custom Icons, Custom Placemarks, Mil Std 2525 Symbols <br>* Other - RSS Viewer, Network Link Generator, KML Report Creator", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1402120800000, "version" : "see site for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200722000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "answeredDate" : 1391447730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Project Manager", "answeredDate" : 1391447730000 } ] }, { "question" : "Are samples included? (SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1393834530000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ { "text" : "Access" }, { "text" : "Data Exchange" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/documentation' title='https://home.gvs.nga.mil/home/documentation' target='_blank'> https://home.gvs.nga.mil/home/documentation</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://software.forge.mil/sf/go/proj1769' title='https://software.forge.mil/sf/go/proj1769' target='_blank'> https://software.forge.mil/sf/go/proj1769</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> https://intellipedia.intelink.gov/wiki/GVS</a>" } ], "reviews" : [ { "username" : "Jack TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 3, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1381644930000, "updateDate" : 1391447730000, "organization" : "Private Company", "recommend" : false, "pros" : [ { "text" : "Well Tested" } ], "cons" : [ ] }, { "username" : "Dawson TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 1, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1362298530000, "updateDate" : 1391537730000, "organization" : "DCGS Army", "recommend" : true, "pros" : [ { "text" : "Compact" } ], "cons" : [ { "text" : "Security Concerns" } ] } ], "dependencies" : [ ] }, { "componentId" : 64, "guid" : "cfb2449d-86fe-4792-ada8-e5d965046026", "name" : "GVS - Features - NES", "description" : "GVS - Features - NES provides a visualization-ready (KML 2.2 compliant formatted) result set for a query of the targets obtained from the NGA National Exploitation System (NES), within a defined AOI (\"bounding box\", \"point/radius\", \"path buffer\").. Note, NES is only available on JWICS. <br> <br>Interface Details: <br>* Access Protocol: HTTP GET or POST with URL-encoded parameters <br>* Base Address: <br>JWICS: <a href='http://home.gvs.nga.ic.gov/NESQuery/CoverageQuery' title='http://home.gvs.nga.ic.gov/NESQuery/CoverageQuery' target='_blank'> CoverageQuery</a> <br> <br> <br>GVS Overview: GVS has several core categories for developers of Geospatial products. These categories are reflected in the evaluation structure and content itself. <br>* Base Maps - Google Globe Google Maps, ArcGIS <br>* Features - MIDB, Intelink, CIDNE SIGACTS, GE shared products, WARP, NES <br>* Imagery - Commercial, WARP, NES <br>* Overlays - Streets, transportation, boundaries <br>* Discovery/Search - GeoQuery, Proximity Query, Google Earth, Globe Catalog, MapProxy, OMAR WCS <br>* Converters - GeoRSS to XML, XLS to KML, Shapefile to KML, KML to Shapefile, Coordinates <br>* Analytic Tools - Viewshed, Best Road Route <br>* Drawing Tools - Ellipse Generator, KML Styles, Custom Icons, Custom Placemarks, Mil Std 2525 Symbols <br>* Other - RSS Viewer, Network Link Generator, KML Report Creator", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1402207200000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200723000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "answeredDate" : 1398845730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Cathy TEST", "userType" : "End User", "answeredDate" : 1399961730000 } ] }, { "question" : "Are samples included? (SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "createDts" : 1367309730000, "updateDts" : 1367309730000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1399961730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ { "text" : "Access" }, { "text" : "Charting" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/documentation' title='https://home.gvs.nga.mil/home/documentation' target='_blank'> https://home.gvs.nga.mil/home/documentation</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> https://intellipedia.intelink.gov/wiki/GVS</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 65, "guid" : "fe3041eb-1e40-4203-987b-e6622695f55b", "name" : "HardwareWall", "description" : "The Boeing eXMeritus HardwareWall* is a highly configurable, commercial-off-the-shelf cross domain solution that enables rapid, automated, and secure data transfer between security domains: <br> <br>eXMeritus has designed HardwareWall* as a secure data transfer system and an off-the-shelf Controlled Interface that meets and exceeds all mission and information assurance requirements for the world's highest-level security directives. Our systems have been deployed and certified in PL-3, PL-4 and PL-5 environments and continue to operate and evolve to meet ever changing requirements and threats. <br> <br>Links: <br> <a href='http://www.exmeritus.com/hardware_wall.html' title='http://www.exmeritus.com/hardware_wall.html' target='_blank'> hardware_wall.html</a> <br> <a href='http://www.boeing.com/advertising/c4isr/isr/exmeritus_harware_wall.html' title='http://www.boeing.com/advertising/c4isr/isr/exmeritus_harware_wall.html' target='_blank'> exmeritus_harware_wall.html</a> <br> <br>HardwareWall* Applications <br>*Files <br> **High to low or low to high <br> **Automated format and content review <br> **Digital signatures <br> **External utilities (e.g. virus scanning) <br> <br>*Streaming data <br> **High to low or low to high <br> **Automated format and content review <br> **Signed records or messages <br> <br>HardwareWall* Capacity <br> **Current installation moving large files at over 85MB/s <br> **Multiple methods to achieve multi-Gigabyte per second throughput: <br> **Scales by replication <br> **Scales by CPUs and interfaces <br> **Demonstrated ability to stripe across multiple Gigabit Ethernet fibers", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "Boeing", "releaseDate" : 1402812000000, "version" : "See Site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200725000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "Y", "codeDescription" : "Yes", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "COTS", "codeDescription" : "COTS", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/eXMeritus.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='http://www.exmeritus.com/hardware_wall.html' title='http://www.exmeritus.com/hardware_wall.html' target='_blank'> http://www.exmeritus.com/hardware_wall.html</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='http://www.exmeritus.com/hardware_wall.html' title='http://www.exmeritus.com/hardware_wall.html' target='_blank'> http://www.exmeritus.com/hardware_wall.html</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='http://www.exmeritus.com/hardware_wall.html' title='http://www.exmeritus.com/hardware_wall.html' target='_blank'> http://www.exmeritus.com/hardware_wall.html</a>" } ], "reviews" : [ { "username" : "Colby TEST", "userType" : "Project Manager", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 1, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1388769330000, "updateDate" : 1391537730000, "organization" : "DCGS Army", "recommend" : true, "pros" : [ { "text" : "Open Source" }, { "text" : "Reliable" } ], "cons" : [ { "text" : "Poor Documentation" } ] } ], "dependencies" : [ ] }, { "componentId" : 36, "guid" : "7268ddbc-ad59-4c8c-b205-96d81d4615e4", "name" : "IC AppsMall Cookbook: Applications Development", "description" : "The Applications Development Cookbook is designed as an overview of principles and best practices for Web Application Development, with a focus on new web and related technologies & concepts that take full advantage of modern browser capabilities. The ideas introduced in this document are not intended to be all inclusive, instead, they are met to expose the reader to concepts and examples that can be adapted and applied to a broad array of development projects and tangential tasks. The content is structured so that a reader with basic technical skills can garner a high-level understanding of the concepts. Where applicable, more detailed information has been included, or identified, to allow further examination of individual areas. <br> <br>This initial document is structured around four subject areas* JavaScript, User Experience (UX), HTML5, and Elastic Scalability. Each section provides a description, and then introduces key concepts[1]. <br> <br>JavaScript - this section provides a concise review of the main impediments developers with a few years of experience struggle with when using JavaScript. The resources section directs less experienced users to references that will teach them basic JavaScript. <br> <br>User Experience (UX) : this section provides a general overview of what UX is, as well as why and how it should, and can, be applied to application development projects. The content in this section has broad applicability, as it can inform decisions across a large spectrum* from aiding developers in designing more appealing applications to assisting managers in assuring they have marketable products. <br> <br>HTML5 : the HTML5 portion of the cookbook provides developers unfamiliar with the proposed standards of the newest iteration of Hypertext Markup Language an introduction to key concepts. The section includes simple exercises to demonstrate utility. <br> <br>Elastic Scalability : the Elastic Scalability section provides an introduction to architecture principles that can help ensure an infrastructure is capable of meeting a modern web browser's demands in accomplishing tasks traditionally held in the realm of the thick client.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "IC SOG", "releaseDate" : 1360047600000, "version" : "NA", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485077000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Are samples included? (SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "answeredDate" : 1391447730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Abby TEST", "userType" : "Developer", "createDts" : 1328379330000, "updateDts" : 1328379330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "answeredDate" : 1398845730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Cathy TEST", "userType" : "End User", "answeredDate" : 1393834530000 } ] }, { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "answeredDate" : 1393834530000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1398845730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "DOC", "codeDescription" : "Documentation", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/AppsMall_Cookbook:_Applications_Development' title='https://intellipedia.intelink.gov/wiki/AppsMall_Cookbook:_Applications_Development' target='_blank'> https://intellipedia.intelink.gov/wiki/AppsMall_Cookbook:_Applications_Development</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/AppsMall_Cookbook:_Applications_Development' title='https://intellipedia.intelink.gov/wiki/AppsMall_Cookbook:_Applications_Development' target='_blank'> https://intellipedia.intelink.gov/wiki/AppsMall_Cookbook:_Applications_Development</a>" } ], "reviews" : [ ], "dependencies" : [ { "dependency" : "Tomcat", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 7 or 8" } ] }, { "componentId" : 37, "guid" : "dcb2db8f-fc5d-4db2-8e1b-cd1459cb34be", "name" : "ISF Enterprise Data Viewer Widget", "description" : "A widget designed to display search results in a tabular format. It can page, sort, filter, and group results and organize items into working folders called \"Workspaces\" as well as perform full-record retrieval for supported result types. It depends on the Persistence Service to store and retrieve results and optionally uses the Map widget to visualize results geospatially. <br> <br>This was previously entered in the storefront as the Enterprise Search Results Widget.", "parentComponent" : { "componentId" : 28, "name" : "DI2E Framework OpenAM" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NRO/GED", "releaseDate" : 1348380000000, "version" : "See links for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485078000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Project Manager", "answeredDate" : 1393834530000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1399961730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "createDts" : 1367309730000, "updateDts" : 1367309730000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "answeredDate" : 1393834530000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "answeredDate" : 1391447730000 } ] }, { "question" : "Are samples included? (SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1398845730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "WIDGET", "codeDescription" : "Widget", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "OWFCOMP", "typeDescription" : "OWF Compatible", "code" : "Y", "codeDescription" : "Yes", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "GOTS", "codeDescription" : "GOTS", "important" : false } ], "tags" : [ ], "metadata" : [ { "label" : "Extra Metadata (SAMPLE)", "value" : "Unfiltered" }, { "label" : "Support Common Interface 2.1 (SAMPLE)", "value" : "No" }, { "label" : "Common Uses (SAMPLE)", "value" : "UDOP, Information Sharing, Research" } ], "componentMedia" : [ { "link" : "images/oldsite/grid.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/data-viewer/browse' title='https://stash.di2e.net/projects/ISF/repos/data-viewer/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/data-viewer/browse</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/data-viewer/browse' title='https://stash.di2e.net/projects/ISF/repos/data-viewer/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/data-viewer/browse</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/data-viewer/browse' title='https://stash.di2e.net/projects/ISF/repos/data-viewer/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/data-viewer/browse</a>" } ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "Developer", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 3, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 6 Months", "lastUsed" : 1367309730000, "updateDate" : 1391447730000, "organization" : "DCGS Army", "recommend" : true, "pros" : [ { "text" : "Active Development" } ], "cons" : [ { "text" : "Bulky" }, { "text" : "Legacy system" } ] }, { "username" : "Colby TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 5, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "> 3 years", "lastUsed" : 1328379330000, "updateDate" : 1393834530000, "organization" : "DCGS Army", "recommend" : false, "pros" : [ { "text" : "Well Tested" } ], "cons" : [ ] }, { "username" : "Jack TEST", "userType" : "Developer", "comment" : "I had issues trying to obtain the component and once I got it is very to difficult to install.", "rating" : 1, "title" : "Hassle (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1388769330000, "updateDate" : 1399961730000, "organization" : "Private Company", "recommend" : false, "pros" : [ { "text" : "Active Development" }, { "text" : "Open Source" } ], "cons" : [ ] } ], "dependencies" : [ ] }, { "componentId" : 38, "guid" : "247533a9-3109-4edd-a1a8-52fdc5bd516e", "name" : "ISF Persistence Service", "description" : "A RESTful service that persists JSON documents. It is designed to have a swappable backend and currently supports MongoDB and in-memory implementations.", "parentComponent" : null, "subComponents" : [ { "componentId" : 19, "name" : "DCGS Integration Backbone (DIB)" } ], "relatedComponents" : [ ], "organization" : "NRO/GED", "releaseDate" : 1329462000000, "version" : "See links for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485079000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "GOTS", "codeDescription" : "GOTS", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/Database-Icon.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/persistence-service/browse' title='https://stash.di2e.net/projects/ISF/repos/persistence-service/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/persistence-service/browse</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/persistence-service/browse' title='https://stash.di2e.net/projects/ISF/repos/persistence-service/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/persistence-service/browse</a>" } ], "reviews" : [ { "username" : "Abby TEST", "userType" : "End User", "comment" : "This wasn't quite what I thought it was.", "rating" : 1, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1367309730000, "updateDate" : 1393834530000, "organization" : "NSA", "recommend" : true, "pros" : [ { "text" : "Active Development" } ], "cons" : [ { "text" : "Poor Documentation" }, { "text" : "Difficult Installation" } ] }, { "username" : "Dawson TEST", "userType" : "End User", "comment" : "I had issues trying to obtain the component and once I got it is very to difficult to install.", "rating" : 5, "title" : "Hassle (SAMPLE)", "usedTimeCode" : "< 1 year", "lastUsed" : 1328379330000, "updateDate" : 1391537730000, "organization" : "DCGS Navy", "recommend" : false, "pros" : [ { "text" : "Open Source" } ], "cons" : [ { "text" : "Bulky" } ] } ], "dependencies" : [ ] }, { "componentId" : 39, "guid" : "e9433496-106f-48bc-9510-3e9a792f949a", "name" : "ISF Search Criteria Widget", "description" : "A widget dedicated to providing search criteria to a compatible CDR backend. It depends on the Persistence Service as a place to put retrieved metadata results. It also optionally depends on the Map widget to interactively define geospatial queries (a text-based option is also available) and to render results. A table of results is provided by the Data Viewer widget.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NRO/GED", "releaseDate" : 1348380000000, "version" : "See links for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485080000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "WIDGET", "codeDescription" : "Widget", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "OWFCOMP", "typeDescription" : "OWF Compatible", "code" : "Y", "codeDescription" : "Yes", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "GOTS", "codeDescription" : "GOTS", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/EntSearchWidget.PNG", "contentType" : "image/PNG", "caption" : null, "description" : null }, { "link" : "images/oldsite/EntSearchWidgetStatus.PNG", "contentType" : "image/PNG", "caption" : null, "description" : null }, { "link" : "images/oldsite/Search.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/search-criteria/browse' title='https://stash.di2e.net/projects/ISF/repos/search-criteria/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/search-criteria/browse</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/search-criteria/browse' title='https://stash.di2e.net/projects/ISF/repos/search-criteria/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/search-criteria/browse</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/search-criteria/browse' title='https://stash.di2e.net/projects/ISF/repos/search-criteria/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/search-criteria/browse</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 40, "guid" : "c1289f76-8704-41f4-8fa3-4b88c9cd0c3b", "name" : "iSpatial", "description" : "iSpatial is a commercially available geospatial framework designed as a set of ready-to-customize, baseline tools that can be rapidly adapted to meet use cases calling for geo-visualization. iSpatial consists of four major areas of core functionality: Authorizing, Searching, Managing and Collaborating. iSpatial's APIs and software libraries can be accessed by developers to customize off the existing framework. It is a front-end browser-based interface developed in JavaScript and ExtJS, a collection of REST services that connect the user interface to the back end, and a PostgreSQL/PostGIS and MongoDB back end. <br> <br> <br> <br>The iSpatial Core Services stack has four main components: the Message Queue (MQ), an Authentication Proxy Service (TAPS), Common Data Access Service (CDAS) , and Agent Manager (AM). <br> <br>iSpatial White Paper: <a href='http://www.t-sciences.com/wp-content/uploads/2013/04/iSpatial_v3_Technical_White_Paper.pdf' title='http://www.t-sciences.com/wp-content/uploads/2013/04/iSpatial_v3_Technical_White_Paper.pdf' target='_blank'> iSpatial_v3_Technical_White_Pape...</a> <br>iSpatial <a href='http://www.t-sciences.com/wp-content/uploads/2014/01/iSpatial_Fed.pptx' title='http://www.t-sciences.com/wp-content/uploads/2014/01/iSpatial_Fed.pptx' target='_blank'> iSpatial_Fed.pptx</a>", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "Thermopylae Sciences and Technology", "releaseDate" : 1395813600000, "version" : "3.2.4", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200726000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.1", "codeDescription" : "2.1 Collaboration", "important" : false }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "COTS", "codeDescription" : "COTS", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/iSpatialLogosquare.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='http://www.t-sciences.com/product/ispatial' title='http://www.t-sciences.com/product/ispatial' target='_blank'> http://www.t-sciences.com/product/ispatial</a>" }, { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='http://therml-pf-app02.pf.cee-w.net/static/docs/iSpatial_v3_User_Guide.pdf' title='http://therml-pf-app02.pf.cee-w.net/static/docs/iSpatial_v3_User_Guide.pdf' target='_blank'> http://therml-pf-app02.pf.cee-w.net/static/docs/iSpatial_v3_User_Guide.pdf</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='http://www.t-sciences.com/product/ispatial' title='http://www.t-sciences.com/product/ispatial' target='_blank'> http://www.t-sciences.com/product/ispatial</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='http://www.t-sciences.com/product/ispatial' title='http://www.t-sciences.com/product/ispatial' target='_blank'> http://www.t-sciences.com/product/ispatial</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 41, "guid" : "96c32c04-852d-4795-b659-235cfd0fdb05", "name" : "JC2CUI Common 2D Map API Widget", "description" : "This is a map widget developed by JC2CUI that conforms to the Common Map API - see below for more information on the API. <br> <br>Using this API allows developers to focus on the problem domain rather than implementing a map widget themselves. It also allows the actual map implementation used to be chosen dynamically by the user at runtime rather than being chosen by the developer. Any map implementation that applies this API can be used. Currently, implementations using Google Earth, Google Maps V2, Google Maps V3, and OpenLayers APIs are available, and others can be written as needed. <br> Another benefit of this API is that it allows multiple widgets to collaboratively display data on a single map widget rather than forcing the user to have a separate map for each widget, so the user does not have to struggle with a different map user interface for each widget. The API uses the OZONE Widget Framework (OWF) inter-widget communication mechanism to allow client widgets to interact with the map. Messages are sent to the appropriate channels (defined below), and the map updates its state accordingly. Other widgets interested in knowing the current map state can subscribe to these messages as well. It is worth noting that the map itself may publish data to these channels on occasion. For example, a map.feature.selected message may originate from a widget asking that a particular feature be selected or because a user has selected the feature on the map. While in most instances the map will not echo back another message to confirm that it has performed an operation, the map will send a view status message whenever the map view (zoom/pan) has been changed, either directly by the user or due to a view change message sent by another widget. This allows non-map widgets that wish to be aware of the current viewport to have that information without having to process all the various messages that can change its state.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "JC2CUI", "releaseDate" : 1342850400000, "version" : "1.3", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485082000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "answeredDate" : 1391537730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1391537730000 } ] }, { "question" : "Are samples included? (SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "answeredDate" : 1391447730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1391537730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "answeredDate" : 1391537730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "WIDGET", "codeDescription" : "Widget", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "OWFCOMP", "typeDescription" : "OWF Compatible", "code" : "Y", "codeDescription" : "Yes", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/EntMapWidget.PNG", "contentType" : "image/PNG", "caption" : null, "description" : null }, { "link" : "images/oldsite/EntMapWidgetNoDraw.PNG", "contentType" : "image/PNG", "caption" : null, "description" : null }, { "link" : "images/oldsite/maps-icon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/inteldocs/browse.php?fFolderId=431871' title='https://www.intelink.gov/inteldocs/browse.php?fFolderId=431871' target='_blank'> https://www.intelink.gov/inteldocs/browse.php?fFolderId=431871</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.jc2cui/frs.common_map_widget' title='https://software.forge.mil/sf/frs/do/listReleases/projects.jc2cui/frs.common_map_widget' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.jc2cui/frs.common_map_widget</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.jc2cui/frs.common_map_widget' title='https://software.forge.mil/sf/frs/do/listReleases/projects.jc2cui/frs.common_map_widget' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.jc2cui/frs.common_map_widget</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 42, "guid" : "a2a4488f-a139-41a2-b455-a1b9ea87f7c8", "name" : "JView", "description" : "JView is a Java-based API (application programmer's interface) that was developed to reduce the time, cost, & effort associated with the creation of computer visualization applications. <br> <br> <br> <br>JView provides the programmer with the ability to quickly develop 2-dimensional and 3-dimensional visualization applications that are tailored to address a specific problem. <br> <br>The JView API is government-owned and available free of charge to government agencies and their contractors. <br> <br>JView License information: Full release of JView is currently being made available to government agencies and their contractors. This release includes, source code, sample JView-based applications, sample models and terrain, and documentation. A limited release that does not include source code is available to universities and foreign governments. All releases are subject to the approval of the JView program office. One can request a copy of JView by visiting <a href='https://extranet.rl.af.mil/jview/.' title='https://extranet.rl.af.mil/jview/.' target='_blank'> .</a> Formal configuration management and distribution of JView is performed through the Information Management Services program.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "AFRL", "releaseDate" : 1310796000000, "version" : "1.7.1", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405370213000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : 1388769330000, "endDate" : 1393694130000, "currentLevelCode" : "LEVEL1", "reviewedVersion" : "1.0", "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : null, "actualCompletionDate" : 1392138930000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ { "name" : "Discoverable", "score" : 2 }, { "name" : "Accessible", "score" : 2 }, { "name" : "Documentation", "score" : 3 }, { "name" : "Deployable", "score" : 4 }, { "name" : "Usable", "score" : 5 }, { "name" : "Error Handling", "score" : 2 }, { "name" : "Integrable", "score" : 4 }, { "name" : "I/O Validation", "score" : 2 }, { "name" : "Testing", "score" : 2 }, { "name" : "Monitoring", "score" : 1 }, { "name" : "Performance", "score" : 3 }, { "name" : "Scalability", "score" : 2 }, { "name" : "Security", "score" : 3 }, { "name" : "Maintainability", "score" : 2 }, { "name" : "Community", "score" : 1 }, { "name" : "Change Management", "score" : 2 }, { "name" : "CA", "score" : 1 }, { "name" : "Licensing", "score" : 2 }, { "name" : "Roadmap", "score" : 1 }, { "name" : "Willingness", "score" : 2 }, { "name" : "Architecture Alignment", "score" : 5 } ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL1", "codeDescription" : "Level 1 - Initial Reuse Analysis", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "GOTS", "codeDescription" : "GOTS", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/JView+Screen+Shot+Shader+Demo.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/JView+Screen+Shot+screencap_large_f22.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null }, { "link" : "images/oldsite/JView_Logo_133_81[1].png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/scm/do/listRepositories/projects.jview/scm' title='https://software.forge.mil/sf/scm/do/listRepositories/projects.jview/scm' target='_blank'> https://software.forge.mil/sf/scm/do/listRepositories/projects.jview/scm</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/scm/do/listRepositories/projects.jview/scm' title='https://software.forge.mil/sf/scm/do/listRepositories/projects.jview/scm' target='_blank'> https://software.forge.mil/sf/scm/do/listRepositories/projects.jview/scm</a>" }, { "name" : "DI2E Framework Evaluation Report URL", "type" : "DI2E Framework Evaluation Report URL", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/JView+API+Evaluation' title='https://confluence.di2e.net/display/DI2E/JView+API+Evaluation' target='_blank'> https://confluence.di2e.net/display/DI2E/JView+API+Evaluation</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://extranet.rl.af.mil/jview/' title='https://extranet.rl.af.mil/jview/' target='_blank'> https://extranet.rl.af.mil/jview/</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://software.forge.mil/sf/go/proj1195' title='https://software.forge.mil/sf/go/proj1195' target='_blank'> https://software.forge.mil/sf/go/proj1195</a>" } ], "reviews" : [ { "username" : "Cathy TEST", "userType" : "End User", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 1, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "> 3 years", "lastUsed" : 1328379330000, "updateDate" : 1391447730000, "organization" : "DCGS Navy", "recommend" : false, "pros" : [ ], "cons" : [ { "text" : "Poorly Tested" } ] } ], "dependencies" : [ ] }, { "componentId" : 43, "guid" : "20dd2ed3-491f-4b8c-99a9-33029c308182", "name" : "Military Symbology Renderer", "description" : "The Mil Symbology Renderer is both a developer's toolkit as well as a ready to use deployable web application. <br>The goal of this project is to provide a single distributable solution that can support as many use cases as possible <br>for military symbology rendering. The current features available are: <br>* Use in web applications using the JavaScript library and SECRenderer applet <br>* Use with thin Ozone Widget Framework with the Rendering widget and API <br>* Use as a REST web service (Currently supports icon based symbols only) <br>* Use of underlying rendering jar files in an application or service", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1358924400000, "version" : "1.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485084000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "WIDGET", "codeDescription" : "Widget", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "OWFCOMP", "typeDescription" : "OWF Compatible", "code" : "Y", "codeDescription" : "Yes", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/maps-icon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://github.com/missioncommand/mil-sym-java/blob/master/documentation/Mil%20Symbology%20Web%20Service%20Developer's%20Guide.docx' title='https://github.com/missioncommand/mil-sym-java/blob/master/documentation/Mil%20Symbology%20Web%20Service%20Developer's%20Guide.docx' target='_blank'> https://github.com/missioncommand/mil-sym-java/blob/master/documentation/Mil%20Symbology%20Web%20Service%20Developer's%20Guide.docx</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://github.com/missioncommand' title='https://github.com/missioncommand' target='_blank'> https://github.com/missioncommand</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://github.com/missioncommand' title='https://github.com/missioncommand' target='_blank'> https://github.com/missioncommand</a>" } ], "reviews" : [ { "username" : "Jack TEST", "userType" : "Project Manager", "comment" : "I had issues trying to obtain the component and once I got it is very to difficult to install.", "rating" : 1, "title" : "Hassle (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1367309730000, "updateDate" : 1398845730000, "organization" : "NSA", "recommend" : false, "pros" : [ ], "cons" : [ { "text" : "Difficult Installation" } ] } ], "dependencies" : [ ] }, { "componentId" : 44, "guid" : "f303606d-5b76-4ebe-beca-cec20c3791e1", "name" : "OpenAM", "description" : "OpenAM is an all-in-one access management platform with the adaptive intelligence to protect against risk-based threats across any environment.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E-F", "releaseDate" : 1345701600000, "version" : "See site for latest versions", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200729000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "1.2.1", "codeDescription" : "Identity and Access Management", "important" : true }, { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : null, "codeDescription" : null, "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/security.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='http://forgerock.com/products/open-identity-stack/openam/' title='http://forgerock.com/products/open-identity-stack/openam/' target='_blank'> http://forgerock.com/products/open-identity-stack/openam/</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='http://forgerock.com/products/open-identity-stack/openam/' title='http://forgerock.com/products/open-identity-stack/openam/' target='_blank'> http://forgerock.com/products/open-identity-stack/openam/</a>" } ], "reviews" : [ { "username" : "Cathy TEST", "userType" : "End User", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 1, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 6 Months", "lastUsed" : 1362298530000, "updateDate" : 1393834530000, "organization" : "NGA", "recommend" : false, "pros" : [ ], "cons" : [ { "text" : "Poorly Tested" } ] } ], "dependencies" : [ ] }, { "componentId" : 45, "guid" : "7c4aa579-64c7-4b35-859d-7b2922ab0efb", "name" : "OpenSextant", "description" : "(U) OpenSextant is an open source software package for geotagging unstructured text. OpenSextant is implemented in Java and based on the open source text analytic software GATE ( <a href='http://gate.ac.uk/' title='http://gate.ac.uk/' target='_blank'> </a> ). <br>(U) OpenSextant can geotag documents in any file format supported by GATE, which includes plain text, Microsoft Word, PDF, and HTML. Multiple files can submitted in a compressed archive. OpenSextant can unpack both .zip and .tar archives, as well as tarball archives with .gz or .tgz extensions. The newer .zipx format is not currently supported. <br>(U) Geospatial information is written out in commonly used geospatial data formats, such as KML, ESRI Shapefile, CSV, JSON or WKT. Details on how OpenSextant works and output formats it supports can be found in the document Introduction to OpenSextant. <br>OpenSextant can be run either as a standalone application or as a web service <br>(U) OpenSextant identifies and disambiguates geospatial information in unstructured text. Geospatial information includes named places as well as explicit spatial coordinates such as latitude-longitude pairs and Military Grid References. Named places can be any geospatial feature, such as countries, cities, rivers, and so on. Disambiguation refers to matching a named place in a document with one or more entries in a gazetteer and providing a relative confidence level for each match.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1367042400000, "version" : "1.3.1", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485085000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ { "label" : "Common Uses (SAMPLE)", "value" : "UDOP, Information Sharing, Research" }, { "label" : "Support Common Interface 2.1 (SAMPLE)", "value" : "No" } ], "componentMedia" : [ { "link" : "images/oldsite/OpenSextantSS.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/OpenSextanticon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://github.com/OpenSextant/opensextant/tree/master/OpenSextantToolbox/doc' title='https://github.com/OpenSextant/opensextant/tree/master/OpenSextantToolbox/doc' target='_blank'> https://github.com/OpenSextant/opensextant/tree/master/OpenSextantToolbox/doc</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://github.com/OpenSextant/opensextant' title='https://github.com/OpenSextant/opensextant' target='_blank'> https://github.com/OpenSextant/opensextant</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://github.com/OpenSextant/opensextant' title='https://github.com/OpenSextant/opensextant' target='_blank'> https://github.com/OpenSextant/opensextant</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 46, "guid" : "66bca318-5cca-45e4-a207-688ad923ede8", "name" : "OpenStack", "description" : "OpenStack is open source software for building public and private clouds ( <a href='http://www.openstack.org' title='http://www.openstack.org' target='_blank'> www.openstack.org</a> ). The release here has been developed by USC/ISI and has two distinctions from the mainstream open source release. First, we've focused on support for high-performance, heterogeneous hardware. Second, we've packaged a release for deployment in secure environments. The release has been developed for RHEL and related host operating systems, includes an SELinux policy, and includes all of the dependent packages, so the release can be deployed stand-alone in environments not connected to the internet. The release uses a modified version of the open source Rackspace Private Cloud software for easy installation.", "parentComponent" : { "componentId" : 45, "name" : "OpenSextant" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "USC/ISI", "releaseDate" : 1386831600000, "version" : "NA, see listing for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485086000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Abby TEST", "userType" : "Project Manager", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "answeredDate" : 1398845730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Cathy TEST", "userType" : "End User", "answeredDate" : 1398845730000 } ] }, { "question" : "Are samples included? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "createDts" : 1367309730000, "updateDts" : 1367309730000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "answeredDate" : 1391447730000 } ] }, { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Cathy TEST", "userType" : "Project Manager", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Abby TEST", "userType" : "Developer", "answeredDate" : 1391447730000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "answeredDate" : 1399961730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "PILOT", "codeDescription" : "Deployment Pilot", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/OpenStack.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/Heterogeneous+OpenStack+Grizzly+Release' title='https://confluence.di2e.net/display/DI2E/Heterogeneous+OpenStack+Grizzly+Release' target='_blank'> https://confluence.di2e.net/display/DI2E/Heterogeneous+OpenStack+Grizzly+Release</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/Heterogeneous+OpenStack+Grizzly+Release' title='https://confluence.di2e.net/display/DI2E/Heterogeneous+OpenStack+Grizzly+Release' target='_blank'> https://confluence.di2e.net/display/DI2E/Heterogeneous+OpenStack+Grizzly+Release</a>" } ], "reviews" : [ { "username" : "Abby TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 4, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 1 year", "lastUsed" : 1381644930000, "updateDate" : 1393834530000, "organization" : "NGA", "recommend" : true, "pros" : [ { "text" : "Well Tested" }, { "text" : "Active Development" } ], "cons" : [ { "text" : "Difficult Installation" } ] }, { "username" : "Colby TEST", "userType" : "End User", "comment" : "I had issues trying to obtain the component and once I got it is very to difficult to install.", "rating" : 2, "title" : "Hassle (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1367309730000, "updateDate" : 1398845730000, "organization" : "NGA", "recommend" : true, "pros" : [ ], "cons" : [ ] }, { "username" : "Cathy TEST", "userType" : "End User", "comment" : "This is a great product however, it's missing what I think are critical features. Hopefully, they are working on it for future updates.", "rating" : 2, "title" : "Great but missing features (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1388769330000, "updateDate" : 1393834530000, "organization" : "NSA", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Security Concerns" }, { "text" : "Poor Documentation" } ] } ], "dependencies" : [ ] }, { "componentId" : 47, "guid" : "638e11e6-39c5-44b3-8168-af7cc1469f15", "name" : "OpenStack Lessons Learned Document", "description" : "Lessons learned in the Openstack Folsom deployment by USC/ISI in the DI2E Framework environment. This document is meant to be very specific to one deployment experience with the intention that it will be useful to others deploying in a similar environment. <br> <br>Note this document is stored on the DI2E Framework Wiki which requires a DI2E Framework Devtools account ( <a href='https://devtools.di2e.net/' title='https://devtools.di2e.net/' target='_blank'> </a> )", "parentComponent" : { "componentId" : 31, "name" : "DI2E RESTful CDR Search Technical Profile" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1386226800000, "version" : "1.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485087000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Are samples included? (SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "createDts" : 1328379330000, "updateDts" : 1328379330000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1399961730000 } ] }, { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "answeredDate" : 1393834530000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "answeredDate" : 1398845730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Abby TEST", "userType" : "Developer", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "answeredDate" : 1399961730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Abby TEST", "userType" : "Developer", "answeredDate" : 1391447730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "DOC", "codeDescription" : "Documentation", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/OpenStack.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/download/attachments/8847504/OpenStack-LessonsLearned.pdf?api=v2' title='https://confluence.di2e.net/download/attachments/8847504/OpenStack-LessonsLearned.pdf?api=v2' target='_blank'> https://confluence.di2e.net/download/attachments/8847504/OpenStack-LessonsLearned.pdf?api=v2</a>" } ], "reviews" : [ { "username" : "Cathy TEST", "userType" : "Project Manager", "comment" : "This wasn't quite what I thought it was.", "rating" : 4, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1381644930000, "updateDate" : 1398845730000, "organization" : "NGA", "recommend" : true, "pros" : [ { "text" : "Reliable" }, { "text" : "Open Source" } ], "cons" : [ { "text" : "Poorly Tested" } ] }, { "username" : "Jack TEST", "userType" : "Developer", "comment" : "This is a great product however, it's missing what I think are critical features. Hopefully, they are working on it for future updates.", "rating" : 2, "title" : "Great but missing features (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1388769330000, "updateDate" : 1398845730000, "organization" : "NGA", "recommend" : true, "pros" : [ ], "cons" : [ ] }, { "username" : "Colby TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 2, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1381644930000, "updateDate" : 1398845730000, "organization" : "DCGS Navy", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Security Concerns" }, { "text" : "Poorly Tested" } ] } ], "dependencies" : [ ] }, { "componentId" : 48, "guid" : "5cb546ca-40de-4744-962d-56cfa9e1cbab", "name" : "OWASP Enterprise Security API", "description" : "ESAPI (The OWASP Enterprise Security API) is a free, open source, web application security control library that makes it easier for programmers to write lower-risk applications. The ESAPI libraries are designed to make it easier for programmers to retrofit security into existing applications. The ESAPI libraries also serve as a solid foundation for new development. <br> <br>Allowing for language-specific differences, all OWASP ESAPI versions have the same basic design: <br>* There is a set of security control interfaces. They define for example types of parameters that are passed to types of security controls. <br>* There is a reference implementation for each security control. The logic is not organization-specific and the logic is not application-specific. An example: string-based input validation. <br>* There are optionally your own implementations for each security control. There may be application logic contained in these classes which may be developed by or for your organization. An example: enterprise authentication. <br> <br>This project source code is licensed under the BSD license, which is very permissive and about as close to public domain as is possible. The project documentation is licensed under the Creative Commons license. You can use or modify ESAPI however you want, even include it in commercial products. <br> <br>The following organizations are a few of the many organizations that are starting to adopt ESAPI to secure their web applications: American Express, Apache Foundation, Booz Allen Hamilton, Aspect Security, Coraid, The Hartford, Infinite Campus, Lockheed Martin, MITRE, U.S. Navy - SPAWAR, The World Bank, SANS Institute. <br> <br>The guide is produced by the Open Web Application Security Project (OWASP) - <a href='https://www.owasp.org.' title='https://www.owasp.org.' target='_blank'> www.owasp.org.</a>", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "OWASP", "releaseDate" : 1121839200000, "version" : "2.10", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485088000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "Access" }, { "text" : "Testing" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/OWASPAPIScreenShot.PNG", "contentType" : "image/PNG", "caption" : null, "description" : null }, { "link" : "images/oldsite/ologo.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.owasp.org/index.php/Esapi' title='https://www.owasp.org/index.php/Esapi' target='_blank'> https://www.owasp.org/index.php/Esapi</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://www.owasp.org/index.php/Esapi#tab=Downloads' title='https://www.owasp.org/index.php/Esapi#tab=Downloads' target='_blank'> https://www.owasp.org/index.php/Esapi#tab=Downloads</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://www.owasp.org/index.php/Esapi' title='https://www.owasp.org/index.php/Esapi' target='_blank'> https://www.owasp.org/index.php/Esapi</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 49, "guid" : "f2a509c0-419f-489e-844d-e783be5f5fe2", "name" : "OWASP Web Application Security Guide", "description" : "The Development Guide is aimed at architects, developers, consultants and auditors and is a comprehensive manual for designing, developing and deploying secure Web Applications and Web Services. The original OWASP Development Guide has become a staple diet for many web security professionals. Since 2002, the initial version was downloaded over 2 million times. Today, the Development Guide is referenced by many leading government, financial, and corporate standards and is the Gold standard for Web Application and Web Service security. <br>The guide is produced by the Open Web Application Security Project (OWASP) - <a href='https://www.owasp.org.' title='https://www.owasp.org.' target='_blank'> www.owasp.org.</a>", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "OWASP", "releaseDate" : 1122098400000, "version" : "2.01", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485088000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "DOC", "codeDescription" : "Documentation", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : null, "codeDescription" : null, "important" : false } ], "tags" : [ { "text" : "Charting" }, { "text" : "Visualization" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/OWASPGuideScreenShot.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/ologo.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.owasp.org/index.php/Category:OWASP_Guide_Project' title='https://www.owasp.org/index.php/Category:OWASP_Guide_Project' target='_blank'> https://www.owasp.org/index.php/Category:OWASP_Guide_Project</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://www.owasp.org/index.php/Category:OWASP_Guide_Project' title='https://www.owasp.org/index.php/Category:OWASP_Guide_Project' target='_blank'> https://www.owasp.org/index.php/Category:OWASP_Guide_Project</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 50, "guid" : "0a1931ac-611d-4d82-a83e-4a48ae51ec7a", "name" : "Ozone Marketplace", "description" : "The Ozone marketplace is a storefront to store widgets, services, and web applications. It can be linked to the Ozone Widget Framework.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "OWF Goss", "releaseDate" : 1349935200000, "version" : "5.0.1", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485089000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "UDOP" }, { "text" : "Communication" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/OMP.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/OMPIcon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.owfgoss.org/downloads/Marketplace/5.0/Marketplace-5.0.1-GA/' title='https://www.owfgoss.org/downloads/Marketplace/5.0/Marketplace-5.0.1-GA/' target='_blank'> https://www.owfgoss.org/downloads/Marketplace/5.0/Marketplace-5.0.1-GA/</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://www.owfgoss.org/downloads/Marketplace/5.0/Marketplace-5.0.1-GA/' title='https://www.owfgoss.org/downloads/Marketplace/5.0/Marketplace-5.0.1-GA/' target='_blank'> https://www.owfgoss.org/downloads/Marketplace/5.0/Marketplace-5.0.1-GA/</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 51, "guid" : "3dd46fe2-8926-45ee-a4dc-63057c030a9e", "name" : "Ozone Widget Framework", "description" : "OWF is a web application that allows users to easily access all their online tools from one location. Not only can users access websites and applications with widgets, they can group them and configure some applications to interact with each other via widget intents. <br> <br> <br> <br> <br> <br>Some Links: <br>http://www.ozoneplatform.org/ (mirror site to below) <br>https://www.owfgoss.org/ (mirror site to above)", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "OWF GOSS", "releaseDate" : 1356246000000, "version" : "7.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1402947991000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "answeredDate" : 1391447730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Project Manager", "answeredDate" : 1391447730000 } ] }, { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "createDts" : 1328379330000, "updateDts" : 1328379330000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "answeredDate" : 1398845730000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "answeredDate" : 1391447730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "LICTYPE", "typeDescription" : "License Type", "code" : "GOVUNL", "codeDescription" : "Government Unlimited Rights", "important" : false } ], "tags" : [ { "text" : "Communication" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/launch-menu.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/graph.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/Ozone-Banner_30x110.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.owfgoss.org/' title='https://www.owfgoss.org/' target='_blank'> https://www.owfgoss.org/</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://www.owfgoss.org/' title='https://www.owfgoss.org/' target='_blank'> https://www.owfgoss.org/</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://www.owfgoss.org/' title='https://www.owfgoss.org/' target='_blank'> https://www.owfgoss.org/</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 53, "guid" : "68e0403b-41d0-48fc-bd46-8f5a6fc8d83d", "name" : "VANTAGE Software Suite", "description" : "VANTAGE is a tactical imagery exploitation software suite. This field proven application screens digital imagery from various tactical reconnaissance sensors and includes simultaneous support for multiple sensor types. VANTAGE provides for real and near real time screening of digital image data from a live data link, solid state recorder, DVD/CD, or local disk. In addition, VANTAGE provides a full featured database that can be used to quickly find imagery based on an area (or point) of interest, a time query, or sensor type. <br> <br> <br>This software suite allows the image analyst to receive, decompress/compress, process, display, evaluate, exploit, and store imagery data; as well as create/disseminate processed image products. VANTAGE was developed by SDL in support of various sensors such as SPIRITT, ATARS/APG-73, LSRS, ASARS-2A, SYERS-2, and Global Hawk and provides simultaneous support for multiple sensor types. <br> <br>The VANTAGE software suite includes the following applications: <br> <br>VANTAGE ViewPoint <br> *Provides rapid display and exploitation of tactical imagery <br> *Displays geo-referenced digital tactical imagery in a robust, near real-time waterfall of decimated imagery <br> *Provides on-demand display of full-resolution imagery with exploitation tools <br> <br>VANTAGE Ascent <br> *Configures ground stations for device interface management (solid-state recorders, CDL interface, STANAG 4575, Ethernet feeds, etc.) <br> *Provides sensor interfacing/processing <br> *Performs NITF image formation <br> *Provides for database management <br> <br>VANTAGE Soar <br> *Interfaces with data received through SDL's CDL Interface Box (CIB) or Sky Lynx for data link interfacing and simulation <br> *Allows operator to load and play simulation CDL files, select CDL data rate, select bit error rates, perform Built-In Test (BIT), and view advanced CDL statistics <br> <br>VANTAGE Web Enabled Sensor Service (WESS) <br> *Provides map-based database access via a standard web browser <br> <br> <br>The Vantage Web Enabled Sensor Service (WESS) is an optional service that provides access to Vantage databases from other applications. WESS The Web Enabled Sensor Service (WESS) is a server that runs on the Vantage server and exposes the Vantage database of imagery and metadata to the outside via SOAP. WESS uses an open protocol to communicate data and is not bound to a browser or programming language. The WESS client is an application that allows users to display imagery from the Vantage database in a web browser, over a network. retrieves imagery, video files, MTI files, and related products from a Vantage database over a network connection, and displays it in a web browser. If you are using Internet Explorer (IE) 9 or Firefox 3, you can also use WESS to manipulate and enhance imagery. <br> <br>", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NRL", "releaseDate" : 1377669600000, "version" : "n/a", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405452097000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "createDts" : 1367309730000, "updateDts" : 1367309730000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1393834530000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "answeredDate" : 1391447730000 } ] }, { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Cathy TEST", "userType" : "End User", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Abby TEST", "userType" : "Developer", "answeredDate" : 1399961730000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Project Manager", "answeredDate" : 1399961730000 } ] }, { "question" : "Are samples included? (SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "createDts" : 1328379330000, "updateDts" : 1328379330000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "answeredDate" : 1393834530000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "DEV", "codeDescription" : "Development", "important" : false } ], "tags" : [ { "text" : "Mapping" } ], "metadata" : [ { "label" : "Support Common Interface 2.1 (SAMPLE)", "value" : "No" }, { "label" : "Common Uses (SAMPLE)", "value" : "UDOP, Information Sharing, Research" }, { "label" : "Available to public (SAMPLE)", "value" : "YES" } ], "componentMedia" : [ { "link" : "images/oldsite/wess_logo.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='http://www.spacedynamics.org/products/vantage' title='http://www.spacedynamics.org/products/vantage' target='_blank'> http://www.spacedynamics.org/products/vantage</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='http://www.spacedynamics.org/products/vantage' title='http://www.spacedynamics.org/products/vantage' target='_blank'> http://www.spacedynamics.org/products/vantage</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='http://www.spacedynamics.org/products/vantage' title='http://www.spacedynamics.org/products/vantage' target='_blank'> http://www.spacedynamics.org/products/vantage</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "email [email protected]" } ], "reviews" : [ { "username" : "Abby TEST", "userType" : "End User", "comment" : "This wasn't quite what I thought it was.", "rating" : 4, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 1 year", "lastUsed" : 1362298530000, "updateDate" : 1398845730000, "organization" : "NSA", "recommend" : false, "pros" : [ { "text" : "Reliable" } ], "cons" : [ ] }, { "username" : "Colby TEST", "userType" : "Developer", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 4, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 1 year", "lastUsed" : 1367309730000, "updateDate" : 1399961730000, "organization" : "DCGS Navy", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Legacy system" }, { "text" : "Poor Documentation" } ] } ], "dependencies" : [ { "dependency" : "Erlang", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 3.0" } ] }, { "componentId" : 54, "guid" : "9a540308-86e4-406a-8923-97496fb9a215", "name" : "VANTAGE WESS OZONE Widget", "description" : "The Vantage Web Enabled Sensor Service (WESS) is an optional service that provides access to Vantage databases from other applications. WESS The Web Enabled Sensor Service (WESS) is a server that runs on the Vantage server and exposes the Vantage database of imagery and metadata to the outside via SOAP. WESS uses an open protocol to communicate data and is not bound to a browser or programming language. The WESS client is an application that allows users to display imagery from the Vantage database in a web browser, over a network. retrieves imagery, video files, MTI files, and related products from a Vantage database over a network connection, and displays it in a web browser. If you are using Internet Explorer (IE) 9 or Firefox 3, you can also use WESS to manipulate and enhance imagery. <br> <br> <br>There are two widgets provided by the WESS application, called the VANTAGE WESS Search widget and the VANTAGE WESS Viewer widget. Together the WESS OZONE Widgets are a lightweight web application that, after installation into the Ozone Widget Framework and configuration, allows the user to view the contents of a VANTAGE database or a CDR compliant data source; it also interfaces with the JC2CUI map widget. Google Maps is one of the view capabilities provided by the Widget. The Widget provides a search capability. <br> <br>Links: <br>SDL Vantage Link: <a href='http://www.spacedynamics.org/products/vantage' title='http://www.spacedynamics.org/products/vantage' target='_blank'> vantage</a>", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NRL", "releaseDate" : 1378101600000, "version" : "0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405452122000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "createDts" : 1328379330000, "updateDts" : 1328379330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1399961730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1393834530000 } ] }, { "question" : "Are samples included? (SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "answeredDate" : 1391537730000 } ] }, { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "answeredDate" : 1399961730000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "answeredDate" : 1399961730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "WIDGET", "codeDescription" : "Widget", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "GOTS", "codeDescription" : "GOTS", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "DEV", "codeDescription" : "Development", "important" : false }, { "type" : "OWFCOMP", "typeDescription" : "OWF Compatible", "code" : "Y", "codeDescription" : "Yes", "important" : false } ], "tags" : [ { "text" : "Mapping" } ], "metadata" : [ { "label" : "Support Common Interface 2.1 (SAMPLE)", "value" : "No" }, { "label" : "Extra Metadata (SAMPLE)", "value" : "Unfiltered" }, { "label" : "Available to public (SAMPLE)", "value" : "YES" } ], "componentMedia" : [ { "link" : "images/oldsite/wess_logo.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/WESS+Documentation' title='https://confluence.di2e.net/display/DI2E/WESS+Documentation' target='_blank'> https://confluence.di2e.net/display/DI2E/WESS+Documentation</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/Installation' title='https://confluence.di2e.net/display/DI2E/Installation' target='_blank'> https://confluence.di2e.net/display/DI2E/Installation</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/USU/repos/wess-widget/browse' title='https://stash.di2e.net/projects/USU/repos/wess-widget/browse' target='_blank'> https://stash.di2e.net/projects/USU/repos/wess-widget/browse</a>" } ], "reviews" : [ { "username" : "Colby TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 4, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1388769330000, "updateDate" : 1393834530000, "organization" : "DCGS Army", "recommend" : false, "pros" : [ { "text" : "Reliable" } ], "cons" : [ ] }, { "username" : "Colby TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 4, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1362298530000, "updateDate" : 1399961730000, "organization" : "DCGS Army", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Poorly Tested" }, { "text" : "Difficult Installation" } ] } ], "dependencies" : [ { "dependency" : "Tomcat", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 7 or 8" } ] }, { "componentId" : 55, "guid" : "3e3b21d6-2374-4417-ba9c-ec56a9e0a314", "name" : "Vega 3D Map Widget", "description" : "Vega is a 3D map widget with support for high-resolution imagery in various formats including WMS, WFS, and ArcGIS. Vega also supports 3-dimensional terrain, and time-based data and has tools for drawing shapes and points and importing/exporting data.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1377669600000, "version" : "0.1-ALPHA2", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200733000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Does this support the 2.0 specs? (SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "createDts" : 1367309730000, "updateDts" : 1367309730000, "responses" : [ { "response" : "No, they planned to add support next Version(SAMPLE)", "username" : "Abby TEST", "userType" : "Project Manager", "answeredDate" : 1393834530000 }, { "response" : "Update: they backport support to version 1.6(SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "answeredDate" : 1391447730000 } ] }, { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "answeredDate" : 1391447730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "answeredDate" : 1391447730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "WIDGET", "codeDescription" : "Widget", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "OWFCOMP", "typeDescription" : "OWF Compatible", "code" : "Y", "codeDescription" : "Yes", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/maps-icon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://wiki.macefusion.com/display/Widgets/Installing+Vega+%283D+Map+Widget%29+into+OWF' title='https://wiki.macefusion.com/display/Widgets/Installing+Vega+%283D+Map+Widget%29+into+OWF' target='_blank'> https://wiki.macefusion.com/display/Widgets/Installing+Vega+%283D+Map+Widget%29+into+OWF</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://git.macefusion.com/git/dcgs-widgets' title='https://git.macefusion.com/git/dcgs-widgets' target='_blank'> https://git.macefusion.com/git/dcgs-widgets</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://git.macefusion.com/git/dcgs-widgets' title='https://git.macefusion.com/git/dcgs-widgets' target='_blank'> https://git.macefusion.com/git/dcgs-widgets</a>" } ], "reviews" : [ ], "dependencies" : [ ] } ]; /* jshint ignore:end */ // Code here will be linted with JSHint. /* jshint ignore:start */ // Code here will be linted with ignored by JSHint. MOCKDATA2.resultsList = [ { "listingType" : "Component", "componentId" : 67, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Central Authentication Service (CAS)", "description" : "The Central Authentication Service (CAS) is a single sign-on protocol for the web. Its purpose is to permit a user to access multiple applications while providing their credentials (such as userid and password) only once. It also allows web applications to authenticate users without gaining access to ...", "organization" : "NRO", "lastActivityDate" : null, "updateDts" : 1405698045000, "averageRating" : 1, "views" : 126, "totalNumberOfReviews" : 71, "resourceLocation" : "api/v1/resource/components/67/detail", "attributes" : [ { "type" : "DI2E-SVCV4-A", "code" : "1.2.1" }, { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "LICTYPE", "code" : "OPENSRC" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 9, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "CLAVIN", "description" : "CLAVIN (Cartographic Location And Vicinity Indexer) is an open source software package for document geotagging and geoparsing that employs context-based geographic entity resolution. It extracts location names from unstructured text and resolves them against a gazetteer to produce data-rich geographic ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1400005248000, "averageRating" : 3, "views" : 167, "totalNumberOfReviews" : 34, "resourceLocation" : "api/v1/resource/components/9/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL1" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "LICCLASS", "code" : "FOSS" } ], "tags" : [ { "text" : "Mapping" }, { "text" : "Reference" } ] }, { "listingType" : "Component", "componentId" : 10, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Common Map API Javascript Library", "description" : "Core Map API is a library of JavaScript (JS) functions that hide the underlying Common Map Widget API so that developers only have to include the JS library and call the appropriate JS functions that way they are kept away from managing or interacting directly with the channels. Purpose/Goal of the <a href='https://confluence.di2e.net/download/attachments/14518881/cpce-map-api-jsDocs.zip?api=v2' title='https://confluence.di2e.net/download/attachments/14518881/cpce-map-api-jsDocs.zip?api=v2' target='_blank'> cpce-map-api-jsDocs.zip?api=v2</a> ...", "organization" : "DCGS-A", "lastActivityDate" : null, "updateDts" : 1399485055000, "averageRating" : 1, "views" : 70, "totalNumberOfReviews" : 57, "resourceLocation" : "api/v1/resource/components/10/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL1" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "PILOT" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 11, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Common Map Widget API", "description" : "Background Many programs and projects create widgets that search for or manipulate data then present the results on a map. The desire is to be able to combine data search/manipulation widgets from any provider with map widgets from other providers. In order to accomplish this, a standard way for the <a href='https://software.forge.mil/sf/frs/do/viewRelease/projects.jc2cui/frs.common_map_widget.common_map_widget_api' title='https://software.forge.mil/sf/frs/do/viewRelease/projects.jc2cui/frs.common_map_widget.common_map_widget_api' target='_blank'> frs.common_map_widget.common_map...</a> ...", "organization" : "DI2E Framework", "lastActivityDate" : null, "updateDts" : 1404172800000, "averageRating" : 0, "views" : 122, "totalNumberOfReviews" : 0, "resourceLocation" : "api/v1/resource/components/11/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "Charting" } ] }, { "listingType" : "Component", "componentId" : 12, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Content Discovery and Retrieval Engine - Brokered Search Component", "description" : "Content Discovery and Retrieval functionality is based on the architecture, standards, and specifications being developed and maintained by the joint IC/DoD Content Discovery and Retrieval (CDR) Integrated Product Team (IPT). The components contained in this release are the 1.1 version of the reference ...", "organization" : "DI2E-F", "lastActivityDate" : null, "updateDts" : 1399485057000, "averageRating" : 0, "views" : 30, "totalNumberOfReviews" : 70, "resourceLocation" : "api/v1/resource/components/12/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ { "text" : "Charting" }, { "text" : "Data Exchange" } ] }, { "listingType" : "Component", "componentId" : 13, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Content Discovery and Retrieval Engine - Describe Component", "description" : "Content Discovery and Retrieval functionality is based on the architecture, standards, and specifications being developed and maintained by the joint IC/DoD Content Discovery and Retrieval (CDR) Integrated Product Team (IPT). The components contained in this release are the 1.1 version of the reference ...", "organization" : "DI2E Framework", "lastActivityDate" : null, "updateDts" : 1399485058000, "averageRating" : 1, "views" : 147, "totalNumberOfReviews" : 37, "resourceLocation" : "api/v1/resource/components/13/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ { "text" : "Data Exchange" }, { "text" : "UDOP" } ] }, { "listingType" : "Component", "componentId" : 14, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Content Discovery and Retrieval Engine - Retrieve Component", "description" : "The Retrieve Components are implementations of the capabilities and interfaces defined in IC/DoD CDR Retrieve Service Specification for SOAP Implementations DRAFT Version 1.0-20100331, March 31, 2010. Each Retrieve Component is a separately deployable component that provides access to a defined content <a href='https://www.intelink.gov/inteldocs/browse.php?fFolderId=431781' title='https://www.intelink.gov/inteldocs/browse.php?fFolderId=431781' target='_blank'> browse.php?fFolderId=431781</a> for more general information about CDR. ...", "organization" : "DI2E-F", "lastActivityDate" : null, "updateDts" : 1399485059000, "averageRating" : 1, "views" : 126, "totalNumberOfReviews" : 27, "resourceLocation" : "api/v1/resource/components/14/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 15, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Cursor on Target Toolkit", "description" : "(U) Cursor on Target is a set of components focused on driving interoperability in message exchanges. Components include: *An XML message schema &nbsp;&nbsp;Basic (mandatory): what, when, where &nbsp;&nbsp; Extensible (optional): add subschema to add details \u0001*A standard &nbsp;&nbsp; Established as ...", "organization" : "Air Force", "lastActivityDate" : null, "updateDts" : 1399485060000, "averageRating" : 3, "views" : 22, "totalNumberOfReviews" : 90, "resourceLocation" : "api/v1/resource/components/15/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 16, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS Discovery Metadata Guide", "description" : "This document provides information on DCGS metadata artifacts and guidance for populating DDMS and the DIB Metacard, using DDMS Schema Extensions, and creating new DDMS extension schemas. These guidelines should be used by developers and System Integrators building resource adapters and schemas to work ...", "organization" : "AFLCMC/HBBG", "lastActivityDate" : null, "updateDts" : 1399485060000, "averageRating" : 3, "views" : 43, "totalNumberOfReviews" : 22, "resourceLocation" : "api/v1/resource/components/16/detail", "attributes" : [ { "type" : "TYPE", "code" : "DOC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 17, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS Enterprise Messaging Technical Profile", "description" : "DCGS Enterprise Services rely on asynchronous communications for sending messages so they can notify users when certain data is published or a particular event has occurred. Users may subscriber to a data source so they can be notified when a piece of intelligence has been published on a topic of interest. ...", "organization" : "DCGS EFT", "lastActivityDate" : null, "updateDts" : 1399485061000, "averageRating" : 0, "views" : 52, "totalNumberOfReviews" : 76, "resourceLocation" : "api/v1/resource/components/17/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 18, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS Enterprise OWF IdAM Technical Profile", "description" : "The Ozone Widget Framework is a web-application engine built around the concept of discrete, reusable web application interface components called widgets. Widgets may be composed into full applications by Ozone users or administrators. The architecture of the Ozone framework allows widgets to be implemented ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1399487595000, "averageRating" : 0, "views" : 139, "totalNumberOfReviews" : 79, "resourceLocation" : "api/v1/resource/components/18/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 19, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS Integration Backbone (DIB)", "description" : "The Distributed Common Ground/Surface System (DCGS) Integration Backbone (DIB) is the enabler for DCGS enterprise interoperability. The DIB is a technical infrastructure, the foundation for sharing data across the ISR enterprise. More specifically the DIB is: 1) Standards-based set of software, services, ...", "organization" : "DMO", "lastActivityDate" : null, "updateDts" : 1399485063000, "averageRating" : 2, "views" : 98, "totalNumberOfReviews" : 8, "resourceLocation" : "api/v1/resource/components/19/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 20, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS-E Audit Log Management and Reporting Technical Profile", "description" : "This CDP provides the technical design description for the Audit and Accountability capability of the Distributed Common Ground/Surface System (DCGS) Enterprise Service Dial Tone (SDT) layer. It includes the capability architecture design details, conformance requirements, and implementation guidance. ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1399485064000, "averageRating" : 1, "views" : 148, "totalNumberOfReviews" : 32, "resourceLocation" : "api/v1/resource/components/20/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "UDOP" }, { "text" : "Charting" } ] }, { "listingType" : "Component", "componentId" : 21, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS-E Domain Name System (DNS) Technical Profile", "description" : "(U) This CDP provides guidance for DNS for use by the DCGS Enterprise Community at large. DCGS Service Providers will use this guidance to make their services visibility and accessibility in the DCGS Enterprise SOA (DES). Several Intelligence Community/Department of Defense (IC/DoD) documents were incorporated ...", "organization" : "DCGS EFT", "lastActivityDate" : null, "updateDts" : 1399485064000, "averageRating" : 1, "views" : 182, "totalNumberOfReviews" : 35, "resourceLocation" : "api/v1/resource/components/21/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 22, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS-E Metrics Management Technical Profile", "description" : "**Previously titled Service Level Agreement/Quality of Service CDP** (U) This CDP provides guidance for Metrics Management for use by the DCGS Enterprise Community at large. DCGS Service Providers will use this guidance to make their services visibility and accessibility in the DCGS Enterprise SOA. ...", "organization" : "DCGS EFT", "lastActivityDate" : null, "updateDts" : 1399485065000, "averageRating" : 5, "views" : 51, "totalNumberOfReviews" : 42, "resourceLocation" : "api/v1/resource/components/22/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 23, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS-E Sensor Web Enablement (SWE) Technical Profile", "description" : "(U//FOUO) This CDP provides the technical design description for the SensorWeb capability of the Distributed Common Ground/Surface System (DCGS) Enterprise Intelligence, Surveillance and Reconnaissance (ISR) Common layer. (U//FOUO) SensorWeb is a development effort led by the Defense Intelligence ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1399485066000, "averageRating" : 2, "views" : 179, "totalNumberOfReviews" : 39, "resourceLocation" : "api/v1/resource/components/23/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "UDOP" } ] }, { "listingType" : "Component", "componentId" : 24, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS-E Service Registration and Discovery (SRD) Technical Profile", "description" : "(U//FOUO) Service discovery provides DCGS Enterprise consumers the ability to locate and invoke services to support a given task or requirement in a trusted and secure operational environment. By leveraging service discovery, existing DCGS Enterprise services will be published to a root service registry, ...", "organization" : "DCGS EFT", "lastActivityDate" : null, "updateDts" : 1399485067000, "averageRating" : 3, "views" : 171, "totalNumberOfReviews" : 67, "resourceLocation" : "api/v1/resource/components/24/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 25, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS-E Time Synchronization (NTP) Technical Profile", "description" : "(U) This provides guidance for Network Time Protocol (NTP) for use by the DCGS Enterprise Community at large. DCGS Service Providers will use this guidance to make their services secure and interoperable in the DCGS Enterprise SOA (U//FOUO) Time synchronization is a critical service in any distributed ...", "organization" : "DCGS EFT", "lastActivityDate" : null, "updateDts" : 1399485068000, "averageRating" : 1, "views" : 86, "totalNumberOfReviews" : 41, "resourceLocation" : "api/v1/resource/components/25/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "Access" }, { "text" : "Visualization" } ] }, { "listingType" : "Component", "componentId" : 26, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS-E Web Service Access Control Technical Profile", "description" : "Access Control incorporates an open framework and industry best practices/standards that leverage Web Services Security (WSS) [17] standards, also referred to as WS-Security, to create a common framework using Attribute Based Access Control (ABAC). The DCGS Enterprise advocates an ABAC model as the desired ...", "organization" : null, "lastActivityDate" : null, "updateDts" : 1399485068000, "averageRating" : 5, "views" : 180, "totalNumberOfReviews" : 91, "resourceLocation" : "api/v1/resource/components/26/detail", "attributes" : [ { "type" : "DI2E-SVCV4-A", "code" : "1.2.1" }, { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "Mapping" }, { "text" : "Communication" } ] }, { "listingType" : "Component", "componentId" : 27, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DI2E Framework DIAS Simulator", "description" : "This package provides a basic simulator of the DoDIIS Identity and Authorization Service (DIAS) in a deployable web application using Apache CFX architecture. The DI2E Framework development team have used this when testing DIAS specific attribute access internally with Identity and Access Management ...", "organization" : "DI2E Framework", "lastActivityDate" : null, "updateDts" : 1403200707000, "averageRating" : 1, "views" : 60, "totalNumberOfReviews" : 43, "resourceLocation" : "api/v1/resource/components/27/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "DEV" }, { "type" : "LICCLASS", "code" : "GOTS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 28, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DI2E Framework OpenAM", "description" : "The DI2E Framework IdAM solution provides a core OpenAM Web Single Sign-On implementation wrapped in a Master IdAM Administration Console for ease of configuration and deployment. Additionally, there are several enhancements to the core authentication functionality as well as external and local attribute ...", "organization" : "DI2E Framework", "lastActivityDate" : null, "updateDts" : 1405308845000, "averageRating" : 3, "views" : 29, "totalNumberOfReviews" : 64, "resourceLocation" : "api/v1/resource/components/28/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "LIFECYCSTG", "code" : "DEV" }, { "type" : "LICCLASS", "code" : "FOSS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 30, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DI2E Framework Reference Architecture", "description" : "The DI2E Framework reference Architecture provides a structural foundation for the DI2E requirements assessment. The DI2E Framework is specified using a level of abstraction that is not dependent on a specific technical solution, but can leverage the benefits of the latest technology advancements and ...", "organization" : "NRO // DI2E Framework PMO", "lastActivityDate" : null, "updateDts" : 1403200710000, "averageRating" : 1, "views" : 154, "totalNumberOfReviews" : 15, "resourceLocation" : "api/v1/resource/components/30/detail", "attributes" : [ { "type" : "TYPE", "code" : "DOC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "Reference" } ] }, { "listingType" : "Component", "componentId" : 31, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DI2E RESTful CDR Search Technical Profile", "description" : "This profile provides the technical design description for the RESTful Search web service of Defense Intelligence Information Enterprise (DI2E). The profile includes capability architecture design details, implementation requirements and additional implementation guidance. DI2E Enterprise service providers ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1399485073000, "averageRating" : 3, "views" : 70, "totalNumberOfReviews" : 6, "resourceLocation" : "api/v1/resource/components/31/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "Visualization" }, { "text" : "Access" } ] }, { "listingType" : "Component", "componentId" : 32, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Distributed Data Framework (DDF)", "description" : "DDF is a free and open source common data layer that abstracts services and business logic from the underlying data structures to enable rapid integration of new data sources. ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1405694884000, "averageRating" : 0, "views" : 186, "totalNumberOfReviews" : 6, "resourceLocation" : "api/v1/resource/components/32/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "LICTYPE", "code" : "OPENSRC" }, { "type" : "LICCLASS", "code" : "FOSS" } ], "tags" : [ { "text" : "UDOP" } ] }, { "listingType" : "Component", "componentId" : 57, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Domain Name System (DNS) Guidebook for Linux/BIND", "description" : "This Guidebook focuses on those involved with the Domain Name System (DNS) in DI2E systems. Those building systems based on DI2E-offered components, running in a DI2E Framework. It provides guidance for two different roles - those who configure DNS, and those who rely on DNS in the development of distributed ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1403200713000, "averageRating" : 1, "views" : 110, "totalNumberOfReviews" : 38, "resourceLocation" : "api/v1/resource/components/57/detail", "attributes" : [ { "type" : "TYPE", "code" : "DOC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 33, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "eDIB", "description" : "(U) eDIB contains the eDIB 4.0 services (management VM and worker VM). eDIB 4.0 is a scalable, virtualized webservice architecture based on the DMO's DIB 4.0. eDIB provides GUIs for an administrator to manage/configure eDIB. An end-user interface is not provided. Different data stores are supported including ...", "organization" : "DI2E Framework", "lastActivityDate" : null, "updateDts" : 1405102845000, "averageRating" : 0, "views" : 22, "totalNumberOfReviews" : 34, "resourceLocation" : "api/v1/resource/components/33/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "Reference" } ] }, { "listingType" : "Component", "componentId" : 34, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Extensible Mapping Platform (EMP)", "description" : "The Extensible Mapping Platform (EMP) is a US Government Open Source project providing a framework for building robust OWF map widgets and map centric web applications. The EMP project is currently managed by US Army Tactical Mission Command (TMC) in partnership with DI2E, and developed by CECOM Software <a href='http://cmapi.org/' title='http://cmapi.org/' target='_blank'> <a href='https://project.forge.mil/sf/frs/do/viewRelease/projects.dcgsaozone/frs.cpce_mapping_components.sprint_18_cpce_infrastructure_er' title='https://project.forge.mil/sf/frs/do/viewRelease/projects.dcgsaozone/frs.cpce_mapping_components.sprint_18_cpce_infrastructure_er' target='_blank'> frs.cpce_mapping_components.spri...</a> ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1403200714000, "averageRating" : 4, "views" : 176, "totalNumberOfReviews" : 6, "resourceLocation" : "api/v1/resource/components/34/detail", "attributes" : [ { "type" : "TYPE", "code" : "WIDGET" }, { "type" : "DI2ELEVEL", "code" : "LEVEL1" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "DEV" }, { "type" : "OWFCOMP", "code" : "Y" }, { "type" : "LICCLASS", "code" : "GOSS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 73, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GAPS - Data Catalog Service", "description" : "The GAPS Data Catalog Service provides a set of RESTful services to manage data sources accessible to GAPS applications. The catalog service offers RESTful interfaces for querying sources as XML or JSON structures. The service is a combination of two web services; the root service, and the metric service. <a href='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datacatalogservice.ashx' title='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datacatalogservice.ashx' target='_blank'> datacatalogservice.ashx</a> <a href='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datacatalogservice.ashx' title='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datacatalogservice.ashx' target='_blank'> datacatalogservice.ashx</a> <a href='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datasourcemetrics.ashx' title='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datasourcemetrics.ashx' target='_blank'> datasourcemetrics.ashx</a> <a href='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datasourcemetrics.ashx' title='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datasourcemetrics.ashx' target='_blank'> datasourcemetrics.ashx</a> ...", "organization" : "STRATCOM J8", "lastActivityDate" : null, "updateDts" : 1405691893000, "averageRating" : 2, "views" : 107, "totalNumberOfReviews" : 23, "resourceLocation" : "api/v1/resource/components/73/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 74, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GAPS - Gazetteer Service", "description" : "The GAPS Gazetteer Service offers a set of geographical dictionary services that allows users to search for city and military bases, retrieving accurate latitude and longitude values for those locations. The user may search based on name or location, with the gazetteer returning all entries that match <a href='https://gapsprod1.stratcom.smil.mil/gazetteers/NgaGnsGazetteerService.asmx' title='https://gapsprod1.stratcom.smil.mil/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a> (NGA Gazetteer) <a href='https://gapsprod1.stratcom.smil.mil/gazetteers/UsgsGnisGazetteerService.asmx' title='https://gapsprod1.stratcom.smil.mil/gazetteers/UsgsGnisGazetteerService.asmx' target='_blank'> UsgsGnisGazetteerService.asmx</a> (USGS Gazetteer) <a href='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' title='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' target='_blank'> NgaGnsGazetteerService.asmx</a> <a href='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' title='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' target='_blank'> NgaGnsGazetteerService.asmx</a> (USGS Gazetteer) ...", "organization" : "STRATCOM J8", "lastActivityDate" : null, "updateDts" : 1405691776000, "averageRating" : 2, "views" : 130, "totalNumberOfReviews" : 37, "resourceLocation" : "api/v1/resource/components/74/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ { "text" : "Reference" } ] }, { "listingType" : "Component", "componentId" : 72, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GAPS - Scenario Service", "description" : "The GAPS Scenario Service is a SOAP based interface into the GAPS UDOP creation, execution and publishing mechanism. The Scenario Service allows an external entity to perform Machine to Machine (M2M) calls in order to create and execute UDOPs. This interface can be used to integrate with other systems <a href='https://gapsprod1.stratcom.smil.mil/ScenarioService/ScenarioService.asmx' title='https://gapsprod1.stratcom.smil.mil/ScenarioService/ScenarioService.asmx' target='_blank'> ScenarioService.asmx</a> <a href='https://gapsprod1.stratcom.smil.mil/VsaPortal/RespositoryService.asmx' title='https://gapsprod1.stratcom.smil.mil/VsaPortal/RespositoryService.asmx' target='_blank'> RespositoryService.asmx</a> JWICS: <a href='http://jwicsgaps.usstratcom.ic.gov:8000/ScenarioService/ScenarioService.asmx' title='http://jwicsgaps.usstratcom.ic.gov:8000/ScenarioService/ScenarioService.asmx' target='_blank'> ScenarioService.asmx</a> <a href='http://jwicsgaps.usstratcom.ic.gov:8000/VsaPortal/RepositoryService.asmx' title='http://jwicsgaps.usstratcom.ic.gov:8000/VsaPortal/RepositoryService.asmx' target='_blank'> RepositoryService.asmx</a> ...", "organization" : "STRATCOM J8", "lastActivityDate" : null, "updateDts" : 1405691317000, "averageRating" : 1, "views" : 85, "totalNumberOfReviews" : 89, "resourceLocation" : "api/v1/resource/components/72/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ { "text" : "Charting" } ] }, { "listingType" : "Component", "componentId" : 35, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS", "description" : "The National Geospatial-Intelligence Agency's (NGA) GEOINT Visualization Services is a suite of web-based capabilities that delivers geospatial visualization services to the Department of Defense (DoD) and Intelligence Community (IC) via classified and unclassified computer networks to provide visualization <a href='https://www.intelink.gov/wiki/GVS' title='https://www.intelink.gov/wiki/GVS' target='_blank'> GVS</a> <a href='https://www.intelink.gov/blogs/geoweb/' title='https://www.intelink.gov/blogs/geoweb/' target='_blank'> <a href='https://community.forge.mil/content/geoint-visualization-services-gvs-program' title='https://community.forge.mil/content/geoint-visualization-services-gvs-program' target='_blank'> geoint-visualization-services-gv...</a> <a href='https://community.forge.mil/content/geoint-visualization-services-gvs-palanterrax3' title='https://community.forge.mil/content/geoint-visualization-services-gvs-palanterrax3' target='_blank'> geoint-visualization-services-gv...</a> ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1405612927000, "averageRating" : 1, "views" : 87, "totalNumberOfReviews" : 81, "resourceLocation" : "api/v1/resource/components/35/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 58, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS - Base Maps - ESRi", "description" : "World Imagery Basemap is a global service that presents imagery from NGA holdings for Cache Scales from 1:147M - 1:282. This imagery includes various sources and resolutions spanning 15m to 75mm. The imagery sources are Buckeye, US/CAN/MX Border Imagery, Commercial Imagery, USGS High Resolution Orthos, ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1403200715000, "averageRating" : 2, "views" : 120, "totalNumberOfReviews" : 73, "resourceLocation" : "api/v1/resource/components/58/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 59, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS - Base Maps - Google Globe - Summary Information", "description" : "GVS Google Earth Globe Services are constructed from DTED, CIB, Natural View, and Commercial Imagery. Vector data includes NGA standards such as VMAP, GeoNames, and GNIS. GVS recently added NavTeq Streets and Homeland Security Infrastructure data to the Google Globe over the United States. The Globes <a href='https://earth.gvs.nga.mil/wms/fusion_maps_wms.cgi' title='https://earth.gvs.nga.mil/wms/fusion_maps_wms.cgi' target='_blank'> fusion_maps_wms.cgi</a> *WMS - AF/PK - <a href='https://earth.gvs.nga.mil/wms/afpk_map/fusion_maps_wms.cgi' title='https://earth.gvs.nga.mil/wms/afpk_map/fusion_maps_wms.cgi' target='_blank'> fusion_maps_wms.cgi</a> <a href='https://earth.gvs.nga.mil/wms/nvue_map/fusion_maps_wms.cgi' title='https://earth.gvs.nga.mil/wms/nvue_map/fusion_maps_wms.cgi' target='_blank'> fusion_maps_wms.cgi</a> *WMTS - <a href='https://earth.gvs.nga.mil/cgi-bin/ogc/service.py' title='https://earth.gvs.nga.mil/cgi-bin/ogc/service.py' target='_blank'> service.py</a> ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1403200717000, "averageRating" : 0, "views" : 39, "totalNumberOfReviews" : 30, "resourceLocation" : "api/v1/resource/components/59/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 60, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS - Features - CIDNE SIGACTS", "description" : "The GVS CIDNE SIGACTS Data Layer provides a visualization-ready (KML 2.2 compliant formatted) result set for a query of SIGACTS, as obtained from the Combined Information Data Network Exchange (CIDNE) within a defined AOI (\"bounding box\", \"point/radius\", \"path buffer\"). To access the CIDNE SIGACTS Dynamic <a href='http://home.gvs.nga.smil.mil/CIDNE/SigactsServlet' title='http://home.gvs.nga.smil.mil/CIDNE/SigactsServlet' target='_blank'> SigactsServlet</a> JWICs: <a href='http://home.gvs.nga.ic.gov/CIDNE/SigactsServlet' title='http://home.gvs.nga.ic.gov/CIDNE/SigactsServlet' target='_blank'> SigactsServlet</a> ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1403200718000, "averageRating" : 4, "views" : 48, "totalNumberOfReviews" : 35, "resourceLocation" : "api/v1/resource/components/60/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 61, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS - Features - GE Shared Products", "description" : "GVS Shared Product Query provides you with the ability to display geospatial information layers in a Google Earth client depicting data previously created and stored in the GVS Shared Product Buffer by other users. Home page: <a href='https://home.gvs.nga.mil/UPS/RSS' title='https://home.gvs.nga.mil/UPS/RSS' target='_blank'> RSS</a> for the manual query <a href='https://home.gvs.nga.mil/home/capabilities/queries/shared_products' title='https://home.gvs.nga.mil/home/capabilities/queries/shared_products' target='_blank'> shared_products</a> for the query tool Wiki: A general GVS Wiki can be found here <a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> GVS</a> no specialized shared product wiki pages exist ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1403200719000, "averageRating" : 1, "views" : 0, "totalNumberOfReviews" : 3, "resourceLocation" : "api/v1/resource/components/61/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 62, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS - Features - Intelink", "description" : "GVS - Features - Intelink: Provides the capability to perform a temporal keyword search for news items, Intellipedia data, and intelligence reporting and finished products found on Intelink. A list of geo-referenced locations in response to a query based on a filter. GVS INTELINK GEO SEARCH WFS INTERFACE <a href='http://home.gvs.nga.ic.gov/metacarta/wfs' title='http://home.gvs.nga.ic.gov/metacarta/wfs' target='_blank'> wfs</a> SIPRNet: <a href='http://home.gvs.nga.smil.mil/metacarta/wfs' title='http://home.gvs.nga.smil.mil/metacarta/wfs' target='_blank'> wfs</a> ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1403200721000, "averageRating" : 5, "views" : 132, "totalNumberOfReviews" : 80, "resourceLocation" : "api/v1/resource/components/62/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 63, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS - Features - MIDB", "description" : "GVS - Features - MIDB allows the user to query MIDB (Equipment) data within a defined AOI. User takes HTTP-Get parameters (Listed below the summary table and in the documentation) and builds a query. In the exposed Service Interfaces document MIDB services are covered in section 6.1 which is approximately <a href='http://home.gvs.nga.ic.gov/MIDB/wfs' title='http://home.gvs.nga.ic.gov/MIDB/wfs' target='_blank'> wfs</a> <a href='http://home.gvs.nga.smil.mil/MIDB/wfs' title='http://home.gvs.nga.smil.mil/MIDB/wfs' target='_blank'> wfs</a> <a href='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' title='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' target='_blank'> documentation</a> <a href='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' title='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' target='_blank'> documentation</a> <a href='https://home.gvs.nga.ic.gov/home/documentation' title='https://home.gvs.nga.ic.gov/home/documentation' target='_blank'> documentation</a> <a href='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> GVS_Exposed_Service_Interfaces.pdf</a> <a href='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> GVS_Exposed_Service_Interfaces.pdf</a> <a href='https://home.gvs.ic.gov/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.ic.gov/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> GVS_Exposed_Service_Interfaces.pdf</a> <a href='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' title='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' target='_blank'> GVS_Consolidated_QRG_Book_Reduce...</a> <a href='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' title='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' target='_blank'> GVS_Consolidated_QRG_Book_Reduce...</a> <a href='https://home.gvs.nga.ic.gov/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' title='https://home.gvs.nga.ic.gov/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' target='_blank'> GVS_Consolidated_QRG_Book_Reduce...</a> ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1403200722000, "averageRating" : 2, "views" : 95, "totalNumberOfReviews" : 41, "resourceLocation" : "api/v1/resource/components/63/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ { "text" : "Access" }, { "text" : "Data Exchange" } ] }, { "listingType" : "Component", "componentId" : 64, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS - Features - NES", "description" : "GVS - Features - NES provides a visualization-ready (KML 2.2 compliant formatted) result set for a query of the targets obtained from the NGA National Exploitation System (NES), within a defined AOI (\"bounding box\", \"point/radius\", \"path buffer\").. Note, NES is only available on JWICS. Interface Details: <a href='http://home.gvs.nga.ic.gov/NESQuery/CoverageQuery' title='http://home.gvs.nga.ic.gov/NESQuery/CoverageQuery' target='_blank'> CoverageQuery</a> ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1403200723000, "averageRating" : 4, "views" : 176, "totalNumberOfReviews" : 10, "resourceLocation" : "api/v1/resource/components/64/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ { "text" : "Access" }, { "text" : "Charting" } ] }, { "listingType" : "Component", "componentId" : 65, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "HardwareWall", "description" : "The Boeing eXMeritus HardwareWall* is a highly configurable, commercial-off-the-shelf cross domain solution that enables rapid, automated, and secure data transfer between security domains: eXMeritus has designed HardwareWall* as a secure data transfer system and an off-the-shelf Controlled Interface <a href='http://www.exmeritus.com/hardware_wall.html' title='http://www.exmeritus.com/hardware_wall.html' target='_blank'> hardware_wall.html</a> <a href='http://www.boeing.com/advertising/c4isr/isr/exmeritus_harware_wall.html' title='http://www.boeing.com/advertising/c4isr/isr/exmeritus_harware_wall.html' target='_blank'> exmeritus_harware_wall.html</a> ...", "organization" : "Boeing", "lastActivityDate" : null, "updateDts" : 1403200725000, "averageRating" : 0, "views" : 183, "totalNumberOfReviews" : 72, "resourceLocation" : "api/v1/resource/components/65/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "Y" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "LICCLASS", "code" : "COTS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 36, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "IC AppsMall Cookbook: Applications Development", "description" : "The Applications Development Cookbook is designed as an overview of principles and best practices for Web Application Development, with a focus on new web and related technologies & concepts that take full advantage of modern browser capabilities. The ideas introduced in this document are not intended ...", "organization" : "IC SOG", "lastActivityDate" : null, "updateDts" : 1399485077000, "averageRating" : 5, "views" : 64, "totalNumberOfReviews" : 66, "resourceLocation" : "api/v1/resource/components/36/detail", "attributes" : [ { "type" : "TYPE", "code" : "DOC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 37, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "ISF Enterprise Data Viewer Widget", "description" : "A widget designed to display search results in a tabular format. It can page, sort, filter, and group results and organize items into working folders called \"Workspaces\" as well as perform full-record retrieval for supported result types. It depends on the Persistence Service to store and retrieve ...", "organization" : "NRO/GED", "lastActivityDate" : null, "updateDts" : 1399485078000, "averageRating" : 3, "views" : 57, "totalNumberOfReviews" : 20, "resourceLocation" : "api/v1/resource/components/37/detail", "attributes" : [ { "type" : "TYPE", "code" : "WIDGET" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "OWFCOMP", "code" : "Y" }, { "type" : "LICCLASS", "code" : "GOTS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 38, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "ISF Persistence Service", "description" : "A RESTful service that persists JSON documents. It is designed to have a swappable backend and currently supports MongoDB and in-memory implementations. ...", "organization" : "NRO/GED", "lastActivityDate" : null, "updateDts" : 1399485079000, "averageRating" : 5, "views" : 188, "totalNumberOfReviews" : 80, "resourceLocation" : "api/v1/resource/components/38/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "LICCLASS", "code" : "GOTS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 39, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "ISF Search Criteria Widget", "description" : "A widget dedicated to providing search criteria to a compatible CDR backend. It depends on the Persistence Service as a place to put retrieved metadata results. It also optionally depends on the Map widget to interactively define geospatial queries (a text-based option is also available) and to render ...", "organization" : "NRO/GED", "lastActivityDate" : null, "updateDts" : 1399485080000, "averageRating" : 3, "views" : 144, "totalNumberOfReviews" : 15, "resourceLocation" : "api/v1/resource/components/39/detail", "attributes" : [ { "type" : "TYPE", "code" : "WIDGET" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "OWFCOMP", "code" : "Y" }, { "type" : "LICCLASS", "code" : "GOTS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 40, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "iSpatial", "description" : "iSpatial is a commercially available geospatial framework designed as a set of ready-to-customize, baseline tools that can be rapidly adapted to meet use cases calling for geo-visualization. iSpatial consists of four major areas of core functionality: Authorizing, Searching, Managing and Collaborating. <a href='http://www.t-sciences.com/wp-content/uploads/2013/04/iSpatial_v3_Technical_White_Paper.pdf' title='http://www.t-sciences.com/wp-content/uploads/2013/04/iSpatial_v3_Technical_White_Paper.pdf' target='_blank'> iSpatial_v3_Technical_White_Pape...</a> iSpatial <a href='http://www.t-sciences.com/wp-content/uploads/2014/01/iSpatial_Fed.pptx' title='http://www.t-sciences.com/wp-content/uploads/2014/01/iSpatial_Fed.pptx' target='_blank'> iSpatial_Fed.pptx</a> ...", "organization" : "Thermopylae Sciences and Technology", "lastActivityDate" : null, "updateDts" : 1403200726000, "averageRating" : 2, "views" : 45, "totalNumberOfReviews" : 99, "resourceLocation" : "api/v1/resource/components/40/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.1" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "LICCLASS", "code" : "COTS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 41, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "JC2CUI Common 2D Map API Widget", "description" : "This is a map widget developed by JC2CUI that conforms to the Common Map API - see below for more information on the API. Using this API allows developers to focus on the problem domain rather than implementing a map widget themselves. It also allows the actual map implementation used to be chosen dynamically ...", "organization" : "JC2CUI", "lastActivityDate" : null, "updateDts" : 1399485082000, "averageRating" : 1, "views" : 96, "totalNumberOfReviews" : 40, "resourceLocation" : "api/v1/resource/components/41/detail", "attributes" : [ { "type" : "TYPE", "code" : "WIDGET" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "OWFCOMP", "code" : "Y" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 42, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "JView", "description" : "JView is a Java-based API (application programmer's interface) that was developed to reduce the time, cost, & effort associated with the creation of computer visualization applications. JView provides the programmer with the ability to quickly develop 2-dimensional and 3-dimensional visualization <a href='https://extranet.rl.af.mil/jview/.' title='https://extranet.rl.af.mil/jview/.' target='_blank'> .</a> Formal configuration management and distribution of JView is performed through the Information Management Services program. ...", "organization" : "AFRL", "lastActivityDate" : null, "updateDts" : 1405370213000, "averageRating" : 1, "views" : 174, "totalNumberOfReviews" : 4, "resourceLocation" : "api/v1/resource/components/42/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL1" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LICCLASS", "code" : "GOTS" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 43, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Military Symbology Renderer", "description" : "The Mil Symbology Renderer is both a developer's toolkit as well as a ready to use deployable web application. The goal of this project is to provide a single distributable solution that can support as many use cases as possible for military symbology rendering. The current features available are: * ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1399485084000, "averageRating" : 2, "views" : 178, "totalNumberOfReviews" : 60, "resourceLocation" : "api/v1/resource/components/43/detail", "attributes" : [ { "type" : "TYPE", "code" : "WIDGET" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "OWFCOMP", "code" : "Y" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 44, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "OpenAM", "description" : "OpenAM is an all-in-one access management platform with the adaptive intelligence to protect against risk-based threats across any environment. ...", "organization" : "DI2E-F", "lastActivityDate" : null, "updateDts" : 1403200729000, "averageRating" : 5, "views" : 29, "totalNumberOfReviews" : 2, "resourceLocation" : "api/v1/resource/components/44/detail", "attributes" : [ { "type" : "DI2E-SVCV4-A", "code" : "1.2.1" }, { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 45, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "OpenSextant", "description" : "(U) OpenSextant is an open source software package for geotagging unstructured text. OpenSextant is implemented in Java and based on the open source text analytic software GATE ( <a href='http://gate.ac.uk/' title='http://gate.ac.uk/' target='_blank'> </a> ). (U) OpenSextant can geotag documents in any ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1399485085000, "averageRating" : 3, "views" : 172, "totalNumberOfReviews" : 29, "resourceLocation" : "api/v1/resource/components/45/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 46, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "OpenStack", "description" : "OpenStack is open source software for building public and private clouds ( <a href='http://www.openstack.org' title='http://www.openstack.org' target='_blank'> www.openstack.org</a> ). The release here has been developed by USC/ISI and has two distinctions from the mainstream open source release. First, ...", "organization" : "USC/ISI", "lastActivityDate" : null, "updateDts" : 1399485086000, "averageRating" : 4, "views" : 64, "totalNumberOfReviews" : 17, "resourceLocation" : "api/v1/resource/components/46/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "PILOT" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 47, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "OpenStack Lessons Learned Document", "description" : "Lessons learned in the Openstack Folsom deployment by USC/ISI in the DI2E Framework environment. This document is meant to be very specific to one deployment experience with the intention that it will be useful to others deploying in a similar environment. Note this document is stored on the DI2E Framework <a href='https://devtools.di2e.net/' title='https://devtools.di2e.net/' target='_blank'> ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1399485087000, "averageRating" : 0, "views" : 178, "totalNumberOfReviews" : 65, "resourceLocation" : "api/v1/resource/components/47/detail", "attributes" : [ { "type" : "TYPE", "code" : "DOC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 48, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "OWASP Enterprise Security API", "description" : "ESAPI (The OWASP Enterprise Security API) is a free, open source, web application security control library that makes it easier for programmers to write lower-risk applications. The ESAPI libraries are designed to make it easier for programmers to retrofit security into existing applications. The ESAPI <a href='https://www.owasp.org.' title='https://www.owasp.org.' target='_blank'> www.owasp.org.</a> ...", "organization" : "OWASP", "lastActivityDate" : null, "updateDts" : 1399485088000, "averageRating" : 5, "views" : 158, "totalNumberOfReviews" : 92, "resourceLocation" : "api/v1/resource/components/48/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "Access" }, { "text" : "Testing" } ] }, { "listingType" : "Component", "componentId" : 49, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "OWASP Web Application Security Guide", "description" : "The Development Guide is aimed at architects, developers, consultants and auditors and is a comprehensive manual for designing, developing and deploying secure Web Applications and Web Services. The original OWASP Development Guide has become a staple diet for many web security professionals. Since 2002, <a href='https://www.owasp.org.' title='https://www.owasp.org.' target='_blank'> www.owasp.org.</a> ...", "organization" : "OWASP", "lastActivityDate" : null, "updateDts" : 1399485088000, "averageRating" : 1, "views" : 46, "totalNumberOfReviews" : 89, "resourceLocation" : "api/v1/resource/components/49/detail", "attributes" : [ { "type" : "TYPE", "code" : "DOC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null } ], "tags" : [ { "text" : "Charting" }, { "text" : "Visualization" } ] }, { "listingType" : "Component", "componentId" : 50, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Ozone Marketplace", "description" : "The Ozone marketplace is a storefront to store widgets, services, and web applications. It can be linked to the Ozone Widget Framework. ...", "organization" : "OWF Goss", "lastActivityDate" : null, "updateDts" : 1399485089000, "averageRating" : 1, "views" : 53, "totalNumberOfReviews" : 60, "resourceLocation" : "api/v1/resource/components/50/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "UDOP" }, { "text" : "Communication" } ] }, { "listingType" : "Component", "componentId" : 51, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Ozone Widget Framework", "description" : "OWF is a web application that allows users to easily access all their online tools from one location. Not only can users access websites and applications with widgets, they can group them and configure some applications to interact with each other via widget intents. Some Links: http://www.ozoneplatform.org/ ...", "organization" : "OWF GOSS", "lastActivityDate" : null, "updateDts" : 1402947991000, "averageRating" : 1, "views" : 173, "totalNumberOfReviews" : 37, "resourceLocation" : "api/v1/resource/components/51/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "LICTYPE", "code" : "GOVUNL" } ], "tags" : [ { "text" : "Communication" } ] }, { "listingType" : "Component", "componentId" : 53, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "VANTAGE Software Suite", "description" : "VANTAGE is a tactical imagery exploitation software suite. This field proven application screens digital imagery from various tactical reconnaissance sensors and includes simultaneous support for multiple sensor types. VANTAGE provides for real and near real time screening of digital image data from ...", "organization" : "NRL", "lastActivityDate" : null, "updateDts" : 1405452097000, "averageRating" : 2, "views" : 77, "totalNumberOfReviews" : 95, "resourceLocation" : "api/v1/resource/components/53/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "DEV" } ], "tags" : [ { "text" : "Mapping" } ] }, { "listingType" : "Component", "componentId" : 54, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "VANTAGE WESS OZONE Widget", "description" : "The Vantage Web Enabled Sensor Service (WESS) is an optional service that provides access to Vantage databases from other applications. WESS The Web Enabled Sensor Service (WESS) is a server that runs on the Vantage server and exposes the Vantage database of imagery and metadata to the outside via SOAP. <a href='http://www.spacedynamics.org/products/vantage' title='http://www.spacedynamics.org/products/vantage' target='_blank'> vantage</a> ...", "organization" : "NRL", "lastActivityDate" : null, "updateDts" : 1405452122000, "averageRating" : 4, "views" : 152, "totalNumberOfReviews" : 78, "resourceLocation" : "api/v1/resource/components/54/detail", "attributes" : [ { "type" : "TYPE", "code" : "WIDGET" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LICCLASS", "code" : "GOTS" }, { "type" : "LIFECYCSTG", "code" : "DEV" }, { "type" : "OWFCOMP", "code" : "Y" } ], "tags" : [ { "text" : "Mapping" } ] }, { "listingType" : "Component", "componentId" : 55, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Vega 3D Map Widget", "description" : "Vega is a 3D map widget with support for high-resolution imagery in various formats including WMS, WFS, and ArcGIS. Vega also supports 3-dimensional terrain, and time-based data and has tools for drawing shapes and points and importing/exporting data. ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1403200733000, "averageRating" : 4, "views" : 198, "totalNumberOfReviews" : 75, "resourceLocation" : "api/v1/resource/components/55/detail", "attributes" : [ { "type" : "TYPE", "code" : "WIDGET" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "OWFCOMP", "code" : "Y" } ], "tags" : [ ] }, { "listingType" : "Article", "componentId" : null, "articleAttributeType" : "1.2.1", "articleAttributeCode" : "DI2E-SVCV4-A", "name" : "IdAM", "description" : "Identity and Access Management Article.....", "organization" : "PMO", "lastActivityDate" : 1407175956075, "updateDts" : 1407175956075, "averageRating" : 0, "views" : 0, "totalNumberOfReviews" : 0, "resourceLocation" : "api/v1/resource/attributes/DI2E-SVCV4-A/attributeCode/1.2.1/article", "attributes" : [ { "type" : "DI2E-SVCV4-A", "code" : "1.2.1" } ], "tags" : [ ] } ]; // (function(){ // var types = []; // _.each(MOCKDATA2.resultsList, function(item){ // _.each(item.attributes, function(attribute){ // if (!types[attribute.typeDescription]) { // types[attribute.typeDescription] = {}; // types[attribute.typeDescription].codes = []; // } // types[attribute.typeDescription].codes.push(attribute.codeDescription); // types[attribute.typeDescription].codes = jQuery.unique(types[attribute.typeDescription].codes); // }) // }) // console.log('results', types); // }()); /* jshint ignore:end */
client/openstorefront/app/scripts/common-min/data2.js
/* * Copyright 2014 Space Dynamics Laboratory - Utah State University Research Foundation. * * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Code here will be linted with JSHint. /* jshint ignore:start */ // Code here will be linted with ignored by JSHint. var MOCKDATA2 = {}; MOCKDATA2.componentList = [ { "componentId" : 67, "guid" : "3a57b4c2-a90b-4098-8c56-916618afd8ee", "name" : "Central Authentication Service (CAS)", "description" : "The Central Authentication Service (CAS) is a single sign-on protocol for the web. Its purpose is to permit a user to access multiple applications while providing their credentials (such as userid and password) only once. It also allows web applications to authenticate users without gaining access to a user's security credentials, such as a password. The name CAS also refers to a software package that implements this protocol. <br> <br>CAS provides enterprise single sign-on service: <br>-An open and well-documented protocol <br>-An open-source Java server component <br>-A library of clients for Java, .Net, PHP, Perl, Apache, uPortal, and others <br>-Integrates with uPortal, Sakai, BlueSocket, TikiWiki, Mule, Liferay, Moodle and others <br>-Community documentation and implementation support <br>-An extensive community of adopters", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NRO", "releaseDate" : null, "version" : null, "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "david.treat", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405698045000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Are samples included? (SAMPLE)", "username" : "Abby TEST", "userType" : "Project Manager", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "answeredDate" : 1399961730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1398845730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1399961730000 } ] } ], "attributes" : [ { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "1.2.1", "codeDescription" : "Identity and Access Management", "important" : true, "codeLongDescription": "<strong>Description:</strong> IdAM includes services that provide criteria used in access decisions and the rules and requirements assessing each request against those criteria. Resources may include applications, services, networks, and computing devices.<br/> <strong>Definition:</strong> Identity and Access Management (IdAM) defines the set of services that manage permissions required to access each resource.", }, { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "LICTYPE", "typeDescription" : "License Type", "code" : "OPENSRC", "codeDescription" : "Open Source", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/CAS.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='http://www.jasig.org/cas' title='http://www.jasig.org/cas' target='_blank'> http://www.jasig.org/cas</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='http://www.jasig.org/cas/download' title='http://www.jasig.org/cas/download' target='_blank'> http://www.jasig.org/cas/download</a>" } ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "Developer", "comment" : "This is a great product however, it's missing what I think are critical features. Hopefully, they are working on it for future updates.", "rating" : 4, "title" : "Great but missing features (SAMPLE)", "usedTimeCode" : "< 1 year", "lastUsed" : 1381644930000, "updateDate" : 1399961730000, "organization" : "NSA", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Difficult Installation" } ] }, { "username" : "Cathy TEST", "userType" : "Project Manager", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 5, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1381644930000, "updateDate" : 1391537730000, "organization" : "NSA", "recommend" : false, "pros" : [ { "text" : "Well Tested" } ], "cons" : [ { "text" : "Poorly Tested" }, { "text" : "Bulky" } ] } ], "dependencies" : [ ] }, { "componentId" : 9, "guid" : "75718e9b-f650-4600-b949-cdebc5c179ec", "name" : "CLAVIN", "description" : "CLAVIN (Cartographic Location And Vicinity Indexer) is an open source software package for document geotagging and geoparsing that employs context-based geographic entity resolution. It extracts location names from unstructured text and resolves them against a gazetteer to produce data-rich geographic entities. CLAVIN uses heuristics to identify exactly which \"Portland\" (for example) was intended by the author, based on the context of the document. CLAVIN also employs fuzzy search to handle incorrectly-spelled location names, and it recognizes alternative names (e.g., \"Ivory Coast\" and \"Cete d'Ivoire\") as referring to the same geographic entity.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1398578400000, "version" : "see site for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1400005248000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : 1388769330000, "endDate" : 1393694130000, "currentLevelCode" : "LEVEL1", "reviewedVersion" : "1.0", "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "P" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ { "name" : "Discoverable", "score" : 3 }, { "name" : "Accessible", "score" : 4 }, { "name" : "Documentation", "score" : 3 }, { "name" : "Deployable", "score" : 4 }, { "name" : "Usable", "score" : 5 }, { "name" : "Error Handling", "score" : 2 }, { "name" : "Integrable", "score" : 1 }, { "name" : "I/O Validation", "score" : 2 }, { "name" : "Testing", "score" : 0 }, { "name" : "Monitoring", "score" : 2 }, { "name" : "Performance", "score" : 1 }, { "name" : "Scalability", "score" : 1 }, { "name" : "Security", "score" : 4 }, { "name" : "Maintainability", "score" : 3 }, { "name" : "Community", "score" : 3 }, { "name" : "Change Management", "score" : 2 }, { "name" : "CA", "score" : 3 }, { "name" : "Licensing", "score" : 4 }, { "name" : "Roadmap", "score" : 0 }, { "name" : "Willingness", "score" : 5 }, { "name" : "Architecture Alignment", "score" : 5 } ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL1", "codeDescription" : "Level 1 - Initial Reuse Analysis", "important" : true }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "FOSS", "codeDescription" : "FOSS", "important" : false } ], "tags" : [ { "text" : "Mapping" }, { "text" : "Reference" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/clavin_logo.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='http://clavin.bericotechnologies.com' title='http://clavin.bericotechnologies.com' target='_blank'> http://clavin.bericotechnologies.com</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://github.com/Berico-Technologies/CLAVIN' title='https://github.com/Berico-Technologies/CLAVIN' target='_blank'> https://github.com/Berico-Technologies/CLAVIN</a>" }, { "name" : "DI2E Framework Evaluation Report URL", "type" : "DI2E Framework Evaluation Report URL", "description" : null, "link" : "<a href='https://storefront.di2e.net/marketplace/public/Clavin_ChecklistReport_v1.0.docx' title='https://storefront.di2e.net/marketplace/public/Clavin_ChecklistReport_v1.0.docx' target='_blank'> https://storefront.di2e.net/marketplace/public/Clavin_ChecklistReport_v1.0.docx</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='http://clavin.bericotechnologies.com/' title='http://clavin.bericotechnologies.com/' target='_blank'> http://clavin.bericotechnologies.com/</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://github.com/Berico-Technologies/CLAVIN' title='https://github.com/Berico-Technologies/CLAVIN' target='_blank'> https://github.com/Berico-Technologies/CLAVIN</a>" } ], "reviews" : [ { "username" : "Abby TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 4, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "> 3 years", "lastUsed" : 1388769330000, "updateDate" : 1391537730000, "organization" : "DCGS Navy", "recommend" : false, "pros" : [ { "text" : "Well Tested" }, { "text" : "Compact" } ], "cons" : [ { "text" : "Poor Documentation" } ] } ], "dependencies" : [ ] }, { "componentId" : 10, "guid" : "23aa2f6b-1842-43d8-910f-f547f4696c0d", "name" : "Common Map API Javascript Library", "description" : "Core Map API is a library of JavaScript (JS) functions that hide the underlying Common Map Widget API so that developers only have to include the JS library and call the appropriate JS functions that way they are kept away from managing or interacting directly with the channels. <br> <br>Purpose/Goal of the Software: Core Map API hides the details on directly interacting with the Ozone Widget Framework (WOF) publish/subscribe channels. It is intended to insulate applications from changes in the underlying CMWAPI as they happen. <br> <br>Additional documentation can also be found here - <a href='https://confluence.di2e.net/download/attachments/14518881/cpce-map-api-jsDocs.zip?api=v2' title='https://confluence.di2e.net/download/attachments/14518881/cpce-map-api-jsDocs.zip?api=v2' target='_blank'> cpce-map-api-jsDocs.zip?api=v2</a> <br> <br>Target Audience: Developers", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DCGS-A", "releaseDate" : 1362812400000, "version" : "1.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485055000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : 1388769330000, "endDate" : 1393694130000, "currentLevelCode" : "LEVEL1", "reviewedVersion" : "1.0", "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : null, "actualCompletionDate" : 1392138930000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ { "name" : "Discoverable", "score" : 3 }, { "name" : "Accessible", "score" : 4 }, { "name" : "Documentation", "score" : 3 }, { "name" : "Deployable", "score" : 0 }, { "name" : "Usable", "score" : 1 }, { "name" : "Error Handling", "score" : 0 }, { "name" : "Integrable", "score" : 3 }, { "name" : "I/O Validation", "score" : 2 }, { "name" : "Testing", "score" : 1 }, { "name" : "Monitoring", "score" : 5 }, { "name" : "Performance", "score" : 0 }, { "name" : "Scalability", "score" : 5 }, { "name" : "Security", "score" : 3 }, { "name" : "Maintainability", "score" : 5 }, { "name" : "Community", "score" : 3 }, { "name" : "Change Management", "score" : 0 }, { "name" : "CA", "score" : 3 }, { "name" : "Licensing", "score" : 5 }, { "name" : "Roadmap", "score" : 3 }, { "name" : "Willingness", "score" : 4 }, { "name" : "Architecture Alignment", "score" : 3 } ] }, "questions" : [ { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1393834530000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "answeredDate" : 1398845730000 } ] }, { "question" : "Does this support the 2.0 specs? (SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "No, they planned to add support next Version(SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "answeredDate" : 1393834530000 }, { "response" : "Update: they backport support to version 1.6(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1398845730000 } ] }, { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1398845730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1399961730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL1", "codeDescription" : "Level 1 - Initial Reuse Analysis", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "PILOT", "codeDescription" : "Deployment Pilot", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/download/attachments/14518881/CP-CE%20COE%20v2%20Map%20API%20Developer%20Guide.pdf?api=v2' title='https://confluence.di2e.net/download/attachments/14518881/CP-CE%20COE%20v2%20Map%20API%20Developer%20Guide.pdf?api=v2' target='_blank'> https://confluence.di2e.net/download/attachments/14518881/CP-CE%20COE%20v2%20Map%20API%20Developer%20Guide.pdf?api=v2</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/download/attachments/14518881/cpce-map-api.war?api=v2' title='https://confluence.di2e.net/download/attachments/14518881/cpce-map-api.war?api=v2' target='_blank'> https://confluence.di2e.net/download/attachments/14518881/cpce-map-api.war?api=v2</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/EMP/repos/map-api/browse/js' title='https://stash.di2e.net/projects/EMP/repos/map-api/browse/js' target='_blank'> https://stash.di2e.net/projects/EMP/repos/map-api/browse/js</a>" }, { "name" : "DI2E Framework Evaluation Report URL", "type" : "DI2E Framework Evaluation Report URL", "description" : null, "link" : "<a href='https://storefront.di2e.net/marketplace/public/CMAPI-JavascriptLibrary_ChecklistReport_v1.0.docx' title='https://storefront.di2e.net/marketplace/public/CMAPI-JavascriptLibrary_ChecklistReport_v1.0.docx' target='_blank'> https://storefront.di2e.net/marketplace/public/CMAPI-JavascriptLibrary_ChecklistReport_v1.0.docx</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 11, "guid" : "4a1c06c7-c854-43db-a41b-5318a7012412", "name" : "Common Map Widget API", "description" : "Background <br>Many programs and projects create widgets that search for or manipulate data then present the results on a map. The desire is to be able to combine data search/manipulation widgets from any provider with map widgets from other providers. In order to accomplish this, a standard way for the data search/manipulation widgets to be able to communicate with the map widget is necessary. This Application Program Interface (API) is the codification of that standard. <br> <br>Overview <br>Using this API allows developers to focus on the problem domain rather than implementing a map widget themselves. It also allows the actual map implementation used to be chosen dynamically by the user at runtime rather than being chosen by the developer. Any map implementation that applies this API can be used. Currently, implementations using Google Earth, Google Maps V2, Google Maps V3, and OpenLayers APIs are available, and others can be written as needed. <br>Another benefit of this API is that it allows multiple widgets to collaboratively display data on a single map widget rather than forcing the user to have a separate map for each widget so the user does not have to learn a different map user interface for each widget. <br>The API uses the OZONE Widget Framework (OWF) inter-widget communication mechanism to allow client widgets to interact with the map. Messages are sent to the appropriate channels (defined below), and the map updates its state accordingly. Other widgets interested in knowing the current map state can subscribe to these messages as well. <br> <br>also available on <a href='https://software.forge.mil/sf/frs/do/viewRelease/projects.jc2cui/frs.common_map_widget.common_map_widget_api' title='https://software.forge.mil/sf/frs/do/viewRelease/projects.jc2cui/frs.common_map_widget.common_map_widget_api' target='_blank'> frs.common_map_widget.common_map...</a>", "parentComponent" : { "componentId" : 9, "name" : "CLAVIN" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E Framework", "releaseDate" : 1364364000000, "version" : "1.1", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "System", "updateDts" : 1404172800000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "Charting" } ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='http://www.cmapi.org/spec.html' title='http://www.cmapi.org/spec.html' target='_blank'> http://www.cmapi.org/spec.html</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='http://www.cmapi.org/spec.html' title='http://www.cmapi.org/spec.html' target='_blank'> http://www.cmapi.org/spec.html</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 12, "guid" : "bbf65a32-157c-4770-9cee-948bd48b3837", "name" : "Content Discovery and Retrieval Engine - Brokered Search Component", "description" : "Content Discovery and Retrieval functionality is based on the architecture, standards, and specifications being developed and maintained by the joint IC/DoD Content Discovery and Retrieval (CDR) Integrated Product Team (IPT). The components contained in this release are the 1.1 version of the reference implementation of the CDR components currently integrated within a system architecture that supports the Intelligence Community. <br> <br>The Brokered Search Component is an implementation of the capabilities and interfaces defined in the following CDR Brokered Search Service Specifications: <br><ul><li>IC/DoD CDR Brokered Search Service Specification for OpenSearch Implementations Version 1.0, 25 October 2010.</li> <br><li>IC/DoD CDR Brokered Search Service Specification for SOAP Implementations, Version 1.0, 26 October 2010.</li></ul> <br> <br>Generally speaking, the main thread of the Brokered Search Component is: <br>1.\tAccept a CDR 1.0 formatted brokered search request from a consumer <br>2.\tExtract routing criteria from the brokered search request <br>3.\tIdentify the correct search components to route the search request to based on the extracted routing criteria <br>4.\tRoute the search request to the identified search components <br>5.\tAggregate the metadata results from the separate search components into a single result stream and return the results to the consumer <br>It is important to note that a compatible service registry must be configured with Brokered Search, in order for the service to work as-implemented. Brokered Search queries the registry to get an accurate list of available endpoints.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E-F", "releaseDate" : 1329634800000, "version" : "n/a", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485057000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Does this support the 2.0 specs? (SAMPLE)", "username" : "Abby TEST", "userType" : "Project Manager", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "No, they planned to add support next Version(SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "answeredDate" : 1391447730000 }, { "response" : "Update: they backport support to version 1.6(SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "answeredDate" : 1391537730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "answeredDate" : 1393834530000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1393834530000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ { "text" : "Charting" }, { "text" : "Data Exchange" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/satellite-icon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' title='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' title='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/Content_Discovery_and_Retrieval_Brokered_Search_Service' title='https://intellipedia.intelink.gov/wiki/Content_Discovery_and_Retrieval_Brokered_Search_Service' target='_blank'> https://intellipedia.intelink.gov/wiki/Content_Discovery_and_Retrieval_Brokered_Search_Service</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 13, "guid" : "ccec2c4d-fa44-487f-9b34-ac7d10ec62ba", "name" : "Content Discovery and Retrieval Engine - Describe Component", "description" : "Content Discovery and Retrieval functionality is based on the architecture, standards, and specifications being developed and maintained by the joint IC/DoD Content Discovery and Retrieval (CDR) Integrated Product Team (IPT). The components contained in this release are the 1.1 version of the reference implementation of the CDR components currently integrated within a system architecture that supports the Intelligence Community. <br> <br>The Describe Service component supports machine-to-machine interactions to provide a service consumer with a list of available search components for which a Brokered Search Service may search. <br> <br>As a result of invoking the Describe Service component, the service consumer receives a list of search components that a broker may search. In any case, the results are returned in the format of an Atom feed.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E Framework", "releaseDate" : 1329894000000, "version" : "n/a", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485058000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "createDts" : 1367309730000, "updateDts" : 1367309730000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "answeredDate" : 1398845730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1398845730000 } ] }, { "question" : "Does this support the 2.0 specs? (SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "No, they planned to add support next Version(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1393834530000 }, { "response" : "Update: they backport support to version 1.6(SAMPLE)", "username" : "Cathy TEST", "userType" : "Project Manager", "answeredDate" : 1398845730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ { "text" : "Data Exchange" }, { "text" : "UDOP" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/satellite-icon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' title='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' title='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 14, "guid" : "2a5401d9-3e8b-4c7a-a75d-273953be24e6", "name" : "Content Discovery and Retrieval Engine - Retrieve Component", "description" : "The Retrieve Components are implementations of the capabilities and interfaces defined in IC/DoD CDR Retrieve Service Specification for SOAP Implementations DRAFT Version 1.0-20100331, March 31, 2010. Each Retrieve Component is a separately deployable component that provides access to a defined content provider/content collection. The main thread of a Retrieve Component is: <br> 1. Accept a CDR 1.0 formatted retrieve request from a consumer <br> 2. Transform the CDR 1.0 retrieve request to a provider-specific retrieve request and execute the request against the provider/content collection to obtain the provider content <br> 3. Package the provider content into a CDR 1.0 formatted retrieve result and return it to the consumer <br> <br>The ADL CDR Components include a programmer Software Development Kit (SDK). The SDK includes the framework, sample code, and test driver for developing Retrieve Components with a SOAP interface conforming to the Agency Data Layer CDR Components implementation of the CDR 1.0 Specifications. <br> <br>Note that this is an abstract service definition and it is expected that it will be instantiated multiple times on multiple networks and in multiple systems. Each of those instances will have their own concrete service description which will include endpoint, additional security information, etc. <br> <br>Also see the Agency Data Layer Overview in <a href='https://www.intelink.gov/inteldocs/browse.php?fFolderId=431781' title='https://www.intelink.gov/inteldocs/browse.php?fFolderId=431781' target='_blank'> browse.php?fFolderId=431781</a> for more general information about CDR.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E-F", "releaseDate" : 1329807600000, "version" : "n/a", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485059000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "createDts" : 1328379330000, "updateDts" : 1328379330000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1391447730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "answeredDate" : 1399961730000 } ] }, { "question" : "Does this support the 2.0 specs? (SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "No, they planned to add support next Version(SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "answeredDate" : 1393834530000 }, { "response" : "Update: they backport support to version 1.6(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1391537730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/satellite-icon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' title='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' title='https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.di2e-f/frs.agency_data_layer_content_discov</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://www.intelink.gov/wiki/Content_Discovery_and_Retrieval_Retrieve_Service' title='https://www.intelink.gov/wiki/Content_Discovery_and_Retrieval_Retrieve_Service' target='_blank'> https://www.intelink.gov/wiki/Content_Discovery_and_Retrieval_Retrieve_Service</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 15, "guid" : "f8a744b0-39b1-4ee9-8dd4-daf5a6f931a2", "name" : "Cursor on Target Toolkit", "description" : "(U) Cursor on Target is a set of components focused on driving interoperability in message exchanges. Components include: <br>*An XML message schema <br> &nbsp;&nbsp;Basic (mandatory): what, when, where <br>&nbsp;&nbsp; Extensible (optional): add subschema to add details <br>\u0001*A standard <br>&nbsp;&nbsp; Established as USAF standard by SECAF memo April 2007 <br>&nbsp;&nbsp; Incorporated in USAF (SAF/XC) Enterprise Architecture <br>&nbsp;&nbsp; Registered by SAF/XC in DISROnline as a USAF Organizationally Unique Standard (OUS) <br>&nbsp;&nbsp; Foundation for UCore data model <br>&nbsp;&nbsp; On the way to becoming a MIL-STD <br>\u0001*A set of software plug-ins to enable systems, including VMF and Link 16, to input and output CoT messages <br>*A CoT message router (software) to facilitate publish/subscribe message routing <br>*A simple developer's tool kit", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "Air Force", "releaseDate" : 1230534000000, "version" : "1.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485060000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/CoTSS.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/CoTIcon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/projects/cot' title='https://software.forge.mil/sf/projects/cot' target='_blank'> https://software.forge.mil/sf/projects/cot</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/projects/cot' title='https://software.forge.mil/sf/projects/cot' target='_blank'> https://software.forge.mil/sf/projects/cot</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 16, "guid" : "8bfc523a-591c-4fb9-a3ff-6bf96ed02c99", "name" : "DCGS Discovery Metadata Guide", "description" : "This document provides information on DCGS metadata artifacts and guidance for populating DDMS and the DIB Metacard, using DDMS Schema Extensions, and creating new DDMS extension schemas. These guidelines should be used by developers and System Integrators building resource adapters and schemas to work with DIB v2.0 or later. <br> <br>DISTRIBUTION STATEMENT C - Distribution authorized to U.S. Government Agencies and their contractors (Critical Technology) Not ITAR restricted", "parentComponent" : null, "subComponents" : [ { "componentId" : 15, "name" : "Cursor on Target Toolkit" } ], "relatedComponents" : [ ], "organization" : "AFLCMC/HBBG", "releaseDate" : 1393830000000, "version" : "See site for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485060000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "answeredDate" : 1391537730000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1393834530000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "DOC", "codeDescription" : "Documentation", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : null, "codeDescription" : null, "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://wiki.macefusion.com/display/MMT/DCGS+Discovery+Metadata+Guide' title='https://wiki.macefusion.com/display/MMT/DCGS+Discovery+Metadata+Guide' target='_blank'> https://wiki.macefusion.com/display/MMT/DCGS+Discovery+Metadata+Guide</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 17, "guid" : "1687ab9a-f6de-4253-9887-f9dfcece10d5", "name" : "DCGS Enterprise Messaging Technical Profile", "description" : "DCGS Enterprise Services rely on asynchronous communications for sending messages so they can notify users when certain data is published or a particular event has occurred. Users may subscriber to a data source so they can be notified when a piece of intelligence has been published on a topic of interest. Enterprise Messaging is a key capability that supports the processing of messages between Web Services that are needed for an enterprise to function efficiently. As the number of Web Services deployed across an enterprise increases, the ability to effectively send and receive messages across an enterprise becomes critical for its success. This Technical Design Document (TDD) was created by the DCGS Enterprise Focus Team (EFT) to provide guidance for Enterprise Messaging for use by the DCGS Enterprise Community at large. DCGS Service Providers will use this guidance to support the Enterprise Standards for the DCGS Enterprise. <br> <br>Content of Enterprise Messaging (EM) CDP: <br> - Technical Design Document (TDD) <br> - Service Specification Package (SSP) <br> - Conformance Test Kit (CTK) <br> - Conformance Traceability Matrix (CTM) <br> - Test Procedure Document <br> - Test Request Messages <br> - Gold Data Set <br> - Conformance Checks Scripts", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DCGS EFT", "releaseDate" : 1278309600000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485061000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/q30MNpu' title='https://www.intelink.gov/go/q30MNpu' target='_blank'> https://www.intelink.gov/go/q30MNpu</a>" } ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "Developer", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 4, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1362298530000, "updateDate" : 1399961730000, "organization" : "Private Company", "recommend" : false, "pros" : [ { "text" : "Compact" }, { "text" : "Well Tested" } ], "cons" : [ ] }, { "username" : "Cathy TEST", "userType" : "End User", "comment" : "This wasn't quite what I thought it was.", "rating" : 2, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1381644930000, "updateDate" : 1391447730000, "organization" : "NGA", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Security Concerns" }, { "text" : "Difficult Installation" } ] } ], "dependencies" : [ ] }, { "componentId" : 18, "guid" : "fe190601-3d24-48fd-b7ca-09ea9b5ddd5f", "name" : "DCGS Enterprise OWF IdAM Technical Profile", "description" : "The Ozone Widget Framework is a web-application engine built around the concept of discrete, reusable web application interface components called widgets. Widgets may be composed into full applications by Ozone users or administrators. <br> <br> <br>The architecture of the Ozone framework allows widgets to be implemented and deployed in remote web application servers. This leads to the possibility of an enterprise Ozone architecture, where Ozone users may access widgets from multiple providers in the enterprise. <br> <br>An enterprise Ozone architecture will require a capability that can provide identity and access management services to Ozone and widget web applications and provide a single-sign-on experience to Ozone users. <br> <br>Content of Ozone Widget Framework Identity and Access Management CDP: <br>- Technical Design Document (TDD) <br>- Web Service Specification, Web Browser Single Sign On <br>- Conformance Test Kit (CTK) <br>- Conformance Traceability Matrix (CTM) <br>- Test Procedure Document <br>- Test Request Messages <br>- Gold Data Set <br>- Conformance Checks Scripts", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1382940000000, "version" : "draft", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399487595000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/jeYvHyO' title='https://www.intelink.gov/go/jeYvHyO' target='_blank'> https://www.intelink.gov/go/jeYvHyO</a>" } ], "reviews" : [ ], "dependencies" : [ { "dependency" : "Erlang", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 3.0" } ] }, { "componentId" : 19, "guid" : "346042fd-1e3c-4486-93a6-f3dc9acb71c1", "name" : "DCGS Integration Backbone (DIB)", "description" : "The Distributed Common Ground/Surface System (DCGS) Integration Backbone (DIB) is the enabler for DCGS enterprise interoperability. The DIB is a technical infrastructure, the foundation for sharing data across the ISR enterprise. More specifically the DIB is: <br>1) Standards-based set of software, services, documentation and metadata schema designed to enhance interoperability of ISR <br>2) Data sharing enabler for the ISR enterprise <br>3) Reduces development costs through component sharing and reuse. <br>DIB Provides timely information, with access to all enterprise intelligence dissemination nodes, containing terabytes of data, the ability to filter data to relevant results, and supports real-time Cross Domain ISR data query and retrieval across Coalition and/or Security domains", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DMO", "releaseDate" : 1383548400000, "version" : "4.0.2", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485063000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/DIBProjectLogo.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/go/proj1145' title='https://software.forge.mil/sf/go/proj1145' target='_blank'> https://software.forge.mil/sf/go/proj1145</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/go/proj1145' title='https://software.forge.mil/sf/go/proj1145' target='_blank'> https://software.forge.mil/sf/go/proj1145</a>" } ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "Project Manager", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 3, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "> 3 years", "lastUsed" : 1381644930000, "updateDate" : 1393834530000, "organization" : "NSA", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Poorly Tested" } ] }, { "username" : "Abby TEST", "userType" : "Project Manager", "comment" : "This wasn't quite what I thought it was.", "rating" : 1, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 6 Months", "lastUsed" : 1367309730000, "updateDate" : 1391537730000, "organization" : "DCGS Navy", "recommend" : false, "pros" : [ { "text" : "Well Tested" } ], "cons" : [ ] } ], "dependencies" : [ { "dependency" : "Ruby", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 2.0+" } ] }, { "componentId" : 20, "guid" : "4cd37f95-c98e-4a83-800b-887cd972c714", "name" : "DCGS-E Audit Log Management and Reporting Technical Profile", "description" : "This CDP provides the technical design description for the Audit and Accountability capability of the Distributed Common Ground/Surface System (DCGS) Enterprise Service Dial Tone (SDT) layer. It includes the capability architecture design details, conformance requirements, and implementation guidance. <br> <br>Certain user actions, performed within a limited time period and in certain patterns, can be signs of preparation or attempts to exploit system vulnerabilities that involve privileged access. Certain actions taken by the application server, in response to a perceived threat, are also potential signs of an attack. Taken individually, these events are not absolute indicators and any response to them could be premature. However, if the execution of the actions is not recorded, it becomes impossible to recognize later the pattern that confirms the occurrence of an attack. In a Service Oriented Architecture (SOA), Web services dynamically bind to one another, making it even more difficult to recognize these patterns across Web services and determine accountability in a service chain. Audit and Accountability is the capability that logs these events at each Web service so that these patterns can be identified, after the fact, and accountability enforced. <br> <br>In support of enterprise behavior within the DCGS Family of Systems (FoS), this technical design document was created by the DCGS Enterprise Focus Team (EFT) to provide guidance for audit and accountability of the DCGS Enterprise Service Dial Tone (SDT) layer for use by the DCGS Enterprise Community at large. It includes the capability architecture design details, conformance requirements, and implementation guidance. DCGS service providers will use this guidance to generate security audit logs to enforce accountability in a service chain. <br> <br>Content of Audit Logging (SOAP) CDP: <br> - Technical Design Document (TDD) <br> - Service Specification Package (SSP) for each service - Not applicable <br> - Conformance Test Kit (CTK) - Currently under development", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1330412400000, "version" : "Draft", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485064000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "UDOP" }, { "text" : "Charting" } ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/zsxM4al' title='https://www.intelink.gov/go/zsxM4al' target='_blank'> https://www.intelink.gov/go/zsxM4al</a>" } ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 2, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1362298530000, "updateDate" : 1398845730000, "organization" : "NSA", "recommend" : true, "pros" : [ { "text" : "Reliable" } ], "cons" : [ { "text" : "Poor Documentation" } ] }, { "username" : "Cathy TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 3, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "> 3 years", "lastUsed" : 1362298530000, "updateDate" : 1393834530000, "organization" : "NSA", "recommend" : false, "pros" : [ { "text" : "Well Tested" }, { "text" : "Open Source" } ], "cons" : [ { "text" : "Security Concerns" }, { "text" : "Bulky" } ] } ], "dependencies" : [ { "dependency" : "Tomcat", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 7 or 8" } ] }, { "componentId" : 21, "guid" : "74f8c854-d70d-45f7-ab74-f63c27abdf8f", "name" : "DCGS-E Domain Name System (DNS) Technical Profile", "description" : "(U) This CDP provides guidance for DNS for use by the DCGS Enterprise Community at large. DCGS Service Providers will use this guidance to make their services visibility and accessibility in the DCGS Enterprise SOA (DES). Several Intelligence Community/Department of Defense (IC/DoD) documents were incorporated to support the guidance provided. DNS is important to the DCGS Community because it supports visibility and accessibility of services hosted on their servers. <br> <br>(U//FOUO) This CDP provides a technical design description for the Domain Name System of the Distributed Common Ground/Surface System (DCGS) Enterprise Service Dial Tone (SDT). It includes the service architecture design details, conformance requirements, and implementation guidance. <br> <br>(U//FOUO) Domain names are meaningful identification labels for Internet addresses. The Domain Name System capability translates domain names into the numerical identifiers associated with networking equipment for the purpose of locating and addressing these devices across the globe. The Domain Name System capability makes it possible to assign domain names to groups of Internet users in a meaningful way, independent of each user's physical location. Because of this, World Wide Web (WWW) hyperlinks and Internet contact information can remain consistent and constant even if the current Internet routing arrangements change or the participant uses a mobile device. The Domain Name System (DNS) is the industry standard for domain name translation and will be utilized across the DCGS Enterprise as the DCGS Enterprise Domain Name System solution. <br> <br>(U//FOUO) In support of enterprise behavior within the DCGS Family of Systems (FoS), this technical design document was created by the DCGS Enterprise Focus Team (EFT) to provide guidance for the use of the Domain Name System capability by the DCGS Enterprise Community at large. DCGS service providers will use this guidance to make their services visible and accessible in the DCGS Enterprise SOA (DES). <br> <br>Content of Domain Name System (DNS) CDP: <br> - Technical Design Document (TDD) <br> - Service Specification Package (SSP) <br> - Conformance Test Kit (CTK) <br> - Conformance Traceability Matrix (CTM) <br> - Test Procedure Document <br> - Test Request Messages - N/A (DNS is a network infrastructure service) <br> - Gold Data Set - N/A (DNS is a network infrastructure service) <br> - Conformance Checks Scripts - N/A (DNS is a network infrastructure service)", "parentComponent" : { "componentId" : 19, "name" : "DCGS Integration Backbone (DIB)" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DCGS EFT", "releaseDate" : 1287640800000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485064000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Cathy TEST", "userType" : "End User", "answeredDate" : 1391537730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "answeredDate" : 1391537730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1391447730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1398845730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/J9qBGN9' title='https://www.intelink.gov/go/J9qBGN9' target='_blank'> https://www.intelink.gov/go/J9qBGN9</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 22, "guid" : "50ababb2-08e3-4f2a-98a5-068b261d9424", "name" : "DCGS-E Metrics Management Technical Profile", "description" : "**Previously titled Service Level Agreement/Quality of Service CDP** <br> <br>(U) This CDP provides guidance for Metrics Management for use by the DCGS Enterprise Community at large. DCGS Service Providers will use this guidance to make their services visibility and accessibility in the DCGS Enterprise SOA. Several Intelligence Community/Department of Defense (IC/DoD) documents were incorporated to support the guidance provided. <br> <br>(U//FOUO) Enterprise Management refers to the management techniques, metrics and related tools that DCGS programs of record can use to support their nodes and make strategic decisions to maintain the overall health of their services. The Metrics Management service family is a key capability that supports Enterprise Management. It is used to monitor the performance and operational status of services. <br> <br>(U//FOUO) Metrics Management measures what is actually delivered to the service consumer via a set of metrics (e.g. service performance and availability). As the number of service offerings deployed across an enterprise increases, the ability to effectively manage and monitor them becomes critical to ensure a successful implementation. Clearly defined metrics need to be collected and reported to determine if the service offerings are meeting their users? needs. <br> <br>(U//FOUO) In support of enterprise behavior within the DCGS Family of Systems (FoS), this technical design document was created by the DCGS Enterprise Focus Team (EFT) to provide guidance on metrics, service events, and service interfaces needed by the DCGS Enterprise Community at large to support Metrics Management. DCGS service providers will use this guidance to collect metrics measurements, calculate associated metrics, and report those metrics to interested parties. <br> <br>Content of Metrics Management (formerly known as QoS Management) CDP: <br> - Technical Design Document (TDD) <br> - Service Specification Package (SSP) <br> - Conformance Test Kit (CTK) <br> - Conformance Traceability Matrix (CTM) <br> - Test Procedure Document <br> - Test Request Messages <br> - Gold Data Set <br> - Conformance Checks Scripts", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DCGS EFT", "releaseDate" : 1278396000000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485065000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/CMpInl8' title='https://www.intelink.gov/go/CMpInl8' target='_blank'> https://www.intelink.gov/go/CMpInl8</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 23, "guid" : "a84fe52a-c964-4be1-b0b1-e00212417817", "name" : "DCGS-E Sensor Web Enablement (SWE) Technical Profile", "description" : "(U//FOUO) This CDP provides the technical design description for the SensorWeb capability of the Distributed Common Ground/Surface System (DCGS) Enterprise Intelligence, Surveillance and Reconnaissance (ISR) Common layer. <br> <br>(U//FOUO) SensorWeb is a development effort led by the Defense Intelligence Agency (DIA) National Measurement and Signature Intelligence (MASINT) Office (NMO) that aligns native sensor data output to open standard data formats in order to improve sensor data discoverability and to increase interoperability between sensor technologies, analytical tools, and Common Operating Environments (COE). <br> <br>(U//FOUO) SensorWeb architecture is based on the Open Geospatial Consortium (OGC) suite of Sensor Web Enablement (SWE) standards and practices: specifically, the Sensor Observation Service (SOS) Interface Standard 2.0 and the Sensor Planning Service (SPS) Interface Standard 2.0. This TDD outlines the SOS and SPS and describes how they are used in the SensorWeb reference implementation. <br>(U//FOUO) The SensorWeb reference implementation can be combined with other SOS servers to cover a wider range of sensor systems, or it can be used as a stand-alone to observe a limited area or slate of sensors. <br> <br>(U//FOUO) The objective of the SensorWeb is to leverage existing data standards and apply them to MASINT sensors and sensor systems. MASINT sensors cross a broad spectrum of collection types and techniques, including radar, sonar, directed energy weapons, and chemical, biological, radiological, and nuclear incident reporting. SensorWeb ingests sensor data from its earliest point of transmittal and aligns that raw sensor output to established data standards. SensorWeb outputs sensor data in Keyhole Markup Language (KML) format, making sensor data readily available in near real-time to systems that support KML, such as Google Earth. <br> <br>(U//FOUO) SensorWeb provides unified access and control of disparate sensor data and standardized services across the ISR Enterprise, as well as delivers Command and Control (C2)/ISR Battlespace Awareness through a visualization client(s). <br>(U//FOUO) The SensorWeb Service Oriented Architecture (SOA) ingests raw data from multiple sensor systems and then converts the data to OGC standardized schemas which allows for sensor discovery, observation, and dissemination using common, open source data exchange standards. <br> <br>(U//FOUO) SensorWeb was established to determine a method and means for collecting and translating MASINT sensor data output and aligning that output with open standards supported by the OGC, the Worldwide Web Consortium (W3C), the International Organization for Standardization (ISO), and the Institute of Electrical and Electronics Engineers (IEEE) directives. <br> <br>(U//FOUO) The models, encodings, and services of the SWE architecture enable implementation of interoperable and scalable service-oriented networks of heterogeneous sensor systems and client applications. In much the same way that Hypertext Markup Language (HTML) and Hypertext Transfer Protocol (HTTP) standards enable the exchange of any type of information on the Web, the OGC's SWE initiative is focused on developing standards to enable the discovery, exchange, and processing of sensor observations, as well as the tasking of sensor systems. <br> <br>Content of Sensor Web Enablement (SWE) CDP: <br> - Technical Design Document (TDD) <br> - Service Specification Package (SSP) <br> - Conformance Test Kit (CTK) <br> - Conformance Traceability Matrix (CTM) <br> - Test Procedure Document - Under development <br> - Test Request Messages - Under development <br> - Gold Data Set - Under development <br> - Conformance Checks Scripts - Under development", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1393225200000, "version" : "draft", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485066000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "answeredDate" : 1398845730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Abby TEST", "userType" : "Developer", "answeredDate" : 1391447730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "UDOP" } ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/N4Gma4M' title='https://www.intelink.gov/go/N4Gma4M' target='_blank'> https://www.intelink.gov/go/N4Gma4M</a>" } ], "reviews" : [ { "username" : "Cathy TEST", "userType" : "Project Manager", "comment" : "This is a great product however, it's missing what I think are critical features. Hopefully, they are working on it for future updates.", "rating" : 5, "title" : "Great but missing features (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1328379330000, "updateDate" : 1391537730000, "organization" : "NSA", "recommend" : true, "pros" : [ { "text" : "Open Source" }, { "text" : "Reliable" } ], "cons" : [ { "text" : "Poorly Tested" } ] }, { "username" : "Abby TEST", "userType" : "Project Manager", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 4, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1381644930000, "updateDate" : 1398845730000, "organization" : "DCGS Navy", "recommend" : false, "pros" : [ { "text" : "Compact" }, { "text" : "Well Tested" } ], "cons" : [ { "text" : "Security Concerns" } ] } ], "dependencies" : [ ] }, { "componentId" : 24, "guid" : "8f915029-78bb-4df2-944f-f6fc4a84eeec", "name" : "DCGS-E Service Registration and Discovery (SRD) Technical Profile", "description" : "(U//FOUO) Service discovery provides DCGS Enterprise consumers the ability to locate and invoke services to support a given task or requirement in a trusted and secure operational environment. By leveraging service discovery, existing DCGS Enterprise services will be published to a root service registry, which is searchable via keyword or taxonomy. This capability provides users and machines the ability to search and discover services or business offerings. The Service Discovery capability is a foundational building block allowing the DCGS programs of record to publish and discover service offerings allowing the DCGS Enterprise Community to share and reuse information in a common, proven, and standards-based manner. <br> <br>(U//FOUO) In support of enterprise behavior within the DCGS Family of Systems (FoS), this technical design document was created by the DCGS Enterprise Focus Team (EFT) to provide guidance for service discovery for use by the DCGS Enterprise Community at large. DCGS service providers will use this guidance to make their services discoverable within the DCGS Enterprise. <br> <br>Content of Service Registration and Discovery (SRD) CDP: <br> - Technical Design Document (TDD) <br> - Service Specification Package (SSP) <br> - Conformance Test Kit (CTK) <br> - Conformance Traceability Matrix (CTM) <br> - Test Procedure Document <br> - Test Request Messages <br> - Gold Data Set <br> - Conformance Checks Scripts", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DCGS EFT", "releaseDate" : 1278309600000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485067000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1398845730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "answeredDate" : 1391537730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ { "label" : "Provides Web Hooks via RPC service(SAMPLE)", "value" : "Yes" }, { "label" : "Available to public (SAMPLE)", "value" : "YES" } ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/bujBaGB' title='https://www.intelink.gov/go/bujBaGB' target='_blank'> https://www.intelink.gov/go/bujBaGB</a>" } ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 2, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 6 Months", "lastUsed" : 1381644930000, "updateDate" : 1393834530000, "organization" : "NGA", "recommend" : false, "pros" : [ ], "cons" : [ ] }, { "username" : "Cathy TEST", "userType" : "End User", "comment" : "This is a great product however, it's missing what I think are critical features. Hopefully, they are working on it for future updates.", "rating" : 2, "title" : "Great but missing features (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1388769330000, "updateDate" : 1391537730000, "organization" : "DCGS Army", "recommend" : false, "pros" : [ { "text" : "Reliable" } ], "cons" : [ { "text" : "Poor Documentation" } ] } ], "dependencies" : [ ] }, { "componentId" : 25, "guid" : "01724885-d2c1-4788-9aa0-ea0128fff805", "name" : "DCGS-E Time Synchronization (NTP) Technical Profile", "description" : "(U) This provides guidance for Network Time Protocol (NTP) for use by the DCGS Enterprise Community at large. DCGS Service Providers will use this guidance to make their services secure and interoperable in the DCGS Enterprise SOA <br> <br>(U//FOUO) Time synchronization is a critical service in any distributed system because it provides the frame of reference for time between all devices on the network. Time synchronization ensures that the system time on a machine located in, for example, San Francisco is the same as the time on a machine located in London before time zones are taken into account. As such, synchronized time is extremely important when performing any operations across a network. When it comes to security, it would be very hard to develop a reliable picture of an incident if logs between routers and other network devices cannot be compared successfully and accurately. Put simply, time synchronization enables security in a Net-centric environment. . <br> <br>Content of Time Synchronization (NTP) CDP: <br>- Technical Design Document (TDD) <br>- Service Specification Package (SSP) <br>- Conformance Test Kit (CTK) <br>- Conformance Traceability Matrix (CTM) <br>- Test Procedure Document <br>- Test Request Messages - N/A (NTP is a network infrastructure service) <br>- Gold Data Set - N/A (NTP is a network infrastructure service) <br>- Conformance Checks Scripts - N/A (NTP is a network infrastructure service", "parentComponent" : { "componentId" : 21, "name" : "DCGS-E Domain Name System (DNS) Technical Profile" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DCGS EFT", "releaseDate" : 1341208800000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485068000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "Access" }, { "text" : "Visualization" } ], "metadata" : [ { "label" : "Provides Web Hooks via RPC service(SAMPLE)", "value" : "Yes" }, { "label" : "Common Uses (SAMPLE)", "value" : "UDOP, Information Sharing, Research" }, { "label" : "Support Common Interface 2.1 (SAMPLE)", "value" : "No" } ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/x5UIJnv' title='https://www.intelink.gov/go/x5UIJnv' target='_blank'> https://www.intelink.gov/go/x5UIJnv</a>" } ], "reviews" : [ { "username" : "Cathy TEST", "userType" : "Project Manager", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 4, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1328379330000, "updateDate" : 1391447730000, "organization" : "DCGS Army", "recommend" : true, "pros" : [ { "text" : "Compact" } ], "cons" : [ ] } ], "dependencies" : [ { "dependency" : "Tomcat", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 7 or 8" } ] }, { "componentId" : 26, "guid" : "b2866715-764f-4266-868f-64cac88556fe", "name" : "DCGS-E Web Service Access Control Technical Profile", "description" : "Access Control incorporates an open framework and industry best practices/standards that leverage Web Services Security (WSS) [17] standards, also referred to as WS-Security, to create a common framework using Attribute Based Access Control (ABAC). The DCGS Enterprise advocates an ABAC model as the desired vision to provide policy compliance and accountability throughout the entire enterprise. To enforce ABAC, identification and authentication is executed on the service consumer and access control is enforced by the service provider. <br> <br>Identification is the process in which the identity of either a user or system is established. Authentication is the process by which an entity proves a claim regarding its identity to one or more other entities. Together, identification and authentication allows a system to securely communicate a service consumer's identity and related security attributes to a service provider. With increased sharing across programs of record and external partners, identification and authentication is crucial to ensure that services and data are secured. The successful authentication of a subject and the attributes assigned to that subject assist in the determination of whether or not a user will be allowed to access a particular service. <br> <br>Identification and authentication joined with access control enforcement provide for the Access Control capability, which is critical for meeting Information Assurance (IA) requirements for those services targeted for the Global Information Grid (GIG). Access control is the process that allows a system to control access to resources in an information system including services and data. Services, supporting the DCGS Enterprise, will be made available to users within and between nodes. It is important that these services and their resources are adequately protected in a consistent manner across the DCGS Enterprise. Services are intended to be accessible only to authorized requesters, thus requiring mechanisms to determine the rights of an authenticated user based on their attributes and enforce access based on its security policy.", "parentComponent" : { "componentId" : 14, "name" : "Content Discovery and Retrieval Engine - Retrieve Component" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : null, "releaseDate" : 1393311600000, "version" : "draft", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485068000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "1.2.1", "codeDescription" : "Identity and Access Management", "important" : true }, { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "Mapping" }, { "text" : "Communication" } ], "metadata" : [ { "label" : "Available to public (SAMPLE)", "value" : "YES" }, { "label" : "Support Common Interface 2.1 (SAMPLE)", "value" : "No" }, { "label" : "Provides Web Hooks via RPC service(SAMPLE)", "value" : "Yes" } ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/kcN4VyS' title='https://www.intelink.gov/go/kcN4VyS' target='_blank'> https://www.intelink.gov/go/kcN4VyS</a>" } ], "reviews" : [ { "username" : "Jack TEST", "userType" : "End User", "comment" : "I had issues trying to obtain the component and once I got it is very to difficult to install.", "rating" : 4, "title" : "Hassle (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1367309730000, "updateDate" : 1398845730000, "organization" : "DCGS Army", "recommend" : true, "pros" : [ { "text" : "Well Tested" } ], "cons" : [ ] } ], "dependencies" : [ { "dependency" : "Windows", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 8.1" } ] }, { "componentId" : 27, "guid" : "35d44bb5-adc5-42ca-9671-c58e257570d9", "name" : "DI2E Framework DIAS Simulator", "description" : "This package provides a basic simulator of the DoDIIS Identity and Authorization Service (DIAS) in a deployable web application using Apache CFX architecture. The DI2E Framework development team have used this when testing DIAS specific attribute access internally with Identity and Access Management functionality.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E Framework", "releaseDate" : 1397455200000, "version" : "1.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200707000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "DEV", "codeDescription" : "Development", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "GOTS", "codeDescription" : "GOTS", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/IdAMLogoMed-Size.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DIAS+Simulation' title='https://confluence.di2e.net/display/DI2E/DIAS+Simulation' target='_blank'> https://confluence.di2e.net/display/DI2E/DIAS+Simulation</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DIAS+Simulation' title='https://confluence.di2e.net/display/DI2E/DIAS+Simulation' target='_blank'> https://confluence.di2e.net/display/DI2E/DIAS+Simulation</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DIAS+Simulation' title='https://confluence.di2e.net/display/DI2E/DIAS+Simulation' target='_blank'> https://confluence.di2e.net/display/DI2E/DIAS+Simulation</a>" } ], "reviews" : [ ], "dependencies" : [ { "dependency" : "Linux", "version" : null, "dependencyReferenceLink" : null, "comment" : "Tested on CentOS 5 and Ubuntu Server 11.0" } ] }, { "componentId" : 28, "guid" : "bcd54d72-3f0d-4a72-b473-2390b42515d5", "name" : "DI2E Framework OpenAM", "description" : "The DI2E Framework IdAM solution provides a core OpenAM Web Single Sign-On implementation wrapped in a Master IdAM Administration Console for ease of configuration and deployment. Additionally, there are several enhancements to the core authentication functionality as well as external and local attribute access with support for Ozone Widget Framework implementations. Please review the Release Notes and associated documentation for further information.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E Framework", "releaseDate" : 1397455200000, "version" : "2.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "dan.stroud", "updateDts" : 1405308845000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "DEV", "codeDescription" : "Development", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "FOSS", "codeDescription" : "FOSS", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/IdAMLogoMed-Size.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download' title='https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download' target='_blank'> https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download' title='https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download' target='_blank'> https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download' title='https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download' target='_blank'> https://confluence.di2e.net/display/DI2E/DI2E+Framework+IdAM+Software+Download</a>" } ], "reviews" : [ ], "dependencies" : [ { "dependency" : "Linux", "version" : null, "dependencyReferenceLink" : null, "comment" : "Tested on CentOS 5 and Ubuntu Server 11.0" } ] }, { "componentId" : 30, "guid" : "3a7e6bf2-bcc4-4c1e-bc33-296cc945e733", "name" : "DI2E Framework Reference Architecture", "description" : "The DI2E Framework reference Architecture provides a structural foundation for the DI2E requirements assessment. The DI2E Framework is specified using a level of abstraction that is not dependent on a specific technical solution, but can leverage the benefits of the latest technology advancements and make them readily accessible across the enterprise. <br> <br>The DI2E Framework architecture is modeled using DoD Architecture Framework (DoDAF) version 2.02. Below is a list of artifacts that are currently available for the DI2E Framework Reference Architecture. <br> <br>Artifact\tName / Purpose <br>OV-5a\tOperational Activity Model Node Tree. A breakdown of the fundamental activities performed by various actors within the DI2E Framework community. Built from both DCGS and JIOC operational models and includes related text descriptions for each activity. <br> <br>SV-1\tComponent (System) Interfaces. Diagrams that show the fundamental interface relationships among DI2E Framework components. <br> <br>SV-2\tComponent Resource Flows. Extends the SV-1 diagrams by highlighting the 'data-in-motion' that passes between components along their interfaces. <br> <br>SV-4\tComponent Functionality. A breakdown of DI2E Framework components, including a short description of their expected functionality. <br> <br>SV-5a\tActivity : Component Matrix. A mapping showing the alignment between DI2E Framework components and activities (and vice versa). <br> <br>SV-10c\tComponent Event Tract Diagrams. Example threads through the component architecture showcasing the interaction of various components relative to example operational scenarios. <br> <br>SvcV-3a\tComponents-Services Matrix. A mapping showing the alignment between DI2E Framework components and services <br> <br>SvcV-4\tServices. A breakdown of the architectures services, including service definitions, descriptions, and other relevant service metadata. <br> <br>StdV-1\tStandards Profile. Lists the various standards and specifications that will be applicable to DI2E Framework. <br> <br>SWDS\tSoftware Description Specification. Documents the basic structure for DI2E Framework component and service specification, then points to an EXCEL worksheet documenting the specifications & related metadata for DI2E Framework components and services. <br> <br>DIV-3\tData Model. A list of 'data-in-motion' Data Object Types (DOTs) that are applicable to the component architecture. <br> <br>DBDS\tDatabase Design Specification. A description of the approach and various data repository lists used to define the data model (DIV-3), along with a link to the defined data model. <br> <br>RVTM\tRequirements Verification Traceability Matrix. A list of DI2E Framework requirements including requirement ID #s, names, descriptions, alignment with the component and service architecture, and other related metadata. <br> <br>PDS\tProject Development Specification. A high level overview of the e DI2E Framework Reference Implementation (RI), and how the components of this RI relate with the overall component architecture and related DI2E Framework requirements. <br> <br>ICD\tInterface Control Document. A further breakdown of the PDS (see row above), showing how RI components relate with overall component specifications as documented in the SWDS.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NRO // DI2E Framework PMO", "releaseDate" : 1390028400000, "version" : "1.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200710000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "DOC", "codeDescription" : "Documentation", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "Reference" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/DI2E Framework RA.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DI2E+Framework+Reference+Architecture+files' title='https://confluence.di2e.net/display/DI2E/DI2E+Framework+Reference+Architecture+files' target='_blank'> https://confluence.di2e.net/display/DI2E/DI2E+Framework+Reference+Architecture+files</a>" }, { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://inteldocs.intelink.gov/inteldocs/page/repository#filter=path|/Group%20Folders/D/DI2E%20Framework/DI2E%20Framework%20Architecture&page=1' title='https://inteldocs.intelink.gov/inteldocs/page/repository#filter=path|/Group%20Folders/D/DI2E%20Framework/DI2E%20Framework%20Architecture&page=1' target='_blank'> https://inteldocs.intelink.gov/inteldocs/page/repository#filter=path|/Group%20Folders/D/DI2E%20Framework/DI2E%20Framework%20Architecture&page=1</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DI2E+Framework+Reference+Architecture+files' title='https://confluence.di2e.net/display/DI2E/DI2E+Framework+Reference+Architecture+files' target='_blank'> https://confluence.di2e.net/display/DI2E/DI2E+Framework+Reference+Architecture+files</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/DI2E+Reference+Architecture' title='https://confluence.di2e.net/display/DI2E/DI2E+Reference+Architecture' target='_blank'> https://confluence.di2e.net/display/DI2E/DI2E+Reference+Architecture</a>" } ], "reviews" : [ { "username" : "Jack TEST", "userType" : "End User", "comment" : "This wasn't quite what I thought it was.", "rating" : 2, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 6 Months", "lastUsed" : 1328379330000, "updateDate" : 1391537730000, "organization" : "Private Company", "recommend" : false, "pros" : [ { "text" : "Well Tested" }, { "text" : "Compact" } ], "cons" : [ ] }, { "username" : "Colby TEST", "userType" : "Developer", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 4, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1388769330000, "updateDate" : 1391447730000, "organization" : "NSA", "recommend" : true, "pros" : [ ], "cons" : [ ] }, { "username" : "Cathy TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 2, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1388769330000, "updateDate" : 1393834530000, "organization" : "NSA", "recommend" : false, "pros" : [ ], "cons" : [ ] } ], "dependencies" : [ { "dependency" : "Erlang", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 3.0" } ] }, { "componentId" : 31, "guid" : "2f8ca98a-a935-4ebf-8504-82756b8ef81b", "name" : "DI2E RESTful CDR Search Technical Profile", "description" : "This profile provides the technical design description for the RESTful Search web service of Defense Intelligence Information Enterprise (DI2E). The profile includes capability architecture design details, implementation requirements and additional implementation guidance. DI2E Enterprise service providers and clients will use this design to support enterprise standards while creating search services within their nodes. <br> <br>This document extends the IC/DoD REST interface encoding specification for Content Discovery and Retrieval (CDR) Search [CDR-RS] . It defines an interface to which a search service implementation and a subsequent deployment must conform. <br> <br>The search service provides the ability to search for contents within the DI2E Enterprise with two primary functions: search and results paging. Analysts require the flexibility to search data stores in a myriad of combinations. For example, a user may perform a search for records with the keyword 'Paris' occurring between January 16, 2009 and January 21, 2009; a user may perform a search for records with the keyword 'airport' and a geo location. The previous examples highlight the three different types of queries that MUST be supported by a search service implementation: <br>- Keyword query with results containing the specified keyword or keyword combination <br>- Temporal query with results within the specified temporal range <br>- Geographic query with results within the specified geographic area <br> <br>The search service provides a standard interface for discovering information and returns a 'hit list' of items. A search service's results are generally resource discovery metadata rather than actual content resources. In the context of search, resource discovery metadata generally refers to a subset of a resource's available metadata, not the entire underlying record. Some of the information contained within each search result may provide the information necessary for a client to retrieve or otherwise use the referenced resource. Retrieval of the product resources associated with each entry in the 'hit list' is discussed in the DI2E RESTful Retrieve profile. <br> <br>Content of DI2E RESTful CDR Search Profile: <br> - Technical Design Document (TDD) <br> - Service Specification Package (SSP) for each service - Not applicable. Since this CDP only contains one service, contents of SSP are rolled into the TDD. <br> - Conformance Test Kit (CTK) <br> - Conformance Traceability Matrix <br> - Test Procedure Document <br> - Test Request Messages <br> - Gold Data Set <br> - Conformance Checks Scripts", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1392966000000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485073000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SPEC", "codeDescription" : "Standards, Specifications, and APIs", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "Visualization" }, { "text" : "Access" } ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/go/zankYmq' title='https://www.intelink.gov/go/zankYmq' target='_blank'> https://www.intelink.gov/go/zankYmq</a>" } ], "reviews" : [ ], "dependencies" : [ { "dependency" : "Windows", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 8.1" } ] }, { "componentId" : 32, "guid" : "e299a3aa-585f-4bad-a4f1-009397b97b93", "name" : "Distributed Data Framework (DDF)", "description" : "DDF is a free and open source common data layer that abstracts services and business logic from the underlying data structures to enable rapid integration of new data sources.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1394002800000, "version" : "See Site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405694884000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "LICTYPE", "typeDescription" : "License Type", "code" : "OPENSRC", "codeDescription" : "Open Source", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "FOSS", "codeDescription" : "FOSS", "important" : false } ], "tags" : [ { "text" : "UDOP" } ], "metadata" : [ { "label" : "Extra Metadata (SAMPLE)", "value" : "Unfiltered" }, { "label" : "Provides Web Hooks via RPC service(SAMPLE)", "value" : "Yes" } ], "componentMedia" : [ { "link" : "images/oldsite/ddf-screenshot-lg.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/ddf-logo.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://tools.codice.org/wiki/display/DDF/DDF+Catalog+Application+Users+Guide' title='https://tools.codice.org/wiki/display/DDF/DDF+Catalog+Application+Users+Guide' target='_blank'> https://tools.codice.org/wiki/display/DDF/DDF+Catalog+Application+Users+Guide</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='http://ddf.codice.org' title='http://ddf.codice.org' target='_blank'> http://ddf.codice.org</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='http://ddf.codice.org' title='http://ddf.codice.org' target='_blank'> http://ddf.codice.org</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://github.com/codice/ddf' title='https://github.com/codice/ddf' target='_blank'> https://github.com/codice/ddf</a>" } ], "reviews" : [ { "username" : "Jack TEST", "userType" : "Developer", "comment" : "This wasn't quite what I thought it was.", "rating" : 2, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1362298530000, "updateDate" : 1399961730000, "organization" : "NGA", "recommend" : false, "pros" : [ ], "cons" : [ ] }, { "username" : "Colby TEST", "userType" : "Developer", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 5, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1367309730000, "updateDate" : 1393834530000, "organization" : "NGA", "recommend" : true, "pros" : [ { "text" : "Compact" } ], "cons" : [ { "text" : "Poor Documentation" }, { "text" : "Bulky" } ] } ], "dependencies" : [ ] }, { "componentId" : 57, "guid" : "79e51469-81b6-4cfb-b6b2-7b0be8065912", "name" : "Domain Name System (DNS) Guidebook for Linux/BIND", "description" : "This Guidebook focuses on those involved with the Domain Name System (DNS) in DI2E systems. Those building systems based on DI2E-offered components, running in a DI2E Framework. It provides guidance for two different roles - those who configure DNS, and those who rely on DNS in the development of distributed systems. <br> <br>The DNS service in both DI2E and the Distributed Common Ground/Surface System Enterprise (DCGS Enterprise) relies on the Berkeley Internet Name Domain software, commonly referred to as BIND. Requirements and policy guidance for DNS are provided in the \"Distributed Common Ground/Surface System Enterprise (DCGS Enterprise), Service Dial Tone Technical Design Document Domain Name System, Version 1.1 (Final) Jun 2012\" . This guidebook supplements the technical profile and describes how DNS capabilities must be acquired, built and deployed by DI2E programs.", "parentComponent" : null, "subComponents" : [ { "componentId" : 67, "name" : "Central Authentication Service (CAS)" } ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1396677600000, "version" : "2.1.1", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200713000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "DOC", "codeDescription" : "Documentation", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://storefront.di2e.net/marketplace/public/DNS_Guidebook_for' title='https://storefront.di2e.net/marketplace/public/DNS_Guidebook_for' target='_blank'> https://storefront.di2e.net/marketplace/public/DNS_Guidebook_for</a> Linux-BIND V2.1.1.doc" } ], "reviews" : [ { "username" : "Colby TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 5, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "> 3 years", "lastUsed" : 1367309730000, "updateDate" : 1391447730000, "organization" : "NGA", "recommend" : true, "pros" : [ ], "cons" : [ ] }, { "username" : "Abby TEST", "userType" : "End User", "comment" : "This wasn't quite what I thought it was.", "rating" : 5, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1362298530000, "updateDate" : 1391537730000, "organization" : "NSA", "recommend" : false, "pros" : [ { "text" : "Active Development" }, { "text" : "Well Tested" } ], "cons" : [ { "text" : "Legacy system" } ] }, { "username" : "Jack TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 1, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1388769330000, "updateDate" : 1393834530000, "organization" : "NSA", "recommend" : false, "pros" : [ { "text" : "Open Source" }, { "text" : "Well Tested" } ], "cons" : [ { "text" : "Poor Documentation" } ] } ], "dependencies" : [ { "dependency" : "Linux", "version" : null, "dependencyReferenceLink" : null, "comment" : "Tested on CentOS 5 and Ubuntu Server 11.0" } ] }, { "componentId" : 33, "guid" : "ef0eaf61-05e2-405e-934a-7c377cc61269", "name" : "eDIB", "description" : "(U) eDIB contains the eDIB 4.0 services (management VM and worker VM). eDIB 4.0 is a scalable, virtualized webservice architecture based on the DMO's DIB 4.0. eDIB provides GUIs for an administrator to manage/configure eDIB. An end-user interface is not provided. Different data stores are supported including Oracle and SOLR. <br> <br>(U) The eDIB provides an easily managed and scalable DIB deployment. The administration console allows for additional worker VMs to scale up to support additional ingest activities or additional query activities. This provides the ability to manage a dynamic workload with a minimum of resources. <br> <br>(U) The software and documentation are currently available on JWICS at GForge, or you can email the DI2E Framework team for access on unclass.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E Framework", "releaseDate" : 1355036400000, "version" : "4.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1405102845000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "Reference" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/eDibIcon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 34, "guid" : "b52b36b8-b556-4d24-a9fe-2597402c32f7", "name" : "Extensible Mapping Platform (EMP)", "description" : "The Extensible Mapping Platform (EMP) is a US Government Open Source project providing a framework for building robust OWF map widgets and map centric web applications. The EMP project is currently managed by US Army Tactical Mission Command (TMC) in partnership with DI2E, and developed by CECOM Software Engineering Center Tactical Solutions Directorate (SEC) . EMP is intended to be used and contributed to by any US Government organization that falls within the ITAR restrictions placed on the software hosted at this location. Current contributors include National Geospatial-Intelligence Agency (NGA), and ICITE-Cloud INSCOM/DCGS-A with growing interest across the defense and Intelligence communities. EMP evolved from the US Army Command Post Computing Environment (CPCE) initiative. The term CPCE is still used in many areas and there is a CPCE targeted build that is produced from EMP to meet the CPCE map widget and API requirements. The great news about EMP is that it is not limited to the CPCE specific build and feature set. EMP is designed to be customized and extended to meet the needs and schedule of any organization. <br> <br>Map Core: <br>The map core is pure HTML, CSS, and JavaScript that can be embedded in any web application. The primary target for this currently is an Ozone Widget Framework (OWF) map widget, however the core code will function outside of OWF and can be used in custom web applications. When running in OWF the map core can handle all CMWA 1.0 and 1.1 messages as well as the capabilities included in the EMP JavaScript API library. <br> <br>Additional Links <br> <a href='http://cmapi.org/' title='http://cmapi.org/' target='_blank'> </a> <br> <a href='https://project.forge.mil/sf/frs/do/viewRelease/projects.dcgsaozone/frs.cpce_mapping_components.sprint_18_cpce_infrastructure_er' title='https://project.forge.mil/sf/frs/do/viewRelease/projects.dcgsaozone/frs.cpce_mapping_components.sprint_18_cpce_infrastructure_er' target='_blank'> frs.cpce_mapping_components.spri...</a> ", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1393830000000, "version" : "See site for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200714000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : 1388769330000, "endDate" : 1393694130000, "currentLevelCode" : "LEVEL1", "reviewedVersion" : "1.0", "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : null, "actualCompletionDate" : 1392138930000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ { "name" : "Discoverable", "score" : 3 }, { "name" : "Accessible", "score" : 4 }, { "name" : "Documentation", "score" : 3 }, { "name" : "Deployable", "score" : 4 }, { "name" : "Usable", "score" : 5 }, { "name" : "Error Handling", "score" : 2 }, { "name" : "Integrable", "score" : 1 }, { "name" : "I/O Validation", "score" : 2 }, { "name" : "Testing", "score" : 3 }, { "name" : "Monitoring", "score" : 2 }, { "name" : "Performance", "score" : 0 }, { "name" : "Scalability", "score" : 1 }, { "name" : "Security", "score" : 4 }, { "name" : "Maintainability", "score" : 3 }, { "name" : "Community", "score" : 3 }, { "name" : "Change Management", "score" : 2 }, { "name" : "CA", "score" : 0 }, { "name" : "Licensing", "score" : 4 }, { "name" : "Roadmap", "score" : 0 }, { "name" : "Willingness", "score" : 5 }, { "name" : "Architecture Alignment", "score" : 5 } ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "WIDGET", "codeDescription" : "Widget", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL1", "codeDescription" : "Level 1 - Initial Reuse Analysis", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "DEV", "codeDescription" : "Development", "important" : false }, { "type" : "OWFCOMP", "typeDescription" : "OWF Compatible", "code" : "Y", "codeDescription" : "Yes", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "GOSS", "codeDescription" : "GOSS", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/core-map-api.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/EMP/repos/map-docs/browse' title='https://stash.di2e.net/projects/EMP/repos/map-docs/browse' target='_blank'> https://stash.di2e.net/projects/EMP/repos/map-docs/browse</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/EMP' title='https://stash.di2e.net/projects/EMP' target='_blank'> https://stash.di2e.net/projects/EMP</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/EMP' title='https://stash.di2e.net/projects/EMP' target='_blank'> https://stash.di2e.net/projects/EMP</a>" }, { "name" : "DI2E Framework Evaluation Report URL", "type" : "DI2E Framework Evaluation Report URL", "description" : null, "link" : "<a href='https://storefront.di2e.net/marketplace/public/Extensible_Mapping_Platform_Evaluation_Report.docx' title='https://storefront.di2e.net/marketplace/public/Extensible_Mapping_Platform_Evaluation_Report.docx' target='_blank'> https://storefront.di2e.net/marketplace/public/Extensible_Mapping_Platform_Evaluation_Report.docx</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/EMP/Extensible+Mapping+Platform+Home' title='https://confluence.di2e.net/display/EMP/Extensible+Mapping+Platform+Home' target='_blank'> https://confluence.di2e.net/display/EMP/Extensible+Mapping+Platform+Home</a>" } ], "reviews" : [ { "username" : "Abby TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. Its quite configurable without a lot of setup and it worked out of the box.", "rating" : 4, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "> 3 years", "lastUsed" : 1328379330000, "updateDate" : 1391537730000, "organization" : "DCGS Navy", "recommend" : true, "pros" : [ { "text": "Reliable" }, { "text": "Compact" }, { "text": "Well Tested" } ], "cons" : [ ] }, { "username" : "Colby TEST", "userType" : "Developer", "comment" : "This is a great product however, it's missing what I think are critical features. Hopefully, they are working on it for future updates.", "rating" : 2.5, "title" : "Great but missing features (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1328379330000, "updateDate" : 1391447730000, "organization" : "DCGS Navy", "recommend" : false, "pros" : [ { "text" : "Well Tested" } ], "cons" : [ { "text" : "Difficult Installation" }, { "text" : "Security Concerns" } ] } ], "dependencies" : [ ] }, { "componentId" : 73, "guid" : "9d61a682-3b5f-4756-96cd-41df323fb371", "name" : "GAPS - Data Catalog Service", "description" : "The GAPS Data Catalog Service provides a set of RESTful services to manage data sources accessible to GAPS applications. The catalog service offers RESTful interfaces for querying sources as XML or JSON structures. The service is a combination of two web services; the root service, and the metric service. This root service allows users to add, remove and update metadata about information sources. The metrics service offers the ability to capture and view metrics information associated with information sources. <br> <br> <br> <br>The Data Catalog Service provides integration with the GAPS KML Feeds to expose all of the KML sources that are registered with GAPS. Documentation states it provides the ability to integrate with OGC CSW catalog services to provide search capabilities that federate across one or more CSW catalogs. The services are also available via a number of OWF widgets that implement the Data Catalog Service API. <br> <br>Root Service <br>SIPR: <a href='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datacatalogservice.ashx' title='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datacatalogservice.ashx' target='_blank'> datacatalogservice.ashx</a> <br>JWICS: <a href='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datacatalogservice.ashx' title='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datacatalogservice.ashx' target='_blank'> datacatalogservice.ashx</a> <br> <br>Metrics Service <br>SIPR: <a href='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datasourcemetrics.ashx' title='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datasourcemetrics.ashx' target='_blank'> datasourcemetrics.ashx</a> <br>JWICS: <a href='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datasourcemetrics.ashx' title='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datasourcemetrics.ashx' target='_blank'> datasourcemetrics.ashx</a> <br> <br>Overview <br>Global Awareness Presentation Services (GAPS) is a web-based command-wide service created to provide analysts and other decision makers the capability to generate Net-Centric Situational Awareness (SA) visualization products from disparate and dispersed data services. GAPS is interoperable with ongoing Department of Defense (DoD) wide C4ISR infrastructure efforts such as FSR and SKIWEB. GAPS attempts to share this data/information of an event in a real-time basis on SIPRNET and JWICS. GAPS allows users at all organizational levels to define, customize, and refine their specific User Defined Operational Picture (UDOP) based on mission and task. GAPS middleware capabilities serve as the \"facilitator\" of authoritative data source information by hosting over 3,000 dynamic and static data feeds and provides metrics and status on those feeds. GAPS provides several Ozone Widget Framework (OWF) based components that offer UDOP service functionality inside of an OWF dashboard. <br> <br>GAPS exposes a number of core UDOP Services through SOAP/RESTful services. <br>-GAPS Gazetteer Services <br>-GAPS Data Catalog Services <br>-GAPS Scenario Services", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "STRATCOM J8", "releaseDate" : null, "version" : "2.5", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "david.treat", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405691893000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Are samples included? (SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "answeredDate" : 1399961730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "createDts" : 1328379330000, "updateDts" : 1328379330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1399961730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Cathy TEST", "userType" : "End User", "answeredDate" : 1391537730000 } ] }, { "question" : "Does this support the 2.0 specs? (SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "No, they planned to add support next Version(SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "answeredDate" : 1391447730000 }, { "response" : "Update: they backport support to version 1.6(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1391447730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ { "label" : "Available to public (SAMPLE)", "value" : "YES" }, { "label" : "Extra Metadata (SAMPLE)", "value" : "Unfiltered" } ], "componentMedia" : [ { "link" : "images/oldsite/GAPS.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "Project Manager", "comment" : "I had issues trying to obtain the component and once I got it is very to difficult to install.", "rating" : 2, "title" : "Hassle (SAMPLE)", "usedTimeCode" : "< 6 Months", "lastUsed" : 1381644930000, "updateDate" : 1393834530000, "organization" : "DCGS Navy", "recommend" : true, "pros" : [ { "text" : "Well Tested" } ], "cons" : [ ] }, { "username" : "Jack TEST", "userType" : "End User", "comment" : "This wasn't quite what I thought it was.", "rating" : 4, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 6 Months", "lastUsed" : 1381644930000, "updateDate" : 1391447730000, "organization" : "NGA", "recommend" : true, "pros" : [ { "text" : "Well Tested" }, { "text" : "Reliable" } ], "cons" : [ ] } ], "dependencies" : [ ] }, { "componentId" : 74, "guid" : "2e7cb2fb-8672-4d8f-9f68-b2243b523a2f", "name" : "GAPS - Gazetteer Service", "description" : "The GAPS Gazetteer Service offers a set of geographical dictionary services that allows users to search for city and military bases, retrieving accurate latitude and longitude values for those locations. The user may search based on name or location, with the gazetteer returning all entries that match the provided name or spatial area. The GAPS Gazetteer Service imports gazetteer services from other data sources including NGA, USGS, DAFIF, and DISDI. <br> <br>Current Service End-Points <br>SIPR: <br> <a href='https://gapsprod1.stratcom.smil.mil/gazetteers/NgaGnsGazetteerService.asmx' title='https://gapsprod1.stratcom.smil.mil/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a> (NGA Gazetteer) <br> <a href='https://gapsprod1.stratcom.smil.mil/gazetteers/UsgsGnisGazetteerService.asmx' title='https://gapsprod1.stratcom.smil.mil/gazetteers/UsgsGnisGazetteerService.asmx' target='_blank'> UsgsGnisGazetteerService.asmx</a> (USGS Gazetteer) <br> <br>JWICS: <br> <a href='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' title='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' target='_blank'> NgaGnsGazetteerService.asmx</a> (USGS Gazetteer) <br> <a href='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' title='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' target='_blank'> NgaGnsGazetteerService.asmx</a> (USGS Gazetteer) <br> <br>Overview <br>Global Awareness Presentation Services (GAPS) is a web-based command-wide service created to provide analysts and other decision makers the capability to generate Net-Centric Situational Awareness (SA) visualization products from disparate and dispersed data services. GAPS is interoperable with ongoing Department of Defense (DoD) wide C4ISR infrastructure efforts such as FSR and SKIWEB. GAPS attempts to share this data/information of an event in a real-time basis on SIPRNET and JWICS. GAPS allows users at all organizational levels to define, customize, and refine their specific User Defined Operational Picture (UDOP) based on mission and task. GAPS middleware capabilities serve as the \"facilitator\" of authoritative data source information by hosting over 3,000 dynamic and static data feeds and provides metrics and status on those feeds. GAPS provides several Ozone Widget Framework (OWF) based components that offer UDOP service functionality inside of an OWF dashboard. <br> <br>GAPS exposes a number of core UDOP Services through SOAP/RESTful services. <br>-GAPS Gazetteer Services <br>-GAPS Data Catalog Services <br>-GAPS Scenario Services", "parentComponent" : { "componentId" : 9, "name" : "CLAVIN" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "STRATCOM J8", "releaseDate" : null, "version" : "2.5", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "david.treat", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405691776000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ { "text" : "Reference" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/GAPS.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 72, "guid" : "6fcf0dc4-091d-4431-a066-d074b4fd63ea", "name" : "GAPS - Scenario Service", "description" : "The GAPS Scenario Service is a SOAP based interface into the GAPS UDOP creation, execution and publishing mechanism. The Scenario Service allows an external entity to perform Machine to Machine (M2M) calls in order to create and execute UDOPs. This interface can be used to integrate with other systems in order to provide geospatial visualization to give contextual SA to end users. <br> <br>GAPS Scenarios are defined as data packages which are stored within the GAPS Repository. The GAPS Repository Service is a SOAP based interface into the GAPS Repository which stores and maintains UDOP scenarios and geospatial products from GAPS data sources. The Repository Service additionally creates a series of DDMS metacards to describe all of the UDOPs and artifacts stored within the GAPS Repository. These metacards can be further published to other metadata catalogs to facilitate discovery of GAPS UDOPs and aggregated data products. <br> <br>A Scenario consists of a UDOP template document, products generated from a UDOP template and metadata gathered from data sources during the execution of a UDOP template. For example, a SKIWeb scenario would consist of a UDOP template that captures information about an event (location, time, description) and other data overlays to give it a spatio-temporal context, JPEG screenshots taken automatically at different view scales for the event on a globe, a movie file with animation for temporal data, a VDF file, a KML file to execute the UDOP in Google Earth, a timeline view and all of the metadata captured during the UDOP execution. <br> <br>The following are the Service Endpoints on SIPR and JWICS. GAPS does not have an UNCLASS instance: <br>SIPR: <br> scenario service: <a href='https://gapsprod1.stratcom.smil.mil/ScenarioService/ScenarioService.asmx' title='https://gapsprod1.stratcom.smil.mil/ScenarioService/ScenarioService.asmx' target='_blank'> ScenarioService.asmx</a> <br> repository service: <a href='https://gapsprod1.stratcom.smil.mil/VsaPortal/RespositoryService.asmx' title='https://gapsprod1.stratcom.smil.mil/VsaPortal/RespositoryService.asmx' target='_blank'> RespositoryService.asmx</a> <br>JWICS: <br> scenario service: <a href='http://jwicsgaps.usstratcom.ic.gov:8000/ScenarioService/ScenarioService.asmx' title='http://jwicsgaps.usstratcom.ic.gov:8000/ScenarioService/ScenarioService.asmx' target='_blank'> ScenarioService.asmx</a> <br> repository service: <a href='http://jwicsgaps.usstratcom.ic.gov:8000/VsaPortal/RepositoryService.asmx' title='http://jwicsgaps.usstratcom.ic.gov:8000/VsaPortal/RepositoryService.asmx' target='_blank'> RepositoryService.asmx</a> <br> <br>GAPS Overview <br>Global Awareness Presentation Services (GAPS) is a web-based command-wide service created to provide analysts and other decision makers the capability to generate Net-Centric Situational Awareness (SA) visualization products from disparate and dispersed data services. GAPS is interoperable with ongoing Department of Defense (DoD) wide C4ISR infrastructure efforts such as FSR and SKIWEB. GAPS attempts to share this data/information of an event in a real-time basis on SIPRNET and JWICS. GAPS allows users at all organizational levels to define, customize, and refine their specific User Defined Operational Picture (UDOP) based on mission and task. GAPS middleware capabilities serve as the \"facilitator\" of authoritative data source information by hosting over 3,000 dynamic and static data feeds and provides metrics and status on those feeds. GAPS provides several Ozone Widget Framework (OWF) based components that offer UDOP service functionality inside of an OWF dashboard. <br> <br>GAPS exposes a number of core UDOP Services through SOAP/RESTful services. <br>-GAPS Gazetteer Services <br>-GAPS Data Catalog Services <br>-GAPS Scenario Services", "parentComponent" : { "componentId" : 17, "name" : "DCGS Enterprise Messaging Technical Profile" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "STRATCOM J8", "releaseDate" : null, "version" : "2.5", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "david.treat", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405691317000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ { "text" : "Charting" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/GAPS.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 35, "guid" : "871e8252-1a22-4677-9a3d-fdd647d5d500", "name" : "GVS", "description" : "The National Geospatial-Intelligence Agency's (NGA) GEOINT Visualization Services is a suite of web-based capabilities that delivers geospatial visualization services to the Department of Defense (DoD) and Intelligence Community (IC) via classified and unclassified computer networks to provide visualization and data access services to the war fighter, intelligence officer, and the policy-maker. More information can be found on <br>Intelink-U: Wiki: <a href='https://www.intelink.gov/wiki/GVS' title='https://www.intelink.gov/wiki/GVS' target='_blank'> GVS</a> <br>Blog: <a href='https://www.intelink.gov/blogs/geoweb/' title='https://www.intelink.gov/blogs/geoweb/' target='_blank'> </a> Forge.mil <br>Dashboard GVS: <a href='https://community.forge.mil/content/geoint-visualization-services-gvs-program' title='https://community.forge.mil/content/geoint-visualization-services-gvs-program' target='_blank'> geoint-visualization-services-gv...</a> <br>Forge.mil Dashboard GVS/PalX3: <a href='https://community.forge.mil/content/geoint-visualization-services-gvs-palanterrax3' title='https://community.forge.mil/content/geoint-visualization-services-gvs-palanterrax3' target='_blank'> geoint-visualization-services-gv...</a>", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1361084400000, "version" : "1", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "chris.bashioum", "updateDts" : 1405612927000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/800px-GVS-4ShotMerge.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null }, { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/docman/do/listDocuments/projects.gvs' title='https://software.forge.mil/sf/docman/do/listDocuments/projects.gvs' target='_blank'> https://software.forge.mil/sf/docman/do/listDocuments/projects.gvs</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/Gvs' title='https://intellipedia.intelink.gov/wiki/Gvs' target='_blank'> https://intellipedia.intelink.gov/wiki/Gvs</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/Gvs' title='https://intellipedia.intelink.gov/wiki/Gvs' target='_blank'> https://intellipedia.intelink.gov/wiki/Gvs</a>" } ], "reviews" : [ ], "dependencies" : [ { "dependency" : "Tomcat", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 7 or 8" } ] }, { "componentId" : 58, "guid" : "cd86387e-08ae-4efe-b783-e8fddeb87021", "name" : "GVS - Base Maps - ESRi", "description" : "World Imagery Basemap is a global service that presents imagery from NGA holdings for Cache Scales from 1:147M - 1:282. This imagery includes various sources and resolutions spanning 15m to 75mm. The imagery sources are Buckeye, US/CAN/MX Border Imagery, Commercial Imagery, USGS High Resolution Orthos, Rampant Lion II, NAIP, CIB, Natural Vue data. Bathymetry data includes NOAA Coastal Relief Model and NGA DBED. This product undergoes bimonthly updates. <br> <br>GVS Overview: GVS has several core categories for developers of Geospatial products. These categories are reflected in the evaluation structure and content itself. <br>* Base Maps - Google Globe Google Maps, ArcGIS <br>* Features - MIDB, Intelink, CIDNE SIGACTS, GE shared products, WARP, NES <br>* Imagery - Commercial, WARP, NES <br>* Overlays - Streets, transportation, boundaries <br>* Discovery/Search - GeoQuery, Proximity Query, Google Earth, Globe Catalog, MapProxy, OMAR WCS <br>* Converters - GeoRSS to XML, XLS to KML, Shapefile to KML, KML to Shapefile, Coordinates <br>* Analytic Tools - Viewshed, Best Road Route <br>* Drawing Tools - Ellipse Generator, KML Styles, Custom Icons, Custom Placemarks, Mil Std 2525 Symbols <br>* Other - RSS Viewer, Network Link Generator, KML Report Creator", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1401861600000, "version" : "See site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200715000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/documentation' title='https://home.gvs.nga.mil/home/documentation' target='_blank'> https://home.gvs.nga.mil/home/documentation</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> https://intellipedia.intelink.gov/wiki/GVS</a>" } ], "reviews" : [ { "username" : "Jack TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 5, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1367309730000, "updateDate" : 1399961730000, "organization" : "NSA", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Bulky" }, { "text" : "Difficult Installation" } ] } ], "dependencies" : [ ] }, { "componentId" : 59, "guid" : "d10e748d-a555-4661-aec9-f192e2f131cc", "name" : "GVS - Base Maps - Google Globe - Summary Information", "description" : "GVS Google Earth Globe Services are constructed from DTED, CIB, Natural View, and Commercial Imagery. Vector data includes NGA standards such as VMAP, GeoNames, and GNIS. GVS recently added NavTeq Streets and Homeland Security Infrastructure data to the Google Globe over the United States. The Globes are continuously improved. <br> <br>The GVS Google Globe Imagery can also be accessed using a WMS/WMTS client at the following URLs: <br>*WMS - <a href='https://earth.gvs.nga.mil/wms/fusion_maps_wms.cgi' title='https://earth.gvs.nga.mil/wms/fusion_maps_wms.cgi' target='_blank'> fusion_maps_wms.cgi</a> <br>*WMS - AF/PK - <a href='https://earth.gvs.nga.mil/wms/afpk_map/fusion_maps_wms.cgi' title='https://earth.gvs.nga.mil/wms/afpk_map/fusion_maps_wms.cgi' target='_blank'> fusion_maps_wms.cgi</a> <br>*WMS - Natural View - <a href='https://earth.gvs.nga.mil/wms/nvue_map/fusion_maps_wms.cgi' title='https://earth.gvs.nga.mil/wms/nvue_map/fusion_maps_wms.cgi' target='_blank'> fusion_maps_wms.cgi</a> <br>*WMTS - <a href='https://earth.gvs.nga.mil/cgi-bin/ogc/service.py' title='https://earth.gvs.nga.mil/cgi-bin/ogc/service.py' target='_blank'> service.py</a> <br>*WMTS OpenLayers Example <br> <br>GVS Overview: GVS has several core categories for developers of Geospatial products. These categories are reflected in the evaluation structure and content itself. <br>* Base Maps - Google Globe Google Maps, ArcGIS <br>* Features - MIDB, Intelink, CIDNE SIGACTS, GE shared products, WARP, NES <br>* Imagery - Commercial, WARP, NES <br>* Overlays - Streets, transportation, boundaries <br>* Discovery/Search - GeoQuery, Proximity Query, Google Earth, Globe Catalog, MapProxy, OMAR WCS <br>* Converters - GeoRSS to XML, XLS to KML, Shapefile to KML, KML to Shapefile, Coordinates <br>* Analytic Tools - Viewshed, Best Road Route <br>* Drawing Tools - Ellipse Generator, KML Styles, Custom Icons, Custom Placemarks, Mil Std 2525 Symbols <br>* Other - RSS Viewer, Network Link Generator, KML Report Creator", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1401948000000, "version" : "See site for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200717000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/documentation' title='https://home.gvs.nga.mil/home/documentation' target='_blank'> https://home.gvs.nga.mil/home/documentation</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/google-earth' title='https://home.gvs.nga.mil/home/google-earth' target='_blank'> https://home.gvs.nga.mil/home/google-earth</a>" } ], "reviews" : [ { "username" : "Colby TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 4, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1328379330000, "updateDate" : 1398845730000, "organization" : "DCGS Army", "recommend" : true, "pros" : [ ], "cons" : [ ] } ], "dependencies" : [ ] }, { "componentId" : 60, "guid" : "134b6770-35f8-40fa-b11f-25e5c782d920", "name" : "GVS - Features - CIDNE SIGACTS", "description" : "The GVS CIDNE SIGACTS Data Layer provides a visualization-ready (KML 2.2 compliant formatted) result set for a query of SIGACTS, as obtained from the Combined Information Data Network Exchange (CIDNE) within a defined AOI (\"bounding box\", \"point/radius\", \"path buffer\"). <br> <br>To access the CIDNE SIGACTS Dynamic Data Layer use the base address: <br>SIPRNet: <a href='http://home.gvs.nga.smil.mil/CIDNE/SigactsServlet' title='http://home.gvs.nga.smil.mil/CIDNE/SigactsServlet' target='_blank'> SigactsServlet</a> <br>JWICs: <a href='http://home.gvs.nga.ic.gov/CIDNE/SigactsServlet' title='http://home.gvs.nga.ic.gov/CIDNE/SigactsServlet' target='_blank'> SigactsServlet</a> <br> <br>GVS Overview: GVS has several core categories for developers of Geospatial products. These categories are reflected in the evaluation structure and content itself. <br>* Base Maps - Google Globe Google Maps, ArcGIS <br>* Features - MIDB, Intelink, CIDNE SIGACTS, GE shared products, WARP, NES <br>* Imagery - Commercial, WARP, NES <br>* Overlays - Streets, transportation, boundaries <br>* Discovery/Search - GeoQuery, Proximity Query, Google Earth, Globe Catalog, MapProxy, OMAR WCS <br>* Converters - GeoRSS to XML, XLS to KML, Shapefile to KML, KML to Shapefile, Coordinates <br>* Analytic Tools - Viewshed, Best Road Route <br>* Drawing Tools - Ellipse Generator, KML Styles, Custom Icons, Custom Placemarks, Mil Std 2525 Symbols <br>* Other - RSS Viewer, Network Link Generator, KML Report Creator", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1401948000000, "version" : "See site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200718000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/documentation' title='https://home.gvs.nga.mil/home/documentation' target='_blank'> https://home.gvs.nga.mil/home/documentation</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/capabilities/queries/cidne_sigacts' title='https://home.gvs.nga.mil/home/capabilities/queries/cidne_sigacts' target='_blank'> https://home.gvs.nga.mil/home/capabilities/queries/cidne_sigacts</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> https://intellipedia.intelink.gov/wiki/GVS</a>" } ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 4, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1381644930000, "updateDate" : 1391537730000, "organization" : "NGA", "recommend" : true, "pros" : [ ], "cons" : [ ] } ], "dependencies" : [ ] }, { "componentId" : 61, "guid" : "f1fa43e1-b2bd-4636-bc86-0b050549c26f", "name" : "GVS - Features - GE Shared Products", "description" : "GVS Shared Product Query provides you with the ability to display geospatial information layers in a Google Earth client depicting data previously created and stored in the GVS Shared Product Buffer by other users. <br> <br>Home page: <a href='https://home.gvs.nga.mil/UPS/RSS' title='https://home.gvs.nga.mil/UPS/RSS' target='_blank'> RSS</a> for the manual query <a href='https://home.gvs.nga.mil/home/capabilities/queries/shared_products' title='https://home.gvs.nga.mil/home/capabilities/queries/shared_products' target='_blank'> shared_products</a> for the query tool <br>Wiki: A general GVS Wiki can be found here <a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> GVS</a> no specialized shared product wiki pages exist <br> <br>GVS Overview: GVS has several core categories for developers of Geospatial products. These categories are reflected in the evaluation structure and content itself. <br>* Base Maps - Google Globe Google Maps, ArcGIS <br>* Features - MIDB, Intelink, CIDNE SIGACTS, GE shared products, WARP, NES <br>* Imagery - Commercial, WARP, NES <br>* Overlays - Streets, transportation, boundaries <br>* Discovery/Search - GeoQuery, Proximity Query, Google Earth, Globe Catalog, MapProxy, OMAR WCS <br>* Converters - GeoRSS to XML, XLS to KML, Shapefile to KML, KML to Shapefile, Coordinates <br>* Analytic Tools - Viewshed, Best Road Route <br>* Drawing Tools - Ellipse Generator, KML Styles, Custom Icons, Custom Placemarks, Mil Std 2525 Symbols <br>* Other - RSS Viewer, Network Link Generator, KML Report Creator", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1401861600000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200719000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/documentation' title='https://home.gvs.nga.mil/home/documentation' target='_blank'> https://home.gvs.nga.mil/home/documentation</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/capabilities/queries/shared_products' title='https://home.gvs.nga.mil/home/capabilities/queries/shared_products' target='_blank'> https://home.gvs.nga.mil/home/capabilities/queries/shared_products</a> or <a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> https://intellipedia.intelink.gov/wiki/GVS</a>" } ], "reviews" : [ ], "dependencies" : [ { "dependency" : "Linux", "version" : null, "dependencyReferenceLink" : null, "comment" : "Tested on CentOS 5 and Ubuntu Server 11.0" } ] }, { "componentId" : 62, "guid" : "aa40dec7-efc9-4b4c-b29a-8eb51876e135", "name" : "GVS - Features - Intelink", "description" : "GVS - Features - Intelink: Provides the capability to perform a temporal keyword search for news items, Intellipedia data, and intelligence reporting and finished products found on Intelink. A list of geo-referenced locations in response to a query based on a filter. <br> <br>GVS INTELINK GEO SEARCH WFS INTERFACE (https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf) <br> <br>Interface Details: <br>* Access Protocol: HTTP WFS calls with URL-encoded parameters <br>* Base Address: <br>JWICS: <a href='http://home.gvs.nga.ic.gov/metacarta/wfs' title='http://home.gvs.nga.ic.gov/metacarta/wfs' target='_blank'> wfs</a> <br>SIPRNet: <a href='http://home.gvs.nga.smil.mil/metacarta/wfs' title='http://home.gvs.nga.smil.mil/metacarta/wfs' target='_blank'> wfs</a> <br> <br>GVS Overview: GVS has several core categories for developers of Geospatial products. These categories are reflected in the evaluation structure and content itself. <br>* Base Maps - Google Globe Google Maps, ArcGIS <br>* Features - MIDB, Intelink, CIDNE SIGACTS, GE shared products, WARP, NES <br>* Imagery - Commercial, WARP, NES <br>* Overlays - Streets, transportation, boundaries <br>* Discovery/Search - GeoQuery, Proximity Query, Google Earth, Globe Catalog, MapProxy, OMAR WCS <br>* Converters - GeoRSS to XML, XLS to KML, Shapefile to KML, KML to Shapefile, Coordinates <br>* Analytic Tools - Viewshed, Best Road Route <br>* Drawing Tools - Ellipse Generator, KML Styles, Custom Icons, Custom Placemarks, Mil Std 2525 Symbols <br>* Other - RSS Viewer, Network Link Generator, KML Report Creator", "parentComponent" : { "componentId" : 28, "name" : "DI2E Framework OpenAM" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1401861600000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200721000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/documentation' title='https://home.gvs.nga.mil/home/documentation' target='_blank'> https://home.gvs.nga.mil/home/documentation</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> https://intellipedia.intelink.gov/wiki/GVS</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 63, "guid" : "25dc2698-a99c-4f4e-b8c1-4e4734f0fbf5", "name" : "GVS - Features - MIDB", "description" : "GVS - Features - MIDB allows the user to query MIDB (Equipment) data within a defined AOI. User takes HTTP-Get parameters (Listed below the summary table and in the documentation) and builds a query. <br> <br>In the exposed Service Interfaces document MIDB services are covered in section 6.1 which is approximately page 73 in the current guide. <br> <br>Service URI <br>JWICS: <a href='http://home.gvs.nga.ic.gov/MIDB/wfs' title='http://home.gvs.nga.ic.gov/MIDB/wfs' target='_blank'> wfs</a> <br>SIPRNet: <a href='http://home.gvs.nga.smil.mil/MIDB/wfs' title='http://home.gvs.nga.smil.mil/MIDB/wfs' target='_blank'> wfs</a> <br> <br>GVS Documentation page <br>NIPRNet: <a href='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' title='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' target='_blank'> documentation</a> <br>SIPRNet: <a href='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' title='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' target='_blank'> documentation</a> <br>JWICs: <a href='https://home.gvs.nga.ic.gov/home/documentation' title='https://home.gvs.nga.ic.gov/home/documentation' target='_blank'> documentation</a> <br> <br>Exposed Service Interface Guide <br>NIPRNet: <a href='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> GVS_Exposed_Service_Interfaces.pdf</a> <br>SIPRNet: <a href='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> GVS_Exposed_Service_Interfaces.pdf</a> <br>JWICs: <a href='https://home.gvs.ic.gov/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.ic.gov/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> GVS_Exposed_Service_Interfaces.pdf</a> <br> <br>GVS Quick Reference Guide <br>NIPRNet: <a href='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' title='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' target='_blank'> GVS_Consolidated_QRG_Book_Reduce...</a> <br>SIPRNet: <a href='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' title='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' target='_blank'> GVS_Consolidated_QRG_Book_Reduce...</a> <br>JWICs: <a href='https://home.gvs.nga.ic.gov/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' title='https://home.gvs.nga.ic.gov/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' target='_blank'> GVS_Consolidated_QRG_Book_Reduce...</a> <br> <br> <br>GVS Overview: GVS has several core categories for developers of Geospatial products. These categories are reflected in the evaluation structure and content itself. <br>* Base Maps - Google Globe Google Maps, ArcGIS <br>* Features - MIDB, Intelink, CIDNE SIGACTS, GE shared products, WARP, NES <br>* Imagery - Commercial, WARP, NES <br>* Overlays - Streets, transportation, boundaries <br>* Discovery/Search - GeoQuery, Proximity Query, Google Earth, Globe Catalog, MapProxy, OMAR WCS <br>* Converters - GeoRSS to XML, XLS to KML, Shapefile to KML, KML to Shapefile, Coordinates <br>* Analytic Tools - Viewshed, Best Road Route <br>* Drawing Tools - Ellipse Generator, KML Styles, Custom Icons, Custom Placemarks, Mil Std 2525 Symbols <br>* Other - RSS Viewer, Network Link Generator, KML Report Creator", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1402120800000, "version" : "see site for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200722000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "answeredDate" : 1391447730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Project Manager", "answeredDate" : 1391447730000 } ] }, { "question" : "Are samples included? (SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1393834530000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ { "text" : "Access" }, { "text" : "Data Exchange" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/documentation' title='https://home.gvs.nga.mil/home/documentation' target='_blank'> https://home.gvs.nga.mil/home/documentation</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://software.forge.mil/sf/go/proj1769' title='https://software.forge.mil/sf/go/proj1769' target='_blank'> https://software.forge.mil/sf/go/proj1769</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> https://intellipedia.intelink.gov/wiki/GVS</a>" } ], "reviews" : [ { "username" : "Jack TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 3, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1381644930000, "updateDate" : 1391447730000, "organization" : "Private Company", "recommend" : false, "pros" : [ { "text" : "Well Tested" } ], "cons" : [ ] }, { "username" : "Dawson TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 1, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1362298530000, "updateDate" : 1391537730000, "organization" : "DCGS Army", "recommend" : true, "pros" : [ { "text" : "Compact" } ], "cons" : [ { "text" : "Security Concerns" } ] } ], "dependencies" : [ ] }, { "componentId" : 64, "guid" : "cfb2449d-86fe-4792-ada8-e5d965046026", "name" : "GVS - Features - NES", "description" : "GVS - Features - NES provides a visualization-ready (KML 2.2 compliant formatted) result set for a query of the targets obtained from the NGA National Exploitation System (NES), within a defined AOI (\"bounding box\", \"point/radius\", \"path buffer\").. Note, NES is only available on JWICS. <br> <br>Interface Details: <br>* Access Protocol: HTTP GET or POST with URL-encoded parameters <br>* Base Address: <br>JWICS: <a href='http://home.gvs.nga.ic.gov/NESQuery/CoverageQuery' title='http://home.gvs.nga.ic.gov/NESQuery/CoverageQuery' target='_blank'> CoverageQuery</a> <br> <br> <br>GVS Overview: GVS has several core categories for developers of Geospatial products. These categories are reflected in the evaluation structure and content itself. <br>* Base Maps - Google Globe Google Maps, ArcGIS <br>* Features - MIDB, Intelink, CIDNE SIGACTS, GE shared products, WARP, NES <br>* Imagery - Commercial, WARP, NES <br>* Overlays - Streets, transportation, boundaries <br>* Discovery/Search - GeoQuery, Proximity Query, Google Earth, Globe Catalog, MapProxy, OMAR WCS <br>* Converters - GeoRSS to XML, XLS to KML, Shapefile to KML, KML to Shapefile, Coordinates <br>* Analytic Tools - Viewshed, Best Road Route <br>* Drawing Tools - Ellipse Generator, KML Styles, Custom Icons, Custom Placemarks, Mil Std 2525 Symbols <br>* Other - RSS Viewer, Network Link Generator, KML Report Creator", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1402207200000, "version" : "see site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200723000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "answeredDate" : 1398845730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Cathy TEST", "userType" : "End User", "answeredDate" : 1399961730000 } ] }, { "question" : "Are samples included? (SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "createDts" : 1367309730000, "updateDts" : 1367309730000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1399961730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SERVICE", "codeDescription" : "Service Endpoint", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ { "text" : "Access" }, { "text" : "Charting" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/gvs.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/home/documentation' title='https://home.gvs.nga.mil/home/documentation' target='_blank'> https://home.gvs.nga.mil/home/documentation</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> https://intellipedia.intelink.gov/wiki/GVS</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 65, "guid" : "fe3041eb-1e40-4203-987b-e6622695f55b", "name" : "HardwareWall", "description" : "The Boeing eXMeritus HardwareWall* is a highly configurable, commercial-off-the-shelf cross domain solution that enables rapid, automated, and secure data transfer between security domains: <br> <br>eXMeritus has designed HardwareWall* as a secure data transfer system and an off-the-shelf Controlled Interface that meets and exceeds all mission and information assurance requirements for the world's highest-level security directives. Our systems have been deployed and certified in PL-3, PL-4 and PL-5 environments and continue to operate and evolve to meet ever changing requirements and threats. <br> <br>Links: <br> <a href='http://www.exmeritus.com/hardware_wall.html' title='http://www.exmeritus.com/hardware_wall.html' target='_blank'> hardware_wall.html</a> <br> <a href='http://www.boeing.com/advertising/c4isr/isr/exmeritus_harware_wall.html' title='http://www.boeing.com/advertising/c4isr/isr/exmeritus_harware_wall.html' target='_blank'> exmeritus_harware_wall.html</a> <br> <br>HardwareWall* Applications <br>*Files <br> **High to low or low to high <br> **Automated format and content review <br> **Digital signatures <br> **External utilities (e.g. virus scanning) <br> <br>*Streaming data <br> **High to low or low to high <br> **Automated format and content review <br> **Signed records or messages <br> <br>HardwareWall* Capacity <br> **Current installation moving large files at over 85MB/s <br> **Multiple methods to achieve multi-Gigabyte per second throughput: <br> **Scales by replication <br> **Scales by CPUs and interfaces <br> **Demonstrated ability to stripe across multiple Gigabit Ethernet fibers", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "Boeing", "releaseDate" : 1402812000000, "version" : "See Site", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "patrick.cross", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200725000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "Y", "codeDescription" : "Yes", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "COTS", "codeDescription" : "COTS", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/eXMeritus.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='http://www.exmeritus.com/hardware_wall.html' title='http://www.exmeritus.com/hardware_wall.html' target='_blank'> http://www.exmeritus.com/hardware_wall.html</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='http://www.exmeritus.com/hardware_wall.html' title='http://www.exmeritus.com/hardware_wall.html' target='_blank'> http://www.exmeritus.com/hardware_wall.html</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='http://www.exmeritus.com/hardware_wall.html' title='http://www.exmeritus.com/hardware_wall.html' target='_blank'> http://www.exmeritus.com/hardware_wall.html</a>" } ], "reviews" : [ { "username" : "Colby TEST", "userType" : "Project Manager", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 1, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1388769330000, "updateDate" : 1391537730000, "organization" : "DCGS Army", "recommend" : true, "pros" : [ { "text" : "Open Source" }, { "text" : "Reliable" } ], "cons" : [ { "text" : "Poor Documentation" } ] } ], "dependencies" : [ ] }, { "componentId" : 36, "guid" : "7268ddbc-ad59-4c8c-b205-96d81d4615e4", "name" : "IC AppsMall Cookbook: Applications Development", "description" : "The Applications Development Cookbook is designed as an overview of principles and best practices for Web Application Development, with a focus on new web and related technologies & concepts that take full advantage of modern browser capabilities. The ideas introduced in this document are not intended to be all inclusive, instead, they are met to expose the reader to concepts and examples that can be adapted and applied to a broad array of development projects and tangential tasks. The content is structured so that a reader with basic technical skills can garner a high-level understanding of the concepts. Where applicable, more detailed information has been included, or identified, to allow further examination of individual areas. <br> <br>This initial document is structured around four subject areas* JavaScript, User Experience (UX), HTML5, and Elastic Scalability. Each section provides a description, and then introduces key concepts[1]. <br> <br>JavaScript - this section provides a concise review of the main impediments developers with a few years of experience struggle with when using JavaScript. The resources section directs less experienced users to references that will teach them basic JavaScript. <br> <br>User Experience (UX) : this section provides a general overview of what UX is, as well as why and how it should, and can, be applied to application development projects. The content in this section has broad applicability, as it can inform decisions across a large spectrum* from aiding developers in designing more appealing applications to assisting managers in assuring they have marketable products. <br> <br>HTML5 : the HTML5 portion of the cookbook provides developers unfamiliar with the proposed standards of the newest iteration of Hypertext Markup Language an introduction to key concepts. The section includes simple exercises to demonstrate utility. <br> <br>Elastic Scalability : the Elastic Scalability section provides an introduction to architecture principles that can help ensure an infrastructure is capable of meeting a modern web browser's demands in accomplishing tasks traditionally held in the realm of the thick client.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "IC SOG", "releaseDate" : 1360047600000, "version" : "NA", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485077000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Are samples included? (SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "answeredDate" : 1391447730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Abby TEST", "userType" : "Developer", "createDts" : 1328379330000, "updateDts" : 1328379330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "answeredDate" : 1398845730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Cathy TEST", "userType" : "End User", "answeredDate" : 1393834530000 } ] }, { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "answeredDate" : 1393834530000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1398845730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "DOC", "codeDescription" : "Documentation", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/AppsMall_Cookbook:_Applications_Development' title='https://intellipedia.intelink.gov/wiki/AppsMall_Cookbook:_Applications_Development' target='_blank'> https://intellipedia.intelink.gov/wiki/AppsMall_Cookbook:_Applications_Development</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://intellipedia.intelink.gov/wiki/AppsMall_Cookbook:_Applications_Development' title='https://intellipedia.intelink.gov/wiki/AppsMall_Cookbook:_Applications_Development' target='_blank'> https://intellipedia.intelink.gov/wiki/AppsMall_Cookbook:_Applications_Development</a>" } ], "reviews" : [ ], "dependencies" : [ { "dependency" : "Tomcat", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 7 or 8" } ] }, { "componentId" : 37, "guid" : "dcb2db8f-fc5d-4db2-8e1b-cd1459cb34be", "name" : "ISF Enterprise Data Viewer Widget", "description" : "A widget designed to display search results in a tabular format. It can page, sort, filter, and group results and organize items into working folders called \"Workspaces\" as well as perform full-record retrieval for supported result types. It depends on the Persistence Service to store and retrieve results and optionally uses the Map widget to visualize results geospatially. <br> <br>This was previously entered in the storefront as the Enterprise Search Results Widget.", "parentComponent" : { "componentId" : 28, "name" : "DI2E Framework OpenAM" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NRO/GED", "releaseDate" : 1348380000000, "version" : "See links for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485078000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Project Manager", "answeredDate" : 1393834530000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1399961730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "createDts" : 1367309730000, "updateDts" : 1367309730000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "answeredDate" : 1393834530000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "answeredDate" : 1391447730000 } ] }, { "question" : "Are samples included? (SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1398845730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "WIDGET", "codeDescription" : "Widget", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "OWFCOMP", "typeDescription" : "OWF Compatible", "code" : "Y", "codeDescription" : "Yes", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "GOTS", "codeDescription" : "GOTS", "important" : false } ], "tags" : [ ], "metadata" : [ { "label" : "Extra Metadata (SAMPLE)", "value" : "Unfiltered" }, { "label" : "Support Common Interface 2.1 (SAMPLE)", "value" : "No" }, { "label" : "Common Uses (SAMPLE)", "value" : "UDOP, Information Sharing, Research" } ], "componentMedia" : [ { "link" : "images/oldsite/grid.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/data-viewer/browse' title='https://stash.di2e.net/projects/ISF/repos/data-viewer/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/data-viewer/browse</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/data-viewer/browse' title='https://stash.di2e.net/projects/ISF/repos/data-viewer/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/data-viewer/browse</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/data-viewer/browse' title='https://stash.di2e.net/projects/ISF/repos/data-viewer/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/data-viewer/browse</a>" } ], "reviews" : [ { "username" : "Dawson TEST", "userType" : "Developer", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 3, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 6 Months", "lastUsed" : 1367309730000, "updateDate" : 1391447730000, "organization" : "DCGS Army", "recommend" : true, "pros" : [ { "text" : "Active Development" } ], "cons" : [ { "text" : "Bulky" }, { "text" : "Legacy system" } ] }, { "username" : "Colby TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 5, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "> 3 years", "lastUsed" : 1328379330000, "updateDate" : 1393834530000, "organization" : "DCGS Army", "recommend" : false, "pros" : [ { "text" : "Well Tested" } ], "cons" : [ ] }, { "username" : "Jack TEST", "userType" : "Developer", "comment" : "I had issues trying to obtain the component and once I got it is very to difficult to install.", "rating" : 1, "title" : "Hassle (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1388769330000, "updateDate" : 1399961730000, "organization" : "Private Company", "recommend" : false, "pros" : [ { "text" : "Active Development" }, { "text" : "Open Source" } ], "cons" : [ ] } ], "dependencies" : [ ] }, { "componentId" : 38, "guid" : "247533a9-3109-4edd-a1a8-52fdc5bd516e", "name" : "ISF Persistence Service", "description" : "A RESTful service that persists JSON documents. It is designed to have a swappable backend and currently supports MongoDB and in-memory implementations.", "parentComponent" : null, "subComponents" : [ { "componentId" : 19, "name" : "DCGS Integration Backbone (DIB)" } ], "relatedComponents" : [ ], "organization" : "NRO/GED", "releaseDate" : 1329462000000, "version" : "See links for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485079000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "GOTS", "codeDescription" : "GOTS", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/Database-Icon.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/persistence-service/browse' title='https://stash.di2e.net/projects/ISF/repos/persistence-service/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/persistence-service/browse</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/persistence-service/browse' title='https://stash.di2e.net/projects/ISF/repos/persistence-service/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/persistence-service/browse</a>" } ], "reviews" : [ { "username" : "Abby TEST", "userType" : "End User", "comment" : "This wasn't quite what I thought it was.", "rating" : 1, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1367309730000, "updateDate" : 1393834530000, "organization" : "NSA", "recommend" : true, "pros" : [ { "text" : "Active Development" } ], "cons" : [ { "text" : "Poor Documentation" }, { "text" : "Difficult Installation" } ] }, { "username" : "Dawson TEST", "userType" : "End User", "comment" : "I had issues trying to obtain the component and once I got it is very to difficult to install.", "rating" : 5, "title" : "Hassle (SAMPLE)", "usedTimeCode" : "< 1 year", "lastUsed" : 1328379330000, "updateDate" : 1391537730000, "organization" : "DCGS Navy", "recommend" : false, "pros" : [ { "text" : "Open Source" } ], "cons" : [ { "text" : "Bulky" } ] } ], "dependencies" : [ ] }, { "componentId" : 39, "guid" : "e9433496-106f-48bc-9510-3e9a792f949a", "name" : "ISF Search Criteria Widget", "description" : "A widget dedicated to providing search criteria to a compatible CDR backend. It depends on the Persistence Service as a place to put retrieved metadata results. It also optionally depends on the Map widget to interactively define geospatial queries (a text-based option is also available) and to render results. A table of results is provided by the Data Viewer widget.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NRO/GED", "releaseDate" : 1348380000000, "version" : "See links for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485080000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "WIDGET", "codeDescription" : "Widget", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "OWFCOMP", "typeDescription" : "OWF Compatible", "code" : "Y", "codeDescription" : "Yes", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "GOTS", "codeDescription" : "GOTS", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/EntSearchWidget.PNG", "contentType" : "image/PNG", "caption" : null, "description" : null }, { "link" : "images/oldsite/EntSearchWidgetStatus.PNG", "contentType" : "image/PNG", "caption" : null, "description" : null }, { "link" : "images/oldsite/Search.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/search-criteria/browse' title='https://stash.di2e.net/projects/ISF/repos/search-criteria/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/search-criteria/browse</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/search-criteria/browse' title='https://stash.di2e.net/projects/ISF/repos/search-criteria/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/search-criteria/browse</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/ISF/repos/search-criteria/browse' title='https://stash.di2e.net/projects/ISF/repos/search-criteria/browse' target='_blank'> https://stash.di2e.net/projects/ISF/repos/search-criteria/browse</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 40, "guid" : "c1289f76-8704-41f4-8fa3-4b88c9cd0c3b", "name" : "iSpatial", "description" : "iSpatial is a commercially available geospatial framework designed as a set of ready-to-customize, baseline tools that can be rapidly adapted to meet use cases calling for geo-visualization. iSpatial consists of four major areas of core functionality: Authorizing, Searching, Managing and Collaborating. iSpatial's APIs and software libraries can be accessed by developers to customize off the existing framework. It is a front-end browser-based interface developed in JavaScript and ExtJS, a collection of REST services that connect the user interface to the back end, and a PostgreSQL/PostGIS and MongoDB back end. <br> <br> <br> <br>The iSpatial Core Services stack has four main components: the Message Queue (MQ), an Authentication Proxy Service (TAPS), Common Data Access Service (CDAS) , and Agent Manager (AM). <br> <br>iSpatial White Paper: <a href='http://www.t-sciences.com/wp-content/uploads/2013/04/iSpatial_v3_Technical_White_Paper.pdf' title='http://www.t-sciences.com/wp-content/uploads/2013/04/iSpatial_v3_Technical_White_Paper.pdf' target='_blank'> iSpatial_v3_Technical_White_Pape...</a> <br>iSpatial <a href='http://www.t-sciences.com/wp-content/uploads/2014/01/iSpatial_Fed.pptx' title='http://www.t-sciences.com/wp-content/uploads/2014/01/iSpatial_Fed.pptx' target='_blank'> iSpatial_Fed.pptx</a>", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "Thermopylae Sciences and Technology", "releaseDate" : 1395813600000, "version" : "3.2.4", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200726000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.1", "codeDescription" : "2.1 Collaboration", "important" : false }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "COTS", "codeDescription" : "COTS", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/iSpatialLogosquare.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='http://www.t-sciences.com/product/ispatial' title='http://www.t-sciences.com/product/ispatial' target='_blank'> http://www.t-sciences.com/product/ispatial</a>" }, { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='http://therml-pf-app02.pf.cee-w.net/static/docs/iSpatial_v3_User_Guide.pdf' title='http://therml-pf-app02.pf.cee-w.net/static/docs/iSpatial_v3_User_Guide.pdf' target='_blank'> http://therml-pf-app02.pf.cee-w.net/static/docs/iSpatial_v3_User_Guide.pdf</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='http://www.t-sciences.com/product/ispatial' title='http://www.t-sciences.com/product/ispatial' target='_blank'> http://www.t-sciences.com/product/ispatial</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='http://www.t-sciences.com/product/ispatial' title='http://www.t-sciences.com/product/ispatial' target='_blank'> http://www.t-sciences.com/product/ispatial</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 41, "guid" : "96c32c04-852d-4795-b659-235cfd0fdb05", "name" : "JC2CUI Common 2D Map API Widget", "description" : "This is a map widget developed by JC2CUI that conforms to the Common Map API - see below for more information on the API. <br> <br>Using this API allows developers to focus on the problem domain rather than implementing a map widget themselves. It also allows the actual map implementation used to be chosen dynamically by the user at runtime rather than being chosen by the developer. Any map implementation that applies this API can be used. Currently, implementations using Google Earth, Google Maps V2, Google Maps V3, and OpenLayers APIs are available, and others can be written as needed. <br> Another benefit of this API is that it allows multiple widgets to collaboratively display data on a single map widget rather than forcing the user to have a separate map for each widget, so the user does not have to struggle with a different map user interface for each widget. The API uses the OZONE Widget Framework (OWF) inter-widget communication mechanism to allow client widgets to interact with the map. Messages are sent to the appropriate channels (defined below), and the map updates its state accordingly. Other widgets interested in knowing the current map state can subscribe to these messages as well. It is worth noting that the map itself may publish data to these channels on occasion. For example, a map.feature.selected message may originate from a widget asking that a particular feature be selected or because a user has selected the feature on the map. While in most instances the map will not echo back another message to confirm that it has performed an operation, the map will send a view status message whenever the map view (zoom/pan) has been changed, either directly by the user or due to a view change message sent by another widget. This allows non-map widgets that wish to be aware of the current viewport to have that information without having to process all the various messages that can change its state.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "JC2CUI", "releaseDate" : 1342850400000, "version" : "1.3", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485082000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "answeredDate" : 1391537730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1391537730000 } ] }, { "question" : "Are samples included? (SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "answeredDate" : 1391447730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1391537730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "answeredDate" : 1391537730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "WIDGET", "codeDescription" : "Widget", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "OWFCOMP", "typeDescription" : "OWF Compatible", "code" : "Y", "codeDescription" : "Yes", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/EntMapWidget.PNG", "contentType" : "image/PNG", "caption" : null, "description" : null }, { "link" : "images/oldsite/EntMapWidgetNoDraw.PNG", "contentType" : "image/PNG", "caption" : null, "description" : null }, { "link" : "images/oldsite/maps-icon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.intelink.gov/inteldocs/browse.php?fFolderId=431871' title='https://www.intelink.gov/inteldocs/browse.php?fFolderId=431871' target='_blank'> https://www.intelink.gov/inteldocs/browse.php?fFolderId=431871</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.jc2cui/frs.common_map_widget' title='https://software.forge.mil/sf/frs/do/listReleases/projects.jc2cui/frs.common_map_widget' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.jc2cui/frs.common_map_widget</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://software.forge.mil/sf/frs/do/listReleases/projects.jc2cui/frs.common_map_widget' title='https://software.forge.mil/sf/frs/do/listReleases/projects.jc2cui/frs.common_map_widget' target='_blank'> https://software.forge.mil/sf/frs/do/listReleases/projects.jc2cui/frs.common_map_widget</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 42, "guid" : "a2a4488f-a139-41a2-b455-a1b9ea87f7c8", "name" : "JView", "description" : "JView is a Java-based API (application programmer's interface) that was developed to reduce the time, cost, & effort associated with the creation of computer visualization applications. <br> <br> <br> <br>JView provides the programmer with the ability to quickly develop 2-dimensional and 3-dimensional visualization applications that are tailored to address a specific problem. <br> <br>The JView API is government-owned and available free of charge to government agencies and their contractors. <br> <br>JView License information: Full release of JView is currently being made available to government agencies and their contractors. This release includes, source code, sample JView-based applications, sample models and terrain, and documentation. A limited release that does not include source code is available to universities and foreign governments. All releases are subject to the approval of the JView program office. One can request a copy of JView by visiting <a href='https://extranet.rl.af.mil/jview/.' title='https://extranet.rl.af.mil/jview/.' target='_blank'> .</a> Formal configuration management and distribution of JView is performed through the Information Management Services program.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "AFRL", "releaseDate" : 1310796000000, "version" : "1.7.1", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405370213000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : 1388769330000, "endDate" : 1393694130000, "currentLevelCode" : "LEVEL1", "reviewedVersion" : "1.0", "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : null, "actualCompletionDate" : 1392138930000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ { "name" : "Discoverable", "score" : 3 }, { "name" : "Accessible", "score" : 2 }, { "name" : "Documentation", "score" : 5 }, { "name" : "Deployable", "score" : 1 }, { "name" : "Usable", "score" : 0 }, { "name" : "Error Handling", "score" : 1 }, { "name" : "Integrable", "score" : 4 }, { "name" : "I/O Validation", "score" : 3 }, { "name" : "Testing", "score" : 1 }, { "name" : "Monitoring", "score" : 2 }, { "name" : "Performance", "score" : 3 }, { "name" : "Scalability", "score" : 4 }, { "name" : "Security", "score" : 1 }, { "name" : "Maintainability", "score" : 2 }, { "name" : "Community", "score" : 5 }, { "name" : "Change Management", "score" : 4 }, { "name" : "CA", "score" : 2 }, { "name" : "Licensing", "score" : 0 }, { "name" : "Roadmap", "score" : 4 }, { "name" : "Willingness", "score" : 4 }, { "name" : "Architecture Alignment", "score" : 5 } ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL1", "codeDescription" : "Level 1 - Initial Reuse Analysis", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "GOTS", "codeDescription" : "GOTS", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/JView+Screen+Shot+Shader+Demo.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/JView+Screen+Shot+screencap_large_f22.jpg", "contentType" : "image/jpg", "caption" : null, "description" : null }, { "link" : "images/oldsite/JView_Logo_133_81[1].png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/scm/do/listRepositories/projects.jview/scm' title='https://software.forge.mil/sf/scm/do/listRepositories/projects.jview/scm' target='_blank'> https://software.forge.mil/sf/scm/do/listRepositories/projects.jview/scm</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://software.forge.mil/sf/scm/do/listRepositories/projects.jview/scm' title='https://software.forge.mil/sf/scm/do/listRepositories/projects.jview/scm' target='_blank'> https://software.forge.mil/sf/scm/do/listRepositories/projects.jview/scm</a>" }, { "name" : "DI2E Framework Evaluation Report URL", "type" : "DI2E Framework Evaluation Report URL", "description" : null, "link" : "<a href='https://storefront.di2e.net/marketplace/public/JViewAPI_ChecklistReport_v1.0.docx' title='https://storefront.di2e.net/marketplace/public/JViewAPI_ChecklistReport_v1.0.docx' target='_blank'> https://storefront.di2e.net/marketplace/public/JViewAPI_ChecklistReport_v1.0.docx</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://extranet.rl.af.mil/jview/' title='https://extranet.rl.af.mil/jview/' target='_blank'> https://extranet.rl.af.mil/jview/</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://software.forge.mil/sf/go/proj1195' title='https://software.forge.mil/sf/go/proj1195' target='_blank'> https://software.forge.mil/sf/go/proj1195</a>" } ], "reviews" : [ { "username" : "Cathy TEST", "userType" : "End User", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 1, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "> 3 years", "lastUsed" : 1328379330000, "updateDate" : 1391447730000, "organization" : "DCGS Navy", "recommend" : false, "pros" : [ ], "cons" : [ { "text" : "Poorly Tested" } ] } ], "dependencies" : [ ] }, { "componentId" : 43, "guid" : "20dd2ed3-491f-4b8c-99a9-33029c308182", "name" : "Military Symbology Renderer", "description" : "The Mil Symbology Renderer is both a developer's toolkit as well as a ready to use deployable web application. <br>The goal of this project is to provide a single distributable solution that can support as many use cases as possible <br>for military symbology rendering. The current features available are: <br>* Use in web applications using the JavaScript library and SECRenderer applet <br>* Use with thin Ozone Widget Framework with the Rendering widget and API <br>* Use as a REST web service (Currently supports icon based symbols only) <br>* Use of underlying rendering jar files in an application or service", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1358924400000, "version" : "1.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485084000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "WIDGET", "codeDescription" : "Widget", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "OWFCOMP", "typeDescription" : "OWF Compatible", "code" : "Y", "codeDescription" : "Yes", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/maps-icon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://github.com/missioncommand/mil-sym-java/blob/master/documentation/Mil%20Symbology%20Web%20Service%20Developer's%20Guide.docx' title='https://github.com/missioncommand/mil-sym-java/blob/master/documentation/Mil%20Symbology%20Web%20Service%20Developer's%20Guide.docx' target='_blank'> https://github.com/missioncommand/mil-sym-java/blob/master/documentation/Mil%20Symbology%20Web%20Service%20Developer's%20Guide.docx</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://github.com/missioncommand' title='https://github.com/missioncommand' target='_blank'> https://github.com/missioncommand</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://github.com/missioncommand' title='https://github.com/missioncommand' target='_blank'> https://github.com/missioncommand</a>" } ], "reviews" : [ { "username" : "Jack TEST", "userType" : "Project Manager", "comment" : "I had issues trying to obtain the component and once I got it is very to difficult to install.", "rating" : 1, "title" : "Hassle (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1367309730000, "updateDate" : 1398845730000, "organization" : "NSA", "recommend" : false, "pros" : [ ], "cons" : [ { "text" : "Difficult Installation" } ] } ], "dependencies" : [ ] }, { "componentId" : 44, "guid" : "f303606d-5b76-4ebe-beca-cec20c3791e1", "name" : "OpenAM", "description" : "OpenAM is an all-in-one access management platform with the adaptive intelligence to protect against risk-based threats across any environment.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "DI2E-F", "releaseDate" : 1345701600000, "version" : "See site for latest versions", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200729000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "1.2.1", "codeDescription" : "Identity and Access Management", "important" : true }, { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : null, "codeDescription" : null, "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/security.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='http://forgerock.com/products/open-identity-stack/openam/' title='http://forgerock.com/products/open-identity-stack/openam/' target='_blank'> http://forgerock.com/products/open-identity-stack/openam/</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='http://forgerock.com/products/open-identity-stack/openam/' title='http://forgerock.com/products/open-identity-stack/openam/' target='_blank'> http://forgerock.com/products/open-identity-stack/openam/</a>" } ], "reviews" : [ { "username" : "Cathy TEST", "userType" : "End User", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 1, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 6 Months", "lastUsed" : 1362298530000, "updateDate" : 1393834530000, "organization" : "NGA", "recommend" : false, "pros" : [ ], "cons" : [ { "text" : "Poorly Tested" } ] } ], "dependencies" : [ ] }, { "componentId" : 45, "guid" : "7c4aa579-64c7-4b35-859d-7b2922ab0efb", "name" : "OpenSextant", "description" : "(U) OpenSextant is an open source software package for geotagging unstructured text. OpenSextant is implemented in Java and based on the open source text analytic software GATE ( <a href='http://gate.ac.uk/' title='http://gate.ac.uk/' target='_blank'> </a> ). <br>(U) OpenSextant can geotag documents in any file format supported by GATE, which includes plain text, Microsoft Word, PDF, and HTML. Multiple files can submitted in a compressed archive. OpenSextant can unpack both .zip and .tar archives, as well as tarball archives with .gz or .tgz extensions. The newer .zipx format is not currently supported. <br>(U) Geospatial information is written out in commonly used geospatial data formats, such as KML, ESRI Shapefile, CSV, JSON or WKT. Details on how OpenSextant works and output formats it supports can be found in the document Introduction to OpenSextant. <br>OpenSextant can be run either as a standalone application or as a web service <br>(U) OpenSextant identifies and disambiguates geospatial information in unstructured text. Geospatial information includes named places as well as explicit spatial coordinates such as latitude-longitude pairs and Military Grid References. Named places can be any geospatial feature, such as countries, cities, rivers, and so on. Disambiguation refers to matching a named place in a document with one or more entries in a gazetteer and providing a relative confidence level for each match.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NGA", "releaseDate" : 1367042400000, "version" : "1.3.1", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485085000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ { "label" : "Common Uses (SAMPLE)", "value" : "UDOP, Information Sharing, Research" }, { "label" : "Support Common Interface 2.1 (SAMPLE)", "value" : "No" } ], "componentMedia" : [ { "link" : "images/oldsite/OpenSextantSS.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/OpenSextanticon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://github.com/OpenSextant/opensextant/tree/master/OpenSextantToolbox/doc' title='https://github.com/OpenSextant/opensextant/tree/master/OpenSextantToolbox/doc' target='_blank'> https://github.com/OpenSextant/opensextant/tree/master/OpenSextantToolbox/doc</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://github.com/OpenSextant/opensextant' title='https://github.com/OpenSextant/opensextant' target='_blank'> https://github.com/OpenSextant/opensextant</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://github.com/OpenSextant/opensextant' title='https://github.com/OpenSextant/opensextant' target='_blank'> https://github.com/OpenSextant/opensextant</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 46, "guid" : "66bca318-5cca-45e4-a207-688ad923ede8", "name" : "OpenStack", "description" : "OpenStack is open source software for building public and private clouds ( <a href='http://www.openstack.org' title='http://www.openstack.org' target='_blank'> www.openstack.org</a> ). The release here has been developed by USC/ISI and has two distinctions from the mainstream open source release. First, we've focused on support for high-performance, heterogeneous hardware. Second, we've packaged a release for deployment in secure environments. The release has been developed for RHEL and related host operating systems, includes an SELinux policy, and includes all of the dependent packages, so the release can be deployed stand-alone in environments not connected to the internet. The release uses a modified version of the open source Rackspace Private Cloud software for easy installation.", "parentComponent" : { "componentId" : 45, "name" : "OpenSextant" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "USC/ISI", "releaseDate" : 1386831600000, "version" : "NA, see listing for latest", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485086000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Abby TEST", "userType" : "Project Manager", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "answeredDate" : 1398845730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Cathy TEST", "userType" : "End User", "answeredDate" : 1398845730000 } ] }, { "question" : "Are samples included? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "createDts" : 1367309730000, "updateDts" : 1367309730000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "answeredDate" : 1391447730000 } ] }, { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Cathy TEST", "userType" : "Project Manager", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Abby TEST", "userType" : "Developer", "answeredDate" : 1391447730000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "answeredDate" : 1399961730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "PILOT", "codeDescription" : "Deployment Pilot", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/OpenStack.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/Heterogeneous+OpenStack+Grizzly+Release' title='https://confluence.di2e.net/display/DI2E/Heterogeneous+OpenStack+Grizzly+Release' target='_blank'> https://confluence.di2e.net/display/DI2E/Heterogeneous+OpenStack+Grizzly+Release</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/Heterogeneous+OpenStack+Grizzly+Release' title='https://confluence.di2e.net/display/DI2E/Heterogeneous+OpenStack+Grizzly+Release' target='_blank'> https://confluence.di2e.net/display/DI2E/Heterogeneous+OpenStack+Grizzly+Release</a>" } ], "reviews" : [ { "username" : "Abby TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 4, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 1 year", "lastUsed" : 1381644930000, "updateDate" : 1393834530000, "organization" : "NGA", "recommend" : true, "pros" : [ { "text" : "Well Tested" }, { "text" : "Active Development" } ], "cons" : [ { "text" : "Difficult Installation" } ] }, { "username" : "Colby TEST", "userType" : "End User", "comment" : "I had issues trying to obtain the component and once I got it is very to difficult to install.", "rating" : 2, "title" : "Hassle (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1367309730000, "updateDate" : 1398845730000, "organization" : "NGA", "recommend" : true, "pros" : [ ], "cons" : [ ] }, { "username" : "Cathy TEST", "userType" : "End User", "comment" : "This is a great product however, it's missing what I think are critical features. Hopefully, they are working on it for future updates.", "rating" : 2, "title" : "Great but missing features (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1388769330000, "updateDate" : 1393834530000, "organization" : "NSA", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Security Concerns" }, { "text" : "Poor Documentation" } ] } ], "dependencies" : [ ] }, { "componentId" : 47, "guid" : "638e11e6-39c5-44b3-8168-af7cc1469f15", "name" : "OpenStack Lessons Learned Document", "description" : "Lessons learned in the Openstack Folsom deployment by USC/ISI in the DI2E Framework environment. This document is meant to be very specific to one deployment experience with the intention that it will be useful to others deploying in a similar environment. <br> <br>Note this document is stored on the DI2E Framework Wiki which requires a DI2E Framework Devtools account ( <a href='https://devtools.di2e.net/' title='https://devtools.di2e.net/' target='_blank'> </a> )", "parentComponent" : { "componentId" : 31, "name" : "DI2E RESTful CDR Search Technical Profile" }, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1386226800000, "version" : "1.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485087000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Are samples included? (SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "createDts" : 1328379330000, "updateDts" : 1328379330000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "answeredDate" : 1399961730000 } ] }, { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "answeredDate" : 1393834530000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "answeredDate" : 1398845730000 } ] }, { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Abby TEST", "userType" : "Developer", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "answeredDate" : 1399961730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Abby TEST", "userType" : "Developer", "answeredDate" : 1391447730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "DOC", "codeDescription" : "Documentation", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/OpenStack.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/download/attachments/8847504/OpenStack-LessonsLearned.pdf?api=v2' title='https://confluence.di2e.net/download/attachments/8847504/OpenStack-LessonsLearned.pdf?api=v2' target='_blank'> https://confluence.di2e.net/download/attachments/8847504/OpenStack-LessonsLearned.pdf?api=v2</a>" } ], "reviews" : [ { "username" : "Cathy TEST", "userType" : "Project Manager", "comment" : "This wasn't quite what I thought it was.", "rating" : 4, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 3 years", "lastUsed" : 1381644930000, "updateDate" : 1398845730000, "organization" : "NGA", "recommend" : true, "pros" : [ { "text" : "Reliable" }, { "text" : "Open Source" } ], "cons" : [ { "text" : "Poorly Tested" } ] }, { "username" : "Jack TEST", "userType" : "Developer", "comment" : "This is a great product however, it's missing what I think are critical features. Hopefully, they are working on it for future updates.", "rating" : 2, "title" : "Great but missing features (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1388769330000, "updateDate" : 1398845730000, "organization" : "NGA", "recommend" : true, "pros" : [ ], "cons" : [ ] }, { "username" : "Colby TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 2, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1381644930000, "updateDate" : 1398845730000, "organization" : "DCGS Navy", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Security Concerns" }, { "text" : "Poorly Tested" } ] } ], "dependencies" : [ ] }, { "componentId" : 48, "guid" : "5cb546ca-40de-4744-962d-56cfa9e1cbab", "name" : "OWASP Enterprise Security API", "description" : "ESAPI (The OWASP Enterprise Security API) is a free, open source, web application security control library that makes it easier for programmers to write lower-risk applications. The ESAPI libraries are designed to make it easier for programmers to retrofit security into existing applications. The ESAPI libraries also serve as a solid foundation for new development. <br> <br>Allowing for language-specific differences, all OWASP ESAPI versions have the same basic design: <br>* There is a set of security control interfaces. They define for example types of parameters that are passed to types of security controls. <br>* There is a reference implementation for each security control. The logic is not organization-specific and the logic is not application-specific. An example: string-based input validation. <br>* There are optionally your own implementations for each security control. There may be application logic contained in these classes which may be developed by or for your organization. An example: enterprise authentication. <br> <br>This project source code is licensed under the BSD license, which is very permissive and about as close to public domain as is possible. The project documentation is licensed under the Creative Commons license. You can use or modify ESAPI however you want, even include it in commercial products. <br> <br>The following organizations are a few of the many organizations that are starting to adopt ESAPI to secure their web applications: American Express, Apache Foundation, Booz Allen Hamilton, Aspect Security, Coraid, The Hartford, Infinite Campus, Lockheed Martin, MITRE, U.S. Navy - SPAWAR, The World Bank, SANS Institute. <br> <br>The guide is produced by the Open Web Application Security Project (OWASP) - <a href='https://www.owasp.org.' title='https://www.owasp.org.' target='_blank'> www.owasp.org.</a>", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "OWASP", "releaseDate" : 1121839200000, "version" : "2.10", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485088000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "SOFTWARE", "codeDescription" : "Software", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "Access" }, { "text" : "Testing" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/OWASPAPIScreenShot.PNG", "contentType" : "image/PNG", "caption" : null, "description" : null }, { "link" : "images/oldsite/ologo.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.owasp.org/index.php/Esapi' title='https://www.owasp.org/index.php/Esapi' target='_blank'> https://www.owasp.org/index.php/Esapi</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://www.owasp.org/index.php/Esapi#tab=Downloads' title='https://www.owasp.org/index.php/Esapi#tab=Downloads' target='_blank'> https://www.owasp.org/index.php/Esapi#tab=Downloads</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='https://www.owasp.org/index.php/Esapi' title='https://www.owasp.org/index.php/Esapi' target='_blank'> https://www.owasp.org/index.php/Esapi</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 49, "guid" : "f2a509c0-419f-489e-844d-e783be5f5fe2", "name" : "OWASP Web Application Security Guide", "description" : "The Development Guide is aimed at architects, developers, consultants and auditors and is a comprehensive manual for designing, developing and deploying secure Web Applications and Web Services. The original OWASP Development Guide has become a staple diet for many web security professionals. Since 2002, the initial version was downloaded over 2 million times. Today, the Development Guide is referenced by many leading government, financial, and corporate standards and is the Gold standard for Web Application and Web Service security. <br>The guide is produced by the Open Web Application Security Project (OWASP) - <a href='https://www.owasp.org.' title='https://www.owasp.org.' target='_blank'> www.owasp.org.</a>", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "OWASP", "releaseDate" : 1122098400000, "version" : "2.01", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485088000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "DOC", "codeDescription" : "Documentation", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : null, "codeDescription" : null, "important" : false } ], "tags" : [ { "text" : "Charting" }, { "text" : "Visualization" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/OWASPGuideScreenShot.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/ologo.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.owasp.org/index.php/Category:OWASP_Guide_Project' title='https://www.owasp.org/index.php/Category:OWASP_Guide_Project' target='_blank'> https://www.owasp.org/index.php/Category:OWASP_Guide_Project</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://www.owasp.org/index.php/Category:OWASP_Guide_Project' title='https://www.owasp.org/index.php/Category:OWASP_Guide_Project' target='_blank'> https://www.owasp.org/index.php/Category:OWASP_Guide_Project</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 50, "guid" : "0a1931ac-611d-4d82-a83e-4a48ae51ec7a", "name" : "Ozone Marketplace", "description" : "The Ozone marketplace is a storefront to store widgets, services, and web applications. It can be linked to the Ozone Widget Framework.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "OWF Goss", "releaseDate" : 1349935200000, "version" : "5.0.1", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "CROSS.PATRICK.I.1126309879", "updateDts" : 1399485089000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false } ], "tags" : [ { "text" : "UDOP" }, { "text" : "Communication" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/OMP.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/OMPIcon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.owfgoss.org/downloads/Marketplace/5.0/Marketplace-5.0.1-GA/' title='https://www.owfgoss.org/downloads/Marketplace/5.0/Marketplace-5.0.1-GA/' target='_blank'> https://www.owfgoss.org/downloads/Marketplace/5.0/Marketplace-5.0.1-GA/</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://www.owfgoss.org/downloads/Marketplace/5.0/Marketplace-5.0.1-GA/' title='https://www.owfgoss.org/downloads/Marketplace/5.0/Marketplace-5.0.1-GA/' target='_blank'> https://www.owfgoss.org/downloads/Marketplace/5.0/Marketplace-5.0.1-GA/</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 51, "guid" : "3dd46fe2-8926-45ee-a4dc-63057c030a9e", "name" : "Ozone Widget Framework", "description" : "OWF is a web application that allows users to easily access all their online tools from one location. Not only can users access websites and applications with widgets, they can group them and configure some applications to interact with each other via widget intents. <br> <br> <br> <br> <br> <br>Some Links: <br>http://www.ozoneplatform.org/ (mirror site to below) <br>https://www.owfgoss.org/ (mirror site to above)", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "OWF GOSS", "releaseDate" : 1356246000000, "version" : "7.0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1402947991000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "answeredDate" : 1391447730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Project Manager", "answeredDate" : 1391447730000 } ] }, { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "createDts" : 1328379330000, "updateDts" : 1328379330000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "answeredDate" : 1398845730000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Colby TEST", "userType" : "Project Manager", "answeredDate" : 1391447730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "LICTYPE", "typeDescription" : "License Type", "code" : "GOVUNL", "codeDescription" : "Government Unlimited Rights", "important" : false } ], "tags" : [ { "text" : "Communication" } ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/launch-menu.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/graph.png", "contentType" : "image/png", "caption" : null, "description" : null }, { "link" : "images/oldsite/Ozone-Banner_30x110.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Cathy TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://www.owfgoss.org/' title='https://www.owfgoss.org/' target='_blank'> https://www.owfgoss.org/</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://www.owfgoss.org/' title='https://www.owfgoss.org/' target='_blank'> https://www.owfgoss.org/</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://www.owfgoss.org/' title='https://www.owfgoss.org/' target='_blank'> https://www.owfgoss.org/</a>" } ], "reviews" : [ ], "dependencies" : [ ] }, { "componentId" : 53, "guid" : "68e0403b-41d0-48fc-bd46-8f5a6fc8d83d", "name" : "VANTAGE Software Suite", "description" : "VANTAGE is a tactical imagery exploitation software suite. This field proven application screens digital imagery from various tactical reconnaissance sensors and includes simultaneous support for multiple sensor types. VANTAGE provides for real and near real time screening of digital image data from a live data link, solid state recorder, DVD/CD, or local disk. In addition, VANTAGE provides a full featured database that can be used to quickly find imagery based on an area (or point) of interest, a time query, or sensor type. <br> <br> <br>This software suite allows the image analyst to receive, decompress/compress, process, display, evaluate, exploit, and store imagery data; as well as create/disseminate processed image products. VANTAGE was developed by SDL in support of various sensors such as SPIRITT, ATARS/APG-73, LSRS, ASARS-2A, SYERS-2, and Global Hawk and provides simultaneous support for multiple sensor types. <br> <br>The VANTAGE software suite includes the following applications: <br> <br>VANTAGE ViewPoint <br> *Provides rapid display and exploitation of tactical imagery <br> *Displays geo-referenced digital tactical imagery in a robust, near real-time waterfall of decimated imagery <br> *Provides on-demand display of full-resolution imagery with exploitation tools <br> <br>VANTAGE Ascent <br> *Configures ground stations for device interface management (solid-state recorders, CDL interface, STANAG 4575, Ethernet feeds, etc.) <br> *Provides sensor interfacing/processing <br> *Performs NITF image formation <br> *Provides for database management <br> <br>VANTAGE Soar <br> *Interfaces with data received through SDL's CDL Interface Box (CIB) or Sky Lynx for data link interfacing and simulation <br> *Allows operator to load and play simulation CDL files, select CDL data rate, select bit error rates, perform Built-In Test (BIT), and view advanced CDL statistics <br> <br>VANTAGE Web Enabled Sensor Service (WESS) <br> *Provides map-based database access via a standard web browser <br> <br> <br>The Vantage Web Enabled Sensor Service (WESS) is an optional service that provides access to Vantage databases from other applications. WESS The Web Enabled Sensor Service (WESS) is a server that runs on the Vantage server and exposes the Vantage database of imagery and metadata to the outside via SOAP. WESS uses an open protocol to communicate data and is not bound to a browser or programming language. The WESS client is an application that allows users to display imagery from the Vantage database in a web browser, over a network. retrieves imagery, video files, MTI files, and related products from a Vantage database over a network connection, and displays it in a web browser. If you are using Internet Explorer (IE) 9 or Firefox 3, you can also use WESS to manipulate and enhance imagery. <br> <br>", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NRL", "releaseDate" : 1377669600000, "version" : "n/a", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405452097000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Colby TEST", "userType" : "Developer", "createDts" : 1367309730000, "updateDts" : 1367309730000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1393834530000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Dawson TEST", "userType" : "Developer", "answeredDate" : 1391447730000 } ] }, { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Cathy TEST", "userType" : "End User", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Abby TEST", "userType" : "Developer", "answeredDate" : 1399961730000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Cathy TEST", "userType" : "Project Manager", "answeredDate" : 1399961730000 } ] }, { "question" : "Are samples included? (SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "createDts" : 1328379330000, "updateDts" : 1328379330000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "answeredDate" : 1393834530000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "APP", "codeDescription" : "Application", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "DEV", "codeDescription" : "Development", "important" : false } ], "tags" : [ { "text" : "Mapping" } ], "metadata" : [ { "label" : "Support Common Interface 2.1 (SAMPLE)", "value" : "No" }, { "label" : "Common Uses (SAMPLE)", "value" : "UDOP, Information Sharing, Research" }, { "label" : "Available to public (SAMPLE)", "value" : "YES" } ], "componentMedia" : [ { "link" : "images/oldsite/wess_logo.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Abby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='http://www.spacedynamics.org/products/vantage' title='http://www.spacedynamics.org/products/vantage' target='_blank'> http://www.spacedynamics.org/products/vantage</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='http://www.spacedynamics.org/products/vantage' title='http://www.spacedynamics.org/products/vantage' target='_blank'> http://www.spacedynamics.org/products/vantage</a>" }, { "name" : "Product Homepage", "type" : "Homepage", "description" : null, "link" : "<a href='http://www.spacedynamics.org/products/vantage' title='http://www.spacedynamics.org/products/vantage' target='_blank'> http://www.spacedynamics.org/products/vantage</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "email [email protected]" } ], "reviews" : [ { "username" : "Abby TEST", "userType" : "End User", "comment" : "This wasn't quite what I thought it was.", "rating" : 4, "title" : "Confused (SAMPLE)", "usedTimeCode" : "< 1 year", "lastUsed" : 1362298530000, "updateDate" : 1398845730000, "organization" : "NSA", "recommend" : false, "pros" : [ { "text" : "Reliable" } ], "cons" : [ ] }, { "username" : "Colby TEST", "userType" : "Developer", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 4, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 1 year", "lastUsed" : 1367309730000, "updateDate" : 1399961730000, "organization" : "DCGS Navy", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Legacy system" }, { "text" : "Poor Documentation" } ] } ], "dependencies" : [ { "dependency" : "Erlang", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 3.0" } ] }, { "componentId" : 54, "guid" : "9a540308-86e4-406a-8923-97496fb9a215", "name" : "VANTAGE WESS OZONE Widget", "description" : "The Vantage Web Enabled Sensor Service (WESS) is an optional service that provides access to Vantage databases from other applications. WESS The Web Enabled Sensor Service (WESS) is a server that runs on the Vantage server and exposes the Vantage database of imagery and metadata to the outside via SOAP. WESS uses an open protocol to communicate data and is not bound to a browser or programming language. The WESS client is an application that allows users to display imagery from the Vantage database in a web browser, over a network. retrieves imagery, video files, MTI files, and related products from a Vantage database over a network connection, and displays it in a web browser. If you are using Internet Explorer (IE) 9 or Firefox 3, you can also use WESS to manipulate and enhance imagery. <br> <br> <br>There are two widgets provided by the WESS application, called the VANTAGE WESS Search widget and the VANTAGE WESS Viewer widget. Together the WESS OZONE Widgets are a lightweight web application that, after installation into the Ozone Widget Framework and configuration, allows the user to view the contents of a VANTAGE database or a CDR compliant data source; it also interfaces with the JC2CUI map widget. Google Maps is one of the view capabilities provided by the Widget. The Widget provides a search capability. <br> <br>Links: <br>SDL Vantage Link: <a href='http://www.spacedynamics.org/products/vantage' title='http://www.spacedynamics.org/products/vantage' target='_blank'> vantage</a>", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "NRL", "releaseDate" : 1378101600000, "version" : "0", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "david.treat", "updateDts" : 1405452122000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Which version supports y-docs 1.5+? (SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "createDts" : 1328379330000, "updateDts" : 1328379330000, "responses" : [ { "response" : "Version 3.1 added support.(SAMPLE)", "username" : "Jack TEST", "userType" : "Developer", "answeredDate" : 1399961730000 }, { "response" : "They depreciated support in version 4.0 since it was a rarely used feature.(SAMPLE)", "username" : "Jack TEST", "userType" : "End User", "answeredDate" : 1393834530000 } ] }, { "question" : "Are samples included? (SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "createDts" : 1381644930000, "updateDts" : 1381644930000, "responses" : [ { "response" : "They are included in a separate download.(SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "answeredDate" : 1391537730000 } ] }, { "question" : "Are there alternate licenses? (SAMPLE)", "username" : "Colby TEST", "userType" : "End User", "createDts" : 1362298530000, "updateDts" : 1362298530000, "responses" : [ { "response" : "You can ask their support team for a custom commerical license that should cover you needs.(SAMPLE)", "username" : "Abby TEST", "userType" : "End User", "answeredDate" : 1399961730000 }, { "response" : "We've try to get an alternate license and we've been waiting for over 6 months for thier legal department.(SAMPLE)", "username" : "Dawson TEST", "userType" : "End User", "answeredDate" : 1399961730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "WIDGET", "codeDescription" : "Widget", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LICCLASS", "typeDescription" : "License Classification", "code" : "GOTS", "codeDescription" : "GOTS", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "DEV", "codeDescription" : "Development", "important" : false }, { "type" : "OWFCOMP", "typeDescription" : "OWF Compatible", "code" : "Y", "codeDescription" : "Yes", "important" : false } ], "tags" : [ { "text" : "Mapping" } ], "metadata" : [ { "label" : "Support Common Interface 2.1 (SAMPLE)", "value" : "No" }, { "label" : "Extra Metadata (SAMPLE)", "value" : "Unfiltered" }, { "label" : "Available to public (SAMPLE)", "value" : "YES" } ], "componentMedia" : [ { "link" : "images/oldsite/wess_logo.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Jack TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/WESS+Documentation' title='https://confluence.di2e.net/display/DI2E/WESS+Documentation' target='_blank'> https://confluence.di2e.net/display/DI2E/WESS+Documentation</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://confluence.di2e.net/display/DI2E/Installation' title='https://confluence.di2e.net/display/DI2E/Installation' target='_blank'> https://confluence.di2e.net/display/DI2E/Installation</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://stash.di2e.net/projects/USU/repos/wess-widget/browse' title='https://stash.di2e.net/projects/USU/repos/wess-widget/browse' target='_blank'> https://stash.di2e.net/projects/USU/repos/wess-widget/browse</a>" } ], "reviews" : [ { "username" : "Colby TEST", "userType" : "Developer", "comment" : "This was perfect it solved our issues and provided tools for things we didn't even anticipate.", "rating" : 4, "title" : "Just what I was looking for (SAMPLE)", "usedTimeCode" : "< 1 month'", "lastUsed" : 1388769330000, "updateDate" : 1393834530000, "organization" : "DCGS Army", "recommend" : false, "pros" : [ { "text" : "Reliable" } ], "cons" : [ ] }, { "username" : "Colby TEST", "userType" : "End User", "comment" : "It's a good product. The features are nice and performed well. It quite configurable without a lot of setup and it worked out of the box.", "rating" : 4, "title" : "Good Product (SAMPLE)", "usedTimeCode" : "< 3 Months", "lastUsed" : 1362298530000, "updateDate" : 1399961730000, "organization" : "DCGS Army", "recommend" : true, "pros" : [ ], "cons" : [ { "text" : "Poorly Tested" }, { "text" : "Difficult Installation" } ] } ], "dependencies" : [ { "dependency" : "Tomcat", "version" : null, "dependencyReferenceLink" : null, "comment" : "Version 7 or 8" } ] }, { "componentId" : 55, "guid" : "3e3b21d6-2374-4417-ba9c-ec56a9e0a314", "name" : "Vega 3D Map Widget", "description" : "Vega is a 3D map widget with support for high-resolution imagery in various formats including WMS, WFS, and ArcGIS. Vega also supports 3-dimensional terrain, and time-based data and has tools for drawing shapes and points and importing/exporting data.", "parentComponent" : null, "subComponents" : [ ], "relatedComponents" : [ ], "organization" : "unknown", "releaseDate" : 1377669600000, "version" : "0.1-ALPHA2", "activeStatus" : "A", "lastActivityDate" : null, "createUser" : "CROSS.PATRICK.I.1126309879", "createDts" : null, "updateUser" : "patrick.cross", "updateDts" : 1403200733000, "approvedDate" : null, "approvalState" : "A", "approvedUser" : null, "evaluation" : { "startDate" : null, "endDate" : null, "currentLevelCode" : "LEVEL0", "reviewedVersion" : null, "evaluationSchedule" : [ { "evaluationLevelCode" : "LEVEL0", "estimatedCompletionDate" : null, "actualCompletionDate" : 1389460530000, "levelStatus" : "C" }, { "evaluationLevelCode" : "LEVEL1", "estimatedCompletionDate" : 1392138930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL2", "estimatedCompletionDate" : 1393002930000, "actualCompletionDate" : null, "levelStatus" : "N" }, { "evaluationLevelCode" : "LEVEL3", "estimatedCompletionDate" : 1393694130000, "actualCompletionDate" : null, "levelStatus" : "N" } ], "evaluationSections" : [ ] }, "questions" : [ { "question" : "Does this support the 2.0 specs? (SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "createDts" : 1367309730000, "updateDts" : 1367309730000, "responses" : [ { "response" : "No, they planned to add support next Version(SAMPLE)", "username" : "Abby TEST", "userType" : "Project Manager", "answeredDate" : 1393834530000 }, { "response" : "Update: they backport support to version 1.6(SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "answeredDate" : 1391447730000 } ] }, { "question" : "Which os platforms does this support? (SAMPLE)", "username" : "Dawson TEST", "userType" : "Project Manager", "createDts" : 1388769330000, "updateDts" : 1388769330000, "responses" : [ { "response" : "CentOS 6.5 and MorphOS(SAMPLE)", "username" : "Jack TEST", "userType" : "Project Manager", "answeredDate" : 1391447730000 }, { "response" : "'I think they also have Windows and ReactOS support. (SAMPLE)", "username" : "Cathy TEST", "userType" : "Developer", "answeredDate" : 1391447730000 } ] } ], "attributes" : [ { "type" : "TYPE", "typeDescription" : "Component Type", "code" : "WIDGET", "codeDescription" : "Widget", "important" : true }, { "type" : "DI2ELEVEL", "typeDescription" : "DI2E Evaluation Level", "code" : "LEVEL0", "codeDescription" : "Level 0 - Available for Reuse/Not Evaluated", "important" : true }, { "type" : "DI2E-SVCV4-A", "typeDescription" : "DI2E SvcV-4 Alignment", "code" : "2.2", "codeDescription" : "2.2 Visualization", "important" : false }, { "type" : "CEEAR", "typeDescription" : "Commercial Exportable via EAR", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "ITAR", "typeDescription" : "ITAR Exportable", "code" : "N", "codeDescription" : "No", "important" : false }, { "type" : "LIFECYCSTG", "typeDescription" : "Lifecycle Stage", "code" : "OPR", "codeDescription" : "Operations", "important" : false }, { "type" : "OWFCOMP", "typeDescription" : "OWF Compatible", "code" : "Y", "codeDescription" : "Yes", "important" : false } ], "tags" : [ ], "metadata" : [ ], "componentMedia" : [ { "link" : "images/oldsite/maps-icon.png", "contentType" : "image/png", "caption" : null, "description" : null } ], "contacts" : [ { "postionDescription" : "Technical POC", "name" : "Colby TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" }, { "postionDescription" : "Government POC", "name" : "Dawson TEST", "email" : "[email protected]", "phone" : "555-555-5555", "organization" : "sample organization" } ], "resources" : [ { "name" : "Documentation", "type" : "Document", "description" : null, "link" : "<a href='https://wiki.macefusion.com/display/Widgets/Installing+Vega+%283D+Map+Widget%29+into+OWF' title='https://wiki.macefusion.com/display/Widgets/Installing+Vega+%283D+Map+Widget%29+into+OWF' target='_blank'> https://wiki.macefusion.com/display/Widgets/Installing+Vega+%283D+Map+Widget%29+into+OWF</a>" }, { "name" : "Install Url", "type" : "Document", "description" : null, "link" : "<a href='https://git.macefusion.com/git/dcgs-widgets' title='https://git.macefusion.com/git/dcgs-widgets' target='_blank'> https://git.macefusion.com/git/dcgs-widgets</a>" }, { "name" : "Code Location URL", "type" : "Code", "description" : null, "link" : "<a href='https://git.macefusion.com/git/dcgs-widgets' title='https://git.macefusion.com/git/dcgs-widgets' target='_blank'> https://git.macefusion.com/git/dcgs-widgets</a>" } ], "reviews" : [ ], "dependencies" : [ ] } ]; /* jshint ignore:end */ // Code here will be linted with JSHint. /* jshint ignore:start */ // Code here will be linted with ignored by JSHint. MOCKDATA2.resultsList = [ { "listingType" : "Component", "componentId" : 67, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Central Authentication Service (CAS)", "description" : "The Central Authentication Service (CAS) is a single sign-on protocol for the web. Its purpose is to permit a user to access multiple applications while providing their credentials (such as userid and password) only once. It also allows web applications to authenticate users without gaining access to ...", "organization" : "NRO", "lastActivityDate" : null, "updateDts" : 1405698045000, "averageRating" : 1, "views" : 126, "totalNumberOfReviews" : 71, "resourceLocation" : "api/v1/resource/components/67/detail", "attributes" : [ { "type" : "DI2E-SVCV4-A", "code" : "1.2.1" }, { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "LICTYPE", "code" : "OPENSRC" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 9, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "CLAVIN", "description" : "CLAVIN (Cartographic Location And Vicinity Indexer) is an open source software package for document geotagging and geoparsing that employs context-based geographic entity resolution. It extracts location names from unstructured text and resolves them against a gazetteer to produce data-rich geographic ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1400005248000, "averageRating" : 3, "views" : 167, "totalNumberOfReviews" : 34, "resourceLocation" : "api/v1/resource/components/9/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL1" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "LICCLASS", "code" : "FOSS" } ], "tags" : [ { "text" : "Mapping" }, { "text" : "Reference" } ] }, { "listingType" : "Component", "componentId" : 10, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Common Map API Javascript Library", "description" : "Core Map API is a library of JavaScript (JS) functions that hide the underlying Common Map Widget API so that developers only have to include the JS library and call the appropriate JS functions that way they are kept away from managing or interacting directly with the channels. Purpose/Goal of the <a href='https://confluence.di2e.net/download/attachments/14518881/cpce-map-api-jsDocs.zip?api=v2' title='https://confluence.di2e.net/download/attachments/14518881/cpce-map-api-jsDocs.zip?api=v2' target='_blank'> cpce-map-api-jsDocs.zip?api=v2</a> ...", "organization" : "DCGS-A", "lastActivityDate" : null, "updateDts" : 1399485055000, "averageRating" : 1, "views" : 70, "totalNumberOfReviews" : 57, "resourceLocation" : "api/v1/resource/components/10/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL1" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "PILOT" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 11, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Common Map Widget API", "description" : "Background Many programs and projects create widgets that search for or manipulate data then present the results on a map. The desire is to be able to combine data search/manipulation widgets from any provider with map widgets from other providers. In order to accomplish this, a standard way for the <a href='https://software.forge.mil/sf/frs/do/viewRelease/projects.jc2cui/frs.common_map_widget.common_map_widget_api' title='https://software.forge.mil/sf/frs/do/viewRelease/projects.jc2cui/frs.common_map_widget.common_map_widget_api' target='_blank'> frs.common_map_widget.common_map...</a> ...", "organization" : "DI2E Framework", "lastActivityDate" : null, "updateDts" : 1404172800000, "averageRating" : 0, "views" : 122, "totalNumberOfReviews" : 0, "resourceLocation" : "api/v1/resource/components/11/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "Charting" } ] }, { "listingType" : "Component", "componentId" : 12, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Content Discovery and Retrieval Engine - Brokered Search Component", "description" : "Content Discovery and Retrieval functionality is based on the architecture, standards, and specifications being developed and maintained by the joint IC/DoD Content Discovery and Retrieval (CDR) Integrated Product Team (IPT). The components contained in this release are the 1.1 version of the reference ...", "organization" : "DI2E-F", "lastActivityDate" : null, "updateDts" : 1399485057000, "averageRating" : 0, "views" : 30, "totalNumberOfReviews" : 70, "resourceLocation" : "api/v1/resource/components/12/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ { "text" : "Charting" }, { "text" : "Data Exchange" } ] }, { "listingType" : "Component", "componentId" : 13, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Content Discovery and Retrieval Engine - Describe Component", "description" : "Content Discovery and Retrieval functionality is based on the architecture, standards, and specifications being developed and maintained by the joint IC/DoD Content Discovery and Retrieval (CDR) Integrated Product Team (IPT). The components contained in this release are the 1.1 version of the reference ...", "organization" : "DI2E Framework", "lastActivityDate" : null, "updateDts" : 1399485058000, "averageRating" : 1, "views" : 147, "totalNumberOfReviews" : 37, "resourceLocation" : "api/v1/resource/components/13/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ { "text" : "Data Exchange" }, { "text" : "UDOP" } ] }, { "listingType" : "Component", "componentId" : 14, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Content Discovery and Retrieval Engine - Retrieve Component", "description" : "The Retrieve Components are implementations of the capabilities and interfaces defined in IC/DoD CDR Retrieve Service Specification for SOAP Implementations DRAFT Version 1.0-20100331, March 31, 2010. Each Retrieve Component is a separately deployable component that provides access to a defined content <a href='https://www.intelink.gov/inteldocs/browse.php?fFolderId=431781' title='https://www.intelink.gov/inteldocs/browse.php?fFolderId=431781' target='_blank'> browse.php?fFolderId=431781</a> for more general information about CDR. ...", "organization" : "DI2E-F", "lastActivityDate" : null, "updateDts" : 1399485059000, "averageRating" : 1, "views" : 126, "totalNumberOfReviews" : 27, "resourceLocation" : "api/v1/resource/components/14/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 15, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Cursor on Target Toolkit", "description" : "(U) Cursor on Target is a set of components focused on driving interoperability in message exchanges. Components include: *An XML message schema &nbsp;&nbsp;Basic (mandatory): what, when, where &nbsp;&nbsp; Extensible (optional): add subschema to add details \u0001*A standard &nbsp;&nbsp; Established as ...", "organization" : "Air Force", "lastActivityDate" : null, "updateDts" : 1399485060000, "averageRating" : 3, "views" : 22, "totalNumberOfReviews" : 90, "resourceLocation" : "api/v1/resource/components/15/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 16, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS Discovery Metadata Guide", "description" : "This document provides information on DCGS metadata artifacts and guidance for populating DDMS and the DIB Metacard, using DDMS Schema Extensions, and creating new DDMS extension schemas. These guidelines should be used by developers and System Integrators building resource adapters and schemas to work ...", "organization" : "AFLCMC/HBBG", "lastActivityDate" : null, "updateDts" : 1399485060000, "averageRating" : 3, "views" : 43, "totalNumberOfReviews" : 22, "resourceLocation" : "api/v1/resource/components/16/detail", "attributes" : [ { "type" : "TYPE", "code" : "DOC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 17, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS Enterprise Messaging Technical Profile", "description" : "DCGS Enterprise Services rely on asynchronous communications for sending messages so they can notify users when certain data is published or a particular event has occurred. Users may subscriber to a data source so they can be notified when a piece of intelligence has been published on a topic of interest. ...", "organization" : "DCGS EFT", "lastActivityDate" : null, "updateDts" : 1399485061000, "averageRating" : 0, "views" : 52, "totalNumberOfReviews" : 76, "resourceLocation" : "api/v1/resource/components/17/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 18, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS Enterprise OWF IdAM Technical Profile", "description" : "The Ozone Widget Framework is a web-application engine built around the concept of discrete, reusable web application interface components called widgets. Widgets may be composed into full applications by Ozone users or administrators. The architecture of the Ozone framework allows widgets to be implemented ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1399487595000, "averageRating" : 0, "views" : 139, "totalNumberOfReviews" : 79, "resourceLocation" : "api/v1/resource/components/18/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 19, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS Integration Backbone (DIB)", "description" : "The Distributed Common Ground/Surface System (DCGS) Integration Backbone (DIB) is the enabler for DCGS enterprise interoperability. The DIB is a technical infrastructure, the foundation for sharing data across the ISR enterprise. More specifically the DIB is: 1) Standards-based set of software, services, ...", "organization" : "DMO", "lastActivityDate" : null, "updateDts" : 1399485063000, "averageRating" : 2, "views" : 98, "totalNumberOfReviews" : 8, "resourceLocation" : "api/v1/resource/components/19/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 20, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS-E Audit Log Management and Reporting Technical Profile", "description" : "This CDP provides the technical design description for the Audit and Accountability capability of the Distributed Common Ground/Surface System (DCGS) Enterprise Service Dial Tone (SDT) layer. It includes the capability architecture design details, conformance requirements, and implementation guidance. ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1399485064000, "averageRating" : 1, "views" : 148, "totalNumberOfReviews" : 32, "resourceLocation" : "api/v1/resource/components/20/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "UDOP" }, { "text" : "Charting" } ] }, { "listingType" : "Component", "componentId" : 21, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS-E Domain Name System (DNS) Technical Profile", "description" : "(U) This CDP provides guidance for DNS for use by the DCGS Enterprise Community at large. DCGS Service Providers will use this guidance to make their services visibility and accessibility in the DCGS Enterprise SOA (DES). Several Intelligence Community/Department of Defense (IC/DoD) documents were incorporated ...", "organization" : "DCGS EFT", "lastActivityDate" : null, "updateDts" : 1399485064000, "averageRating" : 1, "views" : 182, "totalNumberOfReviews" : 35, "resourceLocation" : "api/v1/resource/components/21/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 22, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS-E Metrics Management Technical Profile", "description" : "**Previously titled Service Level Agreement/Quality of Service CDP** (U) This CDP provides guidance for Metrics Management for use by the DCGS Enterprise Community at large. DCGS Service Providers will use this guidance to make their services visibility and accessibility in the DCGS Enterprise SOA. ...", "organization" : "DCGS EFT", "lastActivityDate" : null, "updateDts" : 1399485065000, "averageRating" : 5, "views" : 51, "totalNumberOfReviews" : 42, "resourceLocation" : "api/v1/resource/components/22/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 23, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS-E Sensor Web Enablement (SWE) Technical Profile", "description" : "(U//FOUO) This CDP provides the technical design description for the SensorWeb capability of the Distributed Common Ground/Surface System (DCGS) Enterprise Intelligence, Surveillance and Reconnaissance (ISR) Common layer. (U//FOUO) SensorWeb is a development effort led by the Defense Intelligence ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1399485066000, "averageRating" : 2, "views" : 179, "totalNumberOfReviews" : 39, "resourceLocation" : "api/v1/resource/components/23/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "UDOP" } ] }, { "listingType" : "Component", "componentId" : 24, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS-E Service Registration and Discovery (SRD) Technical Profile", "description" : "(U//FOUO) Service discovery provides DCGS Enterprise consumers the ability to locate and invoke services to support a given task or requirement in a trusted and secure operational environment. By leveraging service discovery, existing DCGS Enterprise services will be published to a root service registry, ...", "organization" : "DCGS EFT", "lastActivityDate" : null, "updateDts" : 1399485067000, "averageRating" : 3, "views" : 171, "totalNumberOfReviews" : 67, "resourceLocation" : "api/v1/resource/components/24/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 25, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS-E Time Synchronization (NTP) Technical Profile", "description" : "(U) This provides guidance for Network Time Protocol (NTP) for use by the DCGS Enterprise Community at large. DCGS Service Providers will use this guidance to make their services secure and interoperable in the DCGS Enterprise SOA (U//FOUO) Time synchronization is a critical service in any distributed ...", "organization" : "DCGS EFT", "lastActivityDate" : null, "updateDts" : 1399485068000, "averageRating" : 1, "views" : 86, "totalNumberOfReviews" : 41, "resourceLocation" : "api/v1/resource/components/25/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "Access" }, { "text" : "Visualization" } ] }, { "listingType" : "Component", "componentId" : 26, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DCGS-E Web Service Access Control Technical Profile", "description" : "Access Control incorporates an open framework and industry best practices/standards that leverage Web Services Security (WSS) [17] standards, also referred to as WS-Security, to create a common framework using Attribute Based Access Control (ABAC). The DCGS Enterprise advocates an ABAC model as the desired ...", "organization" : null, "lastActivityDate" : null, "updateDts" : 1399485068000, "averageRating" : 5, "views" : 180, "totalNumberOfReviews" : 91, "resourceLocation" : "api/v1/resource/components/26/detail", "attributes" : [ { "type" : "DI2E-SVCV4-A", "code" : "1.2.1" }, { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "Mapping" }, { "text" : "Communication" } ] }, { "listingType" : "Component", "componentId" : 27, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DI2E Framework DIAS Simulator", "description" : "This package provides a basic simulator of the DoDIIS Identity and Authorization Service (DIAS) in a deployable web application using Apache CFX architecture. The DI2E Framework development team have used this when testing DIAS specific attribute access internally with Identity and Access Management ...", "organization" : "DI2E Framework", "lastActivityDate" : null, "updateDts" : 1403200707000, "averageRating" : 1, "views" : 60, "totalNumberOfReviews" : 43, "resourceLocation" : "api/v1/resource/components/27/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "DEV" }, { "type" : "LICCLASS", "code" : "GOTS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 28, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DI2E Framework OpenAM", "description" : "The DI2E Framework IdAM solution provides a core OpenAM Web Single Sign-On implementation wrapped in a Master IdAM Administration Console for ease of configuration and deployment. Additionally, there are several enhancements to the core authentication functionality as well as external and local attribute ...", "organization" : "DI2E Framework", "lastActivityDate" : null, "updateDts" : 1405308845000, "averageRating" : 3, "views" : 29, "totalNumberOfReviews" : 64, "resourceLocation" : "api/v1/resource/components/28/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "LIFECYCSTG", "code" : "DEV" }, { "type" : "LICCLASS", "code" : "FOSS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 30, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DI2E Framework Reference Architecture", "description" : "The DI2E Framework reference Architecture provides a structural foundation for the DI2E requirements assessment. The DI2E Framework is specified using a level of abstraction that is not dependent on a specific technical solution, but can leverage the benefits of the latest technology advancements and ...", "organization" : "NRO // DI2E Framework PMO", "lastActivityDate" : null, "updateDts" : 1403200710000, "averageRating" : 1, "views" : 154, "totalNumberOfReviews" : 15, "resourceLocation" : "api/v1/resource/components/30/detail", "attributes" : [ { "type" : "TYPE", "code" : "DOC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "Reference" } ] }, { "listingType" : "Component", "componentId" : 31, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "DI2E RESTful CDR Search Technical Profile", "description" : "This profile provides the technical design description for the RESTful Search web service of Defense Intelligence Information Enterprise (DI2E). The profile includes capability architecture design details, implementation requirements and additional implementation guidance. DI2E Enterprise service providers ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1399485073000, "averageRating" : 3, "views" : 70, "totalNumberOfReviews" : 6, "resourceLocation" : "api/v1/resource/components/31/detail", "attributes" : [ { "type" : "TYPE", "code" : "SPEC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "Visualization" }, { "text" : "Access" } ] }, { "listingType" : "Component", "componentId" : 32, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Distributed Data Framework (DDF)", "description" : "DDF is a free and open source common data layer that abstracts services and business logic from the underlying data structures to enable rapid integration of new data sources. ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1405694884000, "averageRating" : 0, "views" : 186, "totalNumberOfReviews" : 6, "resourceLocation" : "api/v1/resource/components/32/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "LICTYPE", "code" : "OPENSRC" }, { "type" : "LICCLASS", "code" : "FOSS" } ], "tags" : [ { "text" : "UDOP" } ] }, { "listingType" : "Component", "componentId" : 57, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Domain Name System (DNS) Guidebook for Linux/BIND", "description" : "This Guidebook focuses on those involved with the Domain Name System (DNS) in DI2E systems. Those building systems based on DI2E-offered components, running in a DI2E Framework. It provides guidance for two different roles - those who configure DNS, and those who rely on DNS in the development of distributed ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1403200713000, "averageRating" : 1, "views" : 110, "totalNumberOfReviews" : 38, "resourceLocation" : "api/v1/resource/components/57/detail", "attributes" : [ { "type" : "TYPE", "code" : "DOC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 33, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "eDIB", "description" : "(U) eDIB contains the eDIB 4.0 services (management VM and worker VM). eDIB 4.0 is a scalable, virtualized webservice architecture based on the DMO's DIB 4.0. eDIB provides GUIs for an administrator to manage/configure eDIB. An end-user interface is not provided. Different data stores are supported including ...", "organization" : "DI2E Framework", "lastActivityDate" : null, "updateDts" : 1405102845000, "averageRating" : 0, "views" : 22, "totalNumberOfReviews" : 34, "resourceLocation" : "api/v1/resource/components/33/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "Reference" } ] }, { "listingType" : "Component", "componentId" : 34, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Extensible Mapping Platform (EMP)", "description" : "The Extensible Mapping Platform (EMP) is a US Government Open Source project providing a framework for building robust OWF map widgets and map centric web applications. The EMP project is currently managed by US Army Tactical Mission Command (TMC) in partnership with DI2E, and developed by CECOM Software <a href='http://cmapi.org/' title='http://cmapi.org/' target='_blank'> <a href='https://project.forge.mil/sf/frs/do/viewRelease/projects.dcgsaozone/frs.cpce_mapping_components.sprint_18_cpce_infrastructure_er' title='https://project.forge.mil/sf/frs/do/viewRelease/projects.dcgsaozone/frs.cpce_mapping_components.sprint_18_cpce_infrastructure_er' target='_blank'> frs.cpce_mapping_components.spri...</a> ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1403200714000, "averageRating" : 4, "views" : 176, "totalNumberOfReviews" : 6, "resourceLocation" : "api/v1/resource/components/34/detail", "attributes" : [ { "type" : "TYPE", "code" : "WIDGET" }, { "type" : "DI2ELEVEL", "code" : "LEVEL1" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "DEV" }, { "type" : "OWFCOMP", "code" : "Y" }, { "type" : "LICCLASS", "code" : "GOSS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 73, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GAPS - Data Catalog Service", "description" : "The GAPS Data Catalog Service provides a set of RESTful services to manage data sources accessible to GAPS applications. The catalog service offers RESTful interfaces for querying sources as XML or JSON structures. The service is a combination of two web services; the root service, and the metric service. <a href='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datacatalogservice.ashx' title='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datacatalogservice.ashx' target='_blank'> datacatalogservice.ashx</a> <a href='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datacatalogservice.ashx' title='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datacatalogservice.ashx' target='_blank'> datacatalogservice.ashx</a> <a href='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datasourcemetrics.ashx' title='https://gapsprod1.stratcom.smil.mil/datacatalogservice/datasourcemetrics.ashx' target='_blank'> datasourcemetrics.ashx</a> <a href='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datasourcemetrics.ashx' title='http://jwicsgaps.usstratcom.ic.gov/datacatalogservice/datasourcemetrics.ashx' target='_blank'> datasourcemetrics.ashx</a> ...", "organization" : "STRATCOM J8", "lastActivityDate" : null, "updateDts" : 1405691893000, "averageRating" : 2, "views" : 107, "totalNumberOfReviews" : 23, "resourceLocation" : "api/v1/resource/components/73/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 74, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GAPS - Gazetteer Service", "description" : "The GAPS Gazetteer Service offers a set of geographical dictionary services that allows users to search for city and military bases, retrieving accurate latitude and longitude values for those locations. The user may search based on name or location, with the gazetteer returning all entries that match <a href='https://gapsprod1.stratcom.smil.mil/gazetteers/NgaGnsGazetteerService.asmx' title='https://gapsprod1.stratcom.smil.mil/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a> (NGA Gazetteer) <a href='https://gapsprod1.stratcom.smil.mil/gazetteers/UsgsGnisGazetteerService.asmx' title='https://gapsprod1.stratcom.smil.mil/gazetteers/UsgsGnisGazetteerService.asmx' target='_blank'> UsgsGnisGazetteerService.asmx</a> (USGS Gazetteer) <a href='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' title='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' target='_blank'> NgaGnsGazetteerService.asmx</a> <a href='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' title='<a href='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' title='http://jwicsgaps.usstratcom.ic.gov/gazetteers/NgaGnsGazetteerService.asmx' target='_blank'> NgaGnsGazetteerService.asmx</a>' target='_blank'> NgaGnsGazetteerService.asmx</a> (USGS Gazetteer) ...", "organization" : "STRATCOM J8", "lastActivityDate" : null, "updateDts" : 1405691776000, "averageRating" : 2, "views" : 130, "totalNumberOfReviews" : 37, "resourceLocation" : "api/v1/resource/components/74/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ { "text" : "Reference" } ] }, { "listingType" : "Component", "componentId" : 72, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GAPS - Scenario Service", "description" : "The GAPS Scenario Service is a SOAP based interface into the GAPS UDOP creation, execution and publishing mechanism. The Scenario Service allows an external entity to perform Machine to Machine (M2M) calls in order to create and execute UDOPs. This interface can be used to integrate with other systems <a href='https://gapsprod1.stratcom.smil.mil/ScenarioService/ScenarioService.asmx' title='https://gapsprod1.stratcom.smil.mil/ScenarioService/ScenarioService.asmx' target='_blank'> ScenarioService.asmx</a> <a href='https://gapsprod1.stratcom.smil.mil/VsaPortal/RespositoryService.asmx' title='https://gapsprod1.stratcom.smil.mil/VsaPortal/RespositoryService.asmx' target='_blank'> RespositoryService.asmx</a> JWICS: <a href='http://jwicsgaps.usstratcom.ic.gov:8000/ScenarioService/ScenarioService.asmx' title='http://jwicsgaps.usstratcom.ic.gov:8000/ScenarioService/ScenarioService.asmx' target='_blank'> ScenarioService.asmx</a> <a href='http://jwicsgaps.usstratcom.ic.gov:8000/VsaPortal/RepositoryService.asmx' title='http://jwicsgaps.usstratcom.ic.gov:8000/VsaPortal/RepositoryService.asmx' target='_blank'> RepositoryService.asmx</a> ...", "organization" : "STRATCOM J8", "lastActivityDate" : null, "updateDts" : 1405691317000, "averageRating" : 1, "views" : 85, "totalNumberOfReviews" : 89, "resourceLocation" : "api/v1/resource/components/72/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ { "text" : "Charting" } ] }, { "listingType" : "Component", "componentId" : 35, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS", "description" : "The National Geospatial-Intelligence Agency's (NGA) GEOINT Visualization Services is a suite of web-based capabilities that delivers geospatial visualization services to the Department of Defense (DoD) and Intelligence Community (IC) via classified and unclassified computer networks to provide visualization <a href='https://www.intelink.gov/wiki/GVS' title='https://www.intelink.gov/wiki/GVS' target='_blank'> GVS</a> <a href='https://www.intelink.gov/blogs/geoweb/' title='https://www.intelink.gov/blogs/geoweb/' target='_blank'> <a href='https://community.forge.mil/content/geoint-visualization-services-gvs-program' title='https://community.forge.mil/content/geoint-visualization-services-gvs-program' target='_blank'> geoint-visualization-services-gv...</a> <a href='https://community.forge.mil/content/geoint-visualization-services-gvs-palanterrax3' title='https://community.forge.mil/content/geoint-visualization-services-gvs-palanterrax3' target='_blank'> geoint-visualization-services-gv...</a> ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1405612927000, "averageRating" : 1, "views" : 87, "totalNumberOfReviews" : 81, "resourceLocation" : "api/v1/resource/components/35/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 58, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS - Base Maps - ESRi", "description" : "World Imagery Basemap is a global service that presents imagery from NGA holdings for Cache Scales from 1:147M - 1:282. This imagery includes various sources and resolutions spanning 15m to 75mm. The imagery sources are Buckeye, US/CAN/MX Border Imagery, Commercial Imagery, USGS High Resolution Orthos, ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1403200715000, "averageRating" : 2, "views" : 120, "totalNumberOfReviews" : 73, "resourceLocation" : "api/v1/resource/components/58/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 59, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS - Base Maps - Google Globe - Summary Information", "description" : "GVS Google Earth Globe Services are constructed from DTED, CIB, Natural View, and Commercial Imagery. Vector data includes NGA standards such as VMAP, GeoNames, and GNIS. GVS recently added NavTeq Streets and Homeland Security Infrastructure data to the Google Globe over the United States. The Globes <a href='https://earth.gvs.nga.mil/wms/fusion_maps_wms.cgi' title='https://earth.gvs.nga.mil/wms/fusion_maps_wms.cgi' target='_blank'> fusion_maps_wms.cgi</a> *WMS - AF/PK - <a href='https://earth.gvs.nga.mil/wms/afpk_map/fusion_maps_wms.cgi' title='https://earth.gvs.nga.mil/wms/afpk_map/fusion_maps_wms.cgi' target='_blank'> fusion_maps_wms.cgi</a> <a href='https://earth.gvs.nga.mil/wms/nvue_map/fusion_maps_wms.cgi' title='https://earth.gvs.nga.mil/wms/nvue_map/fusion_maps_wms.cgi' target='_blank'> fusion_maps_wms.cgi</a> *WMTS - <a href='https://earth.gvs.nga.mil/cgi-bin/ogc/service.py' title='https://earth.gvs.nga.mil/cgi-bin/ogc/service.py' target='_blank'> service.py</a> ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1403200717000, "averageRating" : 0, "views" : 39, "totalNumberOfReviews" : 30, "resourceLocation" : "api/v1/resource/components/59/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 60, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS - Features - CIDNE SIGACTS", "description" : "The GVS CIDNE SIGACTS Data Layer provides a visualization-ready (KML 2.2 compliant formatted) result set for a query of SIGACTS, as obtained from the Combined Information Data Network Exchange (CIDNE) within a defined AOI (\"bounding box\", \"point/radius\", \"path buffer\"). To access the CIDNE SIGACTS Dynamic <a href='http://home.gvs.nga.smil.mil/CIDNE/SigactsServlet' title='http://home.gvs.nga.smil.mil/CIDNE/SigactsServlet' target='_blank'> SigactsServlet</a> JWICs: <a href='http://home.gvs.nga.ic.gov/CIDNE/SigactsServlet' title='http://home.gvs.nga.ic.gov/CIDNE/SigactsServlet' target='_blank'> SigactsServlet</a> ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1403200718000, "averageRating" : 4, "views" : 48, "totalNumberOfReviews" : 35, "resourceLocation" : "api/v1/resource/components/60/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 61, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS - Features - GE Shared Products", "description" : "GVS Shared Product Query provides you with the ability to display geospatial information layers in a Google Earth client depicting data previously created and stored in the GVS Shared Product Buffer by other users. Home page: <a href='https://home.gvs.nga.mil/UPS/RSS' title='https://home.gvs.nga.mil/UPS/RSS' target='_blank'> RSS</a> for the manual query <a href='https://home.gvs.nga.mil/home/capabilities/queries/shared_products' title='https://home.gvs.nga.mil/home/capabilities/queries/shared_products' target='_blank'> shared_products</a> for the query tool Wiki: A general GVS Wiki can be found here <a href='https://intellipedia.intelink.gov/wiki/GVS' title='https://intellipedia.intelink.gov/wiki/GVS' target='_blank'> GVS</a> no specialized shared product wiki pages exist ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1403200719000, "averageRating" : 1, "views" : 0, "totalNumberOfReviews" : 3, "resourceLocation" : "api/v1/resource/components/61/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 62, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS - Features - Intelink", "description" : "GVS - Features - Intelink: Provides the capability to perform a temporal keyword search for news items, Intellipedia data, and intelligence reporting and finished products found on Intelink. A list of geo-referenced locations in response to a query based on a filter. GVS INTELINK GEO SEARCH WFS INTERFACE <a href='http://home.gvs.nga.ic.gov/metacarta/wfs' title='http://home.gvs.nga.ic.gov/metacarta/wfs' target='_blank'> wfs</a> SIPRNet: <a href='http://home.gvs.nga.smil.mil/metacarta/wfs' title='http://home.gvs.nga.smil.mil/metacarta/wfs' target='_blank'> wfs</a> ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1403200721000, "averageRating" : 5, "views" : 132, "totalNumberOfReviews" : 80, "resourceLocation" : "api/v1/resource/components/62/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 63, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS - Features - MIDB", "description" : "GVS - Features - MIDB allows the user to query MIDB (Equipment) data within a defined AOI. User takes HTTP-Get parameters (Listed below the summary table and in the documentation) and builds a query. In the exposed Service Interfaces document MIDB services are covered in section 6.1 which is approximately <a href='http://home.gvs.nga.ic.gov/MIDB/wfs' title='http://home.gvs.nga.ic.gov/MIDB/wfs' target='_blank'> wfs</a> <a href='http://home.gvs.nga.smil.mil/MIDB/wfs' title='http://home.gvs.nga.smil.mil/MIDB/wfs' target='_blank'> wfs</a> <a href='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' title='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' target='_blank'> documentation</a> <a href='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' title='<a href='https://home.gvs.nga.smil.mil/home/documentation' title='https://home.gvs.nga.smil.mil/home/documentation' target='_blank'> documentation</a>' target='_blank'> documentation</a> <a href='https://home.gvs.nga.ic.gov/home/documentation' title='https://home.gvs.nga.ic.gov/home/documentation' target='_blank'> documentation</a> <a href='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> GVS_Exposed_Service_Interfaces.pdf</a> <a href='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> GVS_Exposed_Service_Interfaces.pdf</a> <a href='https://home.gvs.ic.gov/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' title='https://home.gvs.ic.gov/GVSData/UE_Docs/GVS_Exposed_Service_Interfaces.pdf' target='_blank'> GVS_Exposed_Service_Interfaces.pdf</a> <a href='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' title='https://home.gvs.nga.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' target='_blank'> GVS_Consolidated_QRG_Book_Reduce...</a> <a href='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' title='https://home.gvs.nga.smil.mil/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' target='_blank'> GVS_Consolidated_QRG_Book_Reduce...</a> <a href='https://home.gvs.nga.ic.gov/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' title='https://home.gvs.nga.ic.gov/GVSData/UE_Docs/GVS_Consolidated_QRG_Book_Reduced_Size.pdf' target='_blank'> GVS_Consolidated_QRG_Book_Reduce...</a> ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1403200722000, "averageRating" : 2, "views" : 95, "totalNumberOfReviews" : 41, "resourceLocation" : "api/v1/resource/components/63/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ { "text" : "Access" }, { "text" : "Data Exchange" } ] }, { "listingType" : "Component", "componentId" : 64, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "GVS - Features - NES", "description" : "GVS - Features - NES provides a visualization-ready (KML 2.2 compliant formatted) result set for a query of the targets obtained from the NGA National Exploitation System (NES), within a defined AOI (\"bounding box\", \"point/radius\", \"path buffer\").. Note, NES is only available on JWICS. Interface Details: <a href='http://home.gvs.nga.ic.gov/NESQuery/CoverageQuery' title='http://home.gvs.nga.ic.gov/NESQuery/CoverageQuery' target='_blank'> CoverageQuery</a> ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1403200723000, "averageRating" : 4, "views" : 176, "totalNumberOfReviews" : 10, "resourceLocation" : "api/v1/resource/components/64/detail", "attributes" : [ { "type" : "TYPE", "code" : "SERVICE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ { "text" : "Access" }, { "text" : "Charting" } ] }, { "listingType" : "Component", "componentId" : 65, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "HardwareWall", "description" : "The Boeing eXMeritus HardwareWall* is a highly configurable, commercial-off-the-shelf cross domain solution that enables rapid, automated, and secure data transfer between security domains: eXMeritus has designed HardwareWall* as a secure data transfer system and an off-the-shelf Controlled Interface <a href='http://www.exmeritus.com/hardware_wall.html' title='http://www.exmeritus.com/hardware_wall.html' target='_blank'> hardware_wall.html</a> <a href='http://www.boeing.com/advertising/c4isr/isr/exmeritus_harware_wall.html' title='http://www.boeing.com/advertising/c4isr/isr/exmeritus_harware_wall.html' target='_blank'> exmeritus_harware_wall.html</a> ...", "organization" : "Boeing", "lastActivityDate" : null, "updateDts" : 1403200725000, "averageRating" : 0, "views" : 183, "totalNumberOfReviews" : 72, "resourceLocation" : "api/v1/resource/components/65/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "Y" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "LICCLASS", "code" : "COTS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 36, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "IC AppsMall Cookbook: Applications Development", "description" : "The Applications Development Cookbook is designed as an overview of principles and best practices for Web Application Development, with a focus on new web and related technologies & concepts that take full advantage of modern browser capabilities. The ideas introduced in this document are not intended ...", "organization" : "IC SOG", "lastActivityDate" : null, "updateDts" : 1399485077000, "averageRating" : 5, "views" : 64, "totalNumberOfReviews" : 66, "resourceLocation" : "api/v1/resource/components/36/detail", "attributes" : [ { "type" : "TYPE", "code" : "DOC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 37, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "ISF Enterprise Data Viewer Widget", "description" : "A widget designed to display search results in a tabular format. It can page, sort, filter, and group results and organize items into working folders called \"Workspaces\" as well as perform full-record retrieval for supported result types. It depends on the Persistence Service to store and retrieve ...", "organization" : "NRO/GED", "lastActivityDate" : null, "updateDts" : 1399485078000, "averageRating" : 3, "views" : 57, "totalNumberOfReviews" : 20, "resourceLocation" : "api/v1/resource/components/37/detail", "attributes" : [ { "type" : "TYPE", "code" : "WIDGET" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "OWFCOMP", "code" : "Y" }, { "type" : "LICCLASS", "code" : "GOTS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 38, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "ISF Persistence Service", "description" : "A RESTful service that persists JSON documents. It is designed to have a swappable backend and currently supports MongoDB and in-memory implementations. ...", "organization" : "NRO/GED", "lastActivityDate" : null, "updateDts" : 1399485079000, "averageRating" : 5, "views" : 188, "totalNumberOfReviews" : 80, "resourceLocation" : "api/v1/resource/components/38/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "LICCLASS", "code" : "GOTS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 39, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "ISF Search Criteria Widget", "description" : "A widget dedicated to providing search criteria to a compatible CDR backend. It depends on the Persistence Service as a place to put retrieved metadata results. It also optionally depends on the Map widget to interactively define geospatial queries (a text-based option is also available) and to render ...", "organization" : "NRO/GED", "lastActivityDate" : null, "updateDts" : 1399485080000, "averageRating" : 3, "views" : 144, "totalNumberOfReviews" : 15, "resourceLocation" : "api/v1/resource/components/39/detail", "attributes" : [ { "type" : "TYPE", "code" : "WIDGET" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "OWFCOMP", "code" : "Y" }, { "type" : "LICCLASS", "code" : "GOTS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 40, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "iSpatial", "description" : "iSpatial is a commercially available geospatial framework designed as a set of ready-to-customize, baseline tools that can be rapidly adapted to meet use cases calling for geo-visualization. iSpatial consists of four major areas of core functionality: Authorizing, Searching, Managing and Collaborating. <a href='http://www.t-sciences.com/wp-content/uploads/2013/04/iSpatial_v3_Technical_White_Paper.pdf' title='http://www.t-sciences.com/wp-content/uploads/2013/04/iSpatial_v3_Technical_White_Paper.pdf' target='_blank'> iSpatial_v3_Technical_White_Pape...</a> iSpatial <a href='http://www.t-sciences.com/wp-content/uploads/2014/01/iSpatial_Fed.pptx' title='http://www.t-sciences.com/wp-content/uploads/2014/01/iSpatial_Fed.pptx' target='_blank'> iSpatial_Fed.pptx</a> ...", "organization" : "Thermopylae Sciences and Technology", "lastActivityDate" : null, "updateDts" : 1403200726000, "averageRating" : 2, "views" : 45, "totalNumberOfReviews" : 99, "resourceLocation" : "api/v1/resource/components/40/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.1" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "LICCLASS", "code" : "COTS" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 41, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "JC2CUI Common 2D Map API Widget", "description" : "This is a map widget developed by JC2CUI that conforms to the Common Map API - see below for more information on the API. Using this API allows developers to focus on the problem domain rather than implementing a map widget themselves. It also allows the actual map implementation used to be chosen dynamically ...", "organization" : "JC2CUI", "lastActivityDate" : null, "updateDts" : 1399485082000, "averageRating" : 1, "views" : 96, "totalNumberOfReviews" : 40, "resourceLocation" : "api/v1/resource/components/41/detail", "attributes" : [ { "type" : "TYPE", "code" : "WIDGET" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "OWFCOMP", "code" : "Y" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 42, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "JView", "description" : "JView is a Java-based API (application programmer's interface) that was developed to reduce the time, cost, & effort associated with the creation of computer visualization applications. JView provides the programmer with the ability to quickly develop 2-dimensional and 3-dimensional visualization <a href='https://extranet.rl.af.mil/jview/.' title='https://extranet.rl.af.mil/jview/.' target='_blank'> .</a> Formal configuration management and distribution of JView is performed through the Information Management Services program. ...", "organization" : "AFRL", "lastActivityDate" : null, "updateDts" : 1405370213000, "averageRating" : 1, "views" : 174, "totalNumberOfReviews" : 4, "resourceLocation" : "api/v1/resource/components/42/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL1" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LICCLASS", "code" : "GOTS" }, { "type" : "LIFECYCSTG", "code" : "OPR" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 43, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Military Symbology Renderer", "description" : "The Mil Symbology Renderer is both a developer's toolkit as well as a ready to use deployable web application. The goal of this project is to provide a single distributable solution that can support as many use cases as possible for military symbology rendering. The current features available are: * ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1399485084000, "averageRating" : 2, "views" : 178, "totalNumberOfReviews" : 60, "resourceLocation" : "api/v1/resource/components/43/detail", "attributes" : [ { "type" : "TYPE", "code" : "WIDGET" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "OWFCOMP", "code" : "Y" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 44, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "OpenAM", "description" : "OpenAM is an all-in-one access management platform with the adaptive intelligence to protect against risk-based threats across any environment. ...", "organization" : "DI2E-F", "lastActivityDate" : null, "updateDts" : 1403200729000, "averageRating" : 5, "views" : 29, "totalNumberOfReviews" : 2, "resourceLocation" : "api/v1/resource/components/44/detail", "attributes" : [ { "type" : "DI2E-SVCV4-A", "code" : "1.2.1" }, { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 45, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "OpenSextant", "description" : "(U) OpenSextant is an open source software package for geotagging unstructured text. OpenSextant is implemented in Java and based on the open source text analytic software GATE ( <a href='http://gate.ac.uk/' title='http://gate.ac.uk/' target='_blank'> </a> ). (U) OpenSextant can geotag documents in any ...", "organization" : "NGA", "lastActivityDate" : null, "updateDts" : 1399485085000, "averageRating" : 3, "views" : 172, "totalNumberOfReviews" : 29, "resourceLocation" : "api/v1/resource/components/45/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 46, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "OpenStack", "description" : "OpenStack is open source software for building public and private clouds ( <a href='http://www.openstack.org' title='http://www.openstack.org' target='_blank'> www.openstack.org</a> ). The release here has been developed by USC/ISI and has two distinctions from the mainstream open source release. First, ...", "organization" : "USC/ISI", "lastActivityDate" : null, "updateDts" : 1399485086000, "averageRating" : 4, "views" : 64, "totalNumberOfReviews" : 17, "resourceLocation" : "api/v1/resource/components/46/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "PILOT" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 47, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "OpenStack Lessons Learned Document", "description" : "Lessons learned in the Openstack Folsom deployment by USC/ISI in the DI2E Framework environment. This document is meant to be very specific to one deployment experience with the intention that it will be useful to others deploying in a similar environment. Note this document is stored on the DI2E Framework <a href='https://devtools.di2e.net/' title='https://devtools.di2e.net/' target='_blank'> ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1399485087000, "averageRating" : 0, "views" : 178, "totalNumberOfReviews" : 65, "resourceLocation" : "api/v1/resource/components/47/detail", "attributes" : [ { "type" : "TYPE", "code" : "DOC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ ] }, { "listingType" : "Component", "componentId" : 48, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "OWASP Enterprise Security API", "description" : "ESAPI (The OWASP Enterprise Security API) is a free, open source, web application security control library that makes it easier for programmers to write lower-risk applications. The ESAPI libraries are designed to make it easier for programmers to retrofit security into existing applications. The ESAPI <a href='https://www.owasp.org.' title='https://www.owasp.org.' target='_blank'> www.owasp.org.</a> ...", "organization" : "OWASP", "lastActivityDate" : null, "updateDts" : 1399485088000, "averageRating" : 5, "views" : 158, "totalNumberOfReviews" : 92, "resourceLocation" : "api/v1/resource/components/48/detail", "attributes" : [ { "type" : "TYPE", "code" : "SOFTWARE" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "Access" }, { "text" : "Testing" } ] }, { "listingType" : "Component", "componentId" : 49, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "OWASP Web Application Security Guide", "description" : "The Development Guide is aimed at architects, developers, consultants and auditors and is a comprehensive manual for designing, developing and deploying secure Web Applications and Web Services. The original OWASP Development Guide has become a staple diet for many web security professionals. Since 2002, <a href='https://www.owasp.org.' title='https://www.owasp.org.' target='_blank'> www.owasp.org.</a> ...", "organization" : "OWASP", "lastActivityDate" : null, "updateDts" : 1399485088000, "averageRating" : 1, "views" : 46, "totalNumberOfReviews" : 89, "resourceLocation" : "api/v1/resource/components/49/detail", "attributes" : [ { "type" : "TYPE", "code" : "DOC" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null } ], "tags" : [ { "text" : "Charting" }, { "text" : "Visualization" } ] }, { "listingType" : "Component", "componentId" : 50, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Ozone Marketplace", "description" : "The Ozone marketplace is a storefront to store widgets, services, and web applications. It can be linked to the Ozone Widget Framework. ...", "organization" : "OWF Goss", "lastActivityDate" : null, "updateDts" : 1399485089000, "averageRating" : 1, "views" : 53, "totalNumberOfReviews" : 60, "resourceLocation" : "api/v1/resource/components/50/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : null }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" } ], "tags" : [ { "text" : "UDOP" }, { "text" : "Communication" } ] }, { "listingType" : "Component", "componentId" : 51, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Ozone Widget Framework", "description" : "OWF is a web application that allows users to easily access all their online tools from one location. Not only can users access websites and applications with widgets, they can group them and configure some applications to interact with each other via widget intents. Some Links: http://www.ozoneplatform.org/ ...", "organization" : "OWF GOSS", "lastActivityDate" : null, "updateDts" : 1402947991000, "averageRating" : 1, "views" : 173, "totalNumberOfReviews" : 37, "resourceLocation" : "api/v1/resource/components/51/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "LICTYPE", "code" : "GOVUNL" } ], "tags" : [ { "text" : "Communication" } ] }, { "listingType" : "Component", "componentId" : 53, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "VANTAGE Software Suite", "description" : "VANTAGE is a tactical imagery exploitation software suite. This field proven application screens digital imagery from various tactical reconnaissance sensors and includes simultaneous support for multiple sensor types. VANTAGE provides for real and near real time screening of digital image data from ...", "organization" : "NRL", "lastActivityDate" : null, "updateDts" : 1405452097000, "averageRating" : 2, "views" : 77, "totalNumberOfReviews" : 95, "resourceLocation" : "api/v1/resource/components/53/detail", "attributes" : [ { "type" : "TYPE", "code" : "APP" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "DEV" } ], "tags" : [ { "text" : "Mapping" } ] }, { "listingType" : "Component", "componentId" : 54, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "VANTAGE WESS OZONE Widget", "description" : "The Vantage Web Enabled Sensor Service (WESS) is an optional service that provides access to Vantage databases from other applications. WESS The Web Enabled Sensor Service (WESS) is a server that runs on the Vantage server and exposes the Vantage database of imagery and metadata to the outside via SOAP. <a href='http://www.spacedynamics.org/products/vantage' title='http://www.spacedynamics.org/products/vantage' target='_blank'> vantage</a> ...", "organization" : "NRL", "lastActivityDate" : null, "updateDts" : 1405452122000, "averageRating" : 4, "views" : 152, "totalNumberOfReviews" : 78, "resourceLocation" : "api/v1/resource/components/54/detail", "attributes" : [ { "type" : "TYPE", "code" : "WIDGET" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LICCLASS", "code" : "GOTS" }, { "type" : "LIFECYCSTG", "code" : "DEV" }, { "type" : "OWFCOMP", "code" : "Y" } ], "tags" : [ { "text" : "Mapping" } ] }, { "listingType" : "Component", "componentId" : 55, "articleAttributeType" : null, "articleAttributeCode" : null, "name" : "Vega 3D Map Widget", "description" : "Vega is a 3D map widget with support for high-resolution imagery in various formats including WMS, WFS, and ArcGIS. Vega also supports 3-dimensional terrain, and time-based data and has tools for drawing shapes and points and importing/exporting data. ...", "organization" : "unknown", "lastActivityDate" : null, "updateDts" : 1403200733000, "averageRating" : 4, "views" : 198, "totalNumberOfReviews" : 75, "resourceLocation" : "api/v1/resource/components/55/detail", "attributes" : [ { "type" : "TYPE", "code" : "WIDGET" }, { "type" : "DI2ELEVEL", "code" : "LEVEL0" }, { "type" : "DI2E-SVCV4-A", "code" : "2.2" }, { "type" : "CEEAR", "code" : "N" }, { "type" : "ITAR", "code" : "N" }, { "type" : "LIFECYCSTG", "code" : "OPR" }, { "type" : "OWFCOMP", "code" : "Y" } ], "tags" : [ ] }, { "listingType" : "Article", "componentId" : null, "articleAttributeType" : "1.2.1", "articleAttributeCode" : "DI2E-SVCV4-A", "name" : "IdAM", "description" : "Identity and Access Management Article.....", "organization" : "PMO", "lastActivityDate" : 1407175956075, "updateDts" : 1407175956075, "averageRating" : 0, "views" : 0, "totalNumberOfReviews" : 0, "resourceLocation" : "api/v1/resource/attributes/DI2E-SVCV4-A/attributeCode/1.2.1/article", "attributes" : [ { "type" : "DI2E-SVCV4-A", "code" : "1.2.1" } ], "tags" : [ ] } ]; // (function(){ // var types = []; // _.each(MOCKDATA2.resultsList, function(item){ // _.each(item.attributes, function(attribute){ // if (!types[attribute.typeDescription]) { // types[attribute.typeDescription] = {}; // types[attribute.typeDescription].codes = []; // } // types[attribute.typeDescription].codes.push(attribute.codeDescription); // types[attribute.typeDescription].codes = jQuery.unique(types[attribute.typeDescription].codes); // }) // }) // console.log('results', types); // }()); /* jshint ignore:end */
Added the correct scores for the JView component.
client/openstorefront/app/scripts/common-min/data2.js
Added the correct scores for the JView component.
<ide><path>lient/openstorefront/app/scripts/common-min/data2.js <ide> } ], <ide> "evaluationSections" : [ { <ide> "name" : "Discoverable", <del> "score" : 3 <add> "score" : 2 <ide> }, { <ide> "name" : "Accessible", <ide> "score" : 2 <ide> }, { <ide> "name" : "Documentation", <add> "score" : 3 <add> }, { <add> "name" : "Deployable", <add> "score" : 4 <add> }, { <add> "name" : "Usable", <ide> "score" : 5 <ide> }, { <del> "name" : "Deployable", <del> "score" : 1 <del> }, { <del> "name" : "Usable", <del> "score" : 0 <del> }, { <ide> "name" : "Error Handling", <del> "score" : 1 <add> "score" : 2 <ide> }, { <ide> "name" : "Integrable", <ide> "score" : 4 <ide> }, { <ide> "name" : "I/O Validation", <del> "score" : 3 <add> "score" : 2 <ide> }, { <ide> "name" : "Testing", <add> "score" : 2 <add> }, { <add> "name" : "Monitoring", <ide> "score" : 1 <del> }, { <del> "name" : "Monitoring", <del> "score" : 2 <ide> }, { <ide> "name" : "Performance", <ide> "score" : 3 <ide> }, { <ide> "name" : "Scalability", <del> "score" : 4 <add> "score" : 2 <ide> }, { <ide> "name" : "Security", <del> "score" : 1 <add> "score" : 3 <ide> }, { <ide> "name" : "Maintainability", <ide> "score" : 2 <ide> }, { <ide> "name" : "Community", <del> "score" : 5 <add> "score" : 1 <ide> }, { <ide> "name" : "Change Management", <del> "score" : 4 <add> "score" : 2 <ide> }, { <ide> "name" : "CA", <add> "score" : 1 <add> }, { <add> "name" : "Licensing", <ide> "score" : 2 <ide> }, { <del> "name" : "Licensing", <del> "score" : 0 <del> }, { <ide> "name" : "Roadmap", <del> "score" : 4 <add> "score" : 1 <ide> }, { <ide> "name" : "Willingness", <del> "score" : 4 <add> "score" : 2 <ide> }, { <ide> "name" : "Architecture Alignment", <ide> "score" : 5 <ide> "name" : "DI2E Framework Evaluation Report URL", <ide> "type" : "DI2E Framework Evaluation Report URL", <ide> "description" : null, <del> "link" : "<a href='https://storefront.di2e.net/marketplace/public/JViewAPI_ChecklistReport_v1.0.docx' title='https://storefront.di2e.net/marketplace/public/JViewAPI_ChecklistReport_v1.0.docx' target='_blank'> https://storefront.di2e.net/marketplace/public/JViewAPI_ChecklistReport_v1.0.docx</a>" <add> "link" : "<a href='https://confluence.di2e.net/display/DI2E/JView+API+Evaluation' title='https://confluence.di2e.net/display/DI2E/JView+API+Evaluation' target='_blank'> https://confluence.di2e.net/display/DI2E/JView+API+Evaluation</a>" <ide> }, { <ide> "name" : "Product Homepage", <ide> "type" : "Homepage",
Java
apache-2.0
error: pathspec 'Yamba/src/com/symantec/yamba/TimelineFragment.java' did not match any file(s) known to git
0b51798a697d5507e7fd8c6f66ea0f658fef3b65
1
thenewcircle/class-3272,thenewcircle/class-3272,thenewcircle/class-3272
package com.symantec.yamba; import android.app.ListFragment; import android.os.Bundle; public class TimelineFragment extends ListFragment { @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); getActivity().getContentResolver().query(StatusContract.CONTENT_URI, null, null, null, null); } }
Yamba/src/com/symantec/yamba/TimelineFragment.java
Added basic TimelineFragment
Yamba/src/com/symantec/yamba/TimelineFragment.java
Added basic TimelineFragment
<ide><path>amba/src/com/symantec/yamba/TimelineFragment.java <add>package com.symantec.yamba; <add> <add>import android.app.ListFragment; <add>import android.os.Bundle; <add> <add>public class TimelineFragment extends ListFragment { <add> <add> @Override <add> public void onActivityCreated(Bundle savedInstanceState) { <add> super.onActivityCreated(savedInstanceState); <add> getActivity().getContentResolver().query(StatusContract.CONTENT_URI, <add> null, null, null, null); <add> } <add>}
JavaScript
mit
ddaaab4c5e4dc928d7971d19a476f262df1f97e7
0
tpoikela/battles,tpoikela/battles,tpoikela/battles,tpoikela/battles,tpoikela/battles
/* eslint comma-dangle: 0 */ // Thanks to www.fantasynamegenerators.com for some tips const Names = {}; const RG = require('../src/rg'); const Random = require('../src/random'); const RNG = Random.getRNG(); // There are two kinds of names: // 1. Generic ones such as Dungeon, City, Town, Vault etc. // 2. Unique ones such as Everhold or Ebonfell. /* As the whole purpose of this module is to generate random names, each * function will return randomly picked values of course. */ Names.place = {}; /* Generic place names are placed here. */ Names.place.generic = { branch: [ 'Hand', 'Foot', 'Small', 'Large' ], dungeon: [ 'Crypt', 'Catacombs', 'Tombs', 'Dungeon', 'Cells', 'Cave', 'Grotto', 'Cavern', 'Lair', // 'Burrows', 'Delves', // 'Haunt', 'Point', // 'Vault', 'Tunnels', 'Pits', 'Labyrinth' // , 'Maze' ], mountain: [ 'Summit', 'Volcano', 'Tops', 'Peaks', 'Bluff', 'Highlands', 'Pinnacle', 'Rise', 'Needle', 'Hills', 'Slopes' ], face: [ 'Face', 'Buttress', 'Ridge', 'Shoulder', 'Crag', 'Crest', 'Brink', 'Cairn', 'Col', 'Pass', 'Crown', 'Scree', 'Watershed' ], forest: [ 'Grove', 'Wilds', 'Woodlands', 'Timberland', 'Forest', 'Covert', 'Woods', 'Thicket', 'Glade', ], city: [ 'Town', 'Village', // 'Township', 'Hamlet', 'Fort', // 'Stronghold', 'Fortress', 'Outpost', 'Castle', 'City', // 'Capital', // 'Guard' ], lake: [ 'Basin', 'Cove', 'Reservoir', 'Depths', 'Gorge', 'Lagoon', 'Domain', 'Pond', 'Expanse', 'Lake', 'Shallows', 'Loch', 'Falls', 'Rapids', ], quarter: [ 'Market', 'Bazaar', 'Plaza', 'Row', 'Works', 'Side', 'Acre', 'Garden', 'Park', 'Temple', 'Necropolis', 'Cemetery', 'Library', 'Arcane', 'Royal', 'Slum', 'Living', 'Arena', 'Military', 'Barracks' ], area: [ ] }; Names.place.unique = { city: { first: [ 'Stag', 'Small', 'Mud', 'Ebon', 'Silk', 'Spirit', 'Basin', 'Shadow', 'Gold', 'Snow', 'Frost', 'Ice', 'Hound', 'Moon', 'Dire', 'Ever', 'Iron', 'Ruby', 'Star', 'Crystal', 'Glimmer', 'Winters', 'Raven', 'Pine', 'Ever', 'Never', 'Rune', 'Glace', 'Lumen', 'Confer' ], second: [ 'guard', 'point', 'fell', 'mire', 'shield', 'crest', 'yard', 'minster', 'swallow', 'grasp', 'cliff', 'cross', 'host', 'barrow', 'vein', 'view', 'home', 'gard', 'wall' ] } }; Names.place.unique.mountain = { first: Names.place.unique.city.first, second: Names.place.generic.mountain.map(name => ' ' + name.toLowerCase()) }; Names.place.unique.dungeon = { first: Names.place.unique.city.first, second: Names.place.generic.dungeon.map(name => ' ' + name.toLowerCase()) }; Names.actor = { }; Names.item = { }; Names.getVillageType = () => { return RNG.arrayGetRand(['Village', 'Hamlet', 'Town', 'Township']); }; Names.getUniqueName = type => { const names = Names.place.unique[type]; if (names) { const first = RNG.arrayGetRand(names.first); const second = RNG.arrayGetRand(names.second); return first + second; } else { RG.err('name-gen.js', 'Names.getUniqueName', `No unique names for type ${type}`); } return ''; }; Names.getGenericPlaceName = (type) => { const arr = Names.place.generic[type]; return RNG.arrayGetRand(arr); }; Names.actorCount = 0; Names.getActorName = () => { return 'RandActor' + Names.actorCount++; }; module.exports = Names;
client/data/name-gen.js
/* eslint comma-dangle: 0 */ // Thanks to www.fantasynamegenerators.com for some tips const Names = {}; const RG = require('../src/rg.js'); const RNG = RG.Random.getRNG(); // There are two kinds of names: // 1. Generic ones such as Dungeon, City, Town, Vault etc. // 2. Unique ones such as Everhold or Ebonfell. /* As the whole purpose of this module is to generate random names, each * function will return randomly picked values of course. */ Names.place = {}; /* Generic place names are placed here. */ Names.place.generic = { branch: [ 'Hand', 'Foot', 'Small', 'Large' ], dungeon: [ 'Crypt', 'Catacombs', 'Tombs', 'Dungeon', 'Cells', 'Cave', 'Grotto', 'Cavern', 'Lair', // 'Burrows', 'Delves', // 'Haunt', 'Point', // 'Vault', 'Tunnels', 'Pits', 'Labyrinth' // , 'Maze' ], mountain: [ 'Summit', 'Volcano', 'Tops', 'Peaks', 'Bluff', 'Highlands', 'Pinnacle', 'Rise', 'Needle', 'Hills', 'Slopes' ], face: [ 'Face', 'Buttress', 'Ridge', 'Shoulder', 'Crag', 'Crest', 'Brink', 'Cairn', 'Col', 'Pass', 'Crown', 'Scree', 'Watershed' ], forest: [ 'Grove', 'Wilds', 'Woodlands', 'Timberland', 'Forest', 'Covert', 'Woods', 'Thicket', 'Glade', ], city: [ 'Town', 'Village', // 'Township', 'Hamlet', 'Fort', // 'Stronghold', 'Fortress', 'Outpost', 'Castle', 'City', // 'Capital', // 'Guard' ], lake: [ 'Basin', 'Cove', 'Reservoir', 'Depths', 'Gorge', 'Lagoon', 'Domain', 'Pond', 'Expanse', 'Lake', 'Shallows', 'Loch', 'Falls', 'Rapids', ], quarter: [ 'Market', 'Bazaar', 'Plaza', 'Row', 'Works', 'Side', 'Acre', 'Garden', 'Park', 'Temple', 'Necropolis', 'Cemetery', 'Library', 'Arcane', 'Royal', 'Slum', 'Living', 'Arena', 'Military', 'Barracks' ], area: [ ] }; Names.place.unique = { city: { first: [ 'Stag', 'Small', 'Mud', 'Ebon', 'Silk', 'Spirit', 'Basin', 'Shadow', 'Gold', 'Snow', 'Frost', 'Ice', 'Hound', 'Moon', 'Dire', 'Ever', 'Iron', 'Ruby', 'Star', 'Crystal', 'Glimmer', 'Winters', 'Raven', 'Pine', 'Ever', 'Never', 'Rune', 'Glace', 'Lumen', 'Confer' ], second: [ 'guard', 'point', 'fell', 'mire', 'shield', 'crest', 'yard', 'minster', 'swallow', 'grasp', 'cliff', 'cross', 'host', 'barrow', 'vein', 'view', 'home', 'gard', 'wall' ] } }; Names.place.unique.mountain = { first: Names.place.unique.city.first, second: Names.place.generic.mountain.map(name => ' ' + name.toLowerCase()) }; Names.place.unique.dungeon = { first: Names.place.unique.city.first, second: Names.place.generic.dungeon.map(name => ' ' + name.toLowerCase()) }; Names.actor = { }; Names.item = { }; Names.getVillageType = () => { return RNG.arrayGetRand(['Village', 'Hamlet', 'Town', 'Township']); }; Names.getUniqueName = type => { const names = Names.place.unique[type]; if (names) { const first = RNG.arrayGetRand(names.first); const second = RNG.arrayGetRand(names.second); return first + second; } else { RG.err('name-gen.js', 'Names.getUniqueName', `No unique names for type ${type}`); } return ''; }; Names.getGenericPlaceName = (type) => { const arr = Names.place.generic[type]; return RNG.arrayGetRand(arr); }; module.exports = Names;
Added getActorName() for testing quest generation with random names.
client/data/name-gen.js
Added getActorName() for testing quest generation with random names.
<ide><path>lient/data/name-gen.js <ide> // Thanks to www.fantasynamegenerators.com for some tips <ide> <ide> const Names = {}; <del>const RG = require('../src/rg.js'); <add>const RG = require('../src/rg'); <add>const Random = require('../src/random'); <ide> <del>const RNG = RG.Random.getRNG(); <add>const RNG = Random.getRNG(); <ide> <ide> // There are two kinds of names: <ide> // 1. Generic ones such as Dungeon, City, Town, Vault etc. <ide> return RNG.arrayGetRand(arr); <ide> }; <ide> <add>Names.actorCount = 0; <add>Names.getActorName = () => { <add> return 'RandActor' + Names.actorCount++; <add>}; <add> <ide> module.exports = Names; <ide>
Java
mit
7b48e385a917a66f860a44a19d8d9614dc2d702f
0
mmohan01/ReFactory,mmohan01/ReFactory
package refactorings; import java.util.ArrayList; import recoder.CrossReferenceServiceConfiguration; import recoder.abstraction.ClassType; import recoder.abstraction.Field; import recoder.abstraction.Package; import recoder.abstraction.PrimitiveType; import recoder.abstraction.Type; import recoder.bytecode.ClassFile; import recoder.convenience.AbstractTreeWalker; import recoder.convenience.TreeWalker; import recoder.java.CompilationUnit; import recoder.java.Import; import recoder.java.NonTerminalProgramElement; import recoder.java.ProgramElement; import recoder.java.declaration.MemberDeclaration; import recoder.java.declaration.MethodDeclaration; import recoder.java.declaration.TypeDeclaration; import recoder.java.declaration.modifier.Private; import recoder.java.declaration.modifier.Protected; import recoder.java.declaration.modifier.Public; import recoder.java.declaration.modifier.VisibilityModifier; import recoder.java.reference.FieldReference; import recoder.java.reference.MethodReference; import recoder.java.reference.SuperReference; import recoder.java.reference.ThisReference; import recoder.java.reference.TypeReference; import recoder.kit.Problem; import recoder.kit.ProblemReport; import recoder.kit.TwoPassTransformation; import recoder.list.generic.ASTArrayList; import recoder.list.generic.ASTList; import recoder.service.CrossReferenceSourceInfo; import refactory.AccessFlags; public abstract class Refactoring extends TwoPassTransformation { protected TwoPassTransformation transformation; protected String refactoringInfo; protected AbstractTreeWalker tw; public Refactoring(CrossReferenceServiceConfiguration sc) { super(sc); } public Refactoring() { super(); } public abstract ProblemReport analyze(int iteration, int unit, int element); public abstract ProblemReport analyzeReverse(); public abstract int getAmount(int unit); public abstract String getName(int unit, int element); public void transform(ProblemReport p) { if (p instanceof Problem) { System.out.println("\r\nPROBLEM REPORT: "); System.err.println(p.toString()); } else { if (this.transformation != null) { super.transform(); this.transformation.transform(); } } } protected String currentModifier(VisibilityModifier vm) { if (vm instanceof Public) return "public"; else if (vm instanceof Protected) return "protected"; else if (vm instanceof Private) return "private"; else return "package"; } protected int visibilityUp(VisibilityModifier vm) { if ((vm instanceof Public) || (vm instanceof Protected)) return AccessFlags.PUBLIC; else if (vm instanceof Private) return AccessFlags.PACKAGE; else return AccessFlags.PROTECTED; } protected String refactoredUpModifier(VisibilityModifier vm) { if ((vm instanceof Protected) || (vm instanceof Public)) return "public"; else if (vm instanceof Private) return "package"; else return "protected"; } protected int visibilityDown(VisibilityModifier vm) { if (vm instanceof Public) return AccessFlags.PROTECTED; else if (vm instanceof Protected) return AccessFlags.PACKAGE; else return AccessFlags.PRIVATE; } public String refactoredDownModifier(VisibilityModifier vm) { if (vm instanceof Public) return "protected"; else if (vm instanceof Protected) return "package"; else return "private"; } // Returns all the "super." references in a member declaration. protected ArrayList<SuperReference> getSuperReferences(MemberDeclaration md) { ArrayList<SuperReference> references = new ArrayList<SuperReference>(); TreeWalker tw = new TreeWalker(md); while (tw.next()) { ProgramElement pe = tw.getProgramElement(); if (pe instanceof SuperReference) references.add((SuperReference) pe); } return references; } // Returns all the "this." references in a member declaration. protected ArrayList<ThisReference> getThisReferences(MemberDeclaration md) { ArrayList<ThisReference> references = new ArrayList<ThisReference>(); TreeWalker tw = new TreeWalker(md); while (tw.next()) { ProgramElement pe = tw.getProgramElement(); if (pe instanceof ThisReference) references.add((ThisReference) pe); } return references; } // Returns all the types referenced in a member declaration. protected ArrayList<Type> getTypes(MemberDeclaration md, CrossReferenceSourceInfo si) { ArrayList<Type> types = new ArrayList<Type>(); if (md instanceof MethodDeclaration) { for (Type t : ((MethodDeclaration) md).getSignature()) if ((t != null) && !(types.contains(t)) && !(t.getFullName().contains("java.lang.")) && !(t instanceof PrimitiveType)) types.add(t); Type returnType = ((MethodDeclaration) md).getReturnType(); if ((returnType != null) && !(types.contains(returnType)) && !(returnType.getFullName().contains("java.lang.")) && !(returnType instanceof PrimitiveType)) types.add(returnType); } TreeWalker tw = new TreeWalker(md); while (tw.next()) { ProgramElement pe = tw.getProgramElement(); if (pe instanceof TypeReference) { if ((si.getType(pe) != null) && !(types.contains(si.getType(pe))) && !(si.getType(pe).getFullName().contains("java.lang.")) && !(si.getType(pe) instanceof PrimitiveType)) types.add(si.getType(pe)); } } return types; } // Returns all the method references in a member declaration. protected ArrayList<MethodReference> getMethods(MemberDeclaration md) { ArrayList<MethodReference> methods = new ArrayList<MethodReference>(); TreeWalker tw = new TreeWalker(md); while (tw.next()) { ProgramElement pe = tw.getProgramElement(); if ((pe instanceof MethodReference) && !(methods.contains(pe))) methods.add((MethodReference) pe); } return methods; } // Returns all the fields referenced in a member declaration. protected ArrayList<Field> getFields(MemberDeclaration md, CrossReferenceSourceInfo si) { ArrayList<Field> fields = new ArrayList<Field>(); TreeWalker tw = new TreeWalker(md); while (tw.next()) { ProgramElement pe = tw.getProgramElement(); if ((pe instanceof FieldReference) && !(fields.contains(si.getField((FieldReference) pe)))) fields.add(si.getField((FieldReference) pe)); } return fields; } // Returns all the type declarations in a compilation unit, including nested types. protected ArrayList<TypeDeclaration> getTypeDeclarations(CompilationUnit cu) { ArrayList<TypeDeclaration> types = new ArrayList<TypeDeclaration>(); TreeWalker tw = new TreeWalker(cu); while (tw.next(TypeDeclaration.class)) types.add((TypeDeclaration) tw.getProgramElement()); return types; } // Returns all the imports needed in a class to compile a member declaration that references the list of types supplied. // Uses the list of imports from the class the member declaration was originally in to extract the necessary imports. protected ASTList<Import> getMemberImports(ArrayList<Type> methodTypes, ASTList<Import> classImports, CrossReferenceSourceInfo si) { ASTArrayList<Import> methodImports = new ASTArrayList<Import>(classImports.size()); for (Import ci : classImports) { boolean add = false; if (ci.isMultiImport()) { Package p; if (ci.getTypeReferenceCount() == 0) p = si.getPackage(ci.getPackageReference()); else p = si.getPackage(si.getType(ci.getTypeReference())); for (Type type : methodTypes) { if (((type instanceof TypeDeclaration) || (type instanceof ClassFile)) && (((ClassType) type).getPackage().getName().equals(p.getName()))) { add = true; methodTypes.remove(type); break; } } } else { for (Type t : methodTypes) { if (t.getName().equals(si.getType(ci.getTypeReference()).getName())) { add = true; methodTypes.remove(t); break; } } } if (add) methodImports.add(ci); } return methodImports; } // Returns the position of an element within its class with respect to the other elements, // or the position of a class in a compilation unit. protected int getPosition(NonTerminalProgramElement parent, MemberDeclaration child) { int position = 0; if (parent instanceof TypeDeclaration) { for (int i = 0; i < ((TypeDeclaration) parent).getMembers().size(); i++) { if (((TypeDeclaration) parent).getMembers().get(i).equals(child)) { position = i; break; } } } else if (parent instanceof CompilationUnit) { for (int i = 0; i < ((CompilationUnit) parent).getTypeDeclarationCount(); i++) { if (((CompilationUnit) parent).getTypeDeclarationAt(i).equals(child)) { position = i; break; } } } return position; } // Truncates a path name to just the element name. protected String getFileName(String input) { int lastDash = input.lastIndexOf("\\"); int lastDot = input.lastIndexOf("."); if ((lastDash >= 0) && (lastDot >= 0)) input = input.substring(lastDash + 1, lastDot); return input; } public ProblemReport analyze(int iteration, String name, int element) { int unit = -1; for (int i = 0; i < getSourceFileRepository().getKnownCompilationUnits().size(); i++) { if (getSourceFileRepository().getKnownCompilationUnits().get(i).getName().equals(name)) { unit = i; break; } } return analyze(iteration, unit, element); } public String getRefactoringInfo() { return this.refactoringInfo; } public void setServiceConfiguration(CrossReferenceServiceConfiguration sc) { super.setServiceConfiguration(sc); } }
src/refactorings/Refactoring.java
package refactorings; import java.util.ArrayList; import recoder.CrossReferenceServiceConfiguration; import recoder.abstraction.ClassType; import recoder.abstraction.Field; import recoder.abstraction.Package; import recoder.abstraction.PrimitiveType; import recoder.abstraction.Type; import recoder.bytecode.ClassFile; import recoder.convenience.AbstractTreeWalker; import recoder.convenience.TreeWalker; import recoder.java.CompilationUnit; import recoder.java.Import; import recoder.java.NonTerminalProgramElement; import recoder.java.ProgramElement; import recoder.java.declaration.MemberDeclaration; import recoder.java.declaration.MethodDeclaration; import recoder.java.declaration.TypeDeclaration; import recoder.java.declaration.modifier.Private; import recoder.java.declaration.modifier.Protected; import recoder.java.declaration.modifier.Public; import recoder.java.declaration.modifier.VisibilityModifier; import recoder.java.reference.FieldReference; import recoder.java.reference.MethodReference; import recoder.java.reference.SuperReference; import recoder.java.reference.ThisReference; import recoder.java.reference.TypeReference; import recoder.kit.Problem; import recoder.kit.ProblemReport; import recoder.kit.TwoPassTransformation; import recoder.list.generic.ASTArrayList; import recoder.list.generic.ASTList; import recoder.service.CrossReferenceSourceInfo; import refactory.AccessFlags; public abstract class Refactoring extends TwoPassTransformation { protected TwoPassTransformation transformation; protected String refactoringInfo; protected AbstractTreeWalker tw; public Refactoring(CrossReferenceServiceConfiguration sc) { super(sc); } public Refactoring() { super(); } public abstract ProblemReport analyze(int iteration, int unit, int element); public abstract ProblemReport analyzeReverse(); public abstract int getAmount(int unit); public abstract String getName(int unit, int element); public void transform(ProblemReport p) { if (p instanceof Problem) { System.out.println("\nPROBLEM REPORT: "); System.err.println(p.toString()); } else { if (this.transformation != null) { super.transform(); this.transformation.transform(); } } } protected String currentModifier(VisibilityModifier vm) { if (vm instanceof Public) return "public"; else if (vm instanceof Protected) return "protected"; else if (vm instanceof Private) return "private"; else return "package"; } protected int visibilityUp(VisibilityModifier vm) { if ((vm instanceof Public) || (vm instanceof Protected)) return AccessFlags.PUBLIC; else if (vm instanceof Private) return AccessFlags.PACKAGE; else return AccessFlags.PROTECTED; } protected String refactoredUpModifier(VisibilityModifier vm) { if ((vm instanceof Protected) || (vm instanceof Public)) return "public"; else if (vm instanceof Private) return "package"; else return "protected"; } protected int visibilityDown(VisibilityModifier vm) { if (vm instanceof Public) return AccessFlags.PROTECTED; else if (vm instanceof Protected) return AccessFlags.PACKAGE; else return AccessFlags.PRIVATE; } public String refactoredDownModifier(VisibilityModifier vm) { if (vm instanceof Public) return "protected"; else if (vm instanceof Protected) return "package"; else return "private"; } // Returns all the "super." references in a member declaration. protected ArrayList<SuperReference> getSuperReferences(MemberDeclaration md) { ArrayList<SuperReference> references = new ArrayList<SuperReference>(); TreeWalker tw = new TreeWalker(md); while (tw.next()) { ProgramElement pe = tw.getProgramElement(); if (pe instanceof SuperReference) references.add((SuperReference) pe); } return references; } // Returns all the "this." references in a member declaration. protected ArrayList<ThisReference> getThisReferences(MemberDeclaration md) { ArrayList<ThisReference> references = new ArrayList<ThisReference>(); TreeWalker tw = new TreeWalker(md); while (tw.next()) { ProgramElement pe = tw.getProgramElement(); if (pe instanceof ThisReference) references.add((ThisReference) pe); } return references; } // Returns all the types referenced in a member declaration. protected ArrayList<Type> getTypes(MemberDeclaration md, CrossReferenceSourceInfo si) { ArrayList<Type> types = new ArrayList<Type>(); if (md instanceof MethodDeclaration) { for (Type t : ((MethodDeclaration) md).getSignature()) if ((t != null) && !(types.contains(t)) && !(t.getFullName().contains("java.lang.")) && !(t instanceof PrimitiveType)) types.add(t); Type returnType = ((MethodDeclaration) md).getReturnType(); if ((returnType != null) && !(types.contains(returnType)) && !(returnType.getFullName().contains("java.lang.")) && !(returnType instanceof PrimitiveType)) types.add(returnType); } TreeWalker tw = new TreeWalker(md); while (tw.next()) { ProgramElement pe = tw.getProgramElement(); if (pe instanceof TypeReference) { if ((si.getType(pe) != null) && !(types.contains(si.getType(pe))) && !(si.getType(pe).getFullName().contains("java.lang.")) && !(si.getType(pe) instanceof PrimitiveType)) types.add(si.getType(pe)); } } return types; } // Returns all the method references in a member declaration. protected ArrayList<MethodReference> getMethods(MemberDeclaration md) { ArrayList<MethodReference> methods = new ArrayList<MethodReference>(); TreeWalker tw = new TreeWalker(md); while (tw.next()) { ProgramElement pe = tw.getProgramElement(); if ((pe instanceof MethodReference) && !(methods.contains(pe))) methods.add((MethodReference) pe); } return methods; } // Returns all the fields referenced in a member declaration. protected ArrayList<Field> getFields(MemberDeclaration md, CrossReferenceSourceInfo si) { ArrayList<Field> fields = new ArrayList<Field>(); TreeWalker tw = new TreeWalker(md); while (tw.next()) { ProgramElement pe = tw.getProgramElement(); if ((pe instanceof FieldReference) && !(fields.contains(si.getField((FieldReference) pe)))) fields.add(si.getField((FieldReference) pe)); } return fields; } // Returns all the type declarations in a compilation unit, including nested types. protected ArrayList<TypeDeclaration> getTypeDeclarations(CompilationUnit cu) { ArrayList<TypeDeclaration> types = new ArrayList<TypeDeclaration>(); TreeWalker tw = new TreeWalker(cu); while (tw.next(TypeDeclaration.class)) types.add((TypeDeclaration) tw.getProgramElement()); return types; } // Returns all the imports needed in a class to compile a member declaration that references the list of types supplied. // Uses the list of imports from the class the member declaration was originally in to extract the necessary imports. protected ASTList<Import> getMemberImports(ArrayList<Type> methodTypes, ASTList<Import> classImports, CrossReferenceSourceInfo si) { ASTArrayList<Import> methodImports = new ASTArrayList<Import>(classImports.size()); for (Import ci : classImports) { boolean add = false; if (ci.isMultiImport()) { Package p; if (ci.getTypeReferenceCount() == 0) p = si.getPackage(ci.getPackageReference()); else p = si.getPackage(si.getType(ci.getTypeReference())); for (Type type : methodTypes) { if (((type instanceof TypeDeclaration) || (type instanceof ClassFile)) && (((ClassType) type).getPackage().getName().equals(p.getName()))) { add = true; methodTypes.remove(type); break; } } } else { for (Type t : methodTypes) { if (t.getName().equals(si.getType(ci.getTypeReference()).getName())) { add = true; methodTypes.remove(t); break; } } } if (add) methodImports.add(ci); } return methodImports; } // Returns the position of an element within its class with respect to the other elements, // or the position of a class in a compilation unit. protected int getPosition(NonTerminalProgramElement parent, MemberDeclaration child) { int position = 0; if (parent instanceof TypeDeclaration) { for (int i = 0; i < ((TypeDeclaration) parent).getMembers().size(); i++) { if (((TypeDeclaration) parent).getMembers().get(i).equals(child)) { position = i; break; } } } else if (parent instanceof CompilationUnit) { for (int i = 0; i < ((CompilationUnit) parent).getTypeDeclarationCount(); i++) { if (((CompilationUnit) parent).getTypeDeclarationAt(i).equals(child)) { position = i; break; } } } return position; } // Truncates a path name to just the element name. protected String getFileName(String input) { int lastDash = input.lastIndexOf("\\"); int lastDot = input.lastIndexOf("."); if ((lastDash >= 0) && (lastDot >= 0)) input = input.substring(lastDash + 1, lastDot); return input; } public ProblemReport analyze(int iteration, String name, int element) { int unit = -1; for (int i = 0; i < getSourceFileRepository().getKnownCompilationUnits().size(); i++) { if (getSourceFileRepository().getKnownCompilationUnits().get(i).getName().equals(name)) { unit = i; break; } } return analyze(iteration, unit, element); } public String getRefactoringInfo() { return this.refactoringInfo; } public void setServiceConfiguration(CrossReferenceServiceConfiguration sc) { super.setServiceConfiguration(sc); } }
Added files via upload
src/refactorings/Refactoring.java
Added files via upload
<ide><path>rc/refactorings/Refactoring.java <ide> { <ide> if (p instanceof Problem) <ide> { <del> System.out.println("\nPROBLEM REPORT: "); <add> System.out.println("\r\nPROBLEM REPORT: "); <ide> System.err.println(p.toString()); <ide> } <ide> else
Java
apache-2.0
2106c0a6bc98e0b0da0dbda747e7085f21341304
0
serge-rider/dbeaver,serge-rider/dbeaver,Sargul/dbeaver,serge-rider/dbeaver,Sargul/dbeaver,dbeaver/dbeaver,Sargul/dbeaver,Sargul/dbeaver,dbeaver/dbeaver,Sargul/dbeaver,dbeaver/dbeaver,dbeaver/dbeaver,serge-rider/dbeaver
/* * DBeaver - Universal Database Manager * Copyright (C) 2010-2019 Serge Rider ([email protected]) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jkiss.dbeaver.ui.task; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.*; import org.jkiss.dbeaver.DBException; import org.jkiss.dbeaver.Log; import org.jkiss.dbeaver.model.DBIcon; import org.jkiss.dbeaver.model.app.DBPProject; import org.jkiss.dbeaver.model.task.*; import org.jkiss.dbeaver.registry.task.TaskImpl; import org.jkiss.dbeaver.registry.task.TaskRegistry; import org.jkiss.dbeaver.runtime.DBWorkbench; import org.jkiss.dbeaver.ui.DBeaverIcons; import org.jkiss.dbeaver.ui.UIUtils; import org.jkiss.dbeaver.ui.dialogs.ActiveWizardPage; import org.jkiss.dbeaver.ui.navigator.NavigatorUtils; import org.jkiss.utils.CommonUtils; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; /** * Create task wizard page */ class TaskConfigurationWizardPageTask extends ActiveWizardPage { private static final Log log = Log.getLog(TaskConfigurationWizardPageTask.class); private final DBPProject selectedProject; private Combo taskTypeCombo; private Text taskLabelText; private Text taskDescriptionText; private Tree taskCategoryTree; private DBTTaskType[] taskTypes; private Composite configPanelPlaceholder; private DBTTaskConfigPanel taskConfigPanel; private DBTTaskCategory selectedCategory; private DBTTaskType selectedTaskType; private String taskName; private String taskDescription; private Map<String, Object> initialProperties = new LinkedHashMap<>(); private TaskImpl task; private Map<DBTTaskType, TaskConfigurationWizard> taskWizards = new HashMap<>(); TaskConfigurationWizardPageTask(DBTTask task) { super(task == null ? "Create new task" : "Edit task"); setTitle(task == null ? "New task properties" : "Edit task properties"); setDescription("Set task name, type and input data"); setPageComplete(false); this.task = (TaskImpl) task; if (this.task != null) { selectedTaskType = this.task.getType(); selectedCategory = selectedTaskType.getCategory(); } this.selectedProject = NavigatorUtils.getSelectedProject(); } @Override public TaskConfigurationWizard getWizard() { return (TaskConfigurationWizard)super.getWizard(); } public DBTTaskCategory getSelectedCategory() { return selectedCategory; } public DBTTaskType getSelectedTaskType() { return selectedTaskType; } public String getTaskName() { return taskName; } public String getTaskDescription() { return taskDescription; } public Map<String, Object> getInitialProperties() { return initialProperties; } @Override public boolean canFlipToNextPage() { return isPageComplete(); } @Override public void createControl(Composite parent) { SashForm formSash = new SashForm(parent, SWT.HORIZONTAL); formSash.setLayoutData(new GridData(GridData.FILL_BOTH)); { Composite formPanel = UIUtils.createControlGroup(formSash, "Task info", 2, GridData.FILL_BOTH, 0); formPanel.setLayoutData(new GridData(GridData.FILL_BOTH)); ModifyListener modifyListener = e -> getWizard().getContainer().updateButtons(); if (task == null) { UIUtils.createControlLabel(formPanel, "Category"); taskCategoryTree = new Tree(formPanel, SWT.BORDER | SWT.SINGLE); GridData gd = new GridData(GridData.FILL_BOTH); gd.heightHint = 100; gd.widthHint = 200; taskCategoryTree.setLayoutData(gd); taskCategoryTree.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { TreeItem[] selection = taskCategoryTree.getSelection(); if (selection.length == 1) { if (selectedCategory == selection[0].getData()) { return; } selectedCategory = (DBTTaskCategory) selection[0].getData(); taskTypeCombo.removeAll(); taskTypes = selectedCategory.getTaskTypes(); for (DBTTaskType type : taskTypes) { taskTypeCombo.add(type.getName()); } if (taskTypes.length > 0) { taskTypeCombo.select(0); selectedTaskType = taskTypes[0]; } else { selectedTaskType = null; } updateTaskTypeSelection(); } } }); addTaskCategories(null, TaskRegistry.getInstance().getRootCategories()); taskTypeCombo = UIUtils.createLabelCombo(formPanel, "Type", SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY); taskTypeCombo.addModifyListener(modifyListener); taskTypeCombo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { DBTTaskType newTaskType; if (taskTypeCombo.getSelectionIndex() >= 0) { newTaskType = taskTypes[taskTypeCombo.getSelectionIndex()]; } else { newTaskType = null; } if (selectedTaskType == newTaskType) { return; } selectedTaskType = newTaskType; updateTaskTypeSelection(); } }); } else { UIUtils.createLabelText(formPanel, "Category", task.getType().getCategory().getName(), SWT.BORDER | SWT.READ_ONLY); UIUtils.createLabelText(formPanel, "Type", task.getType().getName(), SWT.BORDER | SWT.READ_ONLY); } taskLabelText = UIUtils.createLabelText(formPanel, "Name", task == null ? "" : CommonUtils.notEmpty(task.getName()), SWT.BORDER); taskLabelText.addModifyListener(e -> { taskName = taskLabelText.getText(); modifyListener.modifyText(e); }); taskDescriptionText = UIUtils.createLabelText(formPanel, "Description", task == null ? "" : CommonUtils.notEmpty(task.getDescription()), SWT.BORDER | SWT.MULTI | SWT.V_SCROLL); ((GridData) taskDescriptionText.getLayoutData()).heightHint = taskDescriptionText.getLineHeight() * 5; taskDescriptionText.addModifyListener(e -> { taskDescription = taskDescriptionText.getText(); modifyListener.modifyText(e); }); UIUtils.asyncExec(() -> taskLabelText.setFocus()); } { configPanelPlaceholder = UIUtils.createComposite(formSash, 1); if (task != null) updateTaskTypeSelection(); } formSash.setWeights(new int[] { 500, 500 }); setControl(formSash); } private void updateTaskTypeSelection() { UIUtils.disposeChildControls(configPanelPlaceholder); taskConfigPanel = null; if (selectedCategory != null && selectedCategory.supportsConfigurator()) { try { DBTTaskConfigurator configurator = selectedCategory.createConfigurator(); DBTTaskConfigPanel configPage = configurator.createInputConfigurator(UIUtils.getDefaultRunnableContext(), selectedTaskType); if (configPage != null) { taskConfigPanel = configPage; taskConfigPanel.createControl(configPanelPlaceholder, getTaskWizard(), this::updatePageCompletion); if (task != null) { taskConfigPanel.loadSettings(); updatePageCompletion(); } } else { // Something weird was created UIUtils.disposeChildControls(configPanelPlaceholder); } } catch (Exception e) { DBWorkbench.getPlatformUI().showError("Task configurator error", "Error creating task configuration UI", e); } } if (taskConfigPanel == null) { Group group = UIUtils.createControlGroup(configPanelPlaceholder, "", 1, GridData.FILL_BOTH, 0); group.setLayoutData(new GridData(GridData.FILL_BOTH)); Label emptyLabel = new Label(group, SWT.NONE); emptyLabel.setText("No configuration"); GridData gd = new GridData(GridData.VERTICAL_ALIGN_CENTER | GridData.HORIZONTAL_ALIGN_CENTER); gd.grabExcessHorizontalSpace = true; gd.grabExcessVerticalSpace = true; emptyLabel.setLayoutData(gd); } getShell().layout(true, true); getWizard().getContainer().updateButtons(); } private void addTaskCategories(TreeItem parentItem, DBTTaskCategory[] categories) { for (DBTTaskCategory cat : categories) { TreeItem item = parentItem == null ? new TreeItem(taskCategoryTree, SWT.NONE) : new TreeItem(parentItem, SWT.NONE); item.setText(cat.getName()); item.setImage(DBeaverIcons.getImage(cat.getIcon() == null ? DBIcon.TREE_PACKAGE : cat.getIcon())); item.setData(cat); addTaskCategories(item, cat.getChildren()); item.setExpanded(true); } } @Override protected boolean determinePageCompletion() { return selectedTaskType != null && (task != null || !CommonUtils.isEmpty(taskName)) && (taskConfigPanel == null || taskConfigPanel.isComplete()); } public TaskConfigurationWizard getTaskWizard() throws DBException { if (!(getWizard() instanceof TaskConfigurationWizardStub)) { // We already have it return getWizard(); } TaskConfigurationWizard realWizard = taskWizards.get(selectedTaskType); if (realWizard == null) { DBTTaskConfigurator configurator = selectedCategory.createConfigurator(); if (task == null) { task = (TaskImpl) selectedProject.getTaskManager().createTaskConfiguration(selectedTaskType, taskName, taskDescription, new LinkedHashMap<>()); } realWizard = (TaskConfigurationWizard) configurator.createTaskConfigWizard(task); taskConfigPanel.saveSettings(); taskWizards.put(selectedTaskType, realWizard); } return realWizard; } public void saveSettings() { if (task != null) { task.setName(taskLabelText.getText()); task.setDescription(taskDescriptionText.getText()); if (taskConfigPanel != null) { taskConfigPanel.saveSettings(); } try { task.getProject().getTaskManager().updateTaskConfiguration(task); } catch (DBException e) { log.error("Error saving task configuration", e); } } } }
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/task/TaskConfigurationWizardPageTask.java
/* * DBeaver - Universal Database Manager * Copyright (C) 2010-2019 Serge Rider ([email protected]) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jkiss.dbeaver.ui.task; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.*; import org.jkiss.dbeaver.DBException; import org.jkiss.dbeaver.Log; import org.jkiss.dbeaver.model.DBIcon; import org.jkiss.dbeaver.model.app.DBPProject; import org.jkiss.dbeaver.model.task.*; import org.jkiss.dbeaver.registry.task.TaskImpl; import org.jkiss.dbeaver.registry.task.TaskRegistry; import org.jkiss.dbeaver.runtime.DBWorkbench; import org.jkiss.dbeaver.ui.DBeaverIcons; import org.jkiss.dbeaver.ui.UIUtils; import org.jkiss.dbeaver.ui.dialogs.ActiveWizardPage; import org.jkiss.dbeaver.ui.navigator.NavigatorUtils; import org.jkiss.utils.CommonUtils; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; /** * Create task wizard page */ class TaskConfigurationWizardPageTask extends ActiveWizardPage { private static final Log log = Log.getLog(TaskConfigurationWizardPageTask.class); private final DBPProject selectedProject; private Combo taskTypeCombo; private Text taskLabelText; private Text taskDescriptionText; private Tree taskCategoryTree; private DBTTaskType[] taskTypes; private Composite configPanelPlaceholder; private DBTTaskConfigPanel taskConfigPanel; private DBTTaskCategory selectedCategory; private DBTTaskType selectedTaskType; private String taskName; private String taskDescription; private Map<String, Object> initialProperties = new LinkedHashMap<>(); private TaskImpl task; private Map<DBTTaskType, TaskConfigurationWizard> taskWizards = new HashMap<>(); TaskConfigurationWizardPageTask(DBTTask task) { super(task == null ? "Create new task" : "Edit task"); setTitle(task == null ? "New task properties" : "Edit task properties"); setDescription("Set task name, type and input data"); setPageComplete(false); this.task = (TaskImpl) task; if (this.task != null) { selectedTaskType = this.task.getType(); selectedCategory = selectedTaskType.getCategory(); } this.selectedProject = NavigatorUtils.getSelectedProject(); } @Override public TaskConfigurationWizard getWizard() { return (TaskConfigurationWizard)super.getWizard(); } public DBTTaskCategory getSelectedCategory() { return selectedCategory; } public DBTTaskType getSelectedTaskType() { return selectedTaskType; } public String getTaskName() { return taskName; } public String getTaskDescription() { return taskDescription; } public Map<String, Object> getInitialProperties() { return initialProperties; } @Override public boolean canFlipToNextPage() { return isPageComplete(); } @Override public void createControl(Composite parent) { SashForm formSash = new SashForm(parent, SWT.HORIZONTAL); formSash.setLayoutData(new GridData(GridData.FILL_BOTH)); { Composite formPanel = UIUtils.createControlGroup(formSash, "Task info", 2, GridData.FILL_BOTH, 0); formPanel.setLayoutData(new GridData(GridData.FILL_BOTH)); ModifyListener modifyListener = e -> getWizard().getContainer().updateButtons(); if (task == null) { UIUtils.createControlLabel(formPanel, "Category"); taskCategoryTree = new Tree(formPanel, SWT.BORDER | SWT.SINGLE); GridData gd = new GridData(GridData.FILL_BOTH); gd.heightHint = 100; gd.widthHint = 200; taskCategoryTree.setLayoutData(gd); taskCategoryTree.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { TreeItem[] selection = taskCategoryTree.getSelection(); if (selection.length == 1) { if (selectedCategory == selection[0].getData()) { return; } selectedCategory = (DBTTaskCategory) selection[0].getData(); taskTypeCombo.removeAll(); taskTypes = selectedCategory.getTaskTypes(); for (DBTTaskType type : taskTypes) { taskTypeCombo.add(type.getName()); } if (taskTypes.length > 0) { taskTypeCombo.select(0); selectedTaskType = taskTypes[0]; } else { selectedTaskType = null; } updateTaskTypeSelection(); } } }); addTaskCategories(null, TaskRegistry.getInstance().getRootCategories()); taskTypeCombo = UIUtils.createLabelCombo(formPanel, "Type", SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY); taskTypeCombo.addModifyListener(modifyListener); taskTypeCombo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { DBTTaskType newTaskType; if (taskTypeCombo.getSelectionIndex() >= 0) { newTaskType = taskTypes[taskTypeCombo.getSelectionIndex()]; } else { newTaskType = null; } if (selectedTaskType == newTaskType) { return; } selectedTaskType = newTaskType; updateTaskTypeSelection(); } }); } else { UIUtils.createLabelText(formPanel, "Category", task.getType().getCategory().getName(), SWT.BORDER | SWT.READ_ONLY); UIUtils.createLabelText(formPanel, "Type", task.getType().getName(), SWT.BORDER | SWT.READ_ONLY); } taskLabelText = UIUtils.createLabelText(formPanel, "Name", task == null ? "" : CommonUtils.notEmpty(task.getName()), SWT.BORDER); taskLabelText.addModifyListener(e -> { taskName = taskLabelText.getText(); modifyListener.modifyText(e); }); taskDescriptionText = UIUtils.createLabelText(formPanel, "Description", task == null ? "" : CommonUtils.notEmpty(task.getDescription()), SWT.BORDER | SWT.MULTI | SWT.V_SCROLL); ((GridData) taskDescriptionText.getLayoutData()).heightHint = taskDescriptionText.getLineHeight() * 5; taskDescriptionText.addModifyListener(e -> { taskDescription = taskDescriptionText.getText(); modifyListener.modifyText(e); }); UIUtils.asyncExec(() -> taskLabelText.setFocus()); } { configPanelPlaceholder = UIUtils.createComposite(formSash, 1); if (task != null) updateTaskTypeSelection(); } formSash.setWeights(new int[] { 500, 500 }); setControl(formSash); } private void updateTaskTypeSelection() { UIUtils.disposeChildControls(configPanelPlaceholder); taskConfigPanel = null; if (selectedCategory != null && selectedCategory.supportsConfigurator()) { try { DBTTaskConfigurator configurator = selectedCategory.createConfigurator(); DBTTaskConfigPanel configPage = configurator.createInputConfigurator(UIUtils.getDefaultRunnableContext(), selectedTaskType); if (configPage != null) { taskConfigPanel = configPage; taskConfigPanel.createControl(configPanelPlaceholder, getTaskWizard(), this::updatePageCompletion); if (task != null) { taskConfigPanel.loadSettings(); updatePageCompletion(); } } else { // Something weird was created UIUtils.disposeChildControls(configPanelPlaceholder); } } catch (Exception e) { DBWorkbench.getPlatformUI().showError("Task configurator error", "Error creating task configuration UI", e); } } if (taskConfigPanel == null) { Group group = UIUtils.createControlGroup(configPanelPlaceholder, "", 1, GridData.FILL_BOTH, 0); group.setLayoutData(new GridData(GridData.FILL_BOTH)); Label emptyLabel = new Label(group, SWT.NONE); emptyLabel.setText("No configuration"); GridData gd = new GridData(GridData.VERTICAL_ALIGN_CENTER | GridData.HORIZONTAL_ALIGN_CENTER); gd.grabExcessHorizontalSpace = true; gd.grabExcessVerticalSpace = true; emptyLabel.setLayoutData(gd); } getShell().layout(true, true); getWizard().getContainer().updateButtons(); } private void addTaskCategories(TreeItem parentItem, DBTTaskCategory[] categories) { for (DBTTaskCategory cat : categories) { TreeItem item = parentItem == null ? new TreeItem(taskCategoryTree, SWT.NONE) : new TreeItem(parentItem, SWT.NONE); item.setText(cat.getName()); item.setImage(DBeaverIcons.getImage(cat.getIcon() == null ? DBIcon.TREE_PACKAGE : cat.getIcon())); item.setData(cat); addTaskCategories(item, cat.getChildren()); item.setExpanded(true); } } @Override protected boolean determinePageCompletion() { return selectedTaskType != null && (task != null || !CommonUtils.isEmpty(taskName)) && (taskConfigPanel == null || taskConfigPanel.isComplete()); } public TaskConfigurationWizard getTaskWizard() throws DBException { TaskConfigurationWizard realWizard = taskWizards.get(selectedTaskType); if (realWizard == null) { DBTTaskConfigurator configurator = selectedCategory.createConfigurator(); if (task == null) { task = (TaskImpl) selectedProject.getTaskManager().createTaskConfiguration(selectedTaskType, taskName, taskDescription, new LinkedHashMap<>()); } realWizard = (TaskConfigurationWizard) configurator.createTaskConfigWizard(task); taskConfigPanel.saveSettings(); taskWizards.put(selectedTaskType, realWizard); } return realWizard; } public void saveSettings() { if (task != null) { task.setName(taskLabelText.getText()); task.setDescription(taskDescriptionText.getText()); if (taskConfigPanel != null) { taskConfigPanel.saveSettings(); } try { task.getProject().getTaskManager().updateTaskConfiguration(task); } catch (DBException e) { log.error("Error saving task configuration", e); } } } }
#2372 Remove redundant settings deserialize Former-commit-id: 245789317f63b7b57a6987249d1f8a542c04b63f
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/task/TaskConfigurationWizardPageTask.java
#2372 Remove redundant settings deserialize
<ide><path>lugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/task/TaskConfigurationWizardPageTask.java <ide> } <ide> <ide> public TaskConfigurationWizard getTaskWizard() throws DBException { <add> if (!(getWizard() instanceof TaskConfigurationWizardStub)) { <add> // We already have it <add> return getWizard(); <add> } <ide> TaskConfigurationWizard realWizard = taskWizards.get(selectedTaskType); <ide> if (realWizard == null) { <ide> DBTTaskConfigurator configurator = selectedCategory.createConfigurator();
Java
unlicense
d329b4be9831b06e6162eaf4e92829e579bf35e9
0
michaelsavich/NotificationCenter
package net.michaelsavich.notification; import java.util.Map; import java.util.HashMap; import java.util.Set; import java.util.HashSet; /** * NotificationCenter objects register {@link NotificationObserver NotificationObservers} * to be notified when a certain {@link Notification} is posted. */ public abstract class NotificationCenter { /** * Gets the default <b>(synchronous)</b> NotificationCenter instance. * This method returns the same instance each time it is called, functioning like a singleton. * <p> * Note both that this method and {@link NotificationCenter#primaryAsync()} return different instances, and that * the object returned by this method notifies observers <b>synchronously.</b> * </p> * <p> * Calling this method for the first time creates a new NotificationCenter, as the field backing * it is <a href=https://en.wikipedia.org/wiki/Lazy_initialization>lazily initialized</a>. Suffice it to say, * if you do not intend to use the NotificationCenter provided by this method, it is best to avoid calling it entirely. * </p> * @return An instance of a concrete NotificationCenter subclass. */ public static NotificationCenter primary() { if (primary == null) { primary = new SynchronousNotificationCenter(); } return primary; } private static SynchronousNotificationCenter primary = null; /** * Gets the default <b>(asynchronous)</b> NotificationCenter instance. * This method returns the same instance each time it is called, functioning like a singleton. * <p> * Note both that this method and {@link NotificationCenter#primary()} return different instances, and that * the object returned by this method notifies observers <b>asynchronously.</b> * </p> * <p> * Calling this method the first time creates a new NotificationCenter, that is to say, the field backing * it is <a href=https://en.wikipedia.org/wiki/Lazy_initialization>lazily initialized</a>. Suffice it to say, * if you do not intend to use the NotificationCenter provided by this method, it is best to avoid calling it entirely. * </p> * @return An instance of a concrete NotificationCenter subclass. */ public static NotificationCenter primaryAsync() { if (primaryAsync == null) { primaryAsync = new AsynchronousNotificationCenter(); } return primaryAsync; } private static AsynchronousNotificationCenter primaryAsync = null; /** * The Map used to route incoming {@link Notification} objects to their registered {@link NotificationObserver NotificationObservers}. * Primarily of interest to subclasses. <p>Note that if a subclass overrides all methods of NotificationCenter, it is safe to ignore this field * and use a different class to store the information required for dispatching.</p> */ protected Map<String,Set<NotificationObserver>> dispatchTable = new HashMap<>(); /** * Posts a {@link Notification} that observers can react to. * @param notification The Notification to post. */ public abstract void post(Notification notification); /** * Posts a {@link Notification} with the specified name. * Equivalent to calling {@code NotificationCenter.post(new Notification(notificationName, null))}. * @param notificationName The Notification to post. */ public void post(String notificationName) { this.post(new Notification(notificationName, null)); } /** * Adds an observer that reacts when a specific {@link Notification} is posted. * More than one object can register to observe a Notification. * @param observer The observer to add. * @param notificationName The name of the Notification to register the observer for. */ public void addObserver(NotificationObserver observer, String notificationName) { dispatchTable.putIfAbsent(notificationName, new HashSet<>()); dispatchTable.get(notificationName).add(observer); } /** * Removes an observer so that it will no longer react to a {@link Notification}. * @param observer The observer to remove. * @param notificationName The name of the Notification to unregister the observer for. */ public void removeObserver(NotificationObserver observer, String notificationName) { Set<NotificationObserver> observers = dispatchTable.get(notificationName); if (observers != null) observers.remove(observer); } }
src/net.michaelsavich.notification/net/michaelsavich/notification/NotificationCenter.java
package net.michaelsavich.notification; import java.util.Map; import java.util.HashMap; import java.util.Set; import java.util.HashSet; /** * NotificationCenter objects register {@link NotificationObserver NotificationObservers} * to be notified when a certain {@link Notification} is posted. */ public abstract class NotificationCenter { /** * Gets the default <b>(synchronous)</b> NotificationCenter instance. * This method returns the same instance each time it is called, functioning like a singleton. * <p> * Note both that this method and {@link NotificationCenter#primaryAsync()} return different instances, and that * the object returned by this method notifies observers <b>synchronously.</b> * </p> * <p> * Calling this method for the first time creates a new NotificationCenter, as the field backing * it is <a href=https://en.wikipedia.org/wiki/Lazy_initialization>lazily initialized</a>. Suffice it to say, * if you do not intend to use the NotificationCenter provided by this method, it is best to avoid calling it entirely. * </p> * @return An instance of a concrete NotificationCenter subclass. */ public static NotificationCenter primary() { if (primary == null) { primary = new SynchronousNotificationCenter(); } return primary; } private static SynchronousNotificationCenter primary = null; /** * Gets the default <b>(asynchronous)</b> NotificationCenter instance. * This method returns the same instance each time it is called, functioning like a singleton. * <p> * Note both that this method and {@link NotificationCenter#primary()} return different instances, and that * the object returned by this method notifies observers <b>asynchronously.</b> * </p> * <p> * Calling this method the first time creates a new NotificationCenter, that is to say, the field backing * it is <a href=https://en.wikipedia.org/wiki/Lazy_initialization>lazily initialized</a>. Suffice it to say, * if you do not intend to use the NotificationCenter provided by this method, it is best to avoid calling it entirely. * </p> * @return An instance of a concrete NotificationCenter subclass. */ public static NotificationCenter primaryAsync() { throw new UnsupportedOperationException("Unimplemented method!"); } /** * The Map used to route incoming {@link Notification} objects to their registered {@link NotificationObserver NotificationObservers}. * Primarily of interest to subclasses. <p>Note that if a subclass overrides all methods of NotificationCenter, it is safe to ignore this field * and use a different class to store the information required for dispatching.</p> */ protected Map<String,Set<NotificationObserver>> dispatchTable = new HashMap<>(); /** * Posts a {@link Notification} that observers can react to. * @param notification The Notification to post. */ public abstract void post(Notification notification); /** * Posts a {@link Notification} with the specified name. * Equivalent to calling {@code NotificationCenter.post(new Notification(notificationName, null))}. * @param notificationName The Notification to post. */ public void post(String notificationName) { this.post(new Notification(notificationName, null)); } /** * Adds an observer that reacts when a specific {@link Notification} is posted. * More than one object can register to observe a Notification. * @param observer The observer to add. * @param notificationName The name of the Notification to register the observer for. */ public void addObserver(NotificationObserver observer, String notificationName) { dispatchTable.putIfAbsent(notificationName, new HashSet<>()); dispatchTable.get(notificationName).add(observer); } /** * Removes an observer so that it will no longer react to a {@link Notification}. * @param observer The observer to remove. * @param notificationName The name of the Notification to unregister the observer for. */ public void removeObserver(NotificationObserver observer, String notificationName) { Set<NotificationObserver> observers = dispatchTable.get(notificationName); if (observers != null) observers.remove(observer); } }
Implement primaryAsync
src/net.michaelsavich.notification/net/michaelsavich/notification/NotificationCenter.java
Implement primaryAsync
<ide><path>rc/net.michaelsavich.notification/net/michaelsavich/notification/NotificationCenter.java <ide> * @return An instance of a concrete NotificationCenter subclass. <ide> */ <ide> public static NotificationCenter primaryAsync() { <del> throw new UnsupportedOperationException("Unimplemented method!"); <add> if (primaryAsync == null) { <add> primaryAsync = new AsynchronousNotificationCenter(); <add> } <add> return primaryAsync; <ide> } <add> private static AsynchronousNotificationCenter primaryAsync = null; <ide> <ide> /** <ide> * The Map used to route incoming {@link Notification} objects to their registered {@link NotificationObserver NotificationObservers}.
Java
apache-2.0
3ae3a796680561ddc1bf6bd2e49dd27df8743969
0
billho/symphony,billho/symphony,billho/symphony
/* * Symphony - A modern community (forum/SNS/blog) platform written in Java. * Copyright (C) 2012-2018, b3log.org & hacpai.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.b3log.symphony.processor.advice; import org.b3log.latke.Keys; import org.b3log.latke.ioc.inject.Inject; import org.b3log.latke.ioc.inject.Named; import org.b3log.latke.ioc.inject.Singleton; import org.b3log.latke.logging.Level; import org.b3log.latke.logging.Logger; import org.b3log.latke.model.User; import org.b3log.latke.service.LangPropsService; import org.b3log.latke.servlet.DispatcherServlet; import org.b3log.latke.servlet.HTTPRequestContext; import org.b3log.latke.servlet.advice.BeforeRequestProcessAdvice; import org.b3log.latke.servlet.advice.RequestProcessAdviceException; import org.b3log.latke.servlet.handler.MatchResult; import org.b3log.latke.servlet.handler.RequestDispatchHandler; import org.b3log.latke.util.Stopwatchs; import org.b3log.symphony.model.Permission; import org.b3log.symphony.model.Role; import org.b3log.symphony.service.RoleQueryService; import org.b3log.symphony.util.Symphonys; import org.json.JSONObject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.lang.reflect.Method; import java.util.*; /** * Permission check. * * @author <a href="http://88250.b3log.org">Liang Ding</a> * @version 1.0.1.0, May 1, 2018 * @since 1.8.0 */ @Named @Singleton public class PermissionCheck extends BeforeRequestProcessAdvice { /** * Logger. */ private static final Logger LOGGER = Logger.getLogger(PermissionCheck.class); /** * URL permission rules. * <p> * &lt;"url:method", permissions&gt; * </p> */ private static final Map<String, Set<String>> URL_PERMISSION_RULES = new HashMap<>(); static { // Loads permission URL rules final String prefix = "permission.rule.url."; final Set<String> keys = Symphonys.CFG.keySet(); for (final String key : keys) { if (key.startsWith(prefix)) { final String value = Symphonys.CFG.getString(key); final Set<String> permissions = new HashSet<>(Arrays.asList(value.split(","))); URL_PERMISSION_RULES.put(key, permissions); } } } /** * Language service. */ @Inject private LangPropsService langPropsService; /** * Role query service. */ @Inject private RoleQueryService roleQueryService; @Override public void doAdvice(final HTTPRequestContext context, final Map<String, Object> args) throws RequestProcessAdviceException { Stopwatchs.start("Check Permissions"); try { final HttpServletRequest request = context.getRequest(); final JSONObject exception = new JSONObject(); exception.put(Keys.MSG, langPropsService.get("noPermissionLabel")); exception.put(Keys.STATUS_CODE, HttpServletResponse.SC_FORBIDDEN); final String prefix = "permission.rule.url."; final String requestURI = request.getRequestURI(); final String method = request.getMethod(); String rule = prefix; final RequestDispatchHandler requestDispatchHandler = (RequestDispatchHandler) DispatcherServlet.SYS_HANDLER.get(2 /* DispatcherServlet#L69 */); try { final Method doMatch = RequestDispatchHandler.class.getDeclaredMethod("doMatch", String.class, String.class); doMatch.setAccessible(true); final MatchResult matchResult = (MatchResult) doMatch.invoke(requestDispatchHandler, requestURI, method); rule += matchResult.getMatchedPattern() + "." + method; } catch (final Exception e) { LOGGER.log(Level.ERROR, "Match method failed", e); throw new RequestProcessAdviceException(exception); } final Set<String> requisitePermissions = URL_PERMISSION_RULES.get(rule); if (null == requisitePermissions) { return; } final JSONObject user = (JSONObject) request.getAttribute(User.USER); final String roleId = null != user ? user.optString(User.USER_ROLE) : Role.ROLE_ID_C_VISITOR; final Set<String> grantPermissions = roleQueryService.getPermissions(roleId); if (!Permission.hasPermission(requisitePermissions, grantPermissions)) { throw new RequestProcessAdviceException(exception); } } finally { Stopwatchs.end(); } } }
src/main/java/org/b3log/symphony/processor/advice/PermissionCheck.java
/* * Symphony - A modern community (forum/SNS/blog) platform written in Java. * Copyright (C) 2012-2018, b3log.org & hacpai.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.b3log.symphony.processor.advice; import org.b3log.latke.Keys; import org.b3log.latke.ioc.inject.Inject; import org.b3log.latke.ioc.inject.Named; import org.b3log.latke.ioc.inject.Singleton; import org.b3log.latke.logging.Level; import org.b3log.latke.logging.Logger; import org.b3log.latke.model.User; import org.b3log.latke.service.LangPropsService; import org.b3log.latke.servlet.DispatcherServlet; import org.b3log.latke.servlet.HTTPRequestContext; import org.b3log.latke.servlet.advice.BeforeRequestProcessAdvice; import org.b3log.latke.servlet.advice.RequestProcessAdviceException; import org.b3log.latke.servlet.handler.MatchResult; import org.b3log.latke.servlet.handler.RequestDispatchHandler; import org.b3log.latke.util.Stopwatchs; import org.b3log.symphony.model.Permission; import org.b3log.symphony.model.Role; import org.b3log.symphony.service.RoleQueryService; import org.b3log.symphony.util.Symphonys; import org.json.JSONObject; import javax.servlet.http.HttpServletRequest; import java.lang.reflect.Method; import java.util.*; /** * Permission check. * * @author <a href="http://88250.b3log.org">Liang Ding</a> * @version 1.0.0.2, Dec 19, 2016 * @since 1.8.0 */ @Named @Singleton public class PermissionCheck extends BeforeRequestProcessAdvice { /** * Logger. */ private static final Logger LOGGER = Logger.getLogger(PermissionCheck.class); /** * URL permission rules. * <p> * &lt;"url:method", permissions&gt; * </p> */ private static final Map<String, Set<String>> URL_PERMISSION_RULES = new HashMap<>(); static { // Loads permission URL rules final String prefix = "permission.rule.url."; final Set<String> keys = Symphonys.CFG.keySet(); for (final String key : keys) { if (key.startsWith(prefix)) { final String value = Symphonys.CFG.getString(key); final Set<String> permissions = new HashSet<>(Arrays.asList(value.split(","))); URL_PERMISSION_RULES.put(key, permissions); } } } /** * Language service. */ @Inject private LangPropsService langPropsService; /** * Role query service. */ @Inject private RoleQueryService roleQueryService; @Override public void doAdvice(final HTTPRequestContext context, final Map<String, Object> args) throws RequestProcessAdviceException { Stopwatchs.start("Check Permissions"); try { final HttpServletRequest request = context.getRequest(); final JSONObject exception = new JSONObject(); exception.put(Keys.MSG, langPropsService.get("noPermissionLabel")); exception.put(Keys.STATUS_CODE, false); final String prefix = "permission.rule.url."; final String requestURI = request.getRequestURI(); final String method = request.getMethod(); String rule = prefix; final RequestDispatchHandler requestDispatchHandler = (RequestDispatchHandler) DispatcherServlet.SYS_HANDLER.get(2 /* DispatcherServlet#L69 */); try { final Method doMatch = RequestDispatchHandler.class.getDeclaredMethod("doMatch", String.class, String.class); doMatch.setAccessible(true); final MatchResult matchResult = (MatchResult) doMatch.invoke(requestDispatchHandler, requestURI, method); rule += matchResult.getMatchedPattern() + "." + method; } catch (final Exception e) { LOGGER.log(Level.ERROR, "Match method failed", e); throw new RequestProcessAdviceException(exception); } final Set<String> requisitePermissions = URL_PERMISSION_RULES.get(rule); if (null == requisitePermissions) { return; } final JSONObject user = (JSONObject) request.getAttribute(User.USER); final String roleId = null != user ? user.optString(User.USER_ROLE) : Role.ROLE_ID_C_VISITOR; final Set<String> grantPermissions = roleQueryService.getPermissions(roleId); if (!Permission.hasPermission(requisitePermissions, grantPermissions)) { throw new RequestProcessAdviceException(exception); } } finally { Stopwatchs.end(); } } }
:bug: Fix #622
src/main/java/org/b3log/symphony/processor/advice/PermissionCheck.java
:bug: Fix #622
<ide><path>rc/main/java/org/b3log/symphony/processor/advice/PermissionCheck.java <ide> import org.json.JSONObject; <ide> <ide> import javax.servlet.http.HttpServletRequest; <add>import javax.servlet.http.HttpServletResponse; <ide> import java.lang.reflect.Method; <ide> import java.util.*; <ide> <ide> * Permission check. <ide> * <ide> * @author <a href="http://88250.b3log.org">Liang Ding</a> <del> * @version 1.0.0.2, Dec 19, 2016 <add> * @version 1.0.1.0, May 1, 2018 <ide> * @since 1.8.0 <ide> */ <ide> @Named <ide> <ide> final JSONObject exception = new JSONObject(); <ide> exception.put(Keys.MSG, langPropsService.get("noPermissionLabel")); <del> exception.put(Keys.STATUS_CODE, false); <add> exception.put(Keys.STATUS_CODE, HttpServletResponse.SC_FORBIDDEN); <ide> <ide> final String prefix = "permission.rule.url."; <ide> final String requestURI = request.getRequestURI();
JavaScript
mit
5942e80209c31ff5a04d8e02cc3663b6ab6278fc
0
deividmarques/locawebstyle,deividmarques/locawebstyle,diegoeis/locawebstyle,EveraldoReis/locawebstyle,MaizerGomes/locawebstyle,locaweb/locawebstyle,locaweb/locawebstyle,EveraldoReis/locawebstyle,MaizerGomes/locawebstyle,diegoeis/locawebstyle,EveraldoReis/locawebstyle,MaizerGomes/locawebstyle,deividmarques/locawebstyle,locaweb/locawebstyle,diegoeis/locawebstyle
var locastyle = locastyle || {}; locastyle.steps = (function() { 'use strict'; var config = { selectors: { moduleActive: '.ls-actived [data-ls-module="steps"]', nav: '.ls-steps-nav', button: '.ls-steps-btn', container: '.ls-steps-content', parent: '.ls-steps', moduleVisible: '.ls-steps-content:visible' }, status: { active: 'ls-active', actived: 'ls-actived' }, classes: { active: '.ls-active' }, actions:{ next: '.ls-steps-content [data-action="next"]', prev: '.ls-steps-content [data-action="prev"]' } }; function init() { unbind(); createArrow(); ariaSteps(); addAriaLabel(); addActivedNav(); bindClickOnTriggers(); bindNextStep(); bindPrevStep(); } // Remove the binds that own module adds function unbind() { $(config.selectors.nav).off('click.steps'); $(config.actions.next).off('click.steps'); $(config.actions.prev).off('click.steps'); } // Create arrow on the navigation function createArrow() { $('.ls-steps-nav li').prepend('<span class="ls-steps-arrow" />'); } // Add the arias function ariaSteps() { $(config.selectors.nav).attr('role' , 'tablist'); $(config.selectors.nav).find(config.selectors.button).attr('aria-selected' , 'false'); $(config.selectors.nav).find('.ls-active .ls-steps-btn').attr('aria-selected' , 'true'); $(config.selectors.button).attr('role' , 'tab'); $(config.selectors.container).attr({ 'aria-hidden' : true, 'role' : 'tabpanel' }); } //Add aria-label in the navigation function addAriaLabel() { var $elem = $(config.selectors.button); var elemLength = $elem.length; for (var i=0; i < elemLength; i++) { var text = $($elem[i]).attr('title'); $($elem[i]).attr({ 'aria-label' : text }); } } // Displays the contents related to the active button function addActivedNav() { var index = $(config.selectors.nav).find(config.classes.active).index(); // Checks if there are any enabled button to load the page if(index === -1) { $(config.selectors.nav).each(function() { var $el = $(this).find('li:first').find(config.selectors.button); var $target = $el.data('target'); activateStep($el, $($target)); }); } else { addActiveContent(index); $(config.selectors.nav).find('li:lt(' + index + ')').addClass(config.status.actived); } var heightStepVisible = $(config.selectors.moduleVisible).height(); stepsAffix(heightStepVisible); } //Create the step by activated navigation buttons function bindClickOnTriggers() { $(config.selectors.nav).on("click.steps", config.selectors.moduleActive, function(evt) { evt.preventDefault(); changeStep($(this)); }); } // Bind the target to cal the nextStep on click function bindNextStep() { $(config.actions.next).on('click.steps', function(evt) { evt.preventDefault(); nextStep(); }); } // Bind the target to call the prevStep on click function bindPrevStep() { $(config.actions.prev).on('click.steps', function(evt) { evt.preventDefault(); prevStep(); }); } // Advances to the next step function nextStep() { // TODO: when change the minor version we can remove this old event. var evt = jQuery.Event('NextStepEvent'); $(document).trigger(evt); var beforeEvent = jQuery.Event('BeforeNextStep'); $(document).trigger(beforeEvent); if(!evt.isDefaultPrevented() && !beforeEvent.isDefaultPrevented()) { var $el = $(config.selectors.nav).find(config.classes.active).next('li').addClass(config.status.active).find(config.selectors.button); changeStep($el); $(document).trigger(jQuery.Event('AfterNextStep')); } } // Back to the previous step function prevStep() { // TODO: when change the minor version we can remove this old event. var evt = jQuery.Event('PrevStepEvent'); $(document).trigger(evt); var beforeEvent = jQuery.Event('BeforePrevStep'); $(document).trigger(beforeEvent); if(!evt.isDefaultPrevented() && !beforeEvent.isDefaultPrevented()) { var $el = $(config.selectors.nav).find(config.classes.active).prev('li').find(config.selectors.button); changeStep($el); $(document).trigger(jQuery.Event('AfterPrevStep')); } } // Always visible navigation when the page scrolls function stepsAffix(elemVisible) { var $steps = $(config.selectors.nav); var offset = $steps.offset(); var $heightNav = $(config.selectors.nav).height(); $(window).scroll(function() { if ($(window).scrollTop() > offset.top ) { var $scroll = parseInt($(window).scrollTop() - $heightNav, 10); $steps.stop().animate({ marginTop: $(window).scrollTop() - offset.top + 20 }); if($scroll + $heightNav >= elemVisible ) { $steps.stop().animate({ marginTop: 0 }); } } else { $steps.stop().animate({ marginTop: 0 }); } }); } // Check what the order of the activated button function addActiveContent(index) { $(config.selectors.container).eq(index).addClass(config.status.active); } // Change the step function changeStep($el) { var $target = $($el.attr('href') || $el.data('target')); activateStep($el, $target); deactivateStep($el, $target); anchorSteps(); } //Active step function activateStep(el, $target) { $(el).parents("li").addClass(config.status.active); $(el).parents("li").prev('li').addClass(config.status.actived); $target.addClass(config.status.active).attr({ 'aria-hidden' : false }); $(el).attr('aria-selected' , true); } //Desactive step function deactivateStep(el, $target) { $(el).parents("li").siblings().removeClass(config.status.active); $target.siblings().removeClass(config.status.active).attr({ 'aria-hidden' : true }); $(el).parents("li").siblings().find(config.selectors.button).attr('aria-selected' , false); } // Create scrollTop when to click function anchorSteps() { $('html, body').stop().animate({scrollTop: $('.ls-steps').offset().top - 60}, 300); var heightStepVisible = $(config.selectors.moduleVisible).height(); stepsAffix(heightStepVisible); } return { init: init, unbind: unbind, nextStep: nextStep, prevStep: prevStep }; }());
source/assets/javascripts/locastyle/_steps.js
var locastyle = locastyle || {}; locastyle.steps = (function() { 'use strict'; var config = { selectors: { moduleActive: '.ls-actived [data-ls-module="steps"]', nav: '.ls-steps-nav', button: '.ls-steps-btn', container: '.ls-steps-content', parent: '.ls-steps', moduleVisible: '.ls-steps-content:visible' }, status: { active: 'ls-active', actived: 'ls-actived' }, classes: { active: '.ls-active' }, actions:{ next: '.ls-steps-content [data-action="next"]', prev: '.ls-steps-content [data-action="prev"]' } }; function init() { unbind(); createArrow(); ariaSteps(); addAriaLabel(); addActivedNav(); bindClickOnTriggers(); bindNextStep(); bindPrevStep(); } // Remove the binds that own module adds function unbind() { $(config.selectors.nav).off('click.steps'); $(config.actions.next).off('click.steps'); $(config.actions.prev).off('click.steps'); } // Create arrow on the navigation function createArrow() { $('.ls-steps-nav li').prepend('<span class="ls-steps-arrow" />'); } // Add the arias function ariaSteps() { $(config.selectors.nav).attr('role' , 'tablist'); $(config.selectors.nav).find(config.selectors.button).attr('aria-selected' , 'false'); $(config.selectors.nav).find('.ls-active .ls-steps-btn').attr('aria-selected' , 'true'); $(config.selectors.button).attr('role' , 'tab'); $(config.selectors.container).attr({ 'aria-hidden' : true, 'role' : 'tabpanel' }); } //Add aria-label in the navigation function addAriaLabel() { var $elem = $(config.selectors.button); var elemLength = $elem.length; for (var i=0; i < elemLength; i++) { var text = $($elem[i]).attr('title'); $($elem[i]).attr({ 'aria-label' : text }); } } // Displays the contents related to the active button function addActivedNav() { var index = $(config.selectors.nav).find(config.classes.active).index(); // Checks if there are any enabled button to load the page if(index === -1) { $(config.selectors.nav).each(function() { var $el = $(this).find('li:first').find(config.selectors.button); var $target = $el.data('target'); activateStep($el, $($target)); }); } else { addActiveContent(index); $(config.selectors.nav).find('li:lt(' + index + ')').addClass(config.status.actived); } var heightStepVisible = $(config.selectors.moduleVisible).height(); stepsAffix(heightStepVisible); } //Create the step by activated navigation buttons function bindClickOnTriggers() { $(config.selectors.nav).on("click.steps", config.selectors.moduleActive, function(evt) { evt.preventDefault(); changeStep($(this)); }); } // Bind the target to cal the nextStep on click function bindNextStep() { $(config.actions.next).on('click.steps', function(evt) { evt.preventDefault(); nextStep(); }); } // Bind the target to call the prevStep on click function bindPrevStep() { $(config.actions.prev).on('click.steps', function(evt) { evt.preventDefault(); prevStep(); }); } // Advances to the next step function nextStep() { // TODO: when change the minor version we can remove this old event. var evt = jQuery.Event('NextStepEvent'); $(document).trigger(evt); var beforeEvent = jQuery.Event('BeforeNextStep'); $(document).trigger(beforeEvent); if(!evt.isDefaultPrevented() && !beforeEvent.isDefaultPrevented()) { var $el = $(config.selectors.nav).find(config.classes.active).next('li').addClass(config.status.active).find(config.selectors.button); changeStep($el); $(document).trigger(jQuery.Event('AfterNextStep')); } } // Back to the previous step function prevStep() { // TODO: when change the minor version we can remove this old event. var evt = jQuery.Event('PrevStepEvent'); $(document).trigger(evt); var beforeEvent = jQuery.Event('BeforePrevStep'); $(document).trigger(beforeEvent); if(!evt.isDefaultPrevented() && !beforeEvent.isDefaultPrevented()) { var $el = $(config.selectors.nav).find(config.classes.active).prev('li').find(config.selectors.button); changeStep($el); $(document).trigger(jQuery.Event('AfterPrevStep')); } } // Always visible navigation when the page scrolls function stepsAffix(elemVisible) { var $steps = $(config.selectors.nav); var offset = $steps.offset(); var $heightNav = $(config.selectors.nav).height(); $(window).scroll(function() { if ($(window).scrollTop() > offset.top ) { var $scroll = parseInt($(window).scrollTop() - $heightNav); $steps.stop().animate({ marginTop: $(window).scrollTop() - offset.top + 20 }); if($scroll + $heightNav >= elemVisible ) { $steps.stop().animate({ marginTop: 0 }); } } else { $steps.stop().animate({ marginTop: 0 }); } }); } // Check what the order of the activated button function addActiveContent(index) { $(config.selectors.container).eq(index).addClass(config.status.active); } // Change the step function changeStep($el) { var $target = $($el.attr('href') || $el.data('target')); activateStep($el, $target); deactivateStep($el, $target); anchorSteps(); } //Active step function activateStep(el, $target) { $(el).parents("li").addClass(config.status.active); $(el).parents("li").prev('li').addClass(config.status.actived); $target.addClass(config.status.active).attr({ 'aria-hidden' : false }); $(el).attr('aria-selected' , true); } //Desactive step function deactivateStep(el, $target) { $(el).parents("li").siblings().removeClass(config.status.active); $target.siblings().removeClass(config.status.active).attr({ 'aria-hidden' : true }); $(el).parents("li").siblings().find(config.selectors.button).attr('aria-selected' , false); } // Create scrollTop when to click function anchorSteps() { $('html, body').stop().animate({scrollTop: $('.ls-steps').offset().top - 60}, 300); var heightStepVisible = $(config.selectors.moduleVisible).height(); stepsAffix(heightStepVisible); } return { init: init, unbind: unbind, nextStep: nextStep, prevStep: prevStep }; }());
add missing radix param
source/assets/javascripts/locastyle/_steps.js
add missing radix param
<ide><path>ource/assets/javascripts/locastyle/_steps.js <ide> <ide> $(window).scroll(function() { <ide> if ($(window).scrollTop() > offset.top ) { <del> var $scroll = parseInt($(window).scrollTop() - $heightNav); <add> var $scroll = parseInt($(window).scrollTop() - $heightNav, 10); <ide> <ide> $steps.stop().animate({ <ide> marginTop: $(window).scrollTop() - offset.top + 20
JavaScript
mit
678d543743889a8f545de6e482be80eabea37469
0
delphiactual/DIM,bhollis/DIM,DestinyItemManager/DIM,delphiactual/DIM,DestinyItemManager/DIM,DestinyItemManager/DIM,chrisfried/DIM,delphiactual/DIM,bhollis/DIM,chrisfried/DIM,chrisfried/DIM,bhollis/DIM,DestinyItemManager/DIM,chrisfried/DIM,bhollis/DIM,delphiactual/DIM
const webpack = require('webpack'); const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const CleanWebpackPlugin = require('clean-webpack-plugin'); const WorkboxPlugin = require('workbox-webpack-plugin'); const WebpackNotifierPlugin = require('webpack-notifier'); const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const HtmlWebpackIncludeSiblingChunksPlugin = require('html-webpack-include-sibling-chunks-plugin'); // const Visualizer = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; const NotifyPlugin = require('notify-webpack-plugin'); const ASSET_NAME_PATTERN = 'static/[name]-[hash:6].[ext]'; const packageJson = require('../package.json'); module.exports = (env) => { const isDev = env === 'dev'; let version = packageJson.version.toString(); if (env === 'beta' && process.env.TRAVIS_BUILD_NUMBER) { version += `.${process.env.TRAVIS_BUILD_NUMBER}`; } // Used for the changelog anchor const versionNoDots = version.replace(/\./g, ''); const config = { mode: isDev ? 'development' : 'production', entry: { main: './src/index.js', browsercheck: './src/browsercheck.js', authReturn: './src/authReturn.js', gdriveReturn: './src/gdriveReturn.js' }, output: { path: path.resolve('./dist'), publicPath: '/', filename: '[name]-[contenthash:6].js', chunkFilename: '[id]-[contenthash:6].js' }, stats: 'minimal', devtool: 'source-map', performance: { // Don't warn about too-large chunks hints: false }, optimization: { // We always want the chunk name, otherwise it's just numbers namedChunks: true, // Extract the runtime into a separate chunk runtimeChunk: 'single', splitChunks: { chunks: "all", automaticNameDelimiter: "-" }, minimizer: [ new UglifyJSPlugin({ cache: true, parallel: true, exclude: [/sqlLib/, /sql-wasm/], // ensure the sqlLib chunk doesnt get minifed uglifyOptions: { compress: { warnings: false }, output: { comments: false } }, sourceMap: true }) ] }, module: { strictExportPresence: true, rules: [ { test: /\.js$/, exclude: [/node_modules/, /sql\.js/], loader: 'babel-loader', options: { cacheDirectory: true } }, { test: /\.html$/, loader: 'html-loader', options: { exportAsEs6Default: true } }, { test: /\.(jpg|png|eot|svg|ttf|woff(2)?)(\?v=\d+\.\d+\.\d+)?/, loader: 'url-loader', options: { limit: 5 * 1024, // only inline if less than 5kb name: ASSET_NAME_PATTERN } }, { test: /\.scss$/, use: [ MiniCssExtractPlugin.loader, 'css-loader', 'postcss-loader', 'sass-loader' ] }, { test: /\.css$/, use: [ MiniCssExtractPlugin.loader, 'css-loader' ] }, // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. { test: /\.tsx?$/, loader: "awesome-typescript-loader", options: { useBabel: true, useCache: true } }, // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. { enforce: "pre", test: /\.js$/, loader: "source-map-loader" }, { type: 'javascript/auto', test: /\.json/, include: /src\/locale/, use: [{ loader: 'file-loader', options: { name: '[name]-[hash:6].[ext]' }, }], }, { type: 'javascript/auto', test: /\.wasm/ } ], noParse: function(path) { return path.endsWith('sql.js/js/sql.js'); } }, resolve: { extensions: ['.js', '.json', '.ts', '.tsx'], alias: { app: path.resolve('./src') } }, plugins: [ new webpack.IgnorePlugin(/caniuse-lite\/data\/regions/), new webpack.ProvidePlugin({ i18next: 'i18next', 'window.i18next': 'i18next' }), new NotifyPlugin('DIM', !isDev), new MiniCssExtractPlugin({ filename: "[name]-[contenthash:6].css", chunkFilename: "[id]-[contenthash:6].css" }), new HtmlWebpackPlugin({ inject: true, filename: 'index.html', template: '!html-loader!src/index.html', chunks: ['main', 'browsercheck'] }), new HtmlWebpackPlugin({ inject: true, filename: 'return.html', template: '!html-loader!src/return.html', chunks: ['authReturn'] }), new HtmlWebpackPlugin({ inject: true, filename: 'gdrive-return.html', template: '!html-loader!src/gdrive-return.html', chunks: ['gdriveReturn'] }), // Fix some chunks not showing up in Webpack 4 new HtmlWebpackIncludeSiblingChunksPlugin(), new CopyWebpackPlugin([ { from: './src/.htaccess' }, { from: './extension', to: '../extension-dist' }, { from: `./icons/${env}-extension/`, to: '../extension-dist' }, { from: './src/manifest-webapp.json' }, { from: './src/data', to: 'data/' }, { from: `./icons/${env}/` }, { from: './src/safari-pinned-tab.svg' }, ]), new webpack.DefinePlugin({ $DIM_VERSION: JSON.stringify(version), $DIM_FLAVOR: JSON.stringify(env), $DIM_BUILD_DATE: JSON.stringify(Date.now()), $DIM_CHANGELOG: JSON.stringify(`https://github.com/DestinyItemManager/DIM/blob/master/docs/CHANGELOG.md#${env === 'release' ? versionNoDots : 'next'}`), // These are set from the Travis repo settings instead of .travis.yml $DIM_WEB_API_KEY: JSON.stringify(process.env.WEB_API_KEY), $DIM_WEB_CLIENT_ID: JSON.stringify(process.env.WEB_OAUTH_CLIENT_ID), $DIM_WEB_CLIENT_SECRET: JSON.stringify(process.env.WEB_OAUTH_CLIENT_SECRET), $GOOGLE_DRIVE_CLIENT_ID: JSON.stringify('22022180893-raop2mu1d7gih97t5da9vj26quqva9dc.apps.googleusercontent.com'), $BROWSERS: JSON.stringify(packageJson.browserslist), // Feature flags! // Print debug info to console about item moves '$featureFlags.debugMoves': JSON.stringify(false), // show changelog toaster '$featureFlags.changelogToaster': JSON.stringify(env === 'release'), '$featureFlags.reviewsEnabled': JSON.stringify(true), // Sync data over gdrive '$featureFlags.gdrive': JSON.stringify(true), '$featureFlags.debugSync': JSON.stringify(env !== 'release'), // Use a WebAssembly version of SQLite, if possible (this crashes on Chrome 58 on Android though) '$featureFlags.wasm': JSON.stringify(true), // Enable color-blind a11y '$featureFlags.colorA11y': JSON.stringify(true), // Whether to log page views for router events '$featureFlags.googleAnalyticsForRouter': JSON.stringify(true), // Debug ui-router '$featureFlags.debugRouter': JSON.stringify(false), // Send exception reports to Sentry.io on beta only '$featureFlags.sentry': JSON.stringify(env === 'beta'), // D2 Vendors '$featureFlags.vendors': JSON.stringify(true), }), // Enable if you want to debug the size of the chunks // new Visualizer(), ], node: { fs: 'empty', net: 'empty', tls: 'empty' } }; if (isDev) { config.plugins.push(new WebpackNotifierPlugin({ title: 'DIM', alwaysNotify: true, contentImage: path.join(__dirname, '../icons/release/favicon-96x96.png') })); return config; } else { // Bail and fail hard on first error config.bail = true; config.stats = 'normal'; config.plugins.push(new CleanWebpackPlugin([ 'dist', '.awcache', 'node_modules/.cache' ], { root: path.resolve('./') })); // Tell React we're in Production mode config.plugins.push(new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('production'), 'process.env': JSON.stringify({ NODE_ENV: 'production' }) })); // Generate a service worker config.plugins.push(new WorkboxPlugin({ maximumFileSizeToCacheInBytes: 5000000, globPatterns: ['**/*.{html,js,css,woff2,json}', 'static/*.{png,jpg}'], globIgnores: [ 'data/**', 'manifest-*.js', 'extension-scripts/*', 'service-worker.js' ], swSrc: './dist/service-worker.js', swDest: './dist/service-worker.js' })); } // Build the service worker in an entirely separate configuration so // it doesn't get name-mangled. It'll be used by the // WorkboxPlugin. This lets us inline the dependencies. const serviceWorker = { mode: isDev ? 'development' : 'production', entry: { 'service-worker': './src/service-worker.js' }, output: { path: path.resolve('./dist'), filename: '[name].js' }, stats: 'errors-only' }; return [serviceWorker, config]; };
config/webpack.js
const webpack = require('webpack'); const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const CleanWebpackPlugin = require('clean-webpack-plugin'); const WorkboxPlugin = require('workbox-webpack-plugin'); const WebpackNotifierPlugin = require('webpack-notifier'); const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const HtmlWebpackIncludeSiblingChunksPlugin = require('html-webpack-include-sibling-chunks-plugin'); // const Visualizer = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; const NotifyPlugin = require('notify-webpack-plugin'); const ASSET_NAME_PATTERN = 'static/[name]-[hash:6].[ext]'; const packageJson = require('../package.json'); module.exports = (env) => { const isDev = env === 'dev'; let version = packageJson.version.toString(); if (env === 'beta' && process.env.TRAVIS_BUILD_NUMBER) { version += `.${process.env.TRAVIS_BUILD_NUMBER}`; } // Used for the changelog anchor const versionNoDots = version.replace(/\./g, ''); const config = { mode: isDev ? 'development' : 'production', entry: { main: './src/index.js', browsercheck: './src/browsercheck.js', authReturn: './src/authReturn.js', gdriveReturn: './src/gdriveReturn.js' }, output: { path: path.resolve('./dist'), publicPath: '/', filename: '[name]-[contenthash:6].js', chunkFilename: '[id]-[contenthash:6].js' }, stats: 'errors-only', devtool: 'source-map', performance: { // Don't warn about too-large chunks hints: false }, optimization: { runtimeChunk: 'single', splitChunks: { chunks: "all", automaticNameDelimiter: "-" }, minimizer: [ new UglifyJSPlugin({ cache: true, parallel: true, exclude: [/sqlLib/, /sql-wasm/], // ensure the sqlLib chunk doesnt get minifed uglifyOptions: { compress: { warnings: false }, output: { comments: false } }, sourceMap: true }) ] }, module: { strictExportPresence: true, rules: [ { test: /\.js$/, exclude: [/node_modules/, /sql\.js/], loader: 'babel-loader', options: { cacheDirectory: true } }, { test: /\.html$/, loader: 'html-loader', options: { exportAsEs6Default: true } }, { test: /\.(jpg|png|eot|svg|ttf|woff(2)?)(\?v=\d+\.\d+\.\d+)?/, loader: 'url-loader', options: { limit: 5 * 1024, // only inline if less than 5kb name: ASSET_NAME_PATTERN } }, { test: /\.scss$/, use: [ MiniCssExtractPlugin.loader, 'css-loader', 'postcss-loader', 'sass-loader' ] }, { test: /\.css$/, use: [ MiniCssExtractPlugin.loader, 'css-loader' ] }, // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. { test: /\.tsx?$/, loader: "awesome-typescript-loader", options: { useBabel: true, useCache: true } }, // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. { enforce: "pre", test: /\.js$/, loader: "source-map-loader" }, { type: 'javascript/auto', test: /\.json/, include: /src\/locale/, use: [{ loader: 'file-loader', options: { name: '[name]-[hash:6].[ext]' }, }], }, { type: 'javascript/auto', test: /\.wasm/ } ], noParse: function(path) { return path.endsWith('sql.js/js/sql.js'); } }, resolve: { extensions: ['.js', '.json', '.ts', '.tsx'], alias: { app: path.resolve('./src') } }, plugins: [ new webpack.IgnorePlugin(/caniuse-lite\/data\/regions/), new webpack.ProvidePlugin({ i18next: 'i18next', 'window.i18next': 'i18next' }), new NotifyPlugin('DIM', !isDev), new MiniCssExtractPlugin({ filename: "[name]-[contenthash:6].css", chunkFilename: "[id]-[contenthash:6].css" }), new HtmlWebpackPlugin({ inject: true, filename: 'index.html', template: '!html-loader!src/index.html', chunks: ['main', 'browsercheck'] }), new HtmlWebpackPlugin({ inject: true, filename: 'return.html', template: '!html-loader!src/return.html', chunks: ['authReturn'] }), new HtmlWebpackPlugin({ inject: true, filename: 'gdrive-return.html', template: '!html-loader!src/gdrive-return.html', chunks: ['gdriveReturn'] }), // Fix some chunks not showing up in Webpack 4 new HtmlWebpackIncludeSiblingChunksPlugin(), new CopyWebpackPlugin([ { from: './src/.htaccess' }, { from: './extension', to: '../extension-dist' }, { from: `./icons/${env}-extension/`, to: '../extension-dist' }, { from: './src/manifest-webapp.json' }, { from: './src/data', to: 'data/' }, { from: `./icons/${env}/` }, { from: './src/safari-pinned-tab.svg' }, ]), new webpack.DefinePlugin({ $DIM_VERSION: JSON.stringify(version), $DIM_FLAVOR: JSON.stringify(env), $DIM_BUILD_DATE: JSON.stringify(Date.now()), $DIM_CHANGELOG: JSON.stringify(`https://github.com/DestinyItemManager/DIM/blob/master/docs/CHANGELOG.md#${env === 'release' ? versionNoDots : 'next'}`), // These are set from the Travis repo settings instead of .travis.yml $DIM_WEB_API_KEY: JSON.stringify(process.env.WEB_API_KEY), $DIM_WEB_CLIENT_ID: JSON.stringify(process.env.WEB_OAUTH_CLIENT_ID), $DIM_WEB_CLIENT_SECRET: JSON.stringify(process.env.WEB_OAUTH_CLIENT_SECRET), $GOOGLE_DRIVE_CLIENT_ID: JSON.stringify('22022180893-raop2mu1d7gih97t5da9vj26quqva9dc.apps.googleusercontent.com'), $BROWSERS: JSON.stringify(packageJson.browserslist), // Feature flags! // Print debug info to console about item moves '$featureFlags.debugMoves': JSON.stringify(false), // show changelog toaster '$featureFlags.changelogToaster': JSON.stringify(env === 'release'), '$featureFlags.reviewsEnabled': JSON.stringify(true), // Sync data over gdrive '$featureFlags.gdrive': JSON.stringify(true), '$featureFlags.debugSync': JSON.stringify(env !== 'release'), // Use a WebAssembly version of SQLite, if possible (this crashes on Chrome 58 on Android though) '$featureFlags.wasm': JSON.stringify(true), // Enable color-blind a11y '$featureFlags.colorA11y': JSON.stringify(true), // Whether to log page views for router events '$featureFlags.googleAnalyticsForRouter': JSON.stringify(true), // Debug ui-router '$featureFlags.debugRouter': JSON.stringify(false), // Send exception reports to Sentry.io on beta only '$featureFlags.sentry': JSON.stringify(env === 'beta'), // D2 Vendors '$featureFlags.vendors': JSON.stringify(true), }), // Enable if you want to debug the size of the chunks // new Visualizer(), ], node: { fs: 'empty', net: 'empty', tls: 'empty' } }; if (isDev) { config.plugins.push(new WebpackNotifierPlugin({ title: 'DIM', alwaysNotify: true, contentImage: path.join(__dirname, '../icons/release/favicon-96x96.png') })); return config; } else { // Bail and fail hard on first error config.bail = true; config.stats = 'verbose'; config.plugins.push(new CleanWebpackPlugin([ 'dist', '.awcache', 'node_modules/.cache' ], { root: path.resolve('./') })); // Tell React we're in Production mode config.plugins.push(new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('production'), 'process.env': JSON.stringify({ NODE_ENV: 'production' }) })); // Generate a service worker config.plugins.push(new WorkboxPlugin({ maximumFileSizeToCacheInBytes: 5000000, globPatterns: ['**/*.{html,js,css,woff2,json}', 'static/*.{png,jpg}'], globIgnores: [ 'data/**', 'manifest-*.js', 'extension-scripts/*', 'service-worker.js' ], swSrc: './dist/service-worker.js', swDest: './dist/service-worker.js' })); } // Build the service worker in an entirely separate configuration so // it doesn't get name-mangled. It'll be used by the // WorkboxPlugin. This lets us inline the dependencies. const serviceWorker = { mode: isDev ? 'development' : 'production', entry: { 'service-worker': './src/service-worker.js' }, output: { path: path.resolve('./dist'), filename: '[name].js' }, stats: 'errors-only' }; return [serviceWorker, config]; };
Clean up webpack
config/webpack.js
Clean up webpack
<ide><path>onfig/webpack.js <ide> chunkFilename: '[id]-[contenthash:6].js' <ide> }, <ide> <del> stats: 'errors-only', <add> stats: 'minimal', <ide> <ide> devtool: 'source-map', <ide> <ide> }, <ide> <ide> optimization: { <add> // We always want the chunk name, otherwise it's just numbers <add> namedChunks: true, <add> // Extract the runtime into a separate chunk <ide> runtimeChunk: 'single', <ide> splitChunks: { <ide> chunks: "all", <ide> } else { <ide> // Bail and fail hard on first error <ide> config.bail = true; <del> config.stats = 'verbose'; <add> config.stats = 'normal'; <ide> <ide> config.plugins.push(new CleanWebpackPlugin([ <ide> 'dist',
Java
lgpl-2.1
ed21c7955181a6066fdae2cd7a873a6fe06073b9
0
alisdev/dss,esig/dss,zsoltii/dss,openlimit-signcubes/dss,zsoltii/dss,alisdev/dss,openlimit-signcubes/dss,esig/dss
/** * DSS - Digital Signature Services * Copyright (C) 2015 European Commission, provided under the CEF programme * * This file is part of the "DSS - Digital Signature Services" project. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package eu.europa.esig.dss.x509; import java.io.IOException; import java.io.StringWriter; import java.security.PublicKey; import java.util.List; import org.bouncycastle.asn1.ASN1ObjectIdentifier; import org.bouncycastle.asn1.x509.CRLReason; import org.bouncycastle.cert.ocsp.BasicOCSPResp; import org.bouncycastle.cert.ocsp.CertificateStatus; import org.bouncycastle.cert.ocsp.OCSPResp; import org.bouncycastle.cert.ocsp.RevokedStatus; import org.bouncycastle.cert.ocsp.SingleResp; import org.bouncycastle.cert.ocsp.UnknownStatus; import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.operator.ContentVerifierProvider; import org.bouncycastle.operator.jcajce.JcaContentVerifierProviderBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import eu.europa.esig.dss.DSSException; import eu.europa.esig.dss.DSSRevocationUtils; import eu.europa.esig.dss.DSSUtils; import eu.europa.esig.dss.SignatureAlgorithm; import eu.europa.esig.dss.x509.crl.CRLReasonEnum; /** * OCSP Signed Token which encapsulate BasicOCSPResp (BC). */ @SuppressWarnings("serial") public class OCSPToken extends RevocationToken { private static final Logger logger = LoggerFactory.getLogger(OCSPToken.class); /** * The encapsulated basic OCSP response. */ private transient final BasicOCSPResp basicOCSPResp; /** * In case of online source this is the source URI. */ private String sourceURI; /** * The default constructor for OCSPToken. * * @param basicOCSPResp * The basic OCSP response. * @param singleResp */ public OCSPToken(final BasicOCSPResp basicOCSPResp, final SingleResp singleResp) { if (basicOCSPResp == null) { throw new NullPointerException(); } if (singleResp == null) { throw new NullPointerException(); } this.basicOCSPResp = basicOCSPResp; this.productionDate = basicOCSPResp.getProducedAt(); this.thisUpdate = singleResp.getThisUpdate(); this.nextUpdate = singleResp.getNextUpdate(); setStatus(singleResp.getCertStatus()); final ASN1ObjectIdentifier signatureAlgOID = basicOCSPResp.getSignatureAlgOID(); final SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.forOID(signatureAlgOID.getId()); this.signatureAlgorithm = signatureAlgorithm; this.extraInfo = new TokenValidationExtraInfo(); if (logger.isTraceEnabled()) { logger.trace("OCSP token, produced at '" + DSSUtils.formatInternal(productionDate) + "' created."); } } private void setStatus(final CertificateStatus certStatus) { if (certStatus == null) { status = true; return; } if (logger.isInfoEnabled()) { logger.info("OCSP certificate status: " + certStatus.getClass().getName()); } if (certStatus instanceof RevokedStatus) { if (logger.isInfoEnabled()) { logger.info("OCSP status revoked"); } final RevokedStatus revokedStatus = (RevokedStatus) certStatus; status = false; revocationDate = revokedStatus.getRevocationTime(); int reasonId = 0; // unspecified if (revokedStatus.hasRevocationReason()) { reasonId = revokedStatus.getRevocationReason(); } reason = CRLReasonEnum.fromInt(reasonId).name(); } else if (certStatus instanceof UnknownStatus) { if (logger.isInfoEnabled()) { logger.info("OCSP status unknown"); } reason = "OCSP status: unknown"; } } private String getRevocationReason(RevokedStatus revokedStatus) { int reasonId = getRevocationReasonId(revokedStatus); CRLReason crlReason = CRLReason.lookup(reasonId); return crlReason.toString(); } private int getRevocationReasonId(RevokedStatus revokedStatus) { try { return revokedStatus.getRevocationReason(); } catch (IllegalStateException e) { logger.warn("OCSP Revocation reason is not available: " + e.getMessage()); return 0; // Zero means 'unspecified' } } /** * @return the ocspResp */ public BasicOCSPResp getBasicOCSPResp() { return basicOCSPResp; } @Override public boolean isSignedBy(final CertificateToken issuerToken) { if (this.issuerToken != null) { return this.issuerToken.equals(issuerToken); } try { signatureInvalidityReason = ""; JcaContentVerifierProviderBuilder jcaContentVerifierProviderBuilder = new JcaContentVerifierProviderBuilder(); jcaContentVerifierProviderBuilder.setProvider(BouncyCastleProvider.PROVIDER_NAME); final PublicKey publicKey = issuerToken.getCertificate().getPublicKey(); ContentVerifierProvider contentVerifierProvider = jcaContentVerifierProviderBuilder.build(publicKey); signatureValid = basicOCSPResp.isSignatureValid(contentVerifierProvider); if (signatureValid) { this.issuerToken = issuerToken; } issuerX500Principal = issuerToken.getSubjectX500Principal(); } catch (Exception e) { signatureInvalidityReason = e.getClass().getSimpleName() + " - " + e.getMessage(); signatureValid = false; } return signatureValid; } @Override public String getSourceURL() { return sourceURI; } public void setSourceURI(final String sourceURI) { this.sourceURI = sourceURI; } /** * Indicates if the token signature is intact. * * @return {@code true} or {@code false} */ @Override public boolean isValid() { return signatureValid; } /** * This method returns the DSS abbreviation of the certificate. It is used * for debugging purpose. * * @return */ @Override public String getAbbreviation() { return "OCSPToken[" + DSSUtils.formatInternal(basicOCSPResp.getProducedAt()) + ", signedBy=" + (issuerToken == null ? "?" : issuerToken.getDSSIdAsString()) + "]"; } @Override public String toString(String indentStr) { final StringWriter out = new StringWriter(); out.append(indentStr).append("OCSPToken["); out.append("ProductionTime: ").append(DSSUtils.formatInternal(productionDate)).append("; "); out.append("ThisUpdate: ").append(DSSUtils.formatInternal(thisUpdate)).append("; "); out.append("NextUpdate: ").append(DSSUtils.formatInternal(nextUpdate)).append('\n'); out.append("SignedBy: ").append(issuerToken != null ? issuerToken.getDSSIdAsString() : null).append('\n'); indentStr += "\t"; out.append(indentStr).append("Signature algorithm: ").append(signatureAlgorithm == null ? "?" : signatureAlgorithm.getJCEId()).append('\n'); out.append(issuerToken != null ? issuerToken.toString(indentStr) : null).append('\n'); final List<String> validationExtraInfo = extraInfo.getValidationInfo(); if (validationExtraInfo.size() > 0) { for (final String info : validationExtraInfo) { out.append('\n').append(indentStr).append("\t- ").append(info); } out.append('\n'); } indentStr = indentStr.substring(1); out.append(indentStr).append("]"); return out.toString(); } @Override public byte[] getEncoded() { final OCSPResp ocspResp = DSSRevocationUtils.fromBasicToResp(basicOCSPResp); try { final byte[] bytes = ocspResp.getEncoded(); return bytes; } catch (IOException e) { throw new DSSException("OCSP encoding error: " + e.getMessage(), e); } } }
dss-spi/src/main/java/eu/europa/esig/dss/x509/OCSPToken.java
/** * DSS - Digital Signature Services * Copyright (C) 2015 European Commission, provided under the CEF programme * * This file is part of the "DSS - Digital Signature Services" project. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package eu.europa.esig.dss.x509; import java.io.IOException; import java.io.StringWriter; import java.security.PublicKey; import java.util.List; import org.bouncycastle.asn1.ASN1ObjectIdentifier; import org.bouncycastle.asn1.x509.CRLReason; import org.bouncycastle.cert.ocsp.BasicOCSPResp; import org.bouncycastle.cert.ocsp.CertificateStatus; import org.bouncycastle.cert.ocsp.OCSPResp; import org.bouncycastle.cert.ocsp.RevokedStatus; import org.bouncycastle.cert.ocsp.SingleResp; import org.bouncycastle.cert.ocsp.UnknownStatus; import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.operator.ContentVerifierProvider; import org.bouncycastle.operator.jcajce.JcaContentVerifierProviderBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import eu.europa.esig.dss.DSSException; import eu.europa.esig.dss.DSSRevocationUtils; import eu.europa.esig.dss.DSSUtils; import eu.europa.esig.dss.SignatureAlgorithm; /** * OCSP Signed Token which encapsulate BasicOCSPResp (BC). */ @SuppressWarnings("serial") public class OCSPToken extends RevocationToken { private static final Logger logger = LoggerFactory.getLogger(OCSPToken.class); /** * The encapsulated basic OCSP response. */ private transient final BasicOCSPResp basicOCSPResp; /** * In case of online source this is the source URI. */ private String sourceURI; /** * The default constructor for OCSPToken. * * @param basicOCSPResp * The basic OCSP response. * @param singleResp */ public OCSPToken(final BasicOCSPResp basicOCSPResp, final SingleResp singleResp) { if (basicOCSPResp == null) { throw new NullPointerException(); } if (singleResp == null) { throw new NullPointerException(); } this.basicOCSPResp = basicOCSPResp; this.productionDate = basicOCSPResp.getProducedAt(); this.thisUpdate = singleResp.getThisUpdate(); this.nextUpdate = singleResp.getNextUpdate(); setStatus(singleResp.getCertStatus()); final ASN1ObjectIdentifier signatureAlgOID = basicOCSPResp.getSignatureAlgOID(); final SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.forOID(signatureAlgOID.getId()); this.signatureAlgorithm = signatureAlgorithm; this.extraInfo = new TokenValidationExtraInfo(); if (logger.isTraceEnabled()) { logger.trace("OCSP token, produced at '" + DSSUtils.formatInternal(productionDate) + "' created."); } } private void setStatus(final CertificateStatus certStatus) { if (certStatus == null) { status = true; return; } if (logger.isInfoEnabled()) { logger.info("OCSP certificate status: " + certStatus.getClass().getName()); } if (certStatus instanceof RevokedStatus) { if (logger.isInfoEnabled()) { logger.info("OCSP status revoked"); } final RevokedStatus revokedStatus = (RevokedStatus) certStatus; status = false; revocationDate = revokedStatus.getRevocationTime(); int reasonId = 0; // unspecified if (revokedStatus.hasRevocationReason()) { reasonId = revokedStatus.getRevocationReason(); } final CRLReason crlReason = CRLReason.lookup(reasonId); reason = crlReason.toString(); } else if (certStatus instanceof UnknownStatus) { if (logger.isInfoEnabled()) { logger.info("OCSP status unknown"); } reason = "OCSP status: unknown"; } } private String getRevocationReason(RevokedStatus revokedStatus) { int reasonId = getRevocationReasonId(revokedStatus); CRLReason crlReason = CRLReason.lookup(reasonId); return crlReason.toString(); } private int getRevocationReasonId(RevokedStatus revokedStatus) { try { return revokedStatus.getRevocationReason(); } catch (IllegalStateException e) { logger.warn("OCSP Revocation reason is not available: " + e.getMessage()); return 0; // Zero means 'unspecified' } } /** * @return the ocspResp */ public BasicOCSPResp getBasicOCSPResp() { return basicOCSPResp; } @Override public boolean isSignedBy(final CertificateToken issuerToken) { if (this.issuerToken != null) { return this.issuerToken.equals(issuerToken); } try { signatureInvalidityReason = ""; JcaContentVerifierProviderBuilder jcaContentVerifierProviderBuilder = new JcaContentVerifierProviderBuilder(); jcaContentVerifierProviderBuilder.setProvider(BouncyCastleProvider.PROVIDER_NAME); final PublicKey publicKey = issuerToken.getCertificate().getPublicKey(); ContentVerifierProvider contentVerifierProvider = jcaContentVerifierProviderBuilder.build(publicKey); signatureValid = basicOCSPResp.isSignatureValid(contentVerifierProvider); if (signatureValid) { this.issuerToken = issuerToken; } issuerX500Principal = issuerToken.getSubjectX500Principal(); } catch (Exception e) { signatureInvalidityReason = e.getClass().getSimpleName() + " - " + e.getMessage(); signatureValid = false; } return signatureValid; } @Override public String getSourceURL() { return sourceURI; } public void setSourceURI(final String sourceURI) { this.sourceURI = sourceURI; } /** * Indicates if the token signature is intact. * * @return {@code true} or {@code false} */ @Override public boolean isValid() { return signatureValid; } /** * This method returns the DSS abbreviation of the certificate. It is used * for debugging purpose. * * @return */ @Override public String getAbbreviation() { return "OCSPToken[" + DSSUtils.formatInternal(basicOCSPResp.getProducedAt()) + ", signedBy=" + (issuerToken == null ? "?" : issuerToken.getDSSIdAsString()) + "]"; } @Override public String toString(String indentStr) { final StringWriter out = new StringWriter(); out.append(indentStr).append("OCSPToken["); out.append("ProductionTime: ").append(DSSUtils.formatInternal(productionDate)).append("; "); out.append("ThisUpdate: ").append(DSSUtils.formatInternal(thisUpdate)).append("; "); out.append("NextUpdate: ").append(DSSUtils.formatInternal(nextUpdate)).append('\n'); out.append("SignedBy: ").append(issuerToken != null ? issuerToken.getDSSIdAsString() : null).append('\n'); indentStr += "\t"; out.append(indentStr).append("Signature algorithm: ").append(signatureAlgorithm == null ? "?" : signatureAlgorithm.getJCEId()).append('\n'); out.append(issuerToken != null ? issuerToken.toString(indentStr) : null).append('\n'); final List<String> validationExtraInfo = extraInfo.getValidationInfo(); if (validationExtraInfo.size() > 0) { for (final String info : validationExtraInfo) { out.append('\n').append(indentStr).append("\t- ").append(info); } out.append('\n'); } indentStr = indentStr.substring(1); out.append(indentStr).append("]"); return out.toString(); } @Override public byte[] getEncoded() { final OCSPResp ocspResp = DSSRevocationUtils.fromBasicToResp(basicOCSPResp); try { final byte[] bytes = ocspResp.getEncoded(); return bytes; } catch (IOException e) { throw new DSSException("OCSP encoding error: " + e.getMessage(), e); } } }
Fix reason value in case of OCSPToken
dss-spi/src/main/java/eu/europa/esig/dss/x509/OCSPToken.java
Fix reason value in case of OCSPToken
<ide><path>ss-spi/src/main/java/eu/europa/esig/dss/x509/OCSPToken.java <ide> import eu.europa.esig.dss.DSSRevocationUtils; <ide> import eu.europa.esig.dss.DSSUtils; <ide> import eu.europa.esig.dss.SignatureAlgorithm; <add>import eu.europa.esig.dss.x509.crl.CRLReasonEnum; <ide> <ide> /** <ide> * OCSP Signed Token which encapsulate BasicOCSPResp (BC). <ide> if (revokedStatus.hasRevocationReason()) { <ide> reasonId = revokedStatus.getRevocationReason(); <ide> } <del> final CRLReason crlReason = CRLReason.lookup(reasonId); <del> reason = crlReason.toString(); <add> reason = CRLReasonEnum.fromInt(reasonId).name(); <ide> } else if (certStatus instanceof UnknownStatus) { <del> <ide> if (logger.isInfoEnabled()) { <ide> logger.info("OCSP status unknown"); <ide> }
Java
apache-2.0
77ef59898798c15ba81bd65aceff938a2d921875
0
tuijldert/jitsi,ringdna/jitsi,dkcreinoso/jitsi,Metaswitch/jitsi,gpolitis/jitsi,dkcreinoso/jitsi,pplatek/jitsi,ibauersachs/jitsi,martin7890/jitsi,damencho/jitsi,tuijldert/jitsi,tuijldert/jitsi,Metaswitch/jitsi,dkcreinoso/jitsi,HelioGuilherme66/jitsi,mckayclarey/jitsi,pplatek/jitsi,procandi/jitsi,laborautonomo/jitsi,tuijldert/jitsi,ibauersachs/jitsi,cobratbq/jitsi,bebo/jitsi,459below/jitsi,damencho/jitsi,dkcreinoso/jitsi,ringdna/jitsi,jitsi/jitsi,marclaporte/jitsi,marclaporte/jitsi,procandi/jitsi,bebo/jitsi,ringdna/jitsi,level7systems/jitsi,damencho/jitsi,bebo/jitsi,mckayclarey/jitsi,HelioGuilherme66/jitsi,Metaswitch/jitsi,marclaporte/jitsi,jitsi/jitsi,ringdna/jitsi,jitsi/jitsi,laborautonomo/jitsi,marclaporte/jitsi,pplatek/jitsi,bhatvv/jitsi,bhatvv/jitsi,bhatvv/jitsi,laborautonomo/jitsi,mckayclarey/jitsi,gpolitis/jitsi,iant-gmbh/jitsi,gpolitis/jitsi,gpolitis/jitsi,tuijldert/jitsi,bhatvv/jitsi,laborautonomo/jitsi,damencho/jitsi,jitsi/jitsi,cobratbq/jitsi,bebo/jitsi,jibaro/jitsi,cobratbq/jitsi,iant-gmbh/jitsi,level7systems/jitsi,HelioGuilherme66/jitsi,bebo/jitsi,procandi/jitsi,Metaswitch/jitsi,cobratbq/jitsi,iant-gmbh/jitsi,gpolitis/jitsi,procandi/jitsi,pplatek/jitsi,iant-gmbh/jitsi,martin7890/jitsi,martin7890/jitsi,HelioGuilherme66/jitsi,ibauersachs/jitsi,mckayclarey/jitsi,level7systems/jitsi,ringdna/jitsi,bhatvv/jitsi,jibaro/jitsi,459below/jitsi,mckayclarey/jitsi,damencho/jitsi,HelioGuilherme66/jitsi,iant-gmbh/jitsi,459below/jitsi,martin7890/jitsi,level7systems/jitsi,level7systems/jitsi,procandi/jitsi,jitsi/jitsi,laborautonomo/jitsi,martin7890/jitsi,ibauersachs/jitsi,jibaro/jitsi,dkcreinoso/jitsi,459below/jitsi,cobratbq/jitsi,pplatek/jitsi,marclaporte/jitsi,459below/jitsi,ibauersachs/jitsi,jibaro/jitsi,jibaro/jitsi
/* * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ package net.java.sip.communicator.impl.systray.jdic; import java.awt.event.*; import java.util.*; import java.util.Timer; import javax.swing.*; import net.java.sip.communicator.impl.systray.*; import net.java.sip.communicator.service.configuration.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.systray.*; import net.java.sip.communicator.service.systray.event.*; import net.java.sip.communicator.util.*; import org.jdesktop.jdic.tray.*; /** * The <tt>Systray</tt> provides a Icon and the associated <tt>TrayMenu</tt> * in the system tray using the Jdic library. * * @author Nicolas Chamouard * @author Yana Stamcheva */ public class SystrayServiceJdicImpl implements SystrayService { /** * The systray. */ private SystemTray systray; /** * The icon in the system tray. */ private TrayIcon trayIcon; /** * The menu that spring with a right click. */ private TrayMenu menu; /** * The list of all added popup message listeners. */ private Vector popupMessageListeners = new Vector(); /** * List of all messages waiting to be shown. */ private ArrayList messageQueue = new ArrayList(); private Timer popupTimer = new Timer(); /** * The delay between the message pop ups. */ private int messageDelay = 1000; private int maxMessageNumber = 3; /** * The logger for this class. */ private static Logger logger = Logger.getLogger(SystrayServiceJdicImpl.class.getName()); private ImageIcon logoIcon; /** * Creates an instance of <tt>Systray</tt>. */ public SystrayServiceJdicImpl() { try { systray = SystemTray.getDefaultSystemTray(); } catch (Throwable e) { logger.error("Failed to create a systray!", e); } if(systray != null) { this.initSystray(); SystrayActivator.getUIService().setExitOnMainWindowClose(false); } } /** * Initializes the systray icon and related listeners. */ private void initSystray() { popupTimer.scheduleAtFixedRate(new ShowPopupTask(), 0, messageDelay); menu = new TrayMenu(this); String osName = System.getProperty("os.name"); // If we're running under Windows, we use a special icon without // background. if (osName.startsWith("Windows")) { logoIcon = new ImageIcon( Resources.getImage("trayIconWindows")); } else { logoIcon = new ImageIcon( Resources.getImage("trayIcon")); } trayIcon = new TrayIcon(logoIcon, "SIP Communicator", menu); trayIcon.setIconAutoSize(true); //Show/hide the contact list when user clicks on the systray. trayIcon.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UIService uiService = SystrayActivator.getUIService(); boolean isVisible; isVisible = ! uiService.isVisible(); uiService.setVisible(isVisible); ConfigurationService configService = SystrayActivator.getConfigurationService(); configService.setProperty( "net.java.sip.communicator.impl.systray.showApplication", new Boolean(isVisible)); } }); //Notify all interested listener that user has clicked on the systray //popup message. trayIcon.addBalloonActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UIService uiService = SystrayActivator.getUIService(); firePopupMessageEvent(e.getSource()); ExportedWindow chatWindow = uiService.getExportedWindow(ExportedWindow.CHAT_WINDOW); if(chatWindow != null && chatWindow.isVisible()) { chatWindow.bringToFront(); } } }); systray.addTrayIcon(trayIcon); } /** * Saves the last status for all accounts. This information is used * on logging. Each time user logs in he's logged with the same status * as he was the last time before closing the application. * * @param protocolProvider the protocol provider for which we save the * last selected status * @param statusName the status name to save */ public void saveStatusInformation( ProtocolProviderService protocolProvider, String statusName) { ConfigurationService configService = SystrayActivator.getConfigurationService(); if(configService != null) { String prefix = "net.java.sip.communicator.impl.gui.accounts"; List accounts = configService .getPropertyNamesByPrefix(prefix, true); boolean savedAccount = false; Iterator accountsIter = accounts.iterator(); while(accountsIter.hasNext()) { String accountRootPropName = (String) accountsIter.next(); String accountUID = configService.getString(accountRootPropName); if(accountUID.equals(protocolProvider .getAccountID().getAccountUniqueID())) { configService.setProperty( accountRootPropName + ".lastAccountStatus", statusName); savedAccount = true; } } if(!savedAccount) { String accNodeName = "acc" + Long.toString(System.currentTimeMillis()); String accountPackage = "net.java.sip.communicator.impl.gui.accounts." + accNodeName; configService.setProperty(accountPackage, protocolProvider.getAccountID().getAccountUniqueID()); configService.setProperty( accountPackage+".lastAccountStatus", statusName); } } } /** * Implements the <tt>SystratService.showPopupMessage</tt> method. Shows * a pop up message, above the Systray icon, which has the given title, * message content and message type. * * @param title the title of the message * @param messageContent the content text * @param messageType the type of the message */ public void showPopupMessage( String title, String messageContent, int messageType) { int trayMsgType = TrayIcon.NONE_MESSAGE_TYPE; if (messageType == SystrayService.ERROR_MESSAGE_TYPE) trayMsgType = TrayIcon.ERROR_MESSAGE_TYPE; else if (messageType == SystrayService.INFORMATION_MESSAGE_TYPE) trayMsgType = TrayIcon.INFO_MESSAGE_TYPE; else if (messageType == SystrayService.WARNING_MESSAGE_TYPE) trayMsgType = TrayIcon.WARNING_MESSAGE_TYPE; if(messageContent.length() > 100) messageContent = messageContent.substring(0, 100).concat("..."); messageQueue.add(new SystrayMessage(title, messageContent, trayMsgType)); } /** * Implements the <tt>SystrayService.addPopupMessageListener</tt> method. * * @param listener the listener to add */ public void addPopupMessageListener(SystrayPopupMessageListener listener) { synchronized (popupMessageListeners) { this.popupMessageListeners.add(listener); } } /** * Implements the <tt>SystrayService.removePopupMessageListener</tt> method. * * @param listener the listener to remove */ public void removePopupMessageListener(SystrayPopupMessageListener listener) { synchronized (popupMessageListeners) { this.popupMessageListeners.remove(listener); } } /** * Notifies all interested listeners that a <tt>SystrayPopupMessageEvent</tt> * has occured. * * @param sourceObject the source of this event */ private void firePopupMessageEvent(Object sourceObject) { SystrayPopupMessageEvent evt = new SystrayPopupMessageEvent(sourceObject); logger.trace("Will dispatch the following systray msg event: " + evt); Iterator listeners = null; synchronized (popupMessageListeners) { listeners = new ArrayList(popupMessageListeners).iterator(); } while (listeners.hasNext()) { SystrayPopupMessageListener listener = (SystrayPopupMessageListener) listeners.next(); listener.popupMessageClicked(evt); } } /** * Sets a new Systray icon. * * @param image the icon to set. */ public void setSystrayIcon(byte[] image) { this.trayIcon.setIcon(new ImageIcon(image)); } /** * Shows the oldest message in the message queue and then removes it from * the queue. */ private class ShowPopupTask extends TimerTask { public void run() { if(messageQueue.isEmpty()) return; int messageNumber = messageQueue.size(); SystrayMessage msg = (SystrayMessage) messageQueue.get(0); if(messageNumber > maxMessageNumber) { messageQueue.clear(); String messageContent = msg.getMessageContent(); if(!messageContent.endsWith("...")) messageContent.concat("..."); messageQueue.add(new SystrayMessage( "You have received " + messageNumber + " new messages. For more info check your chat window.", "Messages starts by: " + messageContent, TrayIcon.INFO_MESSAGE_TYPE)); } else { trayIcon.displayMessage(msg.getTitle(), msg.getMessageContent(), msg.getMessageType()); messageQueue.remove(0); } } } private class SystrayMessage { private String title; private String messageContent; private int messageType; /** * Creates an instance of <tt>SystrayMessage</tt> by specifying the * message <tt>title</tt>, the content of the message and the type of * the message. * * @param title the title of the message * @param messageContent the content of the message * @param messageType the type of the message */ public SystrayMessage( String title, String messageContent, int messageType) { this.title = title; this.messageContent = messageContent; this.messageType = messageType; } /** * Returns the title of the message. * * @return the title of the message */ public String getTitle() { return title; } /** * Returns the message content. * * @return the message content */ public String getMessageContent() { return messageContent; } /** * Returns the message type. * * @return the message type */ public int getMessageType() { return messageType; } } }
src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java
/* * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ package net.java.sip.communicator.impl.systray.jdic; import java.awt.event.*; import java.util.*; import javax.swing.*; import net.java.sip.communicator.impl.systray.*; import net.java.sip.communicator.service.configuration.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.systray.*; import net.java.sip.communicator.service.systray.event.*; import net.java.sip.communicator.util.*; import org.jdesktop.jdic.tray.*; import org.osgi.framework.*; /** * The <tt>Systray</tt> provides a Icon and the associated <tt>TrayMenu</tt> * in the system tray using the Jdic library. * * @author Nicolas Chamouard * @author Yana Stamcheva */ public class SystrayServiceJdicImpl implements SystrayService { /** * The systray. */ private SystemTray systray; /** * The icon in the system tray. */ private TrayIcon trayIcon; /** * The menu that spring with a right click. */ private TrayMenu menu; /** * The list of all added popup message listeners. */ private Vector popupMessageListeners = new Vector(); /** * The logger for this class. */ private static Logger logger = Logger.getLogger(SystrayServiceJdicImpl.class.getName()); private ImageIcon logoIcon; /** * Creates an instance of <tt>Systray</tt>. */ public SystrayServiceJdicImpl() { try { systray = SystemTray.getDefaultSystemTray(); } catch (Throwable e) { logger.error("Failed to create a systray!", e); } if(systray != null) { this.initSystray(); SystrayActivator.getUIService().setExitOnMainWindowClose(false); } } /** * Initializes the systray icon and related listeners. */ private void initSystray() { menu = new TrayMenu(this); String osName = System.getProperty("os.name"); // If we're running under Windows, we use a special icon without // background. if (osName.startsWith("Windows")) { logoIcon = new ImageIcon( Resources.getImage("trayIconWindows")); } else { logoIcon = new ImageIcon( Resources.getImage("trayIcon")); } trayIcon = new TrayIcon(logoIcon, "SIP Communicator", menu); trayIcon.setIconAutoSize(true); //Show/hide the contact list when user clicks on the systray. trayIcon.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UIService uiService = SystrayActivator.getUIService(); boolean isVisible; isVisible = ! uiService.isVisible(); uiService.setVisible(isVisible); ConfigurationService configService = SystrayActivator.getConfigurationService(); configService.setProperty( "net.java.sip.communicator.impl.systray.showApplication", new Boolean(isVisible)); } }); //Notify all interested listener that user has clicked on the systray //popup message. trayIcon.addBalloonActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UIService uiService = SystrayActivator.getUIService(); firePopupMessageEvent(e.getSource()); ExportedWindow chatWindow = uiService.getExportedWindow(ExportedWindow.CHAT_WINDOW); if(chatWindow != null && chatWindow.isVisible()) { chatWindow.bringToFront(); } } }); systray.addTrayIcon(trayIcon); } /** * Saves the last status for all accounts. This information is used * on logging. Each time user logs in he's logged with the same status * as he was the last time before closing the application. * * @param protocolProvider the protocol provider for which we save the * last selected status * @param statusName the status name to save */ public void saveStatusInformation( ProtocolProviderService protocolProvider, String statusName) { ConfigurationService configService = SystrayActivator.getConfigurationService(); if(configService != null) { String prefix = "net.java.sip.communicator.impl.gui.accounts"; List accounts = configService .getPropertyNamesByPrefix(prefix, true); boolean savedAccount = false; Iterator accountsIter = accounts.iterator(); while(accountsIter.hasNext()) { String accountRootPropName = (String) accountsIter.next(); String accountUID = configService.getString(accountRootPropName); if(accountUID.equals(protocolProvider .getAccountID().getAccountUniqueID())) { configService.setProperty( accountRootPropName + ".lastAccountStatus", statusName); savedAccount = true; } } if(!savedAccount) { String accNodeName = "acc" + Long.toString(System.currentTimeMillis()); String accountPackage = "net.java.sip.communicator.impl.gui.accounts." + accNodeName; configService.setProperty(accountPackage, protocolProvider.getAccountID().getAccountUniqueID()); configService.setProperty( accountPackage+".lastAccountStatus", statusName); } } } /** * Implements the <tt>SystratService.showPopupMessage</tt> method. Shows * a pop up message, above the Systray icon, which has the given title, * message content and message type. * * @param title the title of the message * @param messageContent the content text * @param messageType the type of the message */ public void showPopupMessage( String title, String messageContent, int messageType) { int trayMsgType = TrayIcon.NONE_MESSAGE_TYPE; if (messageType == SystrayService.ERROR_MESSAGE_TYPE) trayMsgType = TrayIcon.ERROR_MESSAGE_TYPE; else if (messageType == SystrayService.INFORMATION_MESSAGE_TYPE) trayMsgType = TrayIcon.INFO_MESSAGE_TYPE; else if (messageType == SystrayService.WARNING_MESSAGE_TYPE) trayMsgType = TrayIcon.WARNING_MESSAGE_TYPE; if(messageContent.length() > 100) messageContent = messageContent.substring(0, 100).concat("..."); this.trayIcon.displayMessage( title, messageContent, trayMsgType); } /** * Implements the <tt>SystrayService.addPopupMessageListener</tt> method. * * @param listener the listener to add */ public void addPopupMessageListener(SystrayPopupMessageListener listener) { synchronized (popupMessageListeners) { this.popupMessageListeners.add(listener); } } /** * Implements the <tt>SystrayService.removePopupMessageListener</tt> method. * * @param listener the listener to remove */ public void removePopupMessageListener(SystrayPopupMessageListener listener) { synchronized (popupMessageListeners) { this.popupMessageListeners.remove(listener); } } /** * Notifies all interested listeners that a <tt>SystrayPopupMessageEvent</tt> * has occured. * * @param sourceObject the source of this event */ private void firePopupMessageEvent(Object sourceObject) { SystrayPopupMessageEvent evt = new SystrayPopupMessageEvent(sourceObject); logger.trace("Will dispatch the following systray msg event: " + evt); Iterator listeners = null; synchronized (popupMessageListeners) { listeners = new ArrayList(popupMessageListeners).iterator(); } while (listeners.hasNext()) { SystrayPopupMessageListener listener = (SystrayPopupMessageListener) listeners.next(); listener.popupMessageClicked(evt); } } /** * Sets a new Systray icon. * * @param image the icon to set. */ public void setSystrayIcon(byte[] image) { this.trayIcon.setIcon(new ImageIcon(image)); } }
group systray messages when they are coming too fast
src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java
group systray messages when they are coming too fast
<ide><path>rc/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java <ide> <ide> import java.awt.event.*; <ide> import java.util.*; <add>import java.util.Timer; <ide> <ide> import javax.swing.*; <ide> <ide> import net.java.sip.communicator.util.*; <ide> <ide> import org.jdesktop.jdic.tray.*; <del>import org.osgi.framework.*; <ide> <ide> /** <ide> * The <tt>Systray</tt> provides a Icon and the associated <tt>TrayMenu</tt> <ide> * @author Yana Stamcheva <ide> */ <ide> public class SystrayServiceJdicImpl <del> implements SystrayService <add> implements SystrayService <ide> { <ide> /** <ide> * The systray. <ide> * The list of all added popup message listeners. <ide> */ <ide> private Vector popupMessageListeners = new Vector(); <add> <add> /** <add> * List of all messages waiting to be shown. <add> */ <add> private ArrayList messageQueue = new ArrayList(); <add> <add> private Timer popupTimer = new Timer(); <add> <add> /** <add> * The delay between the message pop ups. <add> */ <add> private int messageDelay = 1000; <add> <add> private int maxMessageNumber = 3; <ide> <ide> /** <ide> * The logger for this class. <ide> */ <ide> private void initSystray() <ide> { <add> popupTimer.scheduleAtFixedRate(new ShowPopupTask(), 0, messageDelay); <add> <ide> menu = new TrayMenu(this); <ide> <ide> String osName = System.getProperty("os.name"); <ide> if(messageContent.length() > 100) <ide> messageContent = messageContent.substring(0, 100).concat("..."); <ide> <del> this.trayIcon.displayMessage( <del> title, messageContent, trayMsgType); <add> messageQueue.add(new SystrayMessage(title, messageContent, trayMsgType)); <ide> } <ide> <ide> /** <ide> { <ide> this.trayIcon.setIcon(new ImageIcon(image)); <ide> } <add> <add> /** <add> * Shows the oldest message in the message queue and then removes it from <add> * the queue. <add> */ <add> private class ShowPopupTask extends TimerTask <add> { <add> public void run() <add> { <add> if(messageQueue.isEmpty()) <add> return; <add> <add> int messageNumber = messageQueue.size(); <add> <add> SystrayMessage msg = (SystrayMessage) messageQueue.get(0); <add> <add> if(messageNumber > maxMessageNumber) <add> { <add> messageQueue.clear(); <add> <add> String messageContent = msg.getMessageContent(); <add> <add> if(!messageContent.endsWith("...")) <add> messageContent.concat("..."); <add> <add> messageQueue.add(new SystrayMessage( <add> "You have received " + messageNumber <add> + " new messages. For more info check your chat window.", <add> "Messages starts by: " + messageContent, <add> TrayIcon.INFO_MESSAGE_TYPE)); <add> } <add> else <add> { <add> trayIcon.displayMessage(msg.getTitle(), <add> msg.getMessageContent(), <add> msg.getMessageType()); <add> <add> messageQueue.remove(0); <add> } <add> } <add> } <add> <add> private class SystrayMessage <add> { <add> private String title; <add> private String messageContent; <add> private int messageType; <add> <add> /** <add> * Creates an instance of <tt>SystrayMessage</tt> by specifying the <add> * message <tt>title</tt>, the content of the message and the type of <add> * the message. <add> * <add> * @param title the title of the message <add> * @param messageContent the content of the message <add> * @param messageType the type of the message <add> */ <add> public SystrayMessage( String title, <add> String messageContent, <add> int messageType) <add> { <add> this.title = title; <add> this.messageContent = messageContent; <add> this.messageType = messageType; <add> } <add> <add> /** <add> * Returns the title of the message. <add> * <add> * @return the title of the message <add> */ <add> public String getTitle() <add> { <add> return title; <add> } <add> <add> /** <add> * Returns the message content. <add> * <add> * @return the message content <add> */ <add> public String getMessageContent() <add> { <add> return messageContent; <add> } <add> <add> /** <add> * Returns the message type. <add> * <add> * @return the message type <add> */ <add> public int getMessageType() <add> { <add> return messageType; <add> } <add> } <ide> }
Java
agpl-3.0
5934fea712ad3f717dc1c8c061347c9aee8b4fef
0
deerwalk/voltdb,simonzhangsm/voltdb,kumarrus/voltdb,wolffcm/voltdb,migue/voltdb,wolffcm/voltdb,migue/voltdb,wolffcm/voltdb,flybird119/voltdb,paulmartel/voltdb,VoltDB/voltdb,ingted/voltdb,VoltDB/voltdb,migue/voltdb,kumarrus/voltdb,VoltDB/voltdb,ingted/voltdb,creative-quant/voltdb,migue/voltdb,simonzhangsm/voltdb,wolffcm/voltdb,zuowang/voltdb,flybird119/voltdb,flybird119/voltdb,deerwalk/voltdb,creative-quant/voltdb,zuowang/voltdb,creative-quant/voltdb,VoltDB/voltdb,flybird119/voltdb,simonzhangsm/voltdb,ingted/voltdb,creative-quant/voltdb,creative-quant/voltdb,zuowang/voltdb,ingted/voltdb,creative-quant/voltdb,migue/voltdb,simonzhangsm/voltdb,flybird119/voltdb,wolffcm/voltdb,creative-quant/voltdb,ingted/voltdb,simonzhangsm/voltdb,deerwalk/voltdb,creative-quant/voltdb,simonzhangsm/voltdb,simonzhangsm/voltdb,paulmartel/voltdb,paulmartel/voltdb,ingted/voltdb,deerwalk/voltdb,kumarrus/voltdb,zuowang/voltdb,deerwalk/voltdb,paulmartel/voltdb,simonzhangsm/voltdb,wolffcm/voltdb,paulmartel/voltdb,flybird119/voltdb,kumarrus/voltdb,ingted/voltdb,kumarrus/voltdb,zuowang/voltdb,flybird119/voltdb,flybird119/voltdb,kumarrus/voltdb,VoltDB/voltdb,zuowang/voltdb,wolffcm/voltdb,kumarrus/voltdb,wolffcm/voltdb,kumarrus/voltdb,migue/voltdb,deerwalk/voltdb,ingted/voltdb,deerwalk/voltdb,migue/voltdb,zuowang/voltdb,VoltDB/voltdb,paulmartel/voltdb,deerwalk/voltdb,paulmartel/voltdb,paulmartel/voltdb,VoltDB/voltdb,zuowang/voltdb,migue/voltdb
/* This file is part of VoltDB. * Copyright (C) 2008-2014 VoltDB Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ package org.voltdb.regressionsuites; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Random; import java.util.Set; import java.util.concurrent.TimeUnit; import junit.framework.Test; import org.HdrHistogram_voltpatches.AbstractHistogram; import org.HdrHistogram_voltpatches.Histogram; import org.hsqldb_voltpatches.HSQLInterface; import org.voltcore.utils.CompressionStrategySnappy; import org.voltdb.BackendTarget; import org.voltdb.VoltDB; import org.voltdb.VoltTable; import org.voltdb.VoltTable.ColumnInfo; import org.voltdb.VoltType; import org.voltdb.client.Client; import org.voltdb.client.ProcCallException; import org.voltdb.compiler.VoltProjectBuilder; import org.voltdb.iv2.MpInitiator; import org.voltdb.join.BalancePartitionsStatistics; import org.voltdb.utils.MiscUtils; import org.voltdb_testprocs.regressionsuites.malicious.GoSleep; public class TestStatisticsSuite extends SaveRestoreBase { private final static int SITES = 2; private final static int HOSTS = 3; private final static int KFACTOR = MiscUtils.isPro() ? 1 : 0; private final static int PARTITIONS = (SITES * HOSTS) / (KFACTOR + 1); private final static boolean hasLocalServer = false; private static final Class<?>[] PROCEDURES = { GoSleep.class }; public TestStatisticsSuite(String name) { super(name); } // For the provided table, verify that there is a row for each host in the cluster where // the column designated by 'columnName' has the value 'rowId'. For example, for // Initiator stats, if columnName is 'PROCEDURE_NAME' and rowId is 'foo', this // will verify that the initiator at each node has seen a procedure invocation for 'foo' private void validateRowSeenAtAllHosts(VoltTable result, String columnName, String rowId, boolean enforceUnique) { assertEquals(HOSTS, countHostsProvidingRows(result, columnName, rowId, enforceUnique)); } private int countHostsProvidingRows(VoltTable result, String columnName, String rowId, boolean enforceUnique) { result.resetRowPosition(); Set<Long> hostsSeen = new HashSet<Long>(); while (result.advanceRow()) { String idFromRow = result.getString(columnName); if (rowId.equalsIgnoreCase(idFromRow)) { Long thisHostId = result.getLong("HOST_ID"); if (enforceUnique) { assertFalse("HOST_ID: " + thisHostId + " seen twice in table looking for " + rowId + " in column " + columnName, hostsSeen.contains(thisHostId)); } hostsSeen.add(thisHostId); } } // Before failing the assert, report details of the non-conforming result. if (HOSTS != hostsSeen.size()) { System.out.println("Something in the following results may fail an assert expecting " + HOSTS + " and getting " + hostsSeen.size()); Set<Long> seenAgain = new HashSet<Long>(); result.resetRowPosition(); while (result.advanceRow()) { String idFromRow = result.getString(columnName); Long thisHostId = result.getLong("HOST_ID"); if (rowId.equalsIgnoreCase(idFromRow)) { System.out.println("Found the match at host " + thisHostId + " for " + columnName + " " + idFromRow + (seenAgain.add(thisHostId) ? " added" : " duplicated")); seenAgain.add(thisHostId); } else { System.out.println("Found non-match at host " + thisHostId + " for " + columnName + " " + idFromRow); } } } return hostsSeen.size(); } // For the provided table, verify that there is a row for each site in the cluster where // the column designated by 'columnName' has the value 'rowId'. For example, for // Table stats, if columnName is 'TABLE_NAME' and rowId is 'foo', this // will verify that each site has returned results for table 'foo' private boolean validateRowSeenAtAllSites(VoltTable result, String columnName, String rowId, boolean enforceUnique) { result.resetRowPosition(); Set<Long> sitesSeen = new HashSet<Long>(); while (result.advanceRow()) { String idFromRow = result.getString(columnName); if (rowId.equalsIgnoreCase(idFromRow)) { long hostId = result.getLong("HOST_ID"); long thisSiteId = result.getLong("SITE_ID"); thisSiteId |= hostId << 32; if (enforceUnique) { assertFalse("SITE_ID: " + thisSiteId + " seen twice in table looking for " + rowId + " in column " + columnName, sitesSeen.contains(thisSiteId)); } sitesSeen.add(thisSiteId); } } return (HOSTS * SITES) == sitesSeen.size(); } // For the provided table, verify that there is a row for each partition in the cluster where // the column designated by 'columnName' has the value 'rowId'. private void validateRowSeenAtAllPartitions(VoltTable result, String columnName, String rowId, boolean enforceUnique) { result.resetRowPosition(); Set<Long> partsSeen = new HashSet<Long>(); while (result.advanceRow()) { String idFromRow = result.getString(columnName); if (rowId.equalsIgnoreCase(idFromRow)) { long thisPartId = result.getLong("PARTITION_ID"); if (enforceUnique) { assertFalse("PARTITION_ID: " + thisPartId + " seen twice in table looking for " + rowId + " in column " + columnName, partsSeen.contains(thisPartId)); } partsSeen.add(thisPartId); } } assertEquals(PARTITIONS, partsSeen.size()); } public void testInvalidCalls() throws Exception { System.out.println("\n\nTESTING INVALID CALLS\n\n\n"); Client client = getFullyConnectedClient(); // // invalid selector // try { // No selector at all. client.callProcedure("@Statistics"); fail(); } catch (ProcCallException ex) { // All badness gets turned into ProcCallExceptions, so we need // to check specifically for this error, otherwise things that // crash the cluster also turn into ProcCallExceptions and don't // trigger failure (ENG-2347) assertEquals("Incorrect number of arguments to @Statistics (expects 2, received 0)", ex.getMessage()); } try { // extra stuff client.callProcedure("@Statistics", "table", 0, "OHHAI"); fail(); } catch (ProcCallException ex) { assertEquals("Incorrect number of arguments to @Statistics (expects 2, received 3)", ex.getMessage()); } try { // Invalid selector client.callProcedure("@Statistics", "garbage", 0); fail(); } catch (ProcCallException ex) {} } public void testLatencyStatistics() throws Exception { System.out.println("\n\nTESTING LATENCY STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[5]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("SITE_ID", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("HISTOGRAM", VoltType.VARBINARY); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; // Do some stuff to generate some latency stats for (int i = 0; i < SITES * HOSTS; i++) { results = client.callProcedure("NEW_ORDER.insert", i).getResults(); } results = client.callProcedure("@Statistics", "LATENCY", 0).getResults(); // one aggregate table returned assertEquals(1, results.length); System.out.println("Test latency table: " + results[0].toString()); validateSchema(results[0], expectedTable); // should have at least one row from each host results[0].advanceRow(); validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), false); // actually, there are 26 rows per host so: assertEquals(HOSTS, results[0].getRowCount()); // Check for non-zero invocations (ENG-4668) long invocations = 0; results[0].resetRowPosition(); while (results[0].advanceRow()) { byte histogramBytes[] = results[0].getVarbinary("HISTOGRAM"); Histogram h = AbstractHistogram.fromCompressedBytes(histogramBytes, CompressionStrategySnappy.INSTANCE); invocations += h.getHistogramData().getTotalCount(); } assertTrue(invocations > 0); } public void testInitiatorStatistics() throws Exception { System.out.println("\n\nTESTING INITIATOR STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[13]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("SITE_ID", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("CONNECTION_ID", VoltType.BIGINT); expectedSchema[5] = new ColumnInfo("CONNECTION_HOSTNAME", VoltType.STRING); expectedSchema[6] = new ColumnInfo("PROCEDURE_NAME", VoltType.STRING); expectedSchema[7] = new ColumnInfo("INVOCATIONS", VoltType.BIGINT); expectedSchema[8] = new ColumnInfo("AVG_EXECUTION_TIME", VoltType.INTEGER); expectedSchema[9] = new ColumnInfo("MIN_EXECUTION_TIME", VoltType.INTEGER); expectedSchema[10] = new ColumnInfo("MAX_EXECUTION_TIME", VoltType.INTEGER); expectedSchema[11] = new ColumnInfo("ABORTS", VoltType.BIGINT); expectedSchema[12] = new ColumnInfo("FAILURES", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); // // initiator selector // VoltTable results[] = null; // This should get us an invocation at each host for (int i = 0; i < 1000; i++) { results = client.callProcedure("NEW_ORDER.insert", i).getResults(); } results = client.callProcedure("@Statistics", "INITIATOR", 0).getResults(); // one aggregate table returned assertEquals(1, results.length); System.out.println("Test initiators table: " + results[0].toString()); // Check the schema validateSchema(results[0], expectedTable); // One WAREHOUSE.select row per host assertEquals(HOSTS, results[0].getRowCount()); // Verify the invocation counts int counts = 0; while (results[0].advanceRow()) { String procName = results[0].getString("PROCEDURE_NAME"); if (procName.equals("@SystemCatalog")) { // One for each connection from the client assertEquals(HOSTS, results[0].getLong("INVOCATIONS")); } else if (procName.equals("NEW_ORDER.insert")) { counts += results[0].getLong("INVOCATIONS"); } } assertEquals(1000, counts); // verify that each node saw a NEW_ORDER.insert initiation validateRowSeenAtAllHosts(results[0], "PROCEDURE_NAME", "NEW_ORDER.insert", true); } public void testPartitionCount() throws Exception { System.out.println("\n\nTESTING PARTITION COUNT\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[4]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("PARTITION_COUNT", VoltType.INTEGER); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; results = client.callProcedure("@Statistics", "PARTITIONCOUNT", 0).getResults(); // Only one table returned assertEquals(1, results.length); validateSchema(results[0], expectedTable); // Should only get one row, total assertEquals(1, results[0].getRowCount()); results[0].advanceRow(); int partCount = (int)results[0].getLong("PARTITION_COUNT"); assertEquals(PARTITIONS, partCount); } public void testTableStatistics() throws Exception { System.out.println("\n\nTESTING TABLE STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[13]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("SITE_ID", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("PARTITION_ID", VoltType.BIGINT); expectedSchema[5] = new ColumnInfo("TABLE_NAME", VoltType.STRING); expectedSchema[6] = new ColumnInfo("TABLE_TYPE", VoltType.STRING); expectedSchema[7] = new ColumnInfo("TUPLE_COUNT", VoltType.BIGINT); expectedSchema[8] = new ColumnInfo("TUPLE_ALLOCATED_MEMORY", VoltType.INTEGER); expectedSchema[9] = new ColumnInfo("TUPLE_DATA_MEMORY", VoltType.INTEGER); expectedSchema[10] = new ColumnInfo("STRING_DATA_MEMORY", VoltType.INTEGER); expectedSchema[11] = new ColumnInfo("TUPLE_LIMIT", VoltType.INTEGER); expectedSchema[12] = new ColumnInfo("PERCENT_FULL", VoltType.INTEGER); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; boolean success = false; long start = System.currentTimeMillis(); while (!success) { if (System.currentTimeMillis() - start > 60000) fail("Took too long"); success = true; // table // results = client.callProcedure("@Statistics", "table", 0).getResults(); System.out.println("Test statistics table: " + results[0].toString()); // one aggregate table returned assertEquals(1, results.length); validateSchema(results[0], expectedTable); // with 10 rows per site. Can be two values depending on the test scenario of cluster vs. local. if (HOSTS * SITES * 3 != results[0].getRowCount()) { success = false; } // Validate that each site returns a result for each table if (success) { success = validateRowSeenAtAllSites(results[0], "TABLE_NAME", "WAREHOUSE", true); } if (success) { success = validateRowSeenAtAllSites(results[0], "TABLE_NAME", "NEW_ORDER", true); } if (success) { validateRowSeenAtAllSites(results[0], "TABLE_NAME", "ITEM", true); } if (success) break; } } public void testIndexStatistics() throws Exception { System.out.println("\n\nTESTING INDEX STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[12]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("SITE_ID", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("PARTITION_ID", VoltType.BIGINT); expectedSchema[5] = new ColumnInfo("INDEX_NAME", VoltType.STRING); expectedSchema[6] = new ColumnInfo("TABLE_NAME", VoltType.STRING); expectedSchema[7] = new ColumnInfo("INDEX_TYPE", VoltType.STRING); expectedSchema[8] = new ColumnInfo("IS_UNIQUE", VoltType.TINYINT); expectedSchema[9] = new ColumnInfo("IS_COUNTABLE", VoltType.TINYINT); expectedSchema[10] = new ColumnInfo("ENTRY_COUNT", VoltType.BIGINT); expectedSchema[11] = new ColumnInfo("MEMORY_ESTIMATE", VoltType.INTEGER); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; boolean success = false; long start = System.currentTimeMillis(); while (!success) { if (System.currentTimeMillis() - start > 60000) fail("Took too long"); success = true; results = client.callProcedure("@Statistics", "index", 0).getResults(); System.out.println("Index results: " + results[0].toString()); assertEquals(1, results.length); validateSchema(results[0], expectedTable); if (success) { success = validateRowSeenAtAllSites(results[0], "INDEX_NAME", HSQLInterface.AUTO_GEN_CONSTRAINT_WRAPPER_PREFIX + "W_PK_TREE", true); } if (success) { success = validateRowSeenAtAllSites(results[0], "INDEX_NAME", HSQLInterface.AUTO_GEN_CONSTRAINT_WRAPPER_PREFIX + "I_PK_TREE", true); } if (success) break; } } public void testMemoryStatistics() throws Exception { System.out.println("\n\nTESTING MEMORY STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[13]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("RSS", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("JAVAUSED", VoltType.INTEGER); expectedSchema[5] = new ColumnInfo("JAVAUNUSED", VoltType.INTEGER); expectedSchema[6] = new ColumnInfo("TUPLEDATA", VoltType.INTEGER); expectedSchema[7] = new ColumnInfo("TUPLEALLOCATED", VoltType.INTEGER); expectedSchema[8] = new ColumnInfo("INDEXMEMORY", VoltType.INTEGER); expectedSchema[9] = new ColumnInfo("STRINGMEMORY", VoltType.INTEGER); expectedSchema[10] = new ColumnInfo("TUPLECOUNT", VoltType.BIGINT); expectedSchema[11] = new ColumnInfo("POOLEDMEMORY", VoltType.BIGINT); expectedSchema[12] = new ColumnInfo("PHYSICALMEMORY", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; // // memory // // give time to seed the stats cache? Thread.sleep(1000); results = client.callProcedure("@Statistics", "memory", 0).getResults(); System.out.println("Node memory statistics table: " + results[0].toString()); // one aggregate table returned assertEquals(1, results.length); validateSchema(results[0], expectedTable); results[0].advanceRow(); // Hacky, on a single local cluster make sure that all 'nodes' are present. // MEMORY stats lacks a common string across nodes, but we can hijack the hostname in this case. validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), true); } public void testCpuStatistics() throws Exception { System.out.println("\n\nTESTING CPU STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[4]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("PERCENT_USED", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; // // cpu // // give time to seed the stats cache? Thread.sleep(1000); results = client.callProcedure("@Statistics", "cpu", 0).getResults(); System.out.println("Node cpu statistics table: " + results[0].toString()); // one aggregate table returned assertEquals(1, results.length); validateSchema(results[0], expectedTable); results[0].advanceRow(); // Hacky, on a single local cluster make sure that all 'nodes' are present. // CPU stats lacks a common string across nodes, but we can hijack the hostname in this case. validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), true); } public void testProcedureStatistics() throws Exception { System.out.println("\n\nTESTING PROCEDURE STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[19]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("SITE_ID", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("PARTITION_ID", VoltType.INTEGER); expectedSchema[5] = new ColumnInfo("PROCEDURE", VoltType.STRING); expectedSchema[6] = new ColumnInfo("INVOCATIONS", VoltType.BIGINT); expectedSchema[7] = new ColumnInfo("TIMED_INVOCATIONS", VoltType.BIGINT); expectedSchema[8] = new ColumnInfo("MIN_EXECUTION_TIME", VoltType.BIGINT); expectedSchema[9] = new ColumnInfo("MAX_EXECUTION_TIME", VoltType.BIGINT); expectedSchema[10] = new ColumnInfo("AVG_EXECUTION_TIME", VoltType.BIGINT); expectedSchema[11] = new ColumnInfo("MIN_RESULT_SIZE", VoltType.INTEGER); expectedSchema[12] = new ColumnInfo("MAX_RESULT_SIZE", VoltType.INTEGER); expectedSchema[13] = new ColumnInfo("AVG_RESULT_SIZE", VoltType.INTEGER); expectedSchema[14] = new ColumnInfo("MIN_PARAMETER_SET_SIZE", VoltType.INTEGER); expectedSchema[15] = new ColumnInfo("MAX_PARAMETER_SET_SIZE", VoltType.INTEGER); expectedSchema[16] = new ColumnInfo("AVG_PARAMETER_SET_SIZE", VoltType.INTEGER); expectedSchema[17] = new ColumnInfo("ABORTS", VoltType.BIGINT); expectedSchema[18] = new ColumnInfo("FAILURES", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; // // procedure // // Induce procedure invocations on all partitions. May fail in non-legacy hashing case // this plus R/W replication should ensure that every site on every node runs this transaction // at least once results = client.callProcedure("@GetPartitionKeys", "INTEGER").getResults(); VoltTable keys = results[0]; for (int k = 0;k < keys.getRowCount(); k++) { long key = keys.fetchRow(k).getLong(1); client.callProcedure("NEW_ORDER.insert", key); } for (int i = 0; i < HOSTS * SITES; i++) { client.callProcedure("NEW_ORDER.insert", i); } // 3 seconds translates to 3 billion nanos, which overflows internal // values (ENG-1039) //It's possible that the nanosecond count goes backwards... so run this a couple //of times to make sure the min value gets set for (int ii = 0; ii < 3; ii++) { results = client.callProcedure("GoSleep", 3000, 0, null).getResults(); } results = client.callProcedure("@Statistics", "procedure", 0).getResults(); System.out.println("Test procedures table: " + results[0].toString()); // one aggregate table returned assertEquals(1, results.length); validateSchema(results[0], expectedTable); // For this table, where unique HSID isn't written to SITE_ID, these // two checks should ensure we get all the rows we expect? validateRowSeenAtAllHosts(results[0], "PROCEDURE", "NEW_ORDER.insert", false); validateRowSeenAtAllPartitions(results[0], "PROCEDURE", "NEW_ORDER.insert", false); results[0].resetRowPosition(); VoltTable stats = results[0]; String procname = "blerg"; while (!procname.equals("org.voltdb_testprocs.regressionsuites.malicious.GoSleep")) { stats.advanceRow(); procname = (String)stats.get("PROCEDURE", VoltType.STRING); } // Retrieve all statistics long min_time = (Long)stats.get("MIN_EXECUTION_TIME", VoltType.BIGINT); long max_time = (Long)stats.get("MAX_EXECUTION_TIME", VoltType.BIGINT); long avg_time = (Long)stats.get("AVG_EXECUTION_TIME", VoltType.BIGINT); long min_result_size = (Long)stats.get("MIN_RESULT_SIZE", VoltType.BIGINT); long max_result_size = (Long)stats.get("MAX_RESULT_SIZE", VoltType.BIGINT); long avg_result_size = (Long)stats.get("AVG_RESULT_SIZE", VoltType.BIGINT); long min_parameter_set_size = (Long)stats.get("MIN_PARAMETER_SET_SIZE", VoltType.BIGINT); long max_parameter_set_size = (Long)stats.get("MAX_PARAMETER_SET_SIZE", VoltType.BIGINT); long avg_parameter_set_size = (Long)stats.get("AVG_PARAMETER_SET_SIZE", VoltType.BIGINT); // Check for overflow assertTrue("Failed MIN_EXECUTION_TIME > 0, value was: " + min_time, min_time > 0); assertTrue("Failed MAX_EXECUTION_TIME > 0, value was: " + max_time, max_time > 0); assertTrue("Failed AVG_EXECUTION_TIME > 0, value was: " + avg_time, avg_time > 0); assertTrue("Failed MIN_RESULT_SIZE > 0, value was: " + min_result_size, min_result_size >= 0); assertTrue("Failed MAX_RESULT_SIZE > 0, value was: " + max_result_size, max_result_size >= 0); assertTrue("Failed AVG_RESULT_SIZE > 0, value was: " + avg_result_size, avg_result_size >= 0); assertTrue("Failed MIN_PARAMETER_SET_SIZE > 0, value was: " + min_parameter_set_size, min_parameter_set_size >= 0); assertTrue("Failed MAX_PARAMETER_SET_SIZE > 0, value was: " + max_parameter_set_size, max_parameter_set_size >= 0); assertTrue("Failed AVG_PARAMETER_SET_SIZE > 0, value was: " + avg_parameter_set_size, avg_parameter_set_size >= 0); // check for reasonable values assertTrue("Failed MIN_EXECUTION_TIME > 2,400,000,000ns, value was: " + min_time, min_time > 2400000000L); assertTrue("Failed MAX_EXECUTION_TIME > 2,400,000,000ns, value was: " + max_time, max_time > 2400000000L); assertTrue("Failed AVG_EXECUTION_TIME > 2,400,000,000ns, value was: " + avg_time, avg_time > 2400000000L); assertTrue("Failed MIN_RESULT_SIZE < 1,000,000, value was: " + min_result_size, min_result_size < 1000000L); assertTrue("Failed MAX_RESULT_SIZE < 1,000,000, value was: " + max_result_size, max_result_size < 1000000L); assertTrue("Failed AVG_RESULT_SIZE < 1,000,000, value was: " + avg_result_size, avg_result_size < 1000000L); assertTrue("Failed MIN_PARAMETER_SET_SIZE < 1,000,000, value was: " + min_parameter_set_size, min_parameter_set_size < 1000000L); assertTrue("Failed MAX_PARAMETER_SET_SIZE < 1,000,000, value was: " + max_parameter_set_size, max_parameter_set_size < 1000000L); assertTrue("Failed AVG_PARAMETER_SET_SIZE < 1,000,000, value was: " + avg_parameter_set_size, avg_parameter_set_size < 1000000L); // Validate the PROCEDUREPROFILE aggregation. results = client.callProcedure("@Statistics", "procedureprofile", 0).getResults(); System.out.println("\n\n\n" + results[0].toString() + "\n\n\n"); // expect NEW_ORDER.insert, GoSleep // see TestStatsProcProfile.java for tests of the aggregation itself. assertEquals("Validate site filtering for PROCEDUREPROFILE", 2, results[0].getRowCount()); } public void testIOStatistics() throws Exception { System.out.println("\n\nTESTING IO STATS\n\n\n"); Client client = getFullyConnectedClient(); // Based on doc, not code // HOST_ID, SITE_ID, and PARTITION_ID all differ. Fixed to match // reality so tests would pass, but, ugh. ColumnInfo[] expectedSchema = new ColumnInfo[9]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("CONNECTION_ID", VoltType.BIGINT); expectedSchema[4] = new ColumnInfo("CONNECTION_HOSTNAME", VoltType.STRING); expectedSchema[5] = new ColumnInfo("BYTES_READ", VoltType.BIGINT); expectedSchema[6] = new ColumnInfo("MESSAGES_READ", VoltType.BIGINT); expectedSchema[7] = new ColumnInfo("BYTES_WRITTEN", VoltType.BIGINT); expectedSchema[8] = new ColumnInfo("MESSAGES_WRITTEN", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; // // iostats // results = client.callProcedure("@Statistics", "iostats", 0).getResults(); System.out.println("Test iostats table: " + results[0].toString()); // one aggregate table returned assertEquals(1, results.length); validateSchema(results[0], expectedTable); } public void testTopoStatistics() throws Exception { System.out.println("\n\nTESTING TOPO STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema1 = new ColumnInfo[3]; expectedSchema1[0] = new ColumnInfo("Partition", VoltType.INTEGER); expectedSchema1[1] = new ColumnInfo("Sites", VoltType.STRING); expectedSchema1[2] = new ColumnInfo("Leader", VoltType.STRING); VoltTable expectedTable1 = new VoltTable(expectedSchema1); ColumnInfo[] expectedSchema2 = new ColumnInfo[2]; expectedSchema2[0] = new ColumnInfo("HASHTYPE", VoltType.STRING); expectedSchema2[1] = new ColumnInfo("HASHCONFIG", VoltType.VARBINARY); VoltTable expectedTable2 = new VoltTable(expectedSchema2); VoltTable[] results = null; // // TOPO // results = client.callProcedure("@Statistics", "TOPO", 0).getResults(); // two aggregate tables returned assertEquals(2, results.length); System.out.println("Test TOPO table: " + results[0].toString()); System.out.println("Test TOPO table: " + results[1].toString()); validateSchema(results[0], expectedTable1); validateSchema(results[1], expectedTable2); VoltTable topo = results[0]; // Should have partitions + 1 rows in the first table assertEquals(PARTITIONS + 1, results[0].getRowCount()); // Make sure we can find the MPI, at least boolean found = false; while (topo.advanceRow()) { if ((int)topo.getLong("Partition") == MpInitiator.MP_INIT_PID) { found = true; } } assertTrue(found); // and only one row in the second table assertEquals(1, results[1].getRowCount()); } // // planner statistics // public void testPlannerStatistics() throws Exception { System.out.println("\n\nTESTING PLANNER STATS\n\n\n"); Client client = getClient(); ColumnInfo[] expectedSchema = new ColumnInfo[14]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("SITE_ID", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("PARTITION_ID", VoltType.INTEGER); expectedSchema[5] = new ColumnInfo("CACHE1_LEVEL", VoltType.INTEGER); expectedSchema[6] = new ColumnInfo("CACHE2_LEVEL", VoltType.INTEGER); expectedSchema[7] = new ColumnInfo("CACHE1_HITS", VoltType.INTEGER); expectedSchema[8] = new ColumnInfo("CACHE2_HITS", VoltType.INTEGER); expectedSchema[9] = new ColumnInfo("CACHE_MISSES", VoltType.INTEGER); expectedSchema[10] = new ColumnInfo("PLAN_TIME_MIN", VoltType.BIGINT); expectedSchema[11] = new ColumnInfo("PLAN_TIME_MAX", VoltType.BIGINT); expectedSchema[12] = new ColumnInfo("PLAN_TIME_AVG", VoltType.BIGINT); expectedSchema[13] = new ColumnInfo("FAILURES", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; // Clear the interval statistics results = client.callProcedure("@Statistics", "planner", 1).getResults(); assertEquals(1, results.length); // Invoke a few select queries a few times to get some cache hits and misses, // and to exceed the sampling frequency. // This does not use level 2 cache (parameterization) or trigger failures. for (String query : new String[] { "select * from warehouse", "select * from new_order", "select * from item", }) { for (int i = 0; i < 10; i++) { client.callProcedure("@AdHoc", query).getResults(); assertEquals(1, results.length); } } // Get the final interval statistics results = client.callProcedure("@Statistics", "planner", 1).getResults(); assertEquals(1, results.length); System.out.println("Test planner table: " + results[0].toString()); validateSchema(results[0], expectedTable); VoltTable stats = results[0]; // Sample the statistics List<Long> siteIds = new ArrayList<Long>(); int cache1_level = 0; int cache2_level = 0; int cache1_hits = 0; int cache2_hits = 0; int cache_misses = 0; long plan_time_min_min = Long.MAX_VALUE; long plan_time_max_max = Long.MIN_VALUE; long plan_time_avg_tot = 0; int failures = 0; while (stats.advanceRow()) { cache1_level += (Integer)stats.get("CACHE1_LEVEL", VoltType.INTEGER); cache2_level += (Integer)stats.get("CACHE2_LEVEL", VoltType.INTEGER); cache1_hits += (Integer)stats.get("CACHE1_HITS", VoltType.INTEGER); cache2_hits += (Integer)stats.get("CACHE2_HITS", VoltType.INTEGER); cache_misses += (Integer)stats.get("CACHE_MISSES", VoltType.INTEGER); plan_time_min_min = Math.min(plan_time_min_min, (Long)stats.get("PLAN_TIME_MIN", VoltType.BIGINT)); plan_time_max_max = Math.max(plan_time_max_max, (Long)stats.get("PLAN_TIME_MAX", VoltType.BIGINT)); plan_time_avg_tot += (Long)stats.get("PLAN_TIME_AVG", VoltType.BIGINT); failures += (Integer)stats.get("FAILURES", VoltType.INTEGER); siteIds.add((Long)stats.get("SITE_ID", VoltType.BIGINT)); } // Check for reasonable results int globalPlanners = 0; assertTrue("Failed siteIds count >= 2", siteIds.size() >= 2); for (long siteId : siteIds) { if (siteId == -1) { globalPlanners++; } } assertTrue("Global planner sites not 1, value was: " + globalPlanners, globalPlanners == 1); assertTrue("Failed total CACHE1_LEVEL > 0, value was: " + cache1_level, cache1_level > 0); assertTrue("Failed total CACHE1_LEVEL < 1,000,000, value was: " + cache1_level, cache1_level < 1000000); assertTrue("Failed total CACHE2_LEVEL >= 0, value was: " + cache2_level, cache2_level >= 0); assertTrue("Failed total CACHE2_LEVEL < 1,000,000, value was: " + cache2_level, cache2_level < 1000000); assertTrue("Failed total CACHE1_HITS > 0, value was: " + cache1_hits, cache1_hits > 0); assertTrue("Failed total CACHE1_HITS < 1,000,000, value was: " + cache1_hits, cache1_hits < 1000000); assertTrue("Failed total CACHE2_HITS == 0, value was: " + cache2_hits, cache2_hits == 0); assertTrue("Failed total CACHE2_HITS < 1,000,000, value was: " + cache2_hits, cache2_hits < 1000000); assertTrue("Failed total CACHE_MISSES > 0, value was: " + cache_misses, cache_misses > 0); assertTrue("Failed total CACHE_MISSES < 1,000,000, value was: " + cache_misses, cache_misses < 1000000); assertTrue("Failed min PLAN_TIME_MIN > 0, value was: " + plan_time_min_min, plan_time_min_min > 0); assertTrue("Failed total PLAN_TIME_MIN < 100,000,000,000, value was: " + plan_time_min_min, plan_time_min_min < 100000000000L); assertTrue("Failed max PLAN_TIME_MAX > 0, value was: " + plan_time_max_max, plan_time_max_max > 0); assertTrue("Failed total PLAN_TIME_MAX < 100,000,000,000, value was: " + plan_time_max_max, plan_time_max_max < 100000000000L); assertTrue("Failed total PLAN_TIME_AVG > 0, value was: " + plan_time_avg_tot, plan_time_avg_tot > 0); assertTrue("Failed total FAILURES == 0, value was: " + failures, failures == 0); } public void testDRNodeStatistics() throws Exception { if (!VoltDB.instance().getConfig().m_isEnterprise) { System.out.println("SKIPPING DRNODE STATS TESTS FOR COMMUNITY VERSION"); return; } System.out.println("\n\nTESTING DRNODE STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema2 = new ColumnInfo[7]; expectedSchema2[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema2[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema2[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema2[3] = new ColumnInfo("ENABLED", VoltType.STRING); expectedSchema2[4] = new ColumnInfo("SYNCSNAPSHOTSTATE", VoltType.STRING); expectedSchema2[5] = new ColumnInfo("ROWSINSYNCSNAPSHOT", VoltType.BIGINT); expectedSchema2[6] = new ColumnInfo("ROWSACKEDFORSYNCSNAPSHOT", VoltType.BIGINT); VoltTable expectedTable2 = new VoltTable(expectedSchema2); VoltTable[] results = null; // // DRNODE // results = client.callProcedure("@Statistics", "DRNODE", 0).getResults(); // one aggregate tables returned assertEquals(1, results.length); System.out.println("Test DRNODE table: " + results[0].toString()); validateSchema(results[0], expectedTable2); // One row per host for DRNODE stats results[0].advanceRow(); validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), true); } public void testDRPartitionStatistics() throws Exception { if (!VoltDB.instance().getConfig().m_isEnterprise) { System.out.println("SKIPPING DRPARTITION STATS TESTS FOR COMMUNITY VERSION"); return; } System.out.println("\n\nTESTING DRPARTITION STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema1 = new ColumnInfo[11]; expectedSchema1[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema1[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema1[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema1[3] = new ColumnInfo("PARTITION_ID", VoltType.INTEGER); expectedSchema1[4] = new ColumnInfo("STREAMTYPE", VoltType.STRING); expectedSchema1[5] = new ColumnInfo("TOTALBYTES", VoltType.BIGINT); expectedSchema1[6] = new ColumnInfo("TOTALBYTESINMEMORY", VoltType.BIGINT); expectedSchema1[7] = new ColumnInfo("TOTALBUFFERS", VoltType.BIGINT); expectedSchema1[8] = new ColumnInfo("LASTACKTIMESTAMP", VoltType.BIGINT); expectedSchema1[9] = new ColumnInfo("ISSYNCED", VoltType.STRING); expectedSchema1[10] = new ColumnInfo("MODE", VoltType.STRING); VoltTable expectedTable1 = new VoltTable(expectedSchema1); VoltTable[] results = null; // // DRPARTITION // results = client.callProcedure("@Statistics", "DRPARTITION", 0).getResults(); // one aggregate tables returned assertEquals(1, results.length); System.out.println("Test DR table: " + results[0].toString()); validateSchema(results[0], expectedTable1); // One row per site, don't have HSID for ease of check, just check a bunch of stuff assertEquals(HOSTS * SITES, results[0].getRowCount()); results[0].advanceRow(); validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), false); results[0].advanceRow(); validateRowSeenAtAllPartitions(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), false); } public void testDRStatistics() throws Exception { if (!VoltDB.instance().getConfig().m_isEnterprise) { System.out.println("SKIPPING DR STATS TESTS FOR COMMUNITY VERSION"); return; } System.out.println("\n\nTESTING DR STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema1 = new ColumnInfo[11]; expectedSchema1[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema1[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema1[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema1[3] = new ColumnInfo("PARTITION_ID", VoltType.INTEGER); expectedSchema1[4] = new ColumnInfo("STREAMTYPE", VoltType.STRING); expectedSchema1[5] = new ColumnInfo("TOTALBYTES", VoltType.BIGINT); expectedSchema1[6] = new ColumnInfo("TOTALBYTESINMEMORY", VoltType.BIGINT); expectedSchema1[7] = new ColumnInfo("TOTALBUFFERS", VoltType.BIGINT); expectedSchema1[8] = new ColumnInfo("LASTACKTIMESTAMP", VoltType.BIGINT); expectedSchema1[9] = new ColumnInfo("ISSYNCED", VoltType.STRING); expectedSchema1[10] = new ColumnInfo("MODE", VoltType.STRING); VoltTable expectedTable1 = new VoltTable(expectedSchema1); ColumnInfo[] expectedSchema2 = new ColumnInfo[7]; expectedSchema2[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema2[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema2[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema2[3] = new ColumnInfo("ENABLED", VoltType.STRING); expectedSchema2[4] = new ColumnInfo("SYNCSNAPSHOTSTATE", VoltType.STRING); expectedSchema2[5] = new ColumnInfo("ROWSINSYNCSNAPSHOT", VoltType.BIGINT); expectedSchema2[6] = new ColumnInfo("ROWSACKEDFORSYNCSNAPSHOT", VoltType.BIGINT); VoltTable expectedTable2 = new VoltTable(expectedSchema2); VoltTable[] results = null; // // DR // results = client.callProcedure("@Statistics", "DR", 0).getResults(); // two aggregate tables returned assertEquals(2, results.length); System.out.println("Test DR table: " + results[0].toString()); System.out.println("Test DR table: " + results[1].toString()); validateSchema(results[0], expectedTable1); validateSchema(results[1], expectedTable2); // One row per site, don't have HSID for ease of check, just check a bunch of stuff assertEquals(HOSTS * SITES, results[0].getRowCount()); results[0].advanceRow(); validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), false); results[0].advanceRow(); validateRowSeenAtAllPartitions(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), false); // One row per host for DRNODE stats results[1].advanceRow(); validateRowSeenAtAllHosts(results[1], "HOSTNAME", results[1].getString("HOSTNAME"), true); } public void testLiveClientsStatistics() throws Exception { System.out.println("\n\nTESTING LIVECLIENTS STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[9]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("CONNECTION_ID", VoltType.BIGINT); expectedSchema[4] = new ColumnInfo("CLIENT_HOSTNAME", VoltType.STRING); expectedSchema[5] = new ColumnInfo("ADMIN", VoltType.TINYINT); expectedSchema[6] = new ColumnInfo("OUTSTANDING_REQUEST_BYTES", VoltType.BIGINT); expectedSchema[7] = new ColumnInfo("OUTSTANDING_RESPONSE_MESSAGES", VoltType.BIGINT); expectedSchema[8] = new ColumnInfo("OUTSTANDING_TRANSACTIONS", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); int patientRetries = 2; int hostsHeardFrom = 0; // // LIVECLIENTS // do { // loop until we get the desired answer or lose patience waiting out possible races. VoltTable[] results = client.callProcedure("@Statistics", "LIVECLIENTS", 0).getResults(); // one aggregate table returned assertEquals(1, results.length); System.out.println("Test LIVECLIENTS table: " + results[0].toString()); validateSchema(results[0], expectedTable); // Hacky, on a single local cluster make sure that all 'nodes' are present. // LiveClients stats lacks a common string across nodes, but we can hijack the hostname in this case. results[0].advanceRow(); hostsHeardFrom = countHostsProvidingRows(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), true); } while ((hostsHeardFrom < HOSTS) && (--patientRetries) > 0); assertEquals(HOSTS, hostsHeardFrom); } public void testStarvationStatistics() throws Exception { System.out.println("\n\nTESTING STARVATION STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[10]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("SITE_ID", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("COUNT", VoltType.BIGINT); expectedSchema[5] = new ColumnInfo("PERCENT", VoltType.FLOAT); expectedSchema[6] = new ColumnInfo("AVG", VoltType.BIGINT); expectedSchema[7] = new ColumnInfo("MIN", VoltType.BIGINT); expectedSchema[8] = new ColumnInfo("MAX", VoltType.BIGINT); expectedSchema[9] = new ColumnInfo("STDDEV", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; // // STARVATION // results = client.callProcedure("@Statistics", "STARVATION", 0).getResults(); // one aggregate table returned assertEquals(1, results.length); System.out.println("Test STARVATION table: " + results[0].toString()); validateSchema(results[0], expectedTable); // One row per site, we don't use HSID though, so hard to do straightforward // per-site unique check. Finesse it. // We also get starvation stats for the MPI, so we need to add a site per host. assertEquals(HOSTS * (SITES + 1), results[0].getRowCount()); results[0].advanceRow(); validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), false); } public void testSnapshotStatus() throws Exception { System.out.println("\n\nTESTING SNAPSHOTSTATUS\n\n\n"); if (KFACTOR == 0) { // SnapshotSave is a PRO feature starting from 4.0 return; } Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[14]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("TABLE", VoltType.STRING); expectedSchema[4] = new ColumnInfo("PATH", VoltType.STRING); expectedSchema[5] = new ColumnInfo("FILENAME", VoltType.STRING); expectedSchema[6] = new ColumnInfo("NONCE", VoltType.STRING); expectedSchema[7] = new ColumnInfo("TXNID", VoltType.BIGINT); expectedSchema[8] = new ColumnInfo("START_TIME", VoltType.BIGINT); expectedSchema[9] = new ColumnInfo("END_TIME", VoltType.BIGINT); expectedSchema[10] = new ColumnInfo("SIZE", VoltType.BIGINT); expectedSchema[11] = new ColumnInfo("DURATION", VoltType.BIGINT); expectedSchema[12] = new ColumnInfo("THROUGHPUT", VoltType.FLOAT); expectedSchema[13] = new ColumnInfo("RESULT", VoltType.STRING); VoltTable expectedTable = new VoltTable(expectedSchema); // Finagle a snapshot client.callProcedure("@SnapshotSave", TMPDIR, TESTNONCE, 1); VoltTable[] results = null; // // SNAPSHOTSTATUS // results = client.callProcedure("@Statistics", "SNAPSHOTSTATUS", 0).getResults(); // one aggregate table returned assertEquals(1, results.length); System.out.println("Test SNAPSHOTSTATUS table: " + results[0].toString()); validateSchema(results[0], expectedTable); // One row per table per node validateRowSeenAtAllHosts(results[0], "TABLE", "WAREHOUSE", true); validateRowSeenAtAllHosts(results[0], "TABLE", "NEW_ORDER", true); validateRowSeenAtAllHosts(results[0], "TABLE", "ITEM", true); } public void testManagementStats() throws Exception { System.out.println("\n\nTESTING MANAGEMENT STATS\n\n\n"); Client client = getFullyConnectedClient(); VoltTable[] results = null; // // LIVECLIENTS // results = client.callProcedure("@Statistics", "MANAGEMENT", 0).getResults(); // eight aggregate tables returned. Assume that we have selected the right // subset of stats internally, just check that we get stuff. assertEquals(8, results.length); } class RebalanceStatsChecker { final double fuzzFactor; final int rangesToMove; long tStartMS; long rangesMoved = 0; long bytesMoved = 0; long rowsMoved = 0; long invocations = 0; long totalInvTimeMS = 0; RebalanceStatsChecker(int rangesToMove, double fuzzFactor) { this.fuzzFactor = fuzzFactor; this.rangesToMove = rangesToMove; this.tStartMS = System.currentTimeMillis(); } void update(int ranges, int bytes, int rows) { rangesMoved += ranges; bytesMoved += bytes; rowsMoved += rows; invocations++; } void checkFuzz(double expected, double actual) { double delta = Math.abs((expected - actual) / expected); if (delta > fuzzFactor) { assertFalse(Math.abs((expected - actual) / expected) > fuzzFactor); } } void check(BalancePartitionsStatistics.StatsPoint stats) { double totalTimeS = (System.currentTimeMillis() - tStartMS) / 1000.0; double statsRangesMoved1 = (stats.getPercentageMoved() / 100.0) * rangesToMove; checkFuzz(rangesMoved, statsRangesMoved1); double statsRangesMoved2 = stats.getRangesPerSecond() * totalTimeS; checkFuzz(rangesMoved, statsRangesMoved2); double statsBytesMoved = stats.getMegabytesPerSecond() * 1000000.0 * totalTimeS; checkFuzz(bytesMoved, statsBytesMoved); double statsRowsMoved = stats.getRowsPerSecond() * totalTimeS; checkFuzz(rowsMoved, statsRowsMoved); double statsInvocations = stats.getInvocationsPerSecond() * totalTimeS; checkFuzz(invocations, statsInvocations); double statsInvTimeMS = stats.getAverageInvocationTime() * invocations; assertTrue(Math.abs((totalInvTimeMS - statsInvTimeMS) / totalInvTimeMS) <= fuzzFactor); checkFuzz(totalInvTimeMS, statsInvTimeMS); double estTimeRemainingS = totalTimeS * (rangesToMove / (double)rangesMoved - 1.0); double statsEstTimeRemainingS = stats.getEstimatedRemaining() / 1000.0; checkFuzz(estTimeRemainingS, statsEstTimeRemainingS); } } public void testRebalanceStats() throws Exception { System.out.println("testRebalanceStats"); // Test constants final int DURATION_SECONDS = 10; final int INVOCATION_SLEEP_MILLIS = 500; final int IDLE_SLEEP_MILLIS = 200; final int RANGES_TO_MOVE = Integer.MAX_VALUE; final int BYTES_TO_MOVE = 10000000; final int ROWS_TO_MOVE = 1000000; final double FUZZ_FACTOR = .1; RebalanceStatsChecker checker = new RebalanceStatsChecker(RANGES_TO_MOVE, FUZZ_FACTOR); BalancePartitionsStatistics bps = new BalancePartitionsStatistics(RANGES_TO_MOVE); Random r = new Random(2222); // Random numbers are between zero and the constant, so everything will average out // to half the time and quantities. Nothing will be exhausted by the test. final int loopCount = (DURATION_SECONDS * 1000) / (INVOCATION_SLEEP_MILLIS + IDLE_SLEEP_MILLIS); for (int i = 0; i < loopCount; i++) { bps.logBalanceStarts(); int invocationTimeMS = r.nextInt(INVOCATION_SLEEP_MILLIS); Thread.sleep(invocationTimeMS); checker.totalInvTimeMS += invocationTimeMS; int ranges = r.nextInt(RANGES_TO_MOVE / loopCount); int bytes = r.nextInt(BYTES_TO_MOVE / loopCount); int rows = r.nextInt(ROWS_TO_MOVE / loopCount); bps.logBalanceEnds(ranges, bytes, TimeUnit.MILLISECONDS.toNanos(invocationTimeMS), TimeUnit.MILLISECONDS.toNanos(invocationTimeMS), rows); checker.update(ranges, bytes, rows); checker.check(bps.getLastStatsPoint()); int idleTimeMS = r.nextInt(IDLE_SLEEP_MILLIS); Thread.sleep(idleTimeMS); } // Check the results with fuzzing to avoid rounding errors. checker.check(bps.getOverallStats()); } // // Build a list of the tests to be run. Use the regression suite // helpers to allow multiple backends. // JUnit magic that uses the regression suite helper classes. // static public Test suite() throws IOException { VoltServerConfig config = null; MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestStatisticsSuite.class); // Not really using TPCC functionality but need a database. // The testLoadMultipartitionTable procedure assumes partitioning // on warehouse id. VoltProjectBuilder project = new VoltProjectBuilder(); project.addLiteralSchema( "CREATE TABLE WAREHOUSE (\n" + " W_ID SMALLINT DEFAULT '0' NOT NULL,\n" + " W_NAME VARCHAR(16) DEFAULT NULL,\n" + " W_STREET_1 VARCHAR(32) DEFAULT NULL,\n" + " W_STREET_2 VARCHAR(32) DEFAULT NULL,\n" + " W_CITY VARCHAR(32) DEFAULT NULL,\n" + " W_STATE VARCHAR(2) DEFAULT NULL,\n" + " W_ZIP VARCHAR(9) DEFAULT NULL,\n" + " W_TAX FLOAT DEFAULT NULL,\n" + " W_YTD FLOAT DEFAULT NULL,\n" + " CONSTRAINT W_PK_TREE PRIMARY KEY (W_ID)\n" + ");\n" + "CREATE TABLE ITEM (\n" + " I_ID INTEGER DEFAULT '0' NOT NULL,\n" + " I_IM_ID INTEGER DEFAULT NULL,\n" + " I_NAME VARCHAR(32) DEFAULT NULL,\n" + " I_PRICE FLOAT DEFAULT NULL,\n" + " I_DATA VARCHAR(64) DEFAULT NULL,\n" + " CONSTRAINT I_PK_TREE PRIMARY KEY (I_ID)\n" + ");\n" + "CREATE TABLE NEW_ORDER (\n" + " NO_W_ID SMALLINT DEFAULT '0' NOT NULL\n" + ");\n"); project.addPartitionInfo("WAREHOUSE", "W_ID"); project.addPartitionInfo("NEW_ORDER", "NO_W_ID"); project.addProcedures(PROCEDURES); /* * Add a cluster configuration for sysprocs too */ config = new LocalCluster("statistics-cluster.jar", TestStatisticsSuite.SITES, TestStatisticsSuite.HOSTS, TestStatisticsSuite.KFACTOR, BackendTarget.NATIVE_EE_JNI); ((LocalCluster) config).setHasLocalServer(hasLocalServer); boolean success = config.compile(project); assertTrue(success); builder.addServerConfig(config); return builder; } }
tests/frontend/org/voltdb/regressionsuites/TestStatisticsSuite.java
/* This file is part of VoltDB. * Copyright (C) 2008-2014 VoltDB Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ package org.voltdb.regressionsuites; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Random; import java.util.Set; import java.util.concurrent.TimeUnit; import junit.framework.Test; import org.HdrHistogram_voltpatches.AbstractHistogram; import org.HdrHistogram_voltpatches.Histogram; import org.hsqldb_voltpatches.HSQLInterface; import org.voltcore.utils.CompressionStrategySnappy; import org.voltdb.BackendTarget; import org.voltdb.VoltDB; import org.voltdb.VoltTable; import org.voltdb.VoltTable.ColumnInfo; import org.voltdb.VoltType; import org.voltdb.client.Client; import org.voltdb.client.ProcCallException; import org.voltdb.compiler.VoltProjectBuilder; import org.voltdb.iv2.MpInitiator; import org.voltdb.join.BalancePartitionsStatistics; import org.voltdb.utils.MiscUtils; import org.voltdb_testprocs.regressionsuites.malicious.GoSleep; public class TestStatisticsSuite extends SaveRestoreBase { private static int SITES = 2; private static int HOSTS = 3; private static int KFACTOR = MiscUtils.isPro() ? 1 : 0; private static int PARTITIONS = (SITES * HOSTS) / (KFACTOR + 1); private static boolean hasLocalServer = false; static final Class<?>[] PROCEDURES = { GoSleep.class }; public TestStatisticsSuite(String name) { super(name); } // For the provided table, verify that there is a row for each host in the cluster where // the column designated by 'columnName' has the value 'rowId'. For example, for // Initiator stats, if columnName is 'PROCEDURE_NAME' and rowId is 'foo', this // will verify that the initiator at each node has seen a procedure invocation for 'foo' public void validateRowSeenAtAllHosts(VoltTable result, String columnName, String rowId, boolean enforceUnique) { result.resetRowPosition(); Set<Long> hostsSeen = new HashSet<Long>(); while (result.advanceRow()) { String procName = result.getString(columnName); if (procName.equalsIgnoreCase(rowId)) { Long thisHostId = result.getLong("HOST_ID"); if (enforceUnique) { assertFalse("HOST_ID: " + thisHostId + " seen twice in table looking for " + rowId + " in column " + columnName, hostsSeen.contains(thisHostId)); } hostsSeen.add(thisHostId); } } // Before failing the assert, report details of the non-conforming result. if (HOSTS != hostsSeen.size()) { System.out.println("Something in the following results will fail the assert."); result.resetRowPosition(); while (result.advanceRow()) { String procName = result.getString(columnName); Long thisHostId = result.getLong("HOST_ID"); if (procName.equalsIgnoreCase(rowId)) { System.out.println("Found the match at host " + thisHostId + " for proc " + procName + (hostsSeen.add(thisHostId) ? " added" : " duplicated")); } else { System.out.println("Found non-match at host " + thisHostId + " for proc " + procName); } } } assertEquals(HOSTS, hostsSeen.size()); } // For the provided table, verify that there is a row for each site in the cluster where // the column designated by 'columnName' has the value 'rowId'. For example, for // Table stats, if columnName is 'TABLE_NAME' and rowId is 'foo', this // will verify that each site has returned results for table 'foo' public boolean validateRowSeenAtAllSites(VoltTable result, String columnName, String rowId, boolean enforceUnique) { result.resetRowPosition(); Set<Long> sitesSeen = new HashSet<Long>(); while (result.advanceRow()) { String procName = result.getString(columnName); if (procName.equalsIgnoreCase(rowId)) { long hostId = result.getLong("HOST_ID"); long thisSiteId = result.getLong("SITE_ID"); thisSiteId |= hostId << 32; if (enforceUnique) { assertFalse("SITE_ID: " + thisSiteId + " seen twice in table looking for " + rowId + " in column " + columnName, sitesSeen.contains(thisSiteId)); } sitesSeen.add(thisSiteId); } } return (HOSTS * SITES) == sitesSeen.size(); } // For the provided table, verify that there is a row for each partition in the cluster where // the column designated by 'columnName' has the value 'rowId'. public void validateRowSeenAtAllPartitions(VoltTable result, String columnName, String rowId, boolean enforceUnique) { result.resetRowPosition(); Set<Long> partsSeen = new HashSet<Long>(); while (result.advanceRow()) { String procName = result.getString(columnName); if (procName.equalsIgnoreCase(rowId)) { long thisPartId = result.getLong("PARTITION_ID"); if (enforceUnique) { assertFalse("PARTITION_ID: " + thisPartId + " seen twice in table looking for " + rowId + " in column " + columnName, partsSeen.contains(thisPartId)); } partsSeen.add(thisPartId); } } assertEquals(PARTITIONS, partsSeen.size()); } public void testInvalidCalls() throws Exception { System.out.println("\n\nTESTING INVALID CALLS\n\n\n"); Client client = getFullyConnectedClient(); // // invalid selector // try { // No selector at all. client.callProcedure("@Statistics"); fail(); } catch (ProcCallException ex) { // All badness gets turned into ProcCallExceptions, so we need // to check specifically for this error, otherwise things that // crash the cluster also turn into ProcCallExceptions and don't // trigger failure (ENG-2347) assertEquals("Incorrect number of arguments to @Statistics (expects 2, received 0)", ex.getMessage()); } try { // extra stuff client.callProcedure("@Statistics", "table", 0, "OHHAI"); fail(); } catch (ProcCallException ex) { assertEquals("Incorrect number of arguments to @Statistics (expects 2, received 3)", ex.getMessage()); } try { // Invalid selector client.callProcedure("@Statistics", "garbage", 0); fail(); } catch (ProcCallException ex) {} } public void testLatencyStatistics() throws Exception { System.out.println("\n\nTESTING LATENCY STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[5]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("SITE_ID", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("HISTOGRAM", VoltType.VARBINARY); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; // Do some stuff to generate some latency stats for (int i = 0; i < SITES * HOSTS; i++) { results = client.callProcedure("NEW_ORDER.insert", i).getResults(); } results = client.callProcedure("@Statistics", "LATENCY", 0).getResults(); // one aggregate table returned assertEquals(1, results.length); System.out.println("Test latency table: " + results[0].toString()); validateSchema(results[0], expectedTable); // should have at least one row from each host results[0].advanceRow(); validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), false); // actually, there are 26 rows per host so: assertEquals(HOSTS, results[0].getRowCount()); // Check for non-zero invocations (ENG-4668) long invocations = 0; results[0].resetRowPosition(); while (results[0].advanceRow()) { byte histogramBytes[] = results[0].getVarbinary("HISTOGRAM"); Histogram h = AbstractHistogram.fromCompressedBytes(histogramBytes, CompressionStrategySnappy.INSTANCE); invocations += h.getHistogramData().getTotalCount(); } assertTrue(invocations > 0); } public void testInitiatorStatistics() throws Exception { System.out.println("\n\nTESTING INITIATOR STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[13]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("SITE_ID", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("CONNECTION_ID", VoltType.BIGINT); expectedSchema[5] = new ColumnInfo("CONNECTION_HOSTNAME", VoltType.STRING); expectedSchema[6] = new ColumnInfo("PROCEDURE_NAME", VoltType.STRING); expectedSchema[7] = new ColumnInfo("INVOCATIONS", VoltType.BIGINT); expectedSchema[8] = new ColumnInfo("AVG_EXECUTION_TIME", VoltType.INTEGER); expectedSchema[9] = new ColumnInfo("MIN_EXECUTION_TIME", VoltType.INTEGER); expectedSchema[10] = new ColumnInfo("MAX_EXECUTION_TIME", VoltType.INTEGER); expectedSchema[11] = new ColumnInfo("ABORTS", VoltType.BIGINT); expectedSchema[12] = new ColumnInfo("FAILURES", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); // // initiator selector // VoltTable results[] = null; // This should get us an invocation at each host for (int i = 0; i < 1000; i++) { results = client.callProcedure("NEW_ORDER.insert", i).getResults(); } results = client.callProcedure("@Statistics", "INITIATOR", 0).getResults(); // one aggregate table returned assertEquals(1, results.length); System.out.println("Test initiators table: " + results[0].toString()); // Check the schema validateSchema(results[0], expectedTable); // One WAREHOUSE.select row per host assertEquals(HOSTS, results[0].getRowCount()); // Verify the invocation counts int counts = 0; while (results[0].advanceRow()) { String procName = results[0].getString("PROCEDURE_NAME"); if (procName.equals("@SystemCatalog")) { // One for each connection from the client assertEquals(HOSTS, results[0].getLong("INVOCATIONS")); } else if (procName.equals("NEW_ORDER.insert")) { counts += results[0].getLong("INVOCATIONS"); } } assertEquals(1000, counts); // verify that each node saw a NEW_ORDER.insert initiation validateRowSeenAtAllHosts(results[0], "PROCEDURE_NAME", "NEW_ORDER.insert", true); } public void testPartitionCount() throws Exception { System.out.println("\n\nTESTING PARTITION COUNT\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[4]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("PARTITION_COUNT", VoltType.INTEGER); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; results = client.callProcedure("@Statistics", "PARTITIONCOUNT", 0).getResults(); // Only one table returned assertEquals(1, results.length); validateSchema(results[0], expectedTable); // Should only get one row, total assertEquals(1, results[0].getRowCount()); results[0].advanceRow(); int partCount = (int)results[0].getLong("PARTITION_COUNT"); assertEquals(PARTITIONS, partCount); } public void testTableStatistics() throws Exception { System.out.println("\n\nTESTING TABLE STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[13]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("SITE_ID", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("PARTITION_ID", VoltType.BIGINT); expectedSchema[5] = new ColumnInfo("TABLE_NAME", VoltType.STRING); expectedSchema[6] = new ColumnInfo("TABLE_TYPE", VoltType.STRING); expectedSchema[7] = new ColumnInfo("TUPLE_COUNT", VoltType.BIGINT); expectedSchema[8] = new ColumnInfo("TUPLE_ALLOCATED_MEMORY", VoltType.INTEGER); expectedSchema[9] = new ColumnInfo("TUPLE_DATA_MEMORY", VoltType.INTEGER); expectedSchema[10] = new ColumnInfo("STRING_DATA_MEMORY", VoltType.INTEGER); expectedSchema[11] = new ColumnInfo("TUPLE_LIMIT", VoltType.INTEGER); expectedSchema[12] = new ColumnInfo("PERCENT_FULL", VoltType.INTEGER); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; boolean success = false; long start = System.currentTimeMillis(); while (!success) { if (System.currentTimeMillis() - start > 60000) fail("Took too long"); success = true; // table // results = client.callProcedure("@Statistics", "table", 0).getResults(); System.out.println("Test statistics table: " + results[0].toString()); // one aggregate table returned assertEquals(1, results.length); validateSchema(results[0], expectedTable); // with 10 rows per site. Can be two values depending on the test scenario of cluster vs. local. if (HOSTS * SITES * 3 != results[0].getRowCount()) { success = false; } // Validate that each site returns a result for each table if (success) { success = validateRowSeenAtAllSites(results[0], "TABLE_NAME", "WAREHOUSE", true); } if (success) { success = validateRowSeenAtAllSites(results[0], "TABLE_NAME", "NEW_ORDER", true); } if (success) { validateRowSeenAtAllSites(results[0], "TABLE_NAME", "ITEM", true); } if (success) break; } } public void testIndexStatistics() throws Exception { System.out.println("\n\nTESTING INDEX STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[12]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("SITE_ID", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("PARTITION_ID", VoltType.BIGINT); expectedSchema[5] = new ColumnInfo("INDEX_NAME", VoltType.STRING); expectedSchema[6] = new ColumnInfo("TABLE_NAME", VoltType.STRING); expectedSchema[7] = new ColumnInfo("INDEX_TYPE", VoltType.STRING); expectedSchema[8] = new ColumnInfo("IS_UNIQUE", VoltType.TINYINT); expectedSchema[9] = new ColumnInfo("IS_COUNTABLE", VoltType.TINYINT); expectedSchema[10] = new ColumnInfo("ENTRY_COUNT", VoltType.BIGINT); expectedSchema[11] = new ColumnInfo("MEMORY_ESTIMATE", VoltType.INTEGER); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; boolean success = false; long start = System.currentTimeMillis(); while (!success) { if (System.currentTimeMillis() - start > 60000) fail("Took too long"); success = true; results = client.callProcedure("@Statistics", "index", 0).getResults(); System.out.println("Index results: " + results[0].toString()); assertEquals(1, results.length); validateSchema(results[0], expectedTable); if (success) { success = validateRowSeenAtAllSites(results[0], "INDEX_NAME", HSQLInterface.AUTO_GEN_CONSTRAINT_WRAPPER_PREFIX + "W_PK_TREE", true); } if (success) { success = validateRowSeenAtAllSites(results[0], "INDEX_NAME", HSQLInterface.AUTO_GEN_CONSTRAINT_WRAPPER_PREFIX + "I_PK_TREE", true); } if (success) break; } } public void testMemoryStatistics() throws Exception { System.out.println("\n\nTESTING MEMORY STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[13]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("RSS", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("JAVAUSED", VoltType.INTEGER); expectedSchema[5] = new ColumnInfo("JAVAUNUSED", VoltType.INTEGER); expectedSchema[6] = new ColumnInfo("TUPLEDATA", VoltType.INTEGER); expectedSchema[7] = new ColumnInfo("TUPLEALLOCATED", VoltType.INTEGER); expectedSchema[8] = new ColumnInfo("INDEXMEMORY", VoltType.INTEGER); expectedSchema[9] = new ColumnInfo("STRINGMEMORY", VoltType.INTEGER); expectedSchema[10] = new ColumnInfo("TUPLECOUNT", VoltType.BIGINT); expectedSchema[11] = new ColumnInfo("POOLEDMEMORY", VoltType.BIGINT); expectedSchema[12] = new ColumnInfo("PHYSICALMEMORY", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; // // memory // // give time to seed the stats cache? Thread.sleep(1000); results = client.callProcedure("@Statistics", "memory", 0).getResults(); System.out.println("Node memory statistics table: " + results[0].toString()); // one aggregate table returned assertEquals(1, results.length); validateSchema(results[0], expectedTable); results[0].advanceRow(); // Hacky, on a single local cluster make sure that all 'nodes' are present. // MEMORY stats lacks a common string across nodes, but we can hijack the hostname in this case. validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), true); } public void testCpuStatistics() throws Exception { System.out.println("\n\nTESTING CPU STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[4]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("PERCENT_USED", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; // // cpu // // give time to seed the stats cache? Thread.sleep(1000); results = client.callProcedure("@Statistics", "cpu", 0).getResults(); System.out.println("Node cpu statistics table: " + results[0].toString()); // one aggregate table returned assertEquals(1, results.length); validateSchema(results[0], expectedTable); results[0].advanceRow(); // Hacky, on a single local cluster make sure that all 'nodes' are present. // CPU stats lacks a common string across nodes, but we can hijack the hostname in this case. validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), true); } public void testProcedureStatistics() throws Exception { System.out.println("\n\nTESTING PROCEDURE STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[19]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("SITE_ID", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("PARTITION_ID", VoltType.INTEGER); expectedSchema[5] = new ColumnInfo("PROCEDURE", VoltType.STRING); expectedSchema[6] = new ColumnInfo("INVOCATIONS", VoltType.BIGINT); expectedSchema[7] = new ColumnInfo("TIMED_INVOCATIONS", VoltType.BIGINT); expectedSchema[8] = new ColumnInfo("MIN_EXECUTION_TIME", VoltType.BIGINT); expectedSchema[9] = new ColumnInfo("MAX_EXECUTION_TIME", VoltType.BIGINT); expectedSchema[10] = new ColumnInfo("AVG_EXECUTION_TIME", VoltType.BIGINT); expectedSchema[11] = new ColumnInfo("MIN_RESULT_SIZE", VoltType.INTEGER); expectedSchema[12] = new ColumnInfo("MAX_RESULT_SIZE", VoltType.INTEGER); expectedSchema[13] = new ColumnInfo("AVG_RESULT_SIZE", VoltType.INTEGER); expectedSchema[14] = new ColumnInfo("MIN_PARAMETER_SET_SIZE", VoltType.INTEGER); expectedSchema[15] = new ColumnInfo("MAX_PARAMETER_SET_SIZE", VoltType.INTEGER); expectedSchema[16] = new ColumnInfo("AVG_PARAMETER_SET_SIZE", VoltType.INTEGER); expectedSchema[17] = new ColumnInfo("ABORTS", VoltType.BIGINT); expectedSchema[18] = new ColumnInfo("FAILURES", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; // // procedure // // Induce procedure invocations on all partitions. May fail in non-legacy hashing case // this plus R/W replication should ensure that every site on every node runs this transaction // at least once results = client.callProcedure("@GetPartitionKeys", "INTEGER").getResults(); VoltTable keys = results[0]; for (int k = 0;k < keys.getRowCount(); k++) { long key = keys.fetchRow(k).getLong(1); client.callProcedure("NEW_ORDER.insert", key); } for (int i = 0; i < HOSTS * SITES; i++) { client.callProcedure("NEW_ORDER.insert", i); } // 3 seconds translates to 3 billion nanos, which overflows internal // values (ENG-1039) //It's possible that the nanosecond count goes backwards... so run this a couple //of times to make sure the min value gets set for (int ii = 0; ii < 3; ii++) { results = client.callProcedure("GoSleep", 3000, 0, null).getResults(); } results = client.callProcedure("@Statistics", "procedure", 0).getResults(); System.out.println("Test procedures table: " + results[0].toString()); // one aggregate table returned assertEquals(1, results.length); validateSchema(results[0], expectedTable); // For this table, where unique HSID isn't written to SITE_ID, these // two checks should ensure we get all the rows we expect? validateRowSeenAtAllHosts(results[0], "PROCEDURE", "NEW_ORDER.insert", false); validateRowSeenAtAllPartitions(results[0], "PROCEDURE", "NEW_ORDER.insert", false); results[0].resetRowPosition(); VoltTable stats = results[0]; String procname = "blerg"; while (!procname.equals("org.voltdb_testprocs.regressionsuites.malicious.GoSleep")) { stats.advanceRow(); procname = (String)stats.get("PROCEDURE", VoltType.STRING); } // Retrieve all statistics long min_time = (Long)stats.get("MIN_EXECUTION_TIME", VoltType.BIGINT); long max_time = (Long)stats.get("MAX_EXECUTION_TIME", VoltType.BIGINT); long avg_time = (Long)stats.get("AVG_EXECUTION_TIME", VoltType.BIGINT); long min_result_size = (Long)stats.get("MIN_RESULT_SIZE", VoltType.BIGINT); long max_result_size = (Long)stats.get("MAX_RESULT_SIZE", VoltType.BIGINT); long avg_result_size = (Long)stats.get("AVG_RESULT_SIZE", VoltType.BIGINT); long min_parameter_set_size = (Long)stats.get("MIN_PARAMETER_SET_SIZE", VoltType.BIGINT); long max_parameter_set_size = (Long)stats.get("MAX_PARAMETER_SET_SIZE", VoltType.BIGINT); long avg_parameter_set_size = (Long)stats.get("AVG_PARAMETER_SET_SIZE", VoltType.BIGINT); // Check for overflow assertTrue("Failed MIN_EXECUTION_TIME > 0, value was: " + min_time, min_time > 0); assertTrue("Failed MAX_EXECUTION_TIME > 0, value was: " + max_time, max_time > 0); assertTrue("Failed AVG_EXECUTION_TIME > 0, value was: " + avg_time, avg_time > 0); assertTrue("Failed MIN_RESULT_SIZE > 0, value was: " + min_result_size, min_result_size >= 0); assertTrue("Failed MAX_RESULT_SIZE > 0, value was: " + max_result_size, max_result_size >= 0); assertTrue("Failed AVG_RESULT_SIZE > 0, value was: " + avg_result_size, avg_result_size >= 0); assertTrue("Failed MIN_PARAMETER_SET_SIZE > 0, value was: " + min_parameter_set_size, min_parameter_set_size >= 0); assertTrue("Failed MAX_PARAMETER_SET_SIZE > 0, value was: " + max_parameter_set_size, max_parameter_set_size >= 0); assertTrue("Failed AVG_PARAMETER_SET_SIZE > 0, value was: " + avg_parameter_set_size, avg_parameter_set_size >= 0); // check for reasonable values assertTrue("Failed MIN_EXECUTION_TIME > 2,400,000,000ns, value was: " + min_time, min_time > 2400000000L); assertTrue("Failed MAX_EXECUTION_TIME > 2,400,000,000ns, value was: " + max_time, max_time > 2400000000L); assertTrue("Failed AVG_EXECUTION_TIME > 2,400,000,000ns, value was: " + avg_time, avg_time > 2400000000L); assertTrue("Failed MIN_RESULT_SIZE < 1,000,000, value was: " + min_result_size, min_result_size < 1000000L); assertTrue("Failed MAX_RESULT_SIZE < 1,000,000, value was: " + max_result_size, max_result_size < 1000000L); assertTrue("Failed AVG_RESULT_SIZE < 1,000,000, value was: " + avg_result_size, avg_result_size < 1000000L); assertTrue("Failed MIN_PARAMETER_SET_SIZE < 1,000,000, value was: " + min_parameter_set_size, min_parameter_set_size < 1000000L); assertTrue("Failed MAX_PARAMETER_SET_SIZE < 1,000,000, value was: " + max_parameter_set_size, max_parameter_set_size < 1000000L); assertTrue("Failed AVG_PARAMETER_SET_SIZE < 1,000,000, value was: " + avg_parameter_set_size, avg_parameter_set_size < 1000000L); // Validate the PROCEDUREPROFILE aggregation. results = client.callProcedure("@Statistics", "procedureprofile", 0).getResults(); System.out.println("\n\n\n" + results[0].toString() + "\n\n\n"); // expect NEW_ORDER.insert, GoSleep // see TestStatsProcProfile.java for tests of the aggregation itself. assertEquals("Validate site filtering for PROCEDUREPROFILE", 2, results[0].getRowCount()); } public void testIOStatistics() throws Exception { System.out.println("\n\nTESTING IO STATS\n\n\n"); Client client = getFullyConnectedClient(); // Based on doc, not code // HOST_ID, SITE_ID, and PARTITION_ID all differ. Fixed to match // reality so tests would pass, but, ugh. ColumnInfo[] expectedSchema = new ColumnInfo[9]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("CONNECTION_ID", VoltType.BIGINT); expectedSchema[4] = new ColumnInfo("CONNECTION_HOSTNAME", VoltType.STRING); expectedSchema[5] = new ColumnInfo("BYTES_READ", VoltType.BIGINT); expectedSchema[6] = new ColumnInfo("MESSAGES_READ", VoltType.BIGINT); expectedSchema[7] = new ColumnInfo("BYTES_WRITTEN", VoltType.BIGINT); expectedSchema[8] = new ColumnInfo("MESSAGES_WRITTEN", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; // // iostats // results = client.callProcedure("@Statistics", "iostats", 0).getResults(); System.out.println("Test iostats table: " + results[0].toString()); // one aggregate table returned assertEquals(1, results.length); validateSchema(results[0], expectedTable); } public void testTopoStatistics() throws Exception { System.out.println("\n\nTESTING TOPO STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema1 = new ColumnInfo[3]; expectedSchema1[0] = new ColumnInfo("Partition", VoltType.INTEGER); expectedSchema1[1] = new ColumnInfo("Sites", VoltType.STRING); expectedSchema1[2] = new ColumnInfo("Leader", VoltType.STRING); VoltTable expectedTable1 = new VoltTable(expectedSchema1); ColumnInfo[] expectedSchema2 = new ColumnInfo[2]; expectedSchema2[0] = new ColumnInfo("HASHTYPE", VoltType.STRING); expectedSchema2[1] = new ColumnInfo("HASHCONFIG", VoltType.VARBINARY); VoltTable expectedTable2 = new VoltTable(expectedSchema2); VoltTable[] results = null; // // TOPO // results = client.callProcedure("@Statistics", "TOPO", 0).getResults(); // two aggregate tables returned assertEquals(2, results.length); System.out.println("Test TOPO table: " + results[0].toString()); System.out.println("Test TOPO table: " + results[1].toString()); validateSchema(results[0], expectedTable1); validateSchema(results[1], expectedTable2); VoltTable topo = results[0]; // Should have partitions + 1 rows in the first table assertEquals(PARTITIONS + 1, results[0].getRowCount()); // Make sure we can find the MPI, at least boolean found = false; while (topo.advanceRow()) { if ((int)topo.getLong("Partition") == MpInitiator.MP_INIT_PID) { found = true; } } assertTrue(found); // and only one row in the second table assertEquals(1, results[1].getRowCount()); } // // planner statistics // public void testPlannerStatistics() throws Exception { System.out.println("\n\nTESTING PLANNER STATS\n\n\n"); Client client = getClient(); ColumnInfo[] expectedSchema = new ColumnInfo[14]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("SITE_ID", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("PARTITION_ID", VoltType.INTEGER); expectedSchema[5] = new ColumnInfo("CACHE1_LEVEL", VoltType.INTEGER); expectedSchema[6] = new ColumnInfo("CACHE2_LEVEL", VoltType.INTEGER); expectedSchema[7] = new ColumnInfo("CACHE1_HITS", VoltType.INTEGER); expectedSchema[8] = new ColumnInfo("CACHE2_HITS", VoltType.INTEGER); expectedSchema[9] = new ColumnInfo("CACHE_MISSES", VoltType.INTEGER); expectedSchema[10] = new ColumnInfo("PLAN_TIME_MIN", VoltType.BIGINT); expectedSchema[11] = new ColumnInfo("PLAN_TIME_MAX", VoltType.BIGINT); expectedSchema[12] = new ColumnInfo("PLAN_TIME_AVG", VoltType.BIGINT); expectedSchema[13] = new ColumnInfo("FAILURES", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; // Clear the interval statistics results = client.callProcedure("@Statistics", "planner", 1).getResults(); assertEquals(1, results.length); // Invoke a few select queries a few times to get some cache hits and misses, // and to exceed the sampling frequency. // This does not use level 2 cache (parameterization) or trigger failures. for (String query : new String[] { "select * from warehouse", "select * from new_order", "select * from item", }) { for (int i = 0; i < 10; i++) { client.callProcedure("@AdHoc", query).getResults(); assertEquals(1, results.length); } } // Get the final interval statistics results = client.callProcedure("@Statistics", "planner", 1).getResults(); assertEquals(1, results.length); System.out.println("Test planner table: " + results[0].toString()); validateSchema(results[0], expectedTable); VoltTable stats = results[0]; // Sample the statistics List<Long> siteIds = new ArrayList<Long>(); int cache1_level = 0; int cache2_level = 0; int cache1_hits = 0; int cache2_hits = 0; int cache_misses = 0; long plan_time_min_min = Long.MAX_VALUE; long plan_time_max_max = Long.MIN_VALUE; long plan_time_avg_tot = 0; int failures = 0; while (stats.advanceRow()) { cache1_level += (Integer)stats.get("CACHE1_LEVEL", VoltType.INTEGER); cache2_level += (Integer)stats.get("CACHE2_LEVEL", VoltType.INTEGER); cache1_hits += (Integer)stats.get("CACHE1_HITS", VoltType.INTEGER); cache2_hits += (Integer)stats.get("CACHE2_HITS", VoltType.INTEGER); cache_misses += (Integer)stats.get("CACHE_MISSES", VoltType.INTEGER); plan_time_min_min = Math.min(plan_time_min_min, (Long)stats.get("PLAN_TIME_MIN", VoltType.BIGINT)); plan_time_max_max = Math.max(plan_time_max_max, (Long)stats.get("PLAN_TIME_MAX", VoltType.BIGINT)); plan_time_avg_tot += (Long)stats.get("PLAN_TIME_AVG", VoltType.BIGINT); failures += (Integer)stats.get("FAILURES", VoltType.INTEGER); siteIds.add((Long)stats.get("SITE_ID", VoltType.BIGINT)); } // Check for reasonable results int globalPlanners = 0; assertTrue("Failed siteIds count >= 2", siteIds.size() >= 2); for (long siteId : siteIds) { if (siteId == -1) { globalPlanners++; } } assertTrue("Global planner sites not 1, value was: " + globalPlanners, globalPlanners == 1); assertTrue("Failed total CACHE1_LEVEL > 0, value was: " + cache1_level, cache1_level > 0); assertTrue("Failed total CACHE1_LEVEL < 1,000,000, value was: " + cache1_level, cache1_level < 1000000); assertTrue("Failed total CACHE2_LEVEL >= 0, value was: " + cache2_level, cache2_level >= 0); assertTrue("Failed total CACHE2_LEVEL < 1,000,000, value was: " + cache2_level, cache2_level < 1000000); assertTrue("Failed total CACHE1_HITS > 0, value was: " + cache1_hits, cache1_hits > 0); assertTrue("Failed total CACHE1_HITS < 1,000,000, value was: " + cache1_hits, cache1_hits < 1000000); assertTrue("Failed total CACHE2_HITS == 0, value was: " + cache2_hits, cache2_hits == 0); assertTrue("Failed total CACHE2_HITS < 1,000,000, value was: " + cache2_hits, cache2_hits < 1000000); assertTrue("Failed total CACHE_MISSES > 0, value was: " + cache_misses, cache_misses > 0); assertTrue("Failed total CACHE_MISSES < 1,000,000, value was: " + cache_misses, cache_misses < 1000000); assertTrue("Failed min PLAN_TIME_MIN > 0, value was: " + plan_time_min_min, plan_time_min_min > 0); assertTrue("Failed total PLAN_TIME_MIN < 100,000,000,000, value was: " + plan_time_min_min, plan_time_min_min < 100000000000L); assertTrue("Failed max PLAN_TIME_MAX > 0, value was: " + plan_time_max_max, plan_time_max_max > 0); assertTrue("Failed total PLAN_TIME_MAX < 100,000,000,000, value was: " + plan_time_max_max, plan_time_max_max < 100000000000L); assertTrue("Failed total PLAN_TIME_AVG > 0, value was: " + plan_time_avg_tot, plan_time_avg_tot > 0); assertTrue("Failed total FAILURES == 0, value was: " + failures, failures == 0); } public void testDRNodeStatistics() throws Exception { if (!VoltDB.instance().getConfig().m_isEnterprise) { System.out.println("SKIPPING DRNODE STATS TESTS FOR COMMUNITY VERSION"); return; } System.out.println("\n\nTESTING DRNODE STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema2 = new ColumnInfo[7]; expectedSchema2[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema2[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema2[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema2[3] = new ColumnInfo("ENABLED", VoltType.STRING); expectedSchema2[4] = new ColumnInfo("SYNCSNAPSHOTSTATE", VoltType.STRING); expectedSchema2[5] = new ColumnInfo("ROWSINSYNCSNAPSHOT", VoltType.BIGINT); expectedSchema2[6] = new ColumnInfo("ROWSACKEDFORSYNCSNAPSHOT", VoltType.BIGINT); VoltTable expectedTable2 = new VoltTable(expectedSchema2); VoltTable[] results = null; // // DRNODE // results = client.callProcedure("@Statistics", "DRNODE", 0).getResults(); // one aggregate tables returned assertEquals(1, results.length); System.out.println("Test DRNODE table: " + results[0].toString()); validateSchema(results[0], expectedTable2); // One row per host for DRNODE stats results[0].advanceRow(); validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), true); } public void testDRPartitionStatistics() throws Exception { if (!VoltDB.instance().getConfig().m_isEnterprise) { System.out.println("SKIPPING DRPARTITION STATS TESTS FOR COMMUNITY VERSION"); return; } System.out.println("\n\nTESTING DRPARTITION STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema1 = new ColumnInfo[11]; expectedSchema1[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema1[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema1[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema1[3] = new ColumnInfo("PARTITION_ID", VoltType.INTEGER); expectedSchema1[4] = new ColumnInfo("STREAMTYPE", VoltType.STRING); expectedSchema1[5] = new ColumnInfo("TOTALBYTES", VoltType.BIGINT); expectedSchema1[6] = new ColumnInfo("TOTALBYTESINMEMORY", VoltType.BIGINT); expectedSchema1[7] = new ColumnInfo("TOTALBUFFERS", VoltType.BIGINT); expectedSchema1[8] = new ColumnInfo("LASTACKTIMESTAMP", VoltType.BIGINT); expectedSchema1[9] = new ColumnInfo("ISSYNCED", VoltType.STRING); expectedSchema1[10] = new ColumnInfo("MODE", VoltType.STRING); VoltTable expectedTable1 = new VoltTable(expectedSchema1); VoltTable[] results = null; // // DRPARTITION // results = client.callProcedure("@Statistics", "DRPARTITION", 0).getResults(); // one aggregate tables returned assertEquals(1, results.length); System.out.println("Test DR table: " + results[0].toString()); validateSchema(results[0], expectedTable1); // One row per site, don't have HSID for ease of check, just check a bunch of stuff assertEquals(HOSTS * SITES, results[0].getRowCount()); results[0].advanceRow(); validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), false); results[0].advanceRow(); validateRowSeenAtAllPartitions(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), false); } public void testDRStatistics() throws Exception { if (!VoltDB.instance().getConfig().m_isEnterprise) { System.out.println("SKIPPING DR STATS TESTS FOR COMMUNITY VERSION"); return; } System.out.println("\n\nTESTING DR STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema1 = new ColumnInfo[11]; expectedSchema1[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema1[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema1[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema1[3] = new ColumnInfo("PARTITION_ID", VoltType.INTEGER); expectedSchema1[4] = new ColumnInfo("STREAMTYPE", VoltType.STRING); expectedSchema1[5] = new ColumnInfo("TOTALBYTES", VoltType.BIGINT); expectedSchema1[6] = new ColumnInfo("TOTALBYTESINMEMORY", VoltType.BIGINT); expectedSchema1[7] = new ColumnInfo("TOTALBUFFERS", VoltType.BIGINT); expectedSchema1[8] = new ColumnInfo("LASTACKTIMESTAMP", VoltType.BIGINT); expectedSchema1[9] = new ColumnInfo("ISSYNCED", VoltType.STRING); expectedSchema1[10] = new ColumnInfo("MODE", VoltType.STRING); VoltTable expectedTable1 = new VoltTable(expectedSchema1); ColumnInfo[] expectedSchema2 = new ColumnInfo[7]; expectedSchema2[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema2[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema2[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema2[3] = new ColumnInfo("ENABLED", VoltType.STRING); expectedSchema2[4] = new ColumnInfo("SYNCSNAPSHOTSTATE", VoltType.STRING); expectedSchema2[5] = new ColumnInfo("ROWSINSYNCSNAPSHOT", VoltType.BIGINT); expectedSchema2[6] = new ColumnInfo("ROWSACKEDFORSYNCSNAPSHOT", VoltType.BIGINT); VoltTable expectedTable2 = new VoltTable(expectedSchema2); VoltTable[] results = null; // // DR // results = client.callProcedure("@Statistics", "DR", 0).getResults(); // two aggregate tables returned assertEquals(2, results.length); System.out.println("Test DR table: " + results[0].toString()); System.out.println("Test DR table: " + results[1].toString()); validateSchema(results[0], expectedTable1); validateSchema(results[1], expectedTable2); // One row per site, don't have HSID for ease of check, just check a bunch of stuff assertEquals(HOSTS * SITES, results[0].getRowCount()); results[0].advanceRow(); validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), false); results[0].advanceRow(); validateRowSeenAtAllPartitions(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), false); // One row per host for DRNODE stats results[1].advanceRow(); validateRowSeenAtAllHosts(results[1], "HOSTNAME", results[1].getString("HOSTNAME"), true); } public void testLiveClientsStatistics() throws Exception { System.out.println("\n\nTESTING LIVECLIENTS STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[9]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("CONNECTION_ID", VoltType.BIGINT); expectedSchema[4] = new ColumnInfo("CLIENT_HOSTNAME", VoltType.STRING); expectedSchema[5] = new ColumnInfo("ADMIN", VoltType.TINYINT); expectedSchema[6] = new ColumnInfo("OUTSTANDING_REQUEST_BYTES", VoltType.BIGINT); expectedSchema[7] = new ColumnInfo("OUTSTANDING_RESPONSE_MESSAGES", VoltType.BIGINT); expectedSchema[8] = new ColumnInfo("OUTSTANDING_TRANSACTIONS", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; // // LIVECLIENTS // results = client.callProcedure("@Statistics", "LIVECLIENTS", 0).getResults(); // one aggregate table returned assertEquals(1, results.length); System.out.println("Test LIVECLIENTS table: " + results[0].toString()); validateSchema(results[0], expectedTable); // Hacky, on a single local cluster make sure that all 'nodes' are present. // LiveClients stats lacks a common string across nodes, but we can hijack the hostname in this case. results[0].advanceRow(); validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), true); } public void testStarvationStatistics() throws Exception { System.out.println("\n\nTESTING STARVATION STATS\n\n\n"); Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[10]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("SITE_ID", VoltType.INTEGER); expectedSchema[4] = new ColumnInfo("COUNT", VoltType.BIGINT); expectedSchema[5] = new ColumnInfo("PERCENT", VoltType.FLOAT); expectedSchema[6] = new ColumnInfo("AVG", VoltType.BIGINT); expectedSchema[7] = new ColumnInfo("MIN", VoltType.BIGINT); expectedSchema[8] = new ColumnInfo("MAX", VoltType.BIGINT); expectedSchema[9] = new ColumnInfo("STDDEV", VoltType.BIGINT); VoltTable expectedTable = new VoltTable(expectedSchema); VoltTable[] results = null; // // STARVATION // results = client.callProcedure("@Statistics", "STARVATION", 0).getResults(); // one aggregate table returned assertEquals(1, results.length); System.out.println("Test STARVATION table: " + results[0].toString()); validateSchema(results[0], expectedTable); // One row per site, we don't use HSID though, so hard to do straightforward // per-site unique check. Finesse it. // We also get starvation stats for the MPI, so we need to add a site per host. assertEquals(HOSTS * (SITES + 1), results[0].getRowCount()); results[0].advanceRow(); validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), false); } public void testSnapshotStatus() throws Exception { System.out.println("\n\nTESTING SNAPSHOTSTATUS\n\n\n"); if (KFACTOR == 0) { // SnapshotSave is a PRO feature starting from 4.0 return; } Client client = getFullyConnectedClient(); ColumnInfo[] expectedSchema = new ColumnInfo[14]; expectedSchema[0] = new ColumnInfo("TIMESTAMP", VoltType.BIGINT); expectedSchema[1] = new ColumnInfo("HOST_ID", VoltType.INTEGER); expectedSchema[2] = new ColumnInfo("HOSTNAME", VoltType.STRING); expectedSchema[3] = new ColumnInfo("TABLE", VoltType.STRING); expectedSchema[4] = new ColumnInfo("PATH", VoltType.STRING); expectedSchema[5] = new ColumnInfo("FILENAME", VoltType.STRING); expectedSchema[6] = new ColumnInfo("NONCE", VoltType.STRING); expectedSchema[7] = new ColumnInfo("TXNID", VoltType.BIGINT); expectedSchema[8] = new ColumnInfo("START_TIME", VoltType.BIGINT); expectedSchema[9] = new ColumnInfo("END_TIME", VoltType.BIGINT); expectedSchema[10] = new ColumnInfo("SIZE", VoltType.BIGINT); expectedSchema[11] = new ColumnInfo("DURATION", VoltType.BIGINT); expectedSchema[12] = new ColumnInfo("THROUGHPUT", VoltType.FLOAT); expectedSchema[13] = new ColumnInfo("RESULT", VoltType.STRING); VoltTable expectedTable = new VoltTable(expectedSchema); // Finagle a snapshot client.callProcedure("@SnapshotSave", TMPDIR, TESTNONCE, 1); VoltTable[] results = null; // // SNAPSHOTSTATUS // results = client.callProcedure("@Statistics", "SNAPSHOTSTATUS", 0).getResults(); // one aggregate table returned assertEquals(1, results.length); System.out.println("Test SNAPSHOTSTATUS table: " + results[0].toString()); validateSchema(results[0], expectedTable); // One row per table per node validateRowSeenAtAllHosts(results[0], "TABLE", "WAREHOUSE", true); validateRowSeenAtAllHosts(results[0], "TABLE", "NEW_ORDER", true); validateRowSeenAtAllHosts(results[0], "TABLE", "ITEM", true); } public void testManagementStats() throws Exception { System.out.println("\n\nTESTING MANAGEMENT STATS\n\n\n"); Client client = getFullyConnectedClient(); VoltTable[] results = null; // // LIVECLIENTS // results = client.callProcedure("@Statistics", "MANAGEMENT", 0).getResults(); // eight aggregate tables returned. Assume that we have selected the right // subset of stats internally, just check that we get stuff. assertEquals(8, results.length); } class RebalanceStatsChecker { final double fuzzFactor; final int rangesToMove; long tStartMS; long rangesMoved = 0; long bytesMoved = 0; long rowsMoved = 0; long invocations = 0; long totalInvTimeMS = 0; RebalanceStatsChecker(int rangesToMove, double fuzzFactor) { this.fuzzFactor = fuzzFactor; this.rangesToMove = rangesToMove; this.tStartMS = System.currentTimeMillis(); } void update(int ranges, int bytes, int rows) { rangesMoved += ranges; bytesMoved += bytes; rowsMoved += rows; invocations++; } void checkFuzz(double expected, double actual) { double delta = Math.abs((expected - actual) / expected); if (delta > fuzzFactor) { assertFalse(Math.abs((expected - actual) / expected) > fuzzFactor); } } void check(BalancePartitionsStatistics.StatsPoint stats) { double totalTimeS = (System.currentTimeMillis() - tStartMS) / 1000.0; double statsRangesMoved1 = (stats.getPercentageMoved() / 100.0) * rangesToMove; checkFuzz(rangesMoved, statsRangesMoved1); double statsRangesMoved2 = stats.getRangesPerSecond() * totalTimeS; checkFuzz(rangesMoved, statsRangesMoved2); double statsBytesMoved = stats.getMegabytesPerSecond() * 1000000.0 * totalTimeS; checkFuzz(bytesMoved, statsBytesMoved); double statsRowsMoved = stats.getRowsPerSecond() * totalTimeS; checkFuzz(rowsMoved, statsRowsMoved); double statsInvocations = stats.getInvocationsPerSecond() * totalTimeS; checkFuzz(invocations, statsInvocations); double statsInvTimeMS = stats.getAverageInvocationTime() * invocations; assertTrue(Math.abs((totalInvTimeMS - statsInvTimeMS) / totalInvTimeMS) <= fuzzFactor); checkFuzz(totalInvTimeMS, statsInvTimeMS); double estTimeRemainingS = totalTimeS * (rangesToMove / (double)rangesMoved - 1.0); double statsEstTimeRemainingS = stats.getEstimatedRemaining() / 1000.0; checkFuzz(estTimeRemainingS, statsEstTimeRemainingS); } } public void testRebalanceStats() throws Exception { System.out.println("testRebalanceStats"); // Test constants final int DURATION_SECONDS = 10; final int INVOCATION_SLEEP_MILLIS = 500; final int IDLE_SLEEP_MILLIS = 200; final int RANGES_TO_MOVE = Integer.MAX_VALUE; final int BYTES_TO_MOVE = 10000000; final int ROWS_TO_MOVE = 1000000; final double FUZZ_FACTOR = .1; RebalanceStatsChecker checker = new RebalanceStatsChecker(RANGES_TO_MOVE, FUZZ_FACTOR); BalancePartitionsStatistics bps = new BalancePartitionsStatistics(RANGES_TO_MOVE); Random r = new Random(2222); // Random numbers are between zero and the constant, so everything will average out // to half the time and quantities. Nothing will be exhausted by the test. final int loopCount = (DURATION_SECONDS * 1000) / (INVOCATION_SLEEP_MILLIS + IDLE_SLEEP_MILLIS); for (int i = 0; i < loopCount; i++) { bps.logBalanceStarts(); int invocationTimeMS = r.nextInt(INVOCATION_SLEEP_MILLIS); Thread.sleep(invocationTimeMS); checker.totalInvTimeMS += invocationTimeMS; int ranges = r.nextInt(RANGES_TO_MOVE / loopCount); int bytes = r.nextInt(BYTES_TO_MOVE / loopCount); int rows = r.nextInt(ROWS_TO_MOVE / loopCount); bps.logBalanceEnds(ranges, bytes, TimeUnit.MILLISECONDS.toNanos(invocationTimeMS), TimeUnit.MILLISECONDS.toNanos(invocationTimeMS), rows); checker.update(ranges, bytes, rows); checker.check(bps.getLastStatsPoint()); int idleTimeMS = r.nextInt(IDLE_SLEEP_MILLIS); Thread.sleep(idleTimeMS); } // Check the results with fuzzing to avoid rounding errors. checker.check(bps.getOverallStats()); } // // Build a list of the tests to be run. Use the regression suite // helpers to allow multiple backends. // JUnit magic that uses the regression suite helper classes. // static public Test suite() throws IOException { VoltServerConfig config = null; MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestStatisticsSuite.class); // Not really using TPCC functionality but need a database. // The testLoadMultipartitionTable procedure assumes partitioning // on warehouse id. VoltProjectBuilder project = new VoltProjectBuilder(); project.addLiteralSchema( "CREATE TABLE WAREHOUSE (\n" + " W_ID SMALLINT DEFAULT '0' NOT NULL,\n" + " W_NAME VARCHAR(16) DEFAULT NULL,\n" + " W_STREET_1 VARCHAR(32) DEFAULT NULL,\n" + " W_STREET_2 VARCHAR(32) DEFAULT NULL,\n" + " W_CITY VARCHAR(32) DEFAULT NULL,\n" + " W_STATE VARCHAR(2) DEFAULT NULL,\n" + " W_ZIP VARCHAR(9) DEFAULT NULL,\n" + " W_TAX FLOAT DEFAULT NULL,\n" + " W_YTD FLOAT DEFAULT NULL,\n" + " CONSTRAINT W_PK_TREE PRIMARY KEY (W_ID)\n" + ");\n" + "CREATE TABLE ITEM (\n" + " I_ID INTEGER DEFAULT '0' NOT NULL,\n" + " I_IM_ID INTEGER DEFAULT NULL,\n" + " I_NAME VARCHAR(32) DEFAULT NULL,\n" + " I_PRICE FLOAT DEFAULT NULL,\n" + " I_DATA VARCHAR(64) DEFAULT NULL,\n" + " CONSTRAINT I_PK_TREE PRIMARY KEY (I_ID)\n" + ");\n" + "CREATE TABLE NEW_ORDER (\n" + " NO_W_ID SMALLINT DEFAULT '0' NOT NULL\n" + ");\n"); project.addPartitionInfo("WAREHOUSE", "W_ID"); project.addPartitionInfo("NEW_ORDER", "NO_W_ID"); project.addProcedures(PROCEDURES); /* * Add a cluster configuration for sysprocs too */ config = new LocalCluster("statistics-cluster.jar", TestStatisticsSuite.SITES, TestStatisticsSuite.HOSTS, TestStatisticsSuite.KFACTOR, BackendTarget.NATIVE_EE_JNI); ((LocalCluster) config).setHasLocalServer(hasLocalServer); boolean success = config.compile(project); assertTrue(success); builder.addServerConfig(config); return builder; } }
Tweak TestStatistics suite diagnostics, readability, and resilience to a recurring LiveClients race condition.
tests/frontend/org/voltdb/regressionsuites/TestStatisticsSuite.java
Tweak TestStatistics suite diagnostics, readability, and resilience to a recurring LiveClients race condition.
<ide><path>ests/frontend/org/voltdb/regressionsuites/TestStatisticsSuite.java <ide> <ide> public class TestStatisticsSuite extends SaveRestoreBase { <ide> <del> private static int SITES = 2; <del> private static int HOSTS = 3; <del> private static int KFACTOR = MiscUtils.isPro() ? 1 : 0; <del> private static int PARTITIONS = (SITES * HOSTS) / (KFACTOR + 1); <del> private static boolean hasLocalServer = false; <del> <del> static final Class<?>[] PROCEDURES = <add> private final static int SITES = 2; <add> private final static int HOSTS = 3; <add> private final static int KFACTOR = MiscUtils.isPro() ? 1 : 0; <add> private final static int PARTITIONS = (SITES * HOSTS) / (KFACTOR + 1); <add> private final static boolean hasLocalServer = false; <add> <add> private static final Class<?>[] PROCEDURES = <ide> { <ide> GoSleep.class <ide> }; <ide> // the column designated by 'columnName' has the value 'rowId'. For example, for <ide> // Initiator stats, if columnName is 'PROCEDURE_NAME' and rowId is 'foo', this <ide> // will verify that the initiator at each node has seen a procedure invocation for 'foo' <del> public void validateRowSeenAtAllHosts(VoltTable result, String columnName, String rowId, <add> private void validateRowSeenAtAllHosts(VoltTable result, String columnName, String rowId, <add> boolean enforceUnique) <add> { <add> assertEquals(HOSTS, countHostsProvidingRows(result, columnName, rowId, enforceUnique)); <add> } <add> <add> private int countHostsProvidingRows(VoltTable result, String columnName, String rowId, <ide> boolean enforceUnique) <ide> { <ide> result.resetRowPosition(); <ide> Set<Long> hostsSeen = new HashSet<Long>(); <ide> while (result.advanceRow()) { <del> String procName = result.getString(columnName); <del> if (procName.equalsIgnoreCase(rowId)) { <add> String idFromRow = result.getString(columnName); <add> if (rowId.equalsIgnoreCase(idFromRow)) { <ide> Long thisHostId = result.getLong("HOST_ID"); <ide> if (enforceUnique) { <ide> assertFalse("HOST_ID: " + thisHostId + " seen twice in table looking for " + rowId + <ide> } <ide> // Before failing the assert, report details of the non-conforming result. <ide> if (HOSTS != hostsSeen.size()) { <del> System.out.println("Something in the following results will fail the assert."); <add> System.out.println("Something in the following results may fail an assert expecting " + <add> HOSTS + " and getting " + hostsSeen.size()); <add> Set<Long> seenAgain = new HashSet<Long>(); <ide> result.resetRowPosition(); <ide> while (result.advanceRow()) { <del> String procName = result.getString(columnName); <add> String idFromRow = result.getString(columnName); <ide> Long thisHostId = result.getLong("HOST_ID"); <del> if (procName.equalsIgnoreCase(rowId)) { <del> System.out.println("Found the match at host " + thisHostId + " for proc " + procName + <del> (hostsSeen.add(thisHostId) ? " added" : " duplicated")); <add> if (rowId.equalsIgnoreCase(idFromRow)) { <add> System.out.println("Found the match at host " + thisHostId + " for " + columnName + " " + idFromRow + <add> (seenAgain.add(thisHostId) ? " added" : " duplicated")); <add> seenAgain.add(thisHostId); <ide> } else { <del> System.out.println("Found non-match at host " + thisHostId + " for proc " + procName); <add> System.out.println("Found non-match at host " + thisHostId + " for " + columnName + " " + idFromRow); <ide> } <ide> } <ide> } <del> assertEquals(HOSTS, hostsSeen.size()); <add> return hostsSeen.size(); <ide> } <ide> <ide> // For the provided table, verify that there is a row for each site in the cluster where <ide> // the column designated by 'columnName' has the value 'rowId'. For example, for <ide> // Table stats, if columnName is 'TABLE_NAME' and rowId is 'foo', this <ide> // will verify that each site has returned results for table 'foo' <del> public boolean validateRowSeenAtAllSites(VoltTable result, String columnName, String rowId, <add> private boolean validateRowSeenAtAllSites(VoltTable result, String columnName, String rowId, <ide> boolean enforceUnique) <ide> { <ide> result.resetRowPosition(); <ide> Set<Long> sitesSeen = new HashSet<Long>(); <ide> while (result.advanceRow()) { <del> String procName = result.getString(columnName); <del> if (procName.equalsIgnoreCase(rowId)) { <add> String idFromRow = result.getString(columnName); <add> if (rowId.equalsIgnoreCase(idFromRow)) { <ide> long hostId = result.getLong("HOST_ID"); <ide> long thisSiteId = result.getLong("SITE_ID"); <ide> thisSiteId |= hostId << 32; <ide> <ide> // For the provided table, verify that there is a row for each partition in the cluster where <ide> // the column designated by 'columnName' has the value 'rowId'. <del> public void validateRowSeenAtAllPartitions(VoltTable result, String columnName, String rowId, <add> private void validateRowSeenAtAllPartitions(VoltTable result, String columnName, String rowId, <ide> boolean enforceUnique) <ide> { <ide> result.resetRowPosition(); <ide> Set<Long> partsSeen = new HashSet<Long>(); <ide> while (result.advanceRow()) { <del> String procName = result.getString(columnName); <del> if (procName.equalsIgnoreCase(rowId)) { <add> String idFromRow = result.getString(columnName); <add> if (rowId.equalsIgnoreCase(idFromRow)) { <ide> long thisPartId = result.getLong("PARTITION_ID"); <ide> if (enforceUnique) { <ide> assertFalse("PARTITION_ID: " + thisPartId + " seen twice in table looking for " + rowId + <ide> expectedSchema[7] = new ColumnInfo("OUTSTANDING_RESPONSE_MESSAGES", VoltType.BIGINT); <ide> expectedSchema[8] = new ColumnInfo("OUTSTANDING_TRANSACTIONS", VoltType.BIGINT); <ide> VoltTable expectedTable = new VoltTable(expectedSchema); <del> <del> VoltTable[] results = null; <add> int patientRetries = 2; <add> int hostsHeardFrom = 0; <ide> // <ide> // LIVECLIENTS <ide> // <del> results = client.callProcedure("@Statistics", "LIVECLIENTS", 0).getResults(); <del> // one aggregate table returned <del> assertEquals(1, results.length); <del> System.out.println("Test LIVECLIENTS table: " + results[0].toString()); <del> validateSchema(results[0], expectedTable); <del> // Hacky, on a single local cluster make sure that all 'nodes' are present. <del> // LiveClients stats lacks a common string across nodes, but we can hijack the hostname in this case. <del> results[0].advanceRow(); <del> validateRowSeenAtAllHosts(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), true); <add> do { // loop until we get the desired answer or lose patience waiting out possible races. <add> VoltTable[] results = client.callProcedure("@Statistics", "LIVECLIENTS", 0).getResults(); <add> // one aggregate table returned <add> assertEquals(1, results.length); <add> System.out.println("Test LIVECLIENTS table: " + results[0].toString()); <add> validateSchema(results[0], expectedTable); <add> // Hacky, on a single local cluster make sure that all 'nodes' are present. <add> // LiveClients stats lacks a common string across nodes, but we can hijack the hostname in this case. <add> results[0].advanceRow(); <add> hostsHeardFrom = <add> countHostsProvidingRows(results[0], "HOSTNAME", results[0].getString("HOSTNAME"), true); <add> } while ((hostsHeardFrom < HOSTS) && (--patientRetries) > 0); <add> assertEquals(HOSTS, hostsHeardFrom); <ide> } <ide> <ide> public void testStarvationStatistics() throws Exception {
JavaScript
mit
426c22e4093b8b90dc7f025c9edf749d5eed5a9e
0
ssbc/muxrpc
var pull = require('pull-stream') // wrap pull streams around packet-stream's weird streams. function once (fn) { var done = false return function (err, val) { if(done) return done = true fn(err, val) } } module.exports = function (weird, done) { var buffer = [], ended = false, waiting done = once(done || function () {}) weird.read = function (data, end) { ended = ended || end if(waiting) { var cb = waiting waiting = null cb(ended, data) } else if(!ended) buffer.push(data) if(ended) done(ended !== true ? ended : null) } return { source: function (abort, cb) { if(abort) { weird.write(null, abort) cb(abort); done(abort !== true ? abort : null) } else if(buffer.length) cb(null, buffer.shift()) else if(ended) cb(ended) else waiting = cb }, sink : function (read) { pull.drain(function (data) { //TODO: make this should only happen on a UNIPLEX stream. if(ended) return false weird.write(data) }, function (err) { if(!weird.writeEnd) weird.write(null, err || true) done(err) }) (read) } } } function uniplex (s, done) { return module.exports(s, function (err) { if(!s.writeEnd) s.write(null, err || true) if(done) done(err) }) } module.exports.source = function (s, done) { return uniplex(s, done).source } module.exports.sink = function (s, done) { return uniplex(s, done).sink }
pull-weird.js
var pull = require('pull-stream') // wrap pull streams around packet-stream's weird streams. module.exports = function (weird, done) { var buffer = [], ended = false, waiting done = done || function () {} weird.read = function (data, end) { ended = ended || end if(waiting) { var cb = waiting waiting = null cb(ended, data) } else if(!ended) buffer.push(data) if(ended) done(ended !== true ? ended : null) } return { source: function (abort, cb) { if(abort) { weird.write(null, abort) cb(abort); done(abort !== true ? abort : null) } else if(buffer.length) cb(null, buffer.shift()) else if(ended) cb(ended) else waiting = cb }, sink : function (read) { pull.drain(function (data) { weird.write(data) }, function (err) { weird.write(null, ended = err || true) done(ended !== true ? ended : null) }) (read) } } } module.exports.source = function (s) { return module.exports(s).source } module.exports.sink = function (s) { return module.exports(s).sink }
end both parts of a uniplex stream correctly
pull-weird.js
end both parts of a uniplex stream correctly
<ide><path>ull-weird.js <ide> var pull = require('pull-stream') <ide> // wrap pull streams around packet-stream's weird streams. <add> <add>function once (fn) { <add> var done = false <add> return function (err, val) { <add> if(done) return <add> done = true <add> fn(err, val) <add> } <add>} <ide> <ide> module.exports = function (weird, done) { <ide> var buffer = [], ended = false, waiting <ide> <del> done = done || function () {} <add> done = once(done || function () {}) <ide> <ide> weird.read = function (data, end) { <ide> ended = ended || end <ide> else if(!ended) buffer.push(data) <ide> <ide> if(ended) done(ended !== true ? ended : null) <del> <ide> } <ide> <ide> return { <ide> }, <ide> sink : function (read) { <ide> pull.drain(function (data) { <add> //TODO: make this should only happen on a UNIPLEX stream. <add> if(ended) return false <ide> weird.write(data) <ide> }, function (err) { <del> weird.write(null, ended = err || true) <del> done(ended !== true ? ended : null) <del> }) (read) <add> if(!weird.writeEnd) weird.write(null, err || true) <add> done(err) <add> }) <add> (read) <ide> } <ide> } <ide> } <ide> <del>module.exports.source = function (s) { <del> return module.exports(s).source <del>} <del>module.exports.sink = function (s) { <del> return module.exports(s).sink <add>function uniplex (s, done) { <add> return module.exports(s, function (err) { <add> if(!s.writeEnd) s.write(null, err || true) <add> if(done) done(err) <add> }) <ide> } <ide> <add>module.exports.source = function (s, done) { <add> return uniplex(s, done).source <add>} <add>module.exports.sink = function (s, done) { <add> return uniplex(s, done).sink <add>} <add>
Java
epl-1.0
d009fe7f827170d599c6b4463fbf2a84583fe308
0
css-iter/cs-studio,ESSICS/cs-studio,ControlSystemStudio/cs-studio,css-iter/cs-studio,ControlSystemStudio/cs-studio,ESSICS/cs-studio,css-iter/cs-studio,ESSICS/cs-studio,ESSICS/cs-studio,ControlSystemStudio/cs-studio,ControlSystemStudio/cs-studio,css-iter/cs-studio,css-iter/cs-studio,ESSICS/cs-studio,css-iter/cs-studio,ESSICS/cs-studio,ControlSystemStudio/cs-studio,ESSICS/cs-studio,ControlSystemStudio/cs-studio,css-iter/cs-studio
package org.csstudio.trends.databrowser.ui; import java.util.ArrayList; import java.util.Timer; import java.util.TimerTask; import org.csstudio.platform.data.ITimestamp; import org.csstudio.platform.data.TimestampFactory; import org.csstudio.platform.model.IArchiveDataSource; import org.csstudio.trends.databrowser.Messages; import org.csstudio.trends.databrowser.archive.ArchiveFetchJob; import org.csstudio.trends.databrowser.archive.ArchiveFetchJobListener; import org.csstudio.trends.databrowser.model.ArchiveDataSource; import org.csstudio.trends.databrowser.model.AxisConfig; import org.csstudio.trends.databrowser.model.Model; import org.csstudio.trends.databrowser.model.ModelItem; import org.csstudio.trends.databrowser.model.ModelListener; import org.csstudio.trends.databrowser.model.PVItem; import org.csstudio.trends.databrowser.preferences.Preferences; import org.csstudio.trends.databrowser.propsheet.AddArchiveCommand; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.widgets.Shell; /** Controller that interfaces the {@link Model} with the {@link Plot}: * <ul> * <li>For each item in the Model, create a trace in the plot. * <li>Perform scrolling of the time axis. * <li>When the plot is interactively zoomed, update the Model's time range. * <li>Get archived data whenever the time axis changes. * </ul> * @author Kay Kasemir */ public class Controller implements ArchiveFetchJobListener { /** Shell used for dialog boxes etc. */ private Shell shell; /** Model with data to display */ final Model model; /** GUI for displaying the data */ final Plot plot; /** Timer that triggers scrolling or trace redraws */ final Timer update_timer = new Timer("Update Timer", true); //$NON-NLS-1$ /** Task executed by update_timer */ private TimerTask update_task = null; /** Was scrolling off, i.e. we have not scrolled for a while? */ private boolean scrolling_was_off = true; /** Delay to avoid flurry of archive requests * @see #scheduleArchiveRetrieval(ITimestamp, ITimestamp) */ final private long archive_fetch_delay = Preferences.getArchiveFetchDelay(); /** Delayed task to avoid flurry of archive requests * @see #scheduleArchiveRetrieval(ITimestamp, ITimestamp) */ private TimerTask archive_fetch_delay_task = null; /** Currently active archive jobs, used to prevent multiple requests * for the same model item. */ final private ArrayList<ArchiveFetchJob> archive_fetch_jobs = new ArrayList<ArchiveFetchJob>(); /** Initialize * @param shell Shell * @param model Model that has the data * @param plot Plot for displaying the Model */ public Controller(final Shell shell, final Model model, final Plot plot) { this.shell = shell; this.model = model; this.plot = plot; createPlotTraces(); // Listen to user input from Plot UI, update model plot.addListener(new PlotListener() { public void scrollRequested(final boolean enable_scrolling) { model.enableScrolling(enable_scrolling); } public void timeAxisChanged(final long start_ms, final long end_ms) { if (model.isScrollEnabled()) { final long dist = Math.abs(end_ms - System.currentTimeMillis()); final long range = end_ms - start_ms; // Iffy range? if (range <= 0) return; // In scroll mode, if the end time selected by the user via // the GUI is close enough to 'now', scrolling remains 'on' // and we'll continue to scroll with the new time range. if (dist * 100 / range > 10) { // Time range 10% away from 'now', disable scrolling model.enableScrolling(false); } else if (Math.abs(100*(range - (long)(model.getTimespan()*1000))/range) <= 1) { // We're still scrolling, and the time span didn't really // change, i.e. it's within 1% of the model's span: Ignore. // This happens when scrolling moved the time axis around, // the user zoomed vertically, and the plot now tells // us about a new time range that resulted from scrolling. return; } } final ITimestamp start_time = TimestampFactory.fromMillisecs(start_ms); final ITimestamp end_time = TimestampFactory.fromMillisecs(end_ms); // Update model's time range model.setTimerange(start_time, end_time); // Controller's ModelListener will fetch new archived data } public void valueAxisChanged(final int index, final double lower, final double upper) { // Update axis range in model final AxisConfig axis = model.getAxisConfig(index); axis.setRange(lower, upper); } public void droppedName(final String name) { // Offer potential PV name in dialog so user can edit/cancel final AddPVAction add = new AddPVAction(plot.getOperationsManager(), shell, model); add.runWithSuggestedName(name, null); } public void droppedPVName(final String name, final IArchiveDataSource archive) { if (name == null) { if (archive == null) return; // Received only an archive. Add to all PVs final ArchiveDataSource arch = new ArchiveDataSource(archive); for (int i=0; i<model.getItemCount(); ++i) { if (! (model.getItem(i) instanceof PVItem)) continue; final PVItem pv = (PVItem) model.getItem(i); if (pv.hasArchiveDataSource(arch)) continue; new AddArchiveCommand(plot.getOperationsManager(), pv, arch); } } else { // Received PV name final ModelItem item = model.getItem(name); if (item == null) { // Add new PV AddModelItemCommand.forPV(shell, plot.getOperationsManager(), model, name, Preferences.getScanPeriod(), archive); return; } if (archive == null || ! (item instanceof PVItem)) { // Duplicate PV, or a formula to which we cannot add archives MessageDialog.openError(shell, Messages.Error, NLS.bind(Messages.DuplicateItemFmt, name)); return; } // Add archive to existing PV if (item instanceof PVItem) new AddArchiveCommand(plot.getOperationsManager(), (PVItem) item, new ArchiveDataSource(archive)); } } }); // Listen to Model changes, update Plot model.addListener(new ModelListener() { public void changedUpdatePeriod() { if (update_task != null) createUpdateTask(); } public void changedColors() { plot.setBackgroundColor(model.getPlotBackground()); } public void changedTimerange() { // Get matching archived data scheduleArchiveRetrieval(); // Show new time range on plot? if (model.isScrollEnabled()) return; // no, scrolling will handle that // Yes, since the time axis is currently 'fixed' final long start_ms = (long) (model.getStartTime().toDouble()*1000); final long end_ms = (long) (model.getEndTime().toDouble()*1000); plot.setTimeRange(start_ms, end_ms); } public void changedAxis(final AxisConfig axis) { if (axis == null) { // New or removed axis: Recreate the whole plot createPlotTraces(); return; } // Else: Update specific axis for (int i=0; i<model.getAxisCount(); ++i) { if (model.getAxisConfig(i) == axis) { plot.updateAxis(i, axis); return; } } } public void itemAdded(final ModelItem item) { if (item.isVisible()) plot.addTrace(item); // Get archived data for new item (NOP for non-PVs) getArchivedData(item, model.getStartTime(), model.getEndTime()); } public void itemRemoved(final ModelItem item) { if (item.isVisible()) plot.removeTrace(item); } public void changedItemVisibility(final ModelItem item) { // Add/remove from plot, but don't need to get archived data if (item.isVisible()) // itemAdded(item) would also get archived data plot.addTrace(item); else plot.removeTrace(item); } public void changedItemLook(final ModelItem item) { plot.updateTrace(item); } public void changedItemDataConfig(final PVItem item) { getArchivedData(item, model.getStartTime(), model.getEndTime()); } public void scrollEnabled(final boolean scroll_enabled) { plot.updateScrollButton(scroll_enabled); } }); } /** When the user moves the time axis around, archive requests for the * new time range are delayed to avoid a flurry of archive * requests while the user is still moving around: */ protected void scheduleArchiveRetrieval() { if (archive_fetch_delay_task != null) archive_fetch_delay_task.cancel(); archive_fetch_delay_task = new TimerTask() { @Override public void run() { getArchivedData(); } }; update_timer.schedule(archive_fetch_delay_task, archive_fetch_delay); } /** Start model items and initiate scrolling/updates * @throws Exception on error */ public void start() throws Exception { if (update_task != null) throw new IllegalStateException("Already started"); //$NON-NLS-1$ createUpdateTask(); model.start(); // In scroll mode, the first scroll will update the plot and get data if (model.isScrollEnabled()) return; // In non-scroll mode, initialize plot's time range and get data plot.setTimeRange(model.getStartTime(), model.getEndTime()); getArchivedData(); } /** Create or re-schedule update task */ private void createUpdateTask() { // Can't actually re-schedule, so stop one that might already be running if (update_task != null) { update_task.cancel(); update_task = null; } update_task = new TimerTask() { @Override public void run() { // Check if anything changed, which also updates formulas final boolean anything_new = model.updateItemsAndCheckForNewSamples(); if (model.isScrollEnabled()) performScroll(); else { scrolling_was_off = true; // Only redraw when needed if (anything_new) plot.redrawTraces(); } } }; final long update_delay = (long) (model.getUpdatePeriod() * 1000); update_timer.schedule(update_task, update_delay, update_delay); } /** Stop scrolling and model items */ public void stop() { // Stop ongoing archive access synchronized (archive_fetch_jobs) { for (ArchiveFetchJob job : archive_fetch_jobs) job.cancel(); archive_fetch_jobs.clear(); } // Stop update task if (update_task == null) throw new IllegalStateException("Not started"); //$NON-NLS-1$ model.stop(); update_task.cancel(); update_task = null; } /** (Re-) create traces in plot for each item in the model */ public void createPlotTraces() { plot.setBackgroundColor(model.getPlotBackground()); plot.updateScrollButton(model.isScrollEnabled()); plot.removeAll(); for (int i=0; i<model.getAxisCount(); ++i) plot.updateAxis(i, model.getAxisConfig(i)); for (int i=0; i<model.getItemCount(); ++i) { final ModelItem item = model.getItem(i); if (item.isVisible()) plot.addTrace(item); } } /** Scroll the plot to 'now' */ protected void performScroll() { if (! model.isScrollEnabled()) return; final long end_ms = System.currentTimeMillis(); final long start_ms = end_ms - (long) (model.getTimespan()*1000); plot.setTimeRange(start_ms, end_ms); if (scrolling_was_off) { // Scrolling was just turned on. // Get new archived data since the new time scale // could be way off what's in the previous time range. scrolling_was_off = false; getArchivedData(); } } /** Initiate archive data retrieval for all model items * @param start Start time * @param end End time */ private void getArchivedData() { final ITimestamp start = model.getStartTime(); final ITimestamp end = model.getEndTime(); for (int i=0; i<model.getItemCount(); ++i) getArchivedData(model.getItem(i), start, end); } /** Initiate archive data retrieval for a specific model item * @param item Model item. NOP for non-PVItem * @param start Start time * @param end End time */ private void getArchivedData(final ModelItem item, final ITimestamp start, final ITimestamp end) { // Only useful for PVItems with archive data source if (!(item instanceof PVItem)) return; final PVItem pv_item = (PVItem) item; if (pv_item.getArchiveDataSources().length <= 0) return; ArchiveFetchJob job; // Stop ongoing jobs for this item synchronized (archive_fetch_jobs) { for (int i=0; i<archive_fetch_jobs.size(); ++i) { job = archive_fetch_jobs.get(i); if (job.getPVItem() != pv_item) continue; // System.out.println("Request for " + item.getName() + " cancels " + job); job.cancel(); archive_fetch_jobs.remove(job); } // Start new job job = new ArchiveFetchJob(pv_item, start, end, this); archive_fetch_jobs.add(job); } job.schedule(); } /** @see ArchiveFetchJobListener */ public void fetchCompleted(final ArchiveFetchJob job) { synchronized (archive_fetch_jobs) { archive_fetch_jobs.remove(job); // System.out.println("Completed " + job + ", " + archive_fetch_jobs.size() + " left"); if (!archive_fetch_jobs.isEmpty()) return; } // All completed. Do something to the plot? } /** @see ArchiveFetchJobListener */ public void archiveFetchFailed(final ArchiveFetchJob job, final ArchiveDataSource archive, final Exception error) { if (shell.isDisposed()) return; shell.getDisplay().asyncExec(new Runnable() { public void run() { final String question = NLS.bind(Messages.ArchiveAccessErrorFmt, new Object[] { job.getPVItem().getDisplayName(), archive.getUrl(), error.getMessage() }); if (MessageDialog.openQuestion(shell, Messages.Error, question)) job.getPVItem().removeArchiveDataSource(archive); } }); } }
applications/plugins/org.csstudio.trends.databrowser2/src/org/csstudio/trends/databrowser/ui/Controller.java
package org.csstudio.trends.databrowser.ui; import java.util.ArrayList; import java.util.Timer; import java.util.TimerTask; import org.csstudio.platform.data.ITimestamp; import org.csstudio.platform.data.TimestampFactory; import org.csstudio.platform.model.IArchiveDataSource; import org.csstudio.trends.databrowser.Messages; import org.csstudio.trends.databrowser.archive.ArchiveFetchJob; import org.csstudio.trends.databrowser.archive.ArchiveFetchJobListener; import org.csstudio.trends.databrowser.model.ArchiveDataSource; import org.csstudio.trends.databrowser.model.AxisConfig; import org.csstudio.trends.databrowser.model.Model; import org.csstudio.trends.databrowser.model.ModelItem; import org.csstudio.trends.databrowser.model.ModelListener; import org.csstudio.trends.databrowser.model.PVItem; import org.csstudio.trends.databrowser.preferences.Preferences; import org.csstudio.trends.databrowser.propsheet.AddArchiveCommand; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.widgets.Shell; /** Controller that interfaces the {@link Model} with the {@link Plot}: * <ul> * <li>For each item in the Model, create a trace in the plot. * <li>Perform scrolling of the time axis. * <li>When the plot is interactively zoomed, update the Model's time range. * <li>Get archived data whenever the time axis changes. * </ul> * @author Kay Kasemir */ public class Controller implements ArchiveFetchJobListener { /** Shell used for dialog boxes etc. */ private Shell shell; /** Model with data to display */ final Model model; /** GUI for displaying the data */ final Plot plot; /** Timer that triggers scrolling or trace redraws */ final Timer update_timer = new Timer("Update Timer", true); //$NON-NLS-1$ /** Task executed by update_timer */ private TimerTask update_task = null; /** Was scrolling off, i.e. we have not scrolled for a while? */ private boolean scrolling_was_off = true; /** Delay to avoid flurry of archive requests * @see #scheduleArchiveRetrieval(ITimestamp, ITimestamp) */ final private long archive_fetch_delay = Preferences.getArchiveFetchDelay(); /** Delayed task to avoid flurry of archive requests * @see #scheduleArchiveRetrieval(ITimestamp, ITimestamp) */ private TimerTask archive_fetch_delay_task = null; /** Currently active archive jobs, used to prevent multiple requests * for the same model item. */ final private ArrayList<ArchiveFetchJob> archive_fetch_jobs = new ArrayList<ArchiveFetchJob>(); /** Initialize * @param shell Shell * @param model Model that has the data * @param plot Plot for displaying the Model */ public Controller(final Shell shell, final Model model, final Plot plot) { this.shell = shell; this.model = model; this.plot = plot; createPlotTraces(); // Listen to user input from Plot UI, update model plot.addListener(new PlotListener() { public void scrollRequested(final boolean enable_scrolling) { model.enableScrolling(enable_scrolling); } public void timeAxisChanged(final long start_ms, final long end_ms) { if (model.isScrollEnabled()) { final long dist = Math.abs(end_ms - System.currentTimeMillis()); final long range = end_ms - start_ms; // Iffy range? if (range <= 0) return; // In scroll mode, if the end time selected by the user via // the GUI is close enough to 'now', scrolling remains 'on' // and we'll continue to scroll with the new time range. if (dist * 100 / range > 10) { // Time range 10% away from 'now', disable scrolling model.enableScrolling(false); } else if (Math.abs(100*(range - (long)(model.getTimespan()*1000))/range) <= 1) { // We're still scrolling, and the time span didn't really // change, i.e. it's within 1% of the model's span: Ignore. // This happens when scrolling moved the time axis around, // the user zoomed vertically, and the plot now tells // us about a new time range that resulted from scrolling. return; } } final ITimestamp start_time = TimestampFactory.fromMillisecs(start_ms); final ITimestamp end_time = TimestampFactory.fromMillisecs(end_ms); // Update model's time range model.setTimerange(start_time, end_time); // Controller's ModelListener will fetch new archived data } public void valueAxisChanged(final int index, final double lower, final double upper) { // Update axis range in model final AxisConfig axis = model.getAxisConfig(index); axis.setRange(lower, upper); } public void droppedName(final String name) { // Offer potential PV name in dialog so user can edit/cancel final AddPVAction add = new AddPVAction(plot.getOperationsManager(), shell, model); add.runWithSuggestedName(name, null); } public void droppedPVName(final String name, final IArchiveDataSource archive) { if (name == null) { if (archive == null) return; // Received only an archive. Add to all PVs final ArchiveDataSource arch = new ArchiveDataSource(archive); for (int i=0; i<model.getItemCount(); ++i) { if (! (model.getItem(i) instanceof PVItem)) continue; final PVItem pv = (PVItem) model.getItem(i); if (pv.hasArchiveDataSource(arch)) continue; new AddArchiveCommand(plot.getOperationsManager(), pv, arch); } } else { // Received PV name final ModelItem item = model.getItem(name); if (item == null) { // Add new PV AddModelItemCommand.forPV(shell, plot.getOperationsManager(), model, name, Preferences.getScanPeriod(), archive); return; } if (archive == null || ! (item instanceof PVItem)) { // Duplicate PV, or a formula to which we cannot add archives MessageDialog.openError(shell, Messages.Error, NLS.bind(Messages.DuplicateItemFmt, name)); return; } // Add archive to existing PV if (item instanceof PVItem) new AddArchiveCommand(plot.getOperationsManager(), (PVItem) item, new ArchiveDataSource(archive)); } } }); // Listen to Model changes, update Plot model.addListener(new ModelListener() { public void changedUpdatePeriod() { if (update_task != null) createUpdateTask(); } public void changedColors() { plot.setBackgroundColor(model.getPlotBackground()); } public void changedTimerange() { // Get matching archived data scheduleArchiveRetrieval(); // Show new time range on plot? if (model.isScrollEnabled()) return; // no, scrolling will handle that // Yes, since the time axis is currently 'fixed' final long start_ms = (long) (model.getStartTime().toDouble()*1000); final long end_ms = (long) (model.getEndTime().toDouble()*1000); plot.setTimeRange(start_ms, end_ms); } public void changedAxis(final AxisConfig axis) { if (axis == null) { // New or removed axis: Recreate the whole plot createPlotTraces(); return; } // Else: Update specific axis for (int i=0; i<model.getAxisCount(); ++i) { if (model.getAxisConfig(i) == axis) { plot.updateAxis(i, axis); return; } } } public void itemAdded(final ModelItem item) { plot.addTrace(item); // Get archived data for new item (NOP for non-PVs) getArchivedData(item, model.getStartTime(), model.getEndTime()); } public void itemRemoved(final ModelItem item) { plot.removeTrace(item); } public void changedItemVisibility(final ModelItem item) { // Add/remove from plot, but don't need to get archived data if (item.isVisible()) // itemAdded(item) would also get archived data plot.addTrace(item); else itemRemoved(item); } public void changedItemLook(final ModelItem item) { plot.updateTrace(item); } public void changedItemDataConfig(final PVItem item) { getArchivedData(item, model.getStartTime(), model.getEndTime()); } public void scrollEnabled(final boolean scroll_enabled) { plot.updateScrollButton(scroll_enabled); } }); } /** When the user moves the time axis around, archive requests for the * new time range are delayed to avoid a flurry of archive * requests while the user is still moving around: */ protected void scheduleArchiveRetrieval() { if (archive_fetch_delay_task != null) archive_fetch_delay_task.cancel(); archive_fetch_delay_task = new TimerTask() { @Override public void run() { getArchivedData(); } }; update_timer.schedule(archive_fetch_delay_task, archive_fetch_delay); } /** Start model items and initiate scrolling/updates * @throws Exception on error */ public void start() throws Exception { if (update_task != null) throw new IllegalStateException("Already started"); //$NON-NLS-1$ createUpdateTask(); model.start(); // In scroll mode, the first scroll will update the plot and get data if (model.isScrollEnabled()) return; // In non-scroll mode, initialize plot's time range and get data plot.setTimeRange(model.getStartTime(), model.getEndTime()); getArchivedData(); } /** Create or re-schedule update task */ private void createUpdateTask() { // Can't actually re-schedule, so stop one that might already be running if (update_task != null) { update_task.cancel(); update_task = null; } update_task = new TimerTask() { @Override public void run() { // Check if anything changed, which also updates formulas final boolean anything_new = model.updateItemsAndCheckForNewSamples(); if (model.isScrollEnabled()) performScroll(); else { scrolling_was_off = true; // Only redraw when needed if (anything_new) plot.redrawTraces(); } } }; final long update_delay = (long) (model.getUpdatePeriod() * 1000); update_timer.schedule(update_task, update_delay, update_delay); } /** Stop scrolling and model items */ public void stop() { // Stop ongoing archive access synchronized (archive_fetch_jobs) { for (ArchiveFetchJob job : archive_fetch_jobs) job.cancel(); archive_fetch_jobs.clear(); } // Stop update task if (update_task == null) throw new IllegalStateException("Not started"); //$NON-NLS-1$ model.stop(); update_task.cancel(); update_task = null; } /** (Re-) create traces in plot for each item in the model */ public void createPlotTraces() { plot.setBackgroundColor(model.getPlotBackground()); plot.updateScrollButton(model.isScrollEnabled()); plot.removeAll(); for (int i=0; i<model.getAxisCount(); ++i) plot.updateAxis(i, model.getAxisConfig(i)); for (int i=0; i<model.getItemCount(); ++i) { final ModelItem item = model.getItem(i); if (item.isVisible()) plot.addTrace(item); } } /** Scroll the plot to 'now' */ protected void performScroll() { if (! model.isScrollEnabled()) return; final long end_ms = System.currentTimeMillis(); final long start_ms = end_ms - (long) (model.getTimespan()*1000); plot.setTimeRange(start_ms, end_ms); if (scrolling_was_off) { // Scrolling was just turned on. // Get new archived data since the new time scale // could be way off what's in the previous time range. scrolling_was_off = false; getArchivedData(); } } /** Initiate archive data retrieval for all model items * @param start Start time * @param end End time */ private void getArchivedData() { final ITimestamp start = model.getStartTime(); final ITimestamp end = model.getEndTime(); for (int i=0; i<model.getItemCount(); ++i) getArchivedData(model.getItem(i), start, end); } /** Initiate archive data retrieval for a specific model item * @param item Model item. NOP for non-PVItem * @param start Start time * @param end End time */ private void getArchivedData(final ModelItem item, final ITimestamp start, final ITimestamp end) { // Only useful for PVItems with archive data source if (!(item instanceof PVItem)) return; final PVItem pv_item = (PVItem) item; if (pv_item.getArchiveDataSources().length <= 0) return; ArchiveFetchJob job; // Stop ongoing jobs for this item synchronized (archive_fetch_jobs) { for (int i=0; i<archive_fetch_jobs.size(); ++i) { job = archive_fetch_jobs.get(i); if (job.getPVItem() != pv_item) continue; // System.out.println("Request for " + item.getName() + " cancels " + job); job.cancel(); archive_fetch_jobs.remove(job); } // Start new job job = new ArchiveFetchJob(pv_item, start, end, this); archive_fetch_jobs.add(job); } job.schedule(); } /** @see ArchiveFetchJobListener */ public void fetchCompleted(final ArchiveFetchJob job) { synchronized (archive_fetch_jobs) { archive_fetch_jobs.remove(job); // System.out.println("Completed " + job + ", " + archive_fetch_jobs.size() + " left"); if (!archive_fetch_jobs.isEmpty()) return; } // All completed. Do something to the plot? } /** @see ArchiveFetchJobListener */ public void archiveFetchFailed(final ArchiveFetchJob job, final ArchiveDataSource archive, final Exception error) { if (shell.isDisposed()) return; shell.getDisplay().asyncExec(new Runnable() { public void run() { final String question = NLS.bind(Messages.ArchiveAccessErrorFmt, new Object[] { job.getPVItem().getDisplayName(), archive.getUrl(), error.getMessage() }); if (MessageDialog.openQuestion(shell, Messages.Error, question)) job.getPVItem().removeArchiveDataSource(archive); } }); } }
Delete-with-undo didn't work for 'hidden' items
applications/plugins/org.csstudio.trends.databrowser2/src/org/csstudio/trends/databrowser/ui/Controller.java
Delete-with-undo didn't work for 'hidden' items
<ide><path>pplications/plugins/org.csstudio.trends.databrowser2/src/org/csstudio/trends/databrowser/ui/Controller.java <ide> <ide> public void itemAdded(final ModelItem item) <ide> { <del> plot.addTrace(item); <add> if (item.isVisible()) <add> plot.addTrace(item); <ide> // Get archived data for new item (NOP for non-PVs) <ide> getArchivedData(item, model.getStartTime(), model.getEndTime()); <ide> } <ide> <ide> public void itemRemoved(final ModelItem item) <ide> { <del> plot.removeTrace(item); <add> if (item.isVisible()) <add> plot.removeTrace(item); <ide> } <ide> <ide> public void changedItemVisibility(final ModelItem item) <ide> // itemAdded(item) would also get archived data <ide> plot.addTrace(item); <ide> else <del> itemRemoved(item); <add> plot.removeTrace(item); <ide> } <ide> <ide> public void changedItemLook(final ModelItem item)
Java
apache-2.0
865a67e82d490500043c31cf2a6318c75368c762
0
WilliamZapata/alluxio,maobaolong/alluxio,maboelhassan/alluxio,wwjiang007/alluxio,Alluxio/alluxio,apc999/alluxio,maobaolong/alluxio,yuluo-ding/alluxio,Alluxio/alluxio,wwjiang007/alluxio,ChangerYoung/alluxio,jsimsa/alluxio,madanadit/alluxio,apc999/alluxio,maboelhassan/alluxio,ChangerYoung/alluxio,jsimsa/alluxio,Reidddddd/alluxio,wwjiang007/alluxio,wwjiang007/alluxio,aaudiber/alluxio,WilliamZapata/alluxio,Reidddddd/alluxio,calvinjia/tachyon,Alluxio/alluxio,aaudiber/alluxio,calvinjia/tachyon,PasaLab/tachyon,calvinjia/tachyon,wwjiang007/alluxio,jswudi/alluxio,wwjiang007/alluxio,maboelhassan/alluxio,ShailShah/alluxio,jsimsa/alluxio,PasaLab/tachyon,wwjiang007/alluxio,aaudiber/alluxio,riversand963/alluxio,WilliamZapata/alluxio,Reidddddd/alluxio,EvilMcJerkface/alluxio,Reidddddd/alluxio,PasaLab/tachyon,maobaolong/alluxio,WilliamZapata/alluxio,uronce-cc/alluxio,Reidddddd/alluxio,Alluxio/alluxio,uronce-cc/alluxio,aaudiber/alluxio,uronce-cc/alluxio,ShailShah/alluxio,apc999/alluxio,aaudiber/alluxio,maboelhassan/alluxio,Alluxio/alluxio,Reidddddd/alluxio,jswudi/alluxio,ChangerYoung/alluxio,calvinjia/tachyon,yuluo-ding/alluxio,EvilMcJerkface/alluxio,maobaolong/alluxio,Alluxio/alluxio,calvinjia/tachyon,PasaLab/tachyon,jswudi/alluxio,wwjiang007/alluxio,Alluxio/alluxio,madanadit/alluxio,Alluxio/alluxio,Reidddddd/mo-alluxio,bf8086/alluxio,madanadit/alluxio,madanadit/alluxio,jswudi/alluxio,bf8086/alluxio,uronce-cc/alluxio,riversand963/alluxio,ShailShah/alluxio,aaudiber/alluxio,maobaolong/alluxio,Alluxio/alluxio,maobaolong/alluxio,calvinjia/tachyon,madanadit/alluxio,bf8086/alluxio,ShailShah/alluxio,uronce-cc/alluxio,maboelhassan/alluxio,riversand963/alluxio,Reidddddd/mo-alluxio,PasaLab/tachyon,yuluo-ding/alluxio,bf8086/alluxio,ChangerYoung/alluxio,maobaolong/alluxio,Reidddddd/mo-alluxio,PasaLab/tachyon,riversand963/alluxio,maboelhassan/alluxio,riversand963/alluxio,WilliamZapata/alluxio,jsimsa/alluxio,Reidddddd/mo-alluxio,yuluo-ding/alluxio,EvilMcJerkface/alluxio,PasaLab/tachyon,calvinjia/tachyon,aaudiber/alluxio,EvilMcJerkface/alluxio,riversand963/alluxio,wwjiang007/alluxio,apc999/alluxio,apc999/alluxio,bf8086/alluxio,EvilMcJerkface/alluxio,madanadit/alluxio,jsimsa/alluxio,wwjiang007/alluxio,calvinjia/tachyon,ShailShah/alluxio,apc999/alluxio,ShailShah/alluxio,ChangerYoung/alluxio,Reidddddd/mo-alluxio,yuluo-ding/alluxio,yuluo-ding/alluxio,bf8086/alluxio,Reidddddd/alluxio,jswudi/alluxio,uronce-cc/alluxio,bf8086/alluxio,bf8086/alluxio,madanadit/alluxio,EvilMcJerkface/alluxio,Alluxio/alluxio,jsimsa/alluxio,Reidddddd/mo-alluxio,EvilMcJerkface/alluxio,jswudi/alluxio,EvilMcJerkface/alluxio,ChangerYoung/alluxio,maobaolong/alluxio,maboelhassan/alluxio,madanadit/alluxio,maobaolong/alluxio,WilliamZapata/alluxio,maobaolong/alluxio,apc999/alluxio
/* * Licensed to the University of California, Berkeley under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional information regarding * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package tachyon.client.file; import java.io.IOException; import java.io.OutputStream; import java.util.LinkedList; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.base.Preconditions; import tachyon.Constants; import tachyon.annotation.PublicApi; import tachyon.client.Cancelable; import tachyon.client.ClientContext; import tachyon.client.TachyonStorageType; import tachyon.client.UnderStorageType; import tachyon.client.Utils; import tachyon.client.WorkerNetAddress; import tachyon.client.block.BufferedBlockOutStream; import tachyon.client.file.options.CompleteFileOptions; import tachyon.client.file.options.OutStreamOptions; import tachyon.client.file.policy.FileWriteLocationPolicy; import tachyon.exception.ExceptionMessage; import tachyon.exception.PreconditionMessage; import tachyon.exception.TachyonException; import tachyon.thrift.FileInfo; import tachyon.underfs.UnderFileSystem; import tachyon.util.io.PathUtils; /** * Provides a streaming API to write a file. This class wraps the BlockOutStreams for each of the * blocks in the file and abstracts the switching between streams. The backing streams can write to * Tachyon space in the local machine or remote machines. If the * {@link UnderStorageType} is {@link UnderStorageType#SYNC_PERSIST}, another stream will write the * data to the under storage system. */ @PublicApi public class FileOutStream extends OutputStream implements Cancelable { private static final Logger LOG = LoggerFactory.getLogger(Constants.LOGGER_TYPE); private final long mBlockSize; protected final TachyonStorageType mTachyonStorageType; private final UnderStorageType mUnderStorageType; private final FileSystemContext mContext; private final OutputStream mUnderStorageOutputStream; private final long mNonce; private String mUfsPath; private FileWriteLocationPolicy mLocationPolicy; protected boolean mCanceled; protected boolean mClosed; private boolean mShouldCacheCurrentBlock; protected BufferedBlockOutStream mCurrentBlockOutStream; protected List<BufferedBlockOutStream> mPreviousBlockOutStreams; protected final long mFileId; /** * Creates a new file output stream. * * @param fileId the file id * @param options the client options * @throws IOException if an I/O error occurs */ public FileOutStream(long fileId, OutStreamOptions options) throws IOException { mFileId = fileId; mNonce = Utils.getRandomNonNegativeLong(); mBlockSize = options.getBlockSizeBytes(); mTachyonStorageType = options.getTachyonStorageType(); mUnderStorageType = options.getUnderStorageType(); mContext = FileSystemContext.INSTANCE; mPreviousBlockOutStreams = new LinkedList<BufferedBlockOutStream>(); if (mUnderStorageType.isSyncPersist()) { updateUfsPath(); String tmpPath = PathUtils.temporaryFileName(fileId, mNonce, mUfsPath); UnderFileSystem ufs = UnderFileSystem.get(tmpPath, ClientContext.getConf()); // TODO(jiri): Implement collection of temporary files left behind by dead clients. mUnderStorageOutputStream = ufs.create(tmpPath, (int) mBlockSize); } else { mUfsPath = null; mUnderStorageOutputStream = null; } mClosed = false; mCanceled = false; mShouldCacheCurrentBlock = mTachyonStorageType.isStore(); mLocationPolicy = Preconditions.checkNotNull(options.getLocationPolicy(), PreconditionMessage.FILE_WRITE_LOCATION_POLICY_UNSPECIFIED); } @Override public void cancel() throws IOException { mCanceled = true; close(); } @Override public void close() throws IOException { if (mClosed) { return; } if (mCurrentBlockOutStream != null) { mPreviousBlockOutStreams.add(mCurrentBlockOutStream); } Boolean canComplete = false; CompleteFileOptions.Builder builder = new CompleteFileOptions.Builder(ClientContext.getConf()); if (mUnderStorageType.isSyncPersist()) { String tmpPath = PathUtils.temporaryFileName(mFileId, mNonce, mUfsPath); UnderFileSystem ufs = UnderFileSystem.get(tmpPath, ClientContext.getConf()); if (mCanceled) { // TODO(yupeng): Handle this special case in under storage integrations. mUnderStorageOutputStream.close(); if (!ufs.exists(tmpPath)) { // Location of the temporary file has changed, recompute it. updateUfsPath(); tmpPath = PathUtils.temporaryFileName(mFileId, mNonce, mUfsPath); } ufs.delete(tmpPath, false); } else { mUnderStorageOutputStream.flush(); mUnderStorageOutputStream.close(); if (!ufs.exists(tmpPath)) { // Location of the temporary file has changed, recompute it. updateUfsPath(); tmpPath = PathUtils.temporaryFileName(mFileId, mNonce, mUfsPath); } if (!ufs.rename(tmpPath, mUfsPath)) { throw new IOException("Failed to rename " + tmpPath + " to " + mUfsPath); } builder.setUfsLength(ufs.getFileSize(mUfsPath)); canComplete = true; } } if (mTachyonStorageType.isStore()) { try { if (mCanceled) { for (BufferedBlockOutStream bos : mPreviousBlockOutStreams) { bos.cancel(); } } else { for (BufferedBlockOutStream bos : mPreviousBlockOutStreams) { bos.close(); } canComplete = true; } } catch (IOException ioe) { handleCacheWriteException(ioe); } } if (canComplete) { FileSystemMasterClient masterClient = mContext.acquireMasterClient(); try { masterClient.completeFile(mFileId, builder.build()); } catch (TachyonException e) { throw new IOException(e); } finally { mContext.releaseMasterClient(masterClient); } } mClosed = true; } @Override public void flush() throws IOException { // TODO(yupeng): Handle flush for Tachyon storage stream as well. if (mUnderStorageType.isSyncPersist()) { mUnderStorageOutputStream.flush(); } } @Override public void write(int b) throws IOException { if (mShouldCacheCurrentBlock) { try { if (mCurrentBlockOutStream == null || mCurrentBlockOutStream.remaining() == 0) { getNextBlock(); } mCurrentBlockOutStream.write(b); } catch (IOException ioe) { handleCacheWriteException(ioe); } } if (mUnderStorageType.isSyncPersist()) { mUnderStorageOutputStream.write(b); ClientContext.getClientMetrics().incBytesWrittenUfs(1); } } @Override public void write(byte[] b) throws IOException { Preconditions.checkArgument(b != null, PreconditionMessage.ERR_WRITE_BUFFER_NULL); write(b, 0, b.length); } @Override public void write(byte[] b, int off, int len) throws IOException { Preconditions.checkArgument(b != null, PreconditionMessage.ERR_WRITE_BUFFER_NULL); Preconditions.checkArgument(off >= 0 && len >= 0 && len + off <= b.length, PreconditionMessage.ERR_BUFFER_STATE, b.length, off, len); if (mShouldCacheCurrentBlock) { try { int tLen = len; int tOff = off; while (tLen > 0) { if (mCurrentBlockOutStream == null || mCurrentBlockOutStream.remaining() == 0) { getNextBlock(); } long currentBlockLeftBytes = mCurrentBlockOutStream.remaining(); if (currentBlockLeftBytes >= tLen) { mCurrentBlockOutStream.write(b, tOff, tLen); tLen = 0; } else { mCurrentBlockOutStream.write(b, tOff, (int) currentBlockLeftBytes); tOff += currentBlockLeftBytes; tLen -= currentBlockLeftBytes; } } } catch (IOException ioe) { handleCacheWriteException(ioe); } } if (mUnderStorageType.isSyncPersist()) { mUnderStorageOutputStream.write(b, off, len); ClientContext.getClientMetrics().incBytesWrittenUfs(len); } } private void getNextBlock() throws IOException { if (mCurrentBlockOutStream != null) { Preconditions.checkState(mCurrentBlockOutStream.remaining() <= 0, PreconditionMessage.ERR_BLOCK_REMAINING); mPreviousBlockOutStreams.add(mCurrentBlockOutStream); } if (mTachyonStorageType.isStore()) { try { WorkerNetAddress address = mLocationPolicy.getWorkerForNextBlock( mContext.getTachyonBlockStore().getWorkerInfoList(), mBlockSize); String hostname = address == null ? null : address.getHost(); // TODO(yupeng) use the returned address directly for constructing the out stream mCurrentBlockOutStream = mContext.getTachyonBlockStore().getOutStream(getNextBlockId(), mBlockSize, hostname); mShouldCacheCurrentBlock = true; } catch (TachyonException e) { throw new IOException(e); } } } private long getNextBlockId() throws IOException { FileSystemMasterClient masterClient = mContext.acquireMasterClient(); try { return masterClient.getNewBlockIdForFile(mFileId); } catch (TachyonException e) { throw new IOException(e); } finally { mContext.releaseMasterClient(masterClient); } } protected void handleCacheWriteException(IOException ioe) throws IOException { if (!mUnderStorageType.isSyncPersist()) { throw new IOException(ExceptionMessage.FAILED_CACHE.getMessage(ioe.getMessage()), ioe); } LOG.warn("Failed to write into TachyonStore, canceling write attempt.", ioe); if (mCurrentBlockOutStream != null) { mShouldCacheCurrentBlock = false; mCurrentBlockOutStream.cancel(); } } private void updateUfsPath() throws IOException { FileSystemMasterClient client = mContext.acquireMasterClient(); try { FileInfo fileInfo = client.getFileInfo(mFileId); mUfsPath = fileInfo.getUfsPath(); } catch (TachyonException e) { throw new IOException(e); } finally { mContext.releaseMasterClient(client); } } }
clients/unshaded/src/main/java/tachyon/client/file/FileOutStream.java
/* * Licensed to the University of California, Berkeley under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional information regarding * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package tachyon.client.file; import java.io.IOException; import java.io.OutputStream; import java.util.LinkedList; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.base.Preconditions; import tachyon.Constants; import tachyon.annotation.PublicApi; import tachyon.client.Cancelable; import tachyon.client.ClientContext; import tachyon.client.TachyonStorageType; import tachyon.client.UnderStorageType; import tachyon.client.Utils; import tachyon.client.WorkerNetAddress; import tachyon.client.block.BufferedBlockOutStream; import tachyon.client.file.options.CompleteFileOptions; import tachyon.client.file.options.OutStreamOptions; import tachyon.client.file.policy.FileWriteLocationPolicy; import tachyon.exception.ExceptionMessage; import tachyon.exception.PreconditionMessage; import tachyon.exception.TachyonException; import tachyon.thrift.FileInfo; import tachyon.underfs.UnderFileSystem; import tachyon.util.io.PathUtils; /** * Provides a streaming API to write a file. This class wraps the BlockOutStreams for each of the * blocks in the file and abstracts the switching between streams. The backing streams can write to * Tachyon space in the local machine or remote machines. If the * {@link UnderStorageType} is {@link UnderStorageType#SYNC_PERSIST}, another stream will write the * data to the under storage system. */ @PublicApi public class FileOutStream extends OutputStream implements Cancelable { private static final Logger LOG = LoggerFactory.getLogger(Constants.LOGGER_TYPE); private final long mBlockSize; protected final TachyonStorageType mTachyonStorageType; private final UnderStorageType mUnderStorageType; private final FileSystemContext mContext; private final OutputStream mUnderStorageOutputStream; private final long mNonce; private String mUfsPath; private FileWriteLocationPolicy mLocationPolicy; protected boolean mCanceled; protected boolean mClosed; private boolean mShouldCacheCurrentBlock; protected BufferedBlockOutStream mCurrentBlockOutStream; protected List<BufferedBlockOutStream> mPreviousBlockOutStreams; protected final long mFileId; /** * Creates a new file output stream. * * @param fileId the file id * @param options the client options * @throws IOException if an I/O error occurs */ public FileOutStream(long fileId, OutStreamOptions options) throws IOException { mFileId = fileId; mNonce = Utils.getRandomNonNegativeLong(); mBlockSize = options.getBlockSizeBytes(); mTachyonStorageType = options.getTachyonStorageType(); mUnderStorageType = options.getUnderStorageType(); mContext = FileSystemContext.INSTANCE; mPreviousBlockOutStreams = new LinkedList<BufferedBlockOutStream>(); if (mUnderStorageType.isSyncPersist()) { updateUfsPath(); String tmpPath = PathUtils.temporaryFileName(fileId, mNonce, mUfsPath); UnderFileSystem ufs = UnderFileSystem.get(tmpPath, ClientContext.getConf()); // TODO(jiri): Implement collection of temporary files left behind by dead clients. mUnderStorageOutputStream = ufs.create(tmpPath, (int) mBlockSize); } else { mUfsPath = null; mUnderStorageOutputStream = null; } mClosed = false; mCanceled = false; mShouldCacheCurrentBlock = mTachyonStorageType.isStore(); mLocationPolicy = Preconditions.checkNotNull(options.getLocationPolicy(), PreconditionMessage.FILE_WRITE_LOCATION_POLICY_UNSPECIFIED); } @Override public void cancel() throws IOException { mCanceled = true; close(); } @Override public void close() throws IOException { if (mClosed) { return; } if (mCurrentBlockOutStream != null) { mPreviousBlockOutStreams.add(mCurrentBlockOutStream); } Boolean canComplete = false; CompleteFileOptions.Builder builder = new CompleteFileOptions.Builder(ClientContext.getConf()); if (mUnderStorageType.isSyncPersist()) { String tmpPath = PathUtils.temporaryFileName(mFileId, mNonce, mUfsPath); UnderFileSystem ufs = UnderFileSystem.get(tmpPath, ClientContext.getConf()); if (mCanceled) { // TODO(yupeng): Handle this special case in under storage integrations. mUnderStorageOutputStream.close(); if (!ufs.exists(tmpPath)) { // Location of the temporary file has changed, recompute it. updateUfsPath(); tmpPath = PathUtils.temporaryFileName(mFileId, mNonce, mUfsPath); } ufs.delete(tmpPath, false); } else { mUnderStorageOutputStream.flush(); mUnderStorageOutputStream.close(); if (!ufs.exists(tmpPath)) { // Location of the temporary file has changed, recompute it. updateUfsPath(); tmpPath = PathUtils.temporaryFileName(mFileId, mNonce, mUfsPath); } if (!ufs.rename(tmpPath, mUfsPath)) { throw new IOException("Failed to rename " + tmpPath + " to " + mUfsPath); } builder.setUfsLength(ufs.getFileSize(mUfsPath)); canComplete = true; } } if (mTachyonStorageType.isStore()) { try { if (mCanceled) { for (BufferedBlockOutStream bos : mPreviousBlockOutStreams) { bos.cancel(); } } else { for (BufferedBlockOutStream bos : mPreviousBlockOutStreams) { bos.close(); } canComplete = true; } } catch (IOException ioe) { handleCacheWriteException(ioe); } } if (canComplete) { FileSystemMasterClient masterClient = mContext.acquireMasterClient(); try { masterClient.completeFile(mFileId, builder.build()); } catch (TachyonException e) { throw new IOException(e); } finally { mContext.releaseMasterClient(masterClient); } } mClosed = true; } @Override public void flush() throws IOException { // TODO(yupeng): Handle flush for Tachyon storage stream as well. if (mUnderStorageType.isSyncPersist()) { mUnderStorageOutputStream.flush(); } } @Override public void write(int b) throws IOException { if (mShouldCacheCurrentBlock) { try { if (mCurrentBlockOutStream == null || mCurrentBlockOutStream.remaining() == 0) { getNextBlock(); } mCurrentBlockOutStream.write(b); } catch (IOException ioe) { handleCacheWriteException(ioe); } } if (mUnderStorageType.isSyncPersist()) { mUnderStorageOutputStream.write(b); ClientContext.getClientMetrics().incBytesWrittenUfs(1); } } @Override public void write(byte[] b) throws IOException { Preconditions.checkArgument(b != null, PreconditionMessage.ERR_WRITE_BUFFER_NULL); write(b, 0, b.length); } @Override public void write(byte[] b, int off, int len) throws IOException { Preconditions.checkArgument(b != null, PreconditionMessage.ERR_WRITE_BUFFER_NULL); Preconditions.checkArgument(off >= 0 && len >= 0 && len + off <= b.length, PreconditionMessage.ERR_BUFFER_STATE, b.length, off, len); if (mShouldCacheCurrentBlock) { try { int tLen = len; int tOff = off; while (tLen > 0) { if (mCurrentBlockOutStream == null || mCurrentBlockOutStream.remaining() == 0) { getNextBlock(); } long currentBlockLeftBytes = mCurrentBlockOutStream.remaining(); if (currentBlockLeftBytes >= tLen) { mCurrentBlockOutStream.write(b, tOff, tLen); tLen = 0; } else { mCurrentBlockOutStream.write(b, tOff, (int) currentBlockLeftBytes); tOff += currentBlockLeftBytes; tLen -= currentBlockLeftBytes; } } } catch (IOException ioe) { handleCacheWriteException(ioe); } } if (mUnderStorageType.isSyncPersist()) { mUnderStorageOutputStream.write(b, off, len); ClientContext.getClientMetrics().incBytesWrittenUfs(len); } } private void getNextBlock() throws IOException { if (mCurrentBlockOutStream != null) { Preconditions.checkState(mCurrentBlockOutStream.remaining() <= 0, PreconditionMessage.ERR_BLOCK_REMAINING); mPreviousBlockOutStreams.add(mCurrentBlockOutStream); } if (mTachyonStorageType.isStore()) { try { WorkerNetAddress address = mLocationPolicy.getWorkerForNextBlock( mContext.getTachyonBlockStore().getWorkerInfoList(), mBlockSize); String hostname = address == null ? null : address.getHost(); // TODO(yupeng) use the returned address directly for constructing the out stream mCurrentBlockOutStream = mContext.getTachyonBlockStore().getOutStream(getNextBlockId(), mBlockSize, hostname); mShouldCacheCurrentBlock = true; } catch (TachyonException e) { throw new IOException(e); } } } private long getNextBlockId() throws IOException { FileSystemMasterClient masterClient = mContext.acquireMasterClient(); try { return masterClient.getNewBlockIdForFile(mFileId); } catch (TachyonException e) { throw new IOException(e); } finally { mContext.releaseMasterClient(masterClient); } } protected void handleCacheWriteException(IOException ioe) throws IOException { if (!mUnderStorageType.isSyncPersist()) { throw new IOException(ExceptionMessage.FAILED_CACHE.getMessage(ioe.getMessage()), ioe); } LOG.warn("Failed to write into TachyonStore, canceling write attempt.", ioe); if (mCurrentBlockOutStream != null) { mShouldCacheCurrentBlock = false; mCurrentBlockOutStream.cancel(); } } private void updateUfsPath() throws IOException { FileSystemMasterClient client = mContext.acquireMasterClient(); try { FileInfo fileInfo = client.getFileInfo(mFileId); mUfsPath = fileInfo.getUfsPath(); } catch (TachyonException e) { throw new IOException(e.getMessage()); } finally { mContext.releaseMasterClient(client); } } }
Improve error propagation in FileOutStream
clients/unshaded/src/main/java/tachyon/client/file/FileOutStream.java
Improve error propagation in FileOutStream
<ide><path>lients/unshaded/src/main/java/tachyon/client/file/FileOutStream.java <ide> FileInfo fileInfo = client.getFileInfo(mFileId); <ide> mUfsPath = fileInfo.getUfsPath(); <ide> } catch (TachyonException e) { <del> throw new IOException(e.getMessage()); <add> throw new IOException(e); <ide> } finally { <ide> mContext.releaseMasterClient(client); <ide> }
JavaScript
mit
7c12951bbb5337e40dc350b9bdc1c1fac8575692
0
evanlucas/paycoin-electron,jwrb/paycoin-electron,jwrb/paycoin-electron,ligerzero459/paycoin-electron,ligerzero459/paycoin-electron,evanlucas/paycoin-electron
var BrowserWindow = require('browser-window') , path = require('path') var name = 'Paycoin' var index = 'file://' + path.join(__dirname, 'views', 'index.html') var app = require('app') app.on('ready', setup) app.on('window-all-closed', function() { if (process.platform !== 'darwin') { app.quit() } }) var mainWindow function setup() { mainWindow = new BrowserWindow({ 'width': 960 , 'height': 650 , 'min-height': 650 , 'min-width': 960 , 'center': true , 'title': name }) mainWindow.loadUrl(index) mainWindow.on('closed', function() { mainWindow = null }) mainWindow.on('page-title-updated', function(e) { e.preventDefault() }) }
index.js
var BrowserWindow = require('browser-window') , path = require('path') var name = 'Paycoin' var index = 'file://' + path.join(__dirname, 'views', 'index.html') var app = require('app') app.on('ready', setup) app.on('window-all-closed', function() { if (process.platform !== 'darwin') { app.quit() } }) var mainWindow function setup() { mainWindow = new BrowserWindow({ 'width': 960 , 'height': 650 , 'min-height': 650 , 'min-width': 960 , 'center': true , 'title': name }) mainWindow.loadUrl(index) mainWindow.on('closed', function() { mainWindow = null }) }
prevent the window title from changing
index.js
prevent the window title from changing
<ide><path>ndex.js <ide> mainWindow.on('closed', function() { <ide> mainWindow = null <ide> }) <add> <add> mainWindow.on('page-title-updated', function(e) { <add> e.preventDefault() <add> }) <ide> }
Java
apache-2.0
511db17bb330988db13220bf4625cd6221d35503
0
Polidea/RxAndroidBle,mzgreen/RxAndroidBle,Polidea/RxAndroidBle,Polidea/RxAndroidBle,mzgreen/RxAndroidBle
package com.polidea.bleplayground; import android.support.v4.app.Fragment; import android.os.Bundle; import android.support.v4.util.Pair; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.polidea.rxandroidble.RxBleClientImpl; import com.polidea.rxandroidble.RxBleConnection; import com.polidea.rxandroidble.RxBleDevice; import com.polidea.rxandroidble.RxBleScanResult; import java.util.Map; import java.util.Set; import java.util.UUID; import rx.Observable; /** * A placeholder fragment containing a simple view. */ public class MainActivityFragment extends Fragment { private final RxBleClientImpl rxBleClient; public MainActivityFragment() { rxBleClient = new RxBleClientImpl(); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_main, container, false); } @Override public void onResume() { super.onResume(); rxBleClient.scanBleDevices(null) .doOnNext(scanResult -> Log.d("AAA", "scanned " + scanResult.getBleDevice())) .filter(rxBleScanResult -> rxBleScanResult.getBleDevice().getName() != null) .filter(rxBleScanResult -> rxBleScanResult.getBleDevice().getName().contains("8775")) .take(1) .map(RxBleScanResult::getBleDevice) .doOnNext(rxBleConnection -> Log.d("AAA", "got device")) .flatMap(rxBleDevice -> rxBleDevice.establishConnection(getContext())) .doOnNext(rxBleConnection -> Log.d("AAA", "connected")) .flatMap(rxBleConnection -> Observable.combineLatest( rxBleConnection .discoverServices() .doOnCompleted(() -> Log.d("AAA", "DISCOVERY:COMPLETED")) .doOnNext(uuidSetMap -> { for (Map.Entry<UUID, Set<UUID>> entry : uuidSetMap.entrySet()) { Log.d("AAA", "service: " + entry.getKey().toString()); for (UUID characteristic : entry.getValue()) { Log.d("AAA", "characteristic: " + characteristic.toString()); } } }), rxBleConnection .readRssi() .doOnCompleted(() -> Log.d("AAA", "RSSI:COMPLETED")) .doOnNext(integer -> Log.d("AAA", "RSSI: " + integer)), (uuidSetMap1, integer1) -> null )) .take(1) // TODO: needed for unsubscribing from RxBleDevice.establishConnection() .subscribe( object -> Log.d("AAA", "connection finished"), throwable -> Log.e("AAA", "an error", throwable), () -> Log.d("AAA", "completed") ); } }
app/src/main/java/com/polidea/bleplayground/MainActivityFragment.java
package com.polidea.bleplayground; import android.support.v4.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; /** * A placeholder fragment containing a simple view. */ public class MainActivityFragment extends Fragment { public MainActivityFragment() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_main, container, false); } }
Added examble usage of the library.
app/src/main/java/com/polidea/bleplayground/MainActivityFragment.java
Added examble usage of the library.
<ide><path>pp/src/main/java/com/polidea/bleplayground/MainActivityFragment.java <ide> <ide> import android.support.v4.app.Fragment; <ide> import android.os.Bundle; <add>import android.support.v4.util.Pair; <add>import android.util.Log; <ide> import android.view.LayoutInflater; <ide> import android.view.View; <ide> import android.view.ViewGroup; <add>import com.polidea.rxandroidble.RxBleClientImpl; <add>import com.polidea.rxandroidble.RxBleConnection; <add>import com.polidea.rxandroidble.RxBleDevice; <add>import com.polidea.rxandroidble.RxBleScanResult; <add>import java.util.Map; <add>import java.util.Set; <add>import java.util.UUID; <add>import rx.Observable; <ide> <ide> /** <ide> * A placeholder fragment containing a simple view. <ide> */ <ide> public class MainActivityFragment extends Fragment { <ide> <add> private final RxBleClientImpl rxBleClient; <add> <ide> public MainActivityFragment() { <add> rxBleClient = new RxBleClientImpl(); <ide> } <ide> <ide> @Override <ide> <ide> return inflater.inflate(R.layout.fragment_main, container, false); <ide> } <add> <add> @Override <add> public void onResume() { <add> super.onResume(); <add> <add> rxBleClient.scanBleDevices(null) <add> .doOnNext(scanResult -> Log.d("AAA", "scanned " + scanResult.getBleDevice())) <add> .filter(rxBleScanResult -> rxBleScanResult.getBleDevice().getName() != null) <add> .filter(rxBleScanResult -> rxBleScanResult.getBleDevice().getName().contains("8775")) <add> .take(1) <add> .map(RxBleScanResult::getBleDevice) <add> .doOnNext(rxBleConnection -> Log.d("AAA", "got device")) <add> .flatMap(rxBleDevice -> rxBleDevice.establishConnection(getContext())) <add> .doOnNext(rxBleConnection -> Log.d("AAA", "connected")) <add> .flatMap(rxBleConnection -> Observable.combineLatest( <add> rxBleConnection <add> .discoverServices() <add> .doOnCompleted(() -> Log.d("AAA", "DISCOVERY:COMPLETED")) <add> .doOnNext(uuidSetMap -> { <add> for (Map.Entry<UUID, Set<UUID>> entry : uuidSetMap.entrySet()) { <add> Log.d("AAA", "service: " + entry.getKey().toString()); <add> for (UUID characteristic : entry.getValue()) { <add> Log.d("AAA", "characteristic: " + characteristic.toString()); <add> } <add> } <add> }), <add> rxBleConnection <add> .readRssi() <add> .doOnCompleted(() -> Log.d("AAA", "RSSI:COMPLETED")) <add> .doOnNext(integer -> Log.d("AAA", "RSSI: " + integer)), <add> (uuidSetMap1, integer1) -> null <add> )) <add> .take(1) // TODO: needed for unsubscribing from RxBleDevice.establishConnection() <add> .subscribe( <add> object -> Log.d("AAA", "connection finished"), <add> throwable -> Log.e("AAA", "an error", throwable), <add> () -> Log.d("AAA", "completed") <add> ); <add> } <ide> }
Java
apache-2.0
6bbc0a2b50d76351e46d1294fca9621dee8a679a
0
mars137/Insight-project,mars137/Insight-project,mars137/Insight-project
/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package avro.Message; import org.apache.avro.specific.SpecificData; import org.apache.avro.message.BinaryMessageEncoder; import org.apache.avro.message.BinaryMessageDecoder; import org.apache.avro.message.SchemaStore; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class Propensity extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { private static final long serialVersionUID = -5832019242516355453L; public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Propensity\",\"namespace\":\"avro.Message\",\"fields\":[{\"name\":\"userid\",\"type\":\"string\"},{\"name\":\"timestamp\",\"type\":\"long\"},{\"name\":\"logtype\",\"type\":\"string\"},{\"name\":\"propensity\",\"type\":\"double\",\"default\":0.0}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } private static SpecificData MODEL$ = new SpecificData(); private static final BinaryMessageEncoder<Propensity> ENCODER = new BinaryMessageEncoder<Propensity>(MODEL$, SCHEMA$); private static final BinaryMessageDecoder<Propensity> DECODER = new BinaryMessageDecoder<Propensity>(MODEL$, SCHEMA$); /** * Return the BinaryMessageDecoder instance used by this class. */ public static BinaryMessageDecoder<Propensity> getDecoder() { return DECODER; } /** * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. * @param resolver a {@link SchemaStore} used to find schemas by fingerprint */ public static BinaryMessageDecoder<Propensity> createDecoder(SchemaStore resolver) { return new BinaryMessageDecoder<Propensity>(MODEL$, SCHEMA$, resolver); } /** Serializes this Propensity to a ByteBuffer. */ public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { return ENCODER.encode(this); } /** Deserializes a Propensity from a ByteBuffer. */ public static Propensity fromByteBuffer( java.nio.ByteBuffer b) throws java.io.IOException { return DECODER.decode(b); } @Deprecated public java.lang.CharSequence userid; @Deprecated public long timestamp; @Deprecated public java.lang.CharSequence logtype; @Deprecated public double propensity; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use <code>newBuilder()</code>. */ public Propensity() {} /** * All-args constructor. * @param userid The new value for userid * @param timestamp The new value for timestamp * @param logtype The new value for logtype * @param propensity The new value for propensity */ public Propensity(java.lang.CharSequence userid, java.lang.Long timestamp, java.lang.CharSequence logtype, java.lang.Double propensity) { this.userid = userid; this.timestamp = timestamp; this.logtype = logtype; this.propensity = propensity; } public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call. public java.lang.Object get(int field$) { switch (field$) { case 0: return userid; case 1: return timestamp; case 2: return logtype; case 3: return propensity; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } // Used by DatumReader. Applications should not call. @SuppressWarnings(value="unchecked") public void put(int field$, java.lang.Object value$) { switch (field$) { case 0: userid = (java.lang.CharSequence)value$; break; case 1: timestamp = (java.lang.Long)value$; break; case 2: logtype = (java.lang.CharSequence)value$; break; case 3: propensity = (java.lang.Double)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'userid' field. * @return The value of the 'userid' field. */ public java.lang.CharSequence getUserid() { return userid; } /** * Sets the value of the 'userid' field. * @param value the value to set. */ public void setUserid(java.lang.CharSequence value) { this.userid = value; } /** * Gets the value of the 'timestamp' field. * @return The value of the 'timestamp' field. */ public java.lang.Long getTimestamp() { return timestamp; } /** * Sets the value of the 'timestamp' field. * @param value the value to set. */ public void setTimestamp(java.lang.Long value) { this.timestamp = value; } /** * Gets the value of the 'logtype' field. * @return The value of the 'logtype' field. */ public java.lang.CharSequence getLogtype() { return logtype; } /** * Sets the value of the 'logtype' field. * @param value the value to set. */ public void setLogtype(java.lang.CharSequence value) { this.logtype = value; } /** * Gets the value of the 'propensity' field. * @return The value of the 'propensity' field. */ public java.lang.Double getPropensity() { return propensity; } /** * Sets the value of the 'propensity' field. * @param value the value to set. */ public void setPropensity(java.lang.Double value) { this.propensity = value; } /** * Creates a new Propensity RecordBuilder. * @return A new Propensity RecordBuilder */ public static avro.Message.Propensity.Builder newBuilder() { return new avro.Message.Propensity.Builder(); } /** * Creates a new Propensity RecordBuilder by copying an existing Builder. * @param other The existing builder to copy. * @return A new Propensity RecordBuilder */ public static avro.Message.Propensity.Builder newBuilder(avro.Message.Propensity.Builder other) { return new avro.Message.Propensity.Builder(other); } /** * Creates a new Propensity RecordBuilder by copying an existing Propensity instance. * @param other The existing instance to copy. * @return A new Propensity RecordBuilder */ public static avro.Message.Propensity.Builder newBuilder(avro.Message.Propensity other) { return new avro.Message.Propensity.Builder(other); } /** * RecordBuilder for Propensity instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<Propensity> implements org.apache.avro.data.RecordBuilder<Propensity> { private java.lang.CharSequence userid; private long timestamp; private java.lang.CharSequence logtype; private double propensity; /** Creates a new Builder */ private Builder() { super(SCHEMA$); } /** * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ private Builder(avro.Message.Propensity.Builder other) { super(other); if (isValidValue(fields()[0], other.userid)) { this.userid = data().deepCopy(fields()[0].schema(), other.userid); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.timestamp)) { this.timestamp = data().deepCopy(fields()[1].schema(), other.timestamp); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.logtype)) { this.logtype = data().deepCopy(fields()[2].schema(), other.logtype); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.propensity)) { this.propensity = data().deepCopy(fields()[3].schema(), other.propensity); fieldSetFlags()[3] = true; } } /** * Creates a Builder by copying an existing Propensity instance * @param other The existing instance to copy. */ private Builder(avro.Message.Propensity other) { super(SCHEMA$); if (isValidValue(fields()[0], other.userid)) { this.userid = data().deepCopy(fields()[0].schema(), other.userid); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.timestamp)) { this.timestamp = data().deepCopy(fields()[1].schema(), other.timestamp); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.logtype)) { this.logtype = data().deepCopy(fields()[2].schema(), other.logtype); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.propensity)) { this.propensity = data().deepCopy(fields()[3].schema(), other.propensity); fieldSetFlags()[3] = true; } } /** * Gets the value of the 'userid' field. * @return The value. */ public java.lang.CharSequence getUserid() { return userid; } /** * Sets the value of the 'userid' field. * @param value The value of 'userid'. * @return This builder. */ public avro.Message.Propensity.Builder setUserid(java.lang.CharSequence value) { validate(fields()[0], value); this.userid = value; fieldSetFlags()[0] = true; return this; } /** * Checks whether the 'userid' field has been set. * @return True if the 'userid' field has been set, false otherwise. */ public boolean hasUserid() { return fieldSetFlags()[0]; } /** * Clears the value of the 'userid' field. * @return This builder. */ public avro.Message.Propensity.Builder clearUserid() { userid = null; fieldSetFlags()[0] = false; return this; } /** * Gets the value of the 'timestamp' field. * @return The value. */ public java.lang.Long getTimestamp() { return timestamp; } /** * Sets the value of the 'timestamp' field. * @param value The value of 'timestamp'. * @return This builder. */ public avro.Message.Propensity.Builder setTimestamp(long value) { validate(fields()[1], value); this.timestamp = value; fieldSetFlags()[1] = true; return this; } /** * Checks whether the 'timestamp' field has been set. * @return True if the 'timestamp' field has been set, false otherwise. */ public boolean hasTimestamp() { return fieldSetFlags()[1]; } /** * Clears the value of the 'timestamp' field. * @return This builder. */ public avro.Message.Propensity.Builder clearTimestamp() { fieldSetFlags()[1] = false; return this; } /** * Gets the value of the 'logtype' field. * @return The value. */ public java.lang.CharSequence getLogtype() { return logtype; } /** * Sets the value of the 'logtype' field. * @param value The value of 'logtype'. * @return This builder. */ public avro.Message.Propensity.Builder setLogtype(java.lang.CharSequence value) { validate(fields()[2], value); this.logtype = value; fieldSetFlags()[2] = true; return this; } /** * Checks whether the 'logtype' field has been set. * @return True if the 'logtype' field has been set, false otherwise. */ public boolean hasLogtype() { return fieldSetFlags()[2]; } /** * Clears the value of the 'logtype' field. * @return This builder. */ public avro.Message.Propensity.Builder clearLogtype() { logtype = null; fieldSetFlags()[2] = false; return this; } /** * Gets the value of the 'propensity' field. * @return The value. */ public java.lang.Double getPropensity() { return propensity; } /** * Sets the value of the 'propensity' field. * @param value The value of 'propensity'. * @return This builder. */ public avro.Message.Propensity.Builder setPropensity(double value) { validate(fields()[3], value); this.propensity = value; fieldSetFlags()[3] = true; return this; } /** * Checks whether the 'propensity' field has been set. * @return True if the 'propensity' field has been set, false otherwise. */ public boolean hasPropensity() { return fieldSetFlags()[3]; } /** * Clears the value of the 'propensity' field. * @return This builder. */ public avro.Message.Propensity.Builder clearPropensity() { fieldSetFlags()[3] = false; return this; } @Override @SuppressWarnings("unchecked") public Propensity build() { try { Propensity record = new Propensity(); record.userid = fieldSetFlags()[0] ? this.userid : (java.lang.CharSequence) defaultValue(fields()[0]); record.timestamp = fieldSetFlags()[1] ? this.timestamp : (java.lang.Long) defaultValue(fields()[1]); record.logtype = fieldSetFlags()[2] ? this.logtype : (java.lang.CharSequence) defaultValue(fields()[2]); record.propensity = fieldSetFlags()[3] ? this.propensity : (java.lang.Double) defaultValue(fields()[3]); return record; } catch (java.lang.Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumWriter<Propensity> WRITER$ = (org.apache.avro.io.DatumWriter<Propensity>)MODEL$.createDatumWriter(SCHEMA$); @Override public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException { WRITER$.write(this, SpecificData.getEncoder(out)); } @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumReader<Propensity> READER$ = (org.apache.avro.io.DatumReader<Propensity>)MODEL$.createDatumReader(SCHEMA$); @Override public void readExternal(java.io.ObjectInput in) throws java.io.IOException { READER$.read(this, SpecificData.getDecoder(in)); } }
kafka-streams-application/src/main/java/avro/Message/Propensity.java
/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package avro.Message; import org.apache.avro.specific.SpecificData; import org.apache.avro.message.BinaryMessageEncoder; import org.apache.avro.message.BinaryMessageDecoder; import org.apache.avro.message.SchemaStore; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class Propensity extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { private static final long serialVersionUID = -7248347725564553377L; public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Propensity\",\"namespace\":\"avro.Message\",\"fields\":[{\"name\":\"userid\",\"type\":\"string\"},{\"name\":\"timestamp\",\"type\":\"long\"},{\"name\":\"logtype\",\"type\":\"string\"},{\"name\":\"propensity\",\"type\":[\"null\",\"double\"],\"default\":null}]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } private static SpecificData MODEL$ = new SpecificData(); private static final BinaryMessageEncoder<Propensity> ENCODER = new BinaryMessageEncoder<Propensity>(MODEL$, SCHEMA$); private static final BinaryMessageDecoder<Propensity> DECODER = new BinaryMessageDecoder<Propensity>(MODEL$, SCHEMA$); /** * Return the BinaryMessageDecoder instance used by this class. */ public static BinaryMessageDecoder<Propensity> getDecoder() { return DECODER; } /** * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. * @param resolver a {@link SchemaStore} used to find schemas by fingerprint */ public static BinaryMessageDecoder<Propensity> createDecoder(SchemaStore resolver) { return new BinaryMessageDecoder<Propensity>(MODEL$, SCHEMA$, resolver); } /** Serializes this Propensity to a ByteBuffer. */ public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { return ENCODER.encode(this); } /** Deserializes a Propensity from a ByteBuffer. */ public static Propensity fromByteBuffer( java.nio.ByteBuffer b) throws java.io.IOException { return DECODER.decode(b); } @Deprecated public java.lang.CharSequence userid; @Deprecated public long timestamp; @Deprecated public java.lang.CharSequence logtype; @Deprecated public java.lang.Double propensity; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use <code>newBuilder()</code>. */ public Propensity() {} /** * All-args constructor. * @param userid The new value for userid * @param timestamp The new value for timestamp * @param logtype The new value for logtype * @param propensity The new value for propensity */ public Propensity(java.lang.CharSequence userid, java.lang.Long timestamp, java.lang.CharSequence logtype, java.lang.Double propensity) { this.userid = userid; this.timestamp = timestamp; this.logtype = logtype; this.propensity = propensity; } public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call. public java.lang.Object get(int field$) { switch (field$) { case 0: return userid; case 1: return timestamp; case 2: return logtype; case 3: return propensity; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } // Used by DatumReader. Applications should not call. @SuppressWarnings(value="unchecked") public void put(int field$, java.lang.Object value$) { switch (field$) { case 0: userid = (java.lang.CharSequence)value$; break; case 1: timestamp = (java.lang.Long)value$; break; case 2: logtype = (java.lang.CharSequence)value$; break; case 3: propensity = (java.lang.Double)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'userid' field. * @return The value of the 'userid' field. */ public java.lang.CharSequence getUserid() { return userid; } /** * Sets the value of the 'userid' field. * @param value the value to set. */ public void setUserid(java.lang.CharSequence value) { this.userid = value; } /** * Gets the value of the 'timestamp' field. * @return The value of the 'timestamp' field. */ public java.lang.Long getTimestamp() { return timestamp; } /** * Sets the value of the 'timestamp' field. * @param value the value to set. */ public void setTimestamp(java.lang.Long value) { this.timestamp = value; } /** * Gets the value of the 'logtype' field. * @return The value of the 'logtype' field. */ public java.lang.CharSequence getLogtype() { return logtype; } /** * Sets the value of the 'logtype' field. * @param value the value to set. */ public void setLogtype(java.lang.CharSequence value) { this.logtype = value; } /** * Gets the value of the 'propensity' field. * @return The value of the 'propensity' field. */ public java.lang.Double getPropensity() { return propensity; } /** * Sets the value of the 'propensity' field. * @param value the value to set. */ public void setPropensity(java.lang.Double value) { this.propensity = value; } /** * Creates a new Propensity RecordBuilder. * @return A new Propensity RecordBuilder */ public static avro.Message.Propensity.Builder newBuilder() { return new avro.Message.Propensity.Builder(); } /** * Creates a new Propensity RecordBuilder by copying an existing Builder. * @param other The existing builder to copy. * @return A new Propensity RecordBuilder */ public static avro.Message.Propensity.Builder newBuilder(avro.Message.Propensity.Builder other) { return new avro.Message.Propensity.Builder(other); } /** * Creates a new Propensity RecordBuilder by copying an existing Propensity instance. * @param other The existing instance to copy. * @return A new Propensity RecordBuilder */ public static avro.Message.Propensity.Builder newBuilder(avro.Message.Propensity other) { return new avro.Message.Propensity.Builder(other); } /** * RecordBuilder for Propensity instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<Propensity> implements org.apache.avro.data.RecordBuilder<Propensity> { private java.lang.CharSequence userid; private long timestamp; private java.lang.CharSequence logtype; private java.lang.Double propensity; /** Creates a new Builder */ private Builder() { super(SCHEMA$); } /** * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ private Builder(avro.Message.Propensity.Builder other) { super(other); if (isValidValue(fields()[0], other.userid)) { this.userid = data().deepCopy(fields()[0].schema(), other.userid); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.timestamp)) { this.timestamp = data().deepCopy(fields()[1].schema(), other.timestamp); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.logtype)) { this.logtype = data().deepCopy(fields()[2].schema(), other.logtype); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.propensity)) { this.propensity = data().deepCopy(fields()[3].schema(), other.propensity); fieldSetFlags()[3] = true; } } /** * Creates a Builder by copying an existing Propensity instance * @param other The existing instance to copy. */ private Builder(avro.Message.Propensity other) { super(SCHEMA$); if (isValidValue(fields()[0], other.userid)) { this.userid = data().deepCopy(fields()[0].schema(), other.userid); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.timestamp)) { this.timestamp = data().deepCopy(fields()[1].schema(), other.timestamp); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.logtype)) { this.logtype = data().deepCopy(fields()[2].schema(), other.logtype); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.propensity)) { this.propensity = data().deepCopy(fields()[3].schema(), other.propensity); fieldSetFlags()[3] = true; } } /** * Gets the value of the 'userid' field. * @return The value. */ public java.lang.CharSequence getUserid() { return userid; } /** * Sets the value of the 'userid' field. * @param value The value of 'userid'. * @return This builder. */ public avro.Message.Propensity.Builder setUserid(java.lang.CharSequence value) { validate(fields()[0], value); this.userid = value; fieldSetFlags()[0] = true; return this; } /** * Checks whether the 'userid' field has been set. * @return True if the 'userid' field has been set, false otherwise. */ public boolean hasUserid() { return fieldSetFlags()[0]; } /** * Clears the value of the 'userid' field. * @return This builder. */ public avro.Message.Propensity.Builder clearUserid() { userid = null; fieldSetFlags()[0] = false; return this; } /** * Gets the value of the 'timestamp' field. * @return The value. */ public java.lang.Long getTimestamp() { return timestamp; } /** * Sets the value of the 'timestamp' field. * @param value The value of 'timestamp'. * @return This builder. */ public avro.Message.Propensity.Builder setTimestamp(long value) { validate(fields()[1], value); this.timestamp = value; fieldSetFlags()[1] = true; return this; } /** * Checks whether the 'timestamp' field has been set. * @return True if the 'timestamp' field has been set, false otherwise. */ public boolean hasTimestamp() { return fieldSetFlags()[1]; } /** * Clears the value of the 'timestamp' field. * @return This builder. */ public avro.Message.Propensity.Builder clearTimestamp() { fieldSetFlags()[1] = false; return this; } /** * Gets the value of the 'logtype' field. * @return The value. */ public java.lang.CharSequence getLogtype() { return logtype; } /** * Sets the value of the 'logtype' field. * @param value The value of 'logtype'. * @return This builder. */ public avro.Message.Propensity.Builder setLogtype(java.lang.CharSequence value) { validate(fields()[2], value); this.logtype = value; fieldSetFlags()[2] = true; return this; } /** * Checks whether the 'logtype' field has been set. * @return True if the 'logtype' field has been set, false otherwise. */ public boolean hasLogtype() { return fieldSetFlags()[2]; } /** * Clears the value of the 'logtype' field. * @return This builder. */ public avro.Message.Propensity.Builder clearLogtype() { logtype = null; fieldSetFlags()[2] = false; return this; } /** * Gets the value of the 'propensity' field. * @return The value. */ public java.lang.Double getPropensity() { return propensity; } /** * Sets the value of the 'propensity' field. * @param value The value of 'propensity'. * @return This builder. */ public avro.Message.Propensity.Builder setPropensity(java.lang.Double value) { validate(fields()[3], value); this.propensity = value; fieldSetFlags()[3] = true; return this; } /** * Checks whether the 'propensity' field has been set. * @return True if the 'propensity' field has been set, false otherwise. */ public boolean hasPropensity() { return fieldSetFlags()[3]; } /** * Clears the value of the 'propensity' field. * @return This builder. */ public avro.Message.Propensity.Builder clearPropensity() { propensity = null; fieldSetFlags()[3] = false; return this; } @Override @SuppressWarnings("unchecked") public Propensity build() { try { Propensity record = new Propensity(); record.userid = fieldSetFlags()[0] ? this.userid : (java.lang.CharSequence) defaultValue(fields()[0]); record.timestamp = fieldSetFlags()[1] ? this.timestamp : (java.lang.Long) defaultValue(fields()[1]); record.logtype = fieldSetFlags()[2] ? this.logtype : (java.lang.CharSequence) defaultValue(fields()[2]); record.propensity = fieldSetFlags()[3] ? this.propensity : (java.lang.Double) defaultValue(fields()[3]); return record; } catch (java.lang.Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumWriter<Propensity> WRITER$ = (org.apache.avro.io.DatumWriter<Propensity>)MODEL$.createDatumWriter(SCHEMA$); @Override public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException { WRITER$.write(this, SpecificData.getEncoder(out)); } @SuppressWarnings("unchecked") private static final org.apache.avro.io.DatumReader<Propensity> READER$ = (org.apache.avro.io.DatumReader<Propensity>)MODEL$.createDatumReader(SCHEMA$); @Override public void readExternal(java.io.ObjectInput in) throws java.io.IOException { READER$.read(this, SpecificData.getDecoder(in)); } }
Updated Avro java class - corresponding Propensity schema
kafka-streams-application/src/main/java/avro/Message/Propensity.java
Updated Avro java class - corresponding Propensity schema
<ide><path>afka-streams-application/src/main/java/avro/Message/Propensity.java <ide> @SuppressWarnings("all") <ide> @org.apache.avro.specific.AvroGenerated <ide> public class Propensity extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { <del> private static final long serialVersionUID = -7248347725564553377L; <del> public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Propensity\",\"namespace\":\"avro.Message\",\"fields\":[{\"name\":\"userid\",\"type\":\"string\"},{\"name\":\"timestamp\",\"type\":\"long\"},{\"name\":\"logtype\",\"type\":\"string\"},{\"name\":\"propensity\",\"type\":[\"null\",\"double\"],\"default\":null}]}"); <add> private static final long serialVersionUID = -5832019242516355453L; <add> public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Propensity\",\"namespace\":\"avro.Message\",\"fields\":[{\"name\":\"userid\",\"type\":\"string\"},{\"name\":\"timestamp\",\"type\":\"long\"},{\"name\":\"logtype\",\"type\":\"string\"},{\"name\":\"propensity\",\"type\":\"double\",\"default\":0.0}]}"); <ide> public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } <ide> <ide> private static SpecificData MODEL$ = new SpecificData(); <ide> @Deprecated public java.lang.CharSequence userid; <ide> @Deprecated public long timestamp; <ide> @Deprecated public java.lang.CharSequence logtype; <del> @Deprecated public java.lang.Double propensity; <add> @Deprecated public double propensity; <ide> <ide> /** <ide> * Default constructor. Note that this does not initialize fields <ide> private java.lang.CharSequence userid; <ide> private long timestamp; <ide> private java.lang.CharSequence logtype; <del> private java.lang.Double propensity; <add> private double propensity; <ide> <ide> /** Creates a new Builder */ <ide> private Builder() { <ide> * @param value The value of 'propensity'. <ide> * @return This builder. <ide> */ <del> public avro.Message.Propensity.Builder setPropensity(java.lang.Double value) { <add> public avro.Message.Propensity.Builder setPropensity(double value) { <ide> validate(fields()[3], value); <ide> this.propensity = value; <ide> fieldSetFlags()[3] = true; <ide> * @return This builder. <ide> */ <ide> public avro.Message.Propensity.Builder clearPropensity() { <del> propensity = null; <ide> fieldSetFlags()[3] = false; <ide> return this; <ide> }
Java
apache-2.0
195dd8112b4a3e3d752de85ec38e7549a0e4a17c
0
dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android
package org.commcare.android.framework; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.SharedPreferences; import android.os.Build; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.text.Spannable; import android.util.DisplayMetrics; import android.util.Pair; import android.view.GestureDetector; import android.view.GestureDetector.OnGestureListener; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.widget.SearchView; import android.widget.TextView; import android.widget.Toast; import org.commcare.android.database.user.models.ACase; import org.commcare.android.javarosa.AndroidLogger; import org.commcare.android.tasks.templates.CommCareTask; import org.commcare.android.tasks.templates.CommCareTaskConnector; import org.commcare.android.util.AndroidUtil; import org.commcare.android.util.MarkupUtil; import org.commcare.android.util.SessionStateUninitException; import org.commcare.android.util.StringUtils; import org.commcare.dalvik.BuildConfig; import org.commcare.dalvik.application.CommCareApplication; import org.commcare.dalvik.dialogs.CustomProgressDialog; import org.commcare.dalvik.dialogs.DialogController; import org.commcare.dalvik.preferences.CommCarePreferences; import org.commcare.suite.model.Detail; import org.commcare.suite.model.StackFrameStep; import org.commcare.util.SessionFrame; import org.javarosa.core.model.instance.TreeReference; import org.javarosa.core.services.Logger; import org.javarosa.core.services.locale.Localization; import org.javarosa.core.util.NoLocalizedTextException; import org.odk.collect.android.views.media.AudioController; import android.annotation.TargetApi; import android.util.Log; import java.lang.reflect.Field; /** * Base class for CommCareActivities to simplify * common localization and workflow tasks * * @author ctsims */ public abstract class CommCareActivity<R> extends FragmentActivity implements CommCareTaskConnector<R>, DialogController, OnGestureListener { private static final String TAG = CommCareActivity.class.getSimpleName(); private final static String KEY_DIALOG_FRAG = "dialog_fragment"; StateFragment stateHolder; //fields for implementing task transitions for CommCareTaskConnector private boolean inTaskTransition; /** * Used to indicate that the (progress) dialog associated with a task * should be dismissed because the task has completed or been canceled. */ private boolean shouldDismissDialog = true; private GestureDetector mGestureDetector; public static final String KEY_LAST_QUERY_STRING = "LAST_QUERY_STRING"; protected String lastQueryString; /** * Activity has been put in the background. This is used to prevent dialogs * from being shown while activity isn't active. */ private boolean activityPaused; /** * Stores the id of a dialog that tried to be shown when the activity * wasn't active. When the activity resumes, create this dialog if the * associated task is still running and the id is non-negative. */ private int showDialogIdOnResume = -1; @Override @TargetApi(14) protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (showDialogIdOnResume > 0 && !shouldDismissDialog) { startBlockingForTask(showDialogIdOnResume); } showDialogIdOnResume = -1; FragmentManager fm = this.getSupportFragmentManager(); stateHolder = (StateFragment) fm.findFragmentByTag("state"); // stateHolder and its previous state aren't null if the activity is // being created due to an orientation change. if (stateHolder == null) { stateHolder = new StateFragment(); fm.beginTransaction().add(stateHolder, "state").commit(); // entering new activity, not just rotating one, so release old // media AudioController.INSTANCE.releaseCurrentMediaEntity(); } if(this.getClass().isAnnotationPresent(ManagedUi.class)) { this.setContentView(this.getClass().getAnnotation(ManagedUi.class).value()); loadFields(); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { getActionBar().setDisplayShowCustomEnabled(true); // Add breadcrumb bar BreadcrumbBarFragment bar = (BreadcrumbBarFragment) fm.findFragmentByTag("breadcrumbs"); // If the state holder is null, create a new one for this activity if (bar == null) { bar = new BreadcrumbBarFragment(); fm.beginTransaction().add(bar, "breadcrumbs").commit(); } } mGestureDetector = new GestureDetector(this, this); } protected void restoreLastQueryString(String key) { SharedPreferences settings = getSharedPreferences(CommCarePreferences.ACTIONBAR_PREFS, 0); lastQueryString = settings.getString(key, null); if (BuildConfig.DEBUG) { Log.v(TAG, "Recovered lastQueryString: (" + lastQueryString + ")"); } } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: this.onBackPressed(); return true; default: return super.onOptionsItemSelected(item); } } private void loadFields() { CommCareActivity oldActivity = stateHolder.getPreviousState(); Class c = this.getClass(); for(Field f : c.getDeclaredFields()) { if(f.isAnnotationPresent(UiElement.class)) { UiElement element = f.getAnnotation(UiElement.class); try{ f.setAccessible(true); try { View v = this.findViewById(element.value()); f.set(this, v); if(oldActivity != null) { View oldView = (View)f.get(oldActivity); if(oldView != null) { if(v instanceof TextView) { ((TextView)v).setText(((TextView)oldView).getText()); } if (v == null) { Log.d("loadFields", "NullPointerException when trying to find view with id: " + + element.value() + " (" + getResources().getResourceEntryName(element.value()) + ") " + " oldView is " + oldView + " for activity " + oldActivity + ", element is: " + f + " (" + f.getName() + ")"); } v.setVisibility(oldView.getVisibility()); v.setEnabled(oldView.isEnabled()); continue; } } if(!"".equals(element.locale())) { if(v instanceof TextView) { ((TextView)v).setText(Localization.get(element.locale())); } else { throw new RuntimeException("Can't set the text for a " + v.getClass().getName() + " View!"); } } } catch (IllegalArgumentException e) { e.printStackTrace(); throw new RuntimeException("Bad Object type for field " + f.getName()); } catch (IllegalAccessException e) { throw new RuntimeException("Couldn't access the activity field for some reason"); } } finally { f.setAccessible(false); } } } } protected CommCareActivity getDestroyedActivityState() { return stateHolder.getPreviousState(); } protected boolean isTopNavEnabled() { return false; } @Override @TargetApi(11) protected void onResume() { super.onResume(); activityPaused = false; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { // In honeycomb and above the fragment takes care of this this.setTitle(getTitle(this, getActivityTitle())); } AudioController.INSTANCE.playPreviousAudio(); } @Override protected void onPause() { super.onPause(); activityPaused = true; AudioController.INSTANCE.systemInducedPause(); } @Override public <A, B, C> void connectTask(CommCareTask<A, B, C, R> task) { //If stateHolder is null here, it's because it is restoring itself, it doesn't need //this step wakelock(); stateHolder.connectTask(task); //If we've left an old dialog showing during the task transition and it was from the same task //as the one that is starting, don't dismiss it CustomProgressDialog currDialog = getCurrentDialog(); if (currDialog != null && currDialog.getTaskId() == task.getTaskId()) { shouldDismissDialog = false; } } @Override public R getReceiver() { return (R)this; } /** * Override these to control the UI for your task */ @Override public void startBlockingForTask(int id) { if (activityPaused) { // don't show the dialog if the activity is in the background showDialogIdOnResume = id; return; } // attempt to dismiss the dialog from the last task before showing this // one attemptDismissDialog(); // ONLY if shouldDismissDialog = true, i.e. if we chose to dismiss the // last dialog during transition, show a new one if (id >= 0 && shouldDismissDialog) { this.showProgressDialog(id); } } @Override public void stopBlockingForTask(int id) { if (id >= 0) { if (inTaskTransition) { shouldDismissDialog = true; } else { dismissProgressDialog(); } } unlock(); } @Override public void startTaskTransition() { inTaskTransition = true; } @Override public void stopTaskTransition() { inTaskTransition = false; attemptDismissDialog(); //reset shouldDismissDialog to true after this transition cycle is over shouldDismissDialog = true; } //if shouldDismiss flag has not been set to false in the course of a task transition, //then dismiss the dialog void attemptDismissDialog() { if (shouldDismissDialog) { dismissProgressDialog(); } } /** * Handle an error in task execution. */ protected void taskError(Exception e) { //TODO: For forms with good error reporting, integrate that Toast.makeText(this, Localization.get("activity.task.error.generic", new String[] {e.getMessage()}), Toast.LENGTH_LONG).show(); Logger.log(AndroidLogger.TYPE_ERROR_WORKFLOW, e.getMessage()); } /** * Display exception details as a pop-up to the user. * * @param e Exception to handle */ protected void displayException(Exception e) { String mErrorMessage = e.getMessage(); AlertDialog mAlertDialog = new AlertDialog.Builder(this).create(); mAlertDialog.setIcon(android.R.drawable.ic_dialog_info); mAlertDialog.setTitle(Localization.get("notification.case.predicate.title")); mAlertDialog.setMessage(Localization.get("notification.case.predicate.action", new String[] {mErrorMessage})); DialogInterface.OnClickListener errorListener = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int i) { switch (i) { case DialogInterface.BUTTON1: finish(); break; } } }; mAlertDialog.setCancelable(false); mAlertDialog.setButton(Localization.get("dialog.ok"), errorListener); mAlertDialog.show(); } @Override public void taskCancelled(int id) { } public void cancelCurrentTask() { stateHolder.cancelTask(); } protected void saveLastQueryString(String key) { SharedPreferences settings = getSharedPreferences(CommCarePreferences.ACTIONBAR_PREFS, 0); SharedPreferences.Editor editor = settings.edit(); editor.putString(key, lastQueryString); editor.commit(); if (BuildConfig.DEBUG) { Log.v(TAG, "Saving lastQueryString: (" + lastQueryString + ") in file: " + CommCarePreferences.ACTIONBAR_PREFS); } } private void wakelock() { int lockLevel = getWakeLockingLevel(); if(lockLevel == -1) { return;} stateHolder.wakelock(lockLevel); } private void unlock() { stateHolder.unlock(); } /** * @return The WakeLock flags that should be used for this activity's tasks. -1 * if this activity should not acquire/use the wakelock for tasks */ protected int getWakeLockingLevel() { return -1; } //Graphical stuff below, needs to get modularized public void transplantStyle(TextView target, int resource) { //get styles from here TextView tv = (TextView)View.inflate(this, resource, null); int[] padding = {target.getPaddingLeft(), target.getPaddingTop(), target.getPaddingRight(),target.getPaddingBottom() }; target.setTextColor(tv.getTextColors().getDefaultColor()); target.setTypeface(tv.getTypeface()); target.setBackgroundDrawable(tv.getBackground()); target.setPadding(padding[0], padding[1], padding[2], padding[3]); } /** * The right-hand side of the title associated with this activity. * * This will update dynamically as the activity loads/updates, but if * it will ever have a value it must return a blank string when one * isn't available. */ public String getActivityTitle() { return null; } public static String getTopLevelTitleName(Context c) { try { return Localization.get("app.display.name"); } catch(NoLocalizedTextException nlte) { return c.getString(org.commcare.dalvik.R.string.title_bar_name); } } public static String getTitle(Context c, String local) { String topLevel = getTopLevelTitleName(c); String[] stepTitles = new String[0]; try { stepTitles = CommCareApplication._().getCurrentSession().getHeaderTitles(); //See if we can insert any case hacks int i = 0; for(StackFrameStep step : CommCareApplication._().getCurrentSession().getFrame().getSteps()){ try { if(SessionFrame.STATE_DATUM_VAL.equals(step.getType())) { //Haaack if(step.getId() != null && step.getId().contains("case_id")) { ACase foundCase = CommCareApplication._().getUserStorage(ACase.STORAGE_KEY, ACase.class).getRecordForValue(ACase.INDEX_CASE_ID, step.getValue()); stepTitles[i] = Localization.get("title.datum.wrapper", new String[] { foundCase.getName()}); } } } catch(Exception e) { //TODO: Your error handling is bad and you should feel bad } ++i; } } catch(SessionStateUninitException e) { } StringBuilder titleBuf = new StringBuilder(topLevel); for(String title : stepTitles) { if(title != null) { titleBuf.append(" > ").append(title); } } if(local != null) { titleBuf.append(" > ").append(local); } return titleBuf.toString(); } protected void createErrorDialog(String errorMsg, boolean shouldExit) { createErrorDialog(this, errorMsg, shouldExit); } /** * Pop up a semi-friendly error dialog rather than crashing outright. * @param activity Activity to which to attach the dialog. * @param shouldExit If true, cancel activity when user exits dialog. */ public static void createErrorDialog(final Activity activity, String errorMsg, final boolean shouldExit) { AlertDialog dialog = new AlertDialog.Builder(activity).create(); dialog.setIcon(android.R.drawable.ic_dialog_info); dialog.setTitle(StringUtils.getStringRobust(activity, org.commcare.dalvik.R.string.error_occured)); dialog.setMessage(errorMsg); DialogInterface.OnClickListener errorListener = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int i) { switch (i) { case DialogInterface.BUTTON_POSITIVE: if (shouldExit) { activity.setResult(RESULT_CANCELED); activity.finish(); } break; } } }; dialog.setCancelable(false); dialog.setButton(AlertDialog.BUTTON_POSITIVE, StringUtils.getStringSpannableRobust(activity, org.commcare.dalvik.R.string.ok), errorListener); dialog.show(); } /** All methods for implementation of DialogController **/ @Override public void updateProgress(String updateText, int taskId) { CustomProgressDialog mProgressDialog = getCurrentDialog(); if (mProgressDialog != null) { if (mProgressDialog.getTaskId() == taskId) { mProgressDialog.updateMessage(updateText); } else { Logger.log(AndroidLogger.TYPE_ERROR_ASSERTION, "Attempting to update a progress dialog whose taskId does not match the" + "task for which the update message was intended."); } } } @Override public void updateProgressBar(int progress, int max, int taskId) { CustomProgressDialog mProgressDialog = getCurrentDialog(); if (mProgressDialog != null) { if (mProgressDialog.getTaskId() == taskId) { mProgressDialog.updateProgressBar(progress, max); } else { Logger.log(AndroidLogger.TYPE_ERROR_ASSERTION, "Attempting to update a progress dialog whose taskId does not match the" + "task for which the update message was intended."); } } } @Override public void showProgressDialog(int taskId) { CustomProgressDialog dialog = generateProgressDialog(taskId); if (dialog != null) { dialog.show(getSupportFragmentManager(), KEY_DIALOG_FRAG); } } @Override public CustomProgressDialog getCurrentDialog() { return (CustomProgressDialog) getSupportFragmentManager(). findFragmentByTag(KEY_DIALOG_FRAG); } @Override public void dismissProgressDialog() { CustomProgressDialog mProgressDialog = getCurrentDialog(); if (mProgressDialog != null && mProgressDialog.isAdded()) { mProgressDialog.dismissAllowingStateLoss(); } } @Override public CustomProgressDialog generateProgressDialog(int taskId) { //dummy method for compilation, implementation handled in those subclasses that need it return null; } public Pair<Detail, TreeReference> requestEntityContext() { return null; } /** * Interface to perform additional setup code when adding an ActionBar * using the {@link #tryToAddActionSearchBar(android.app.Activity, * android.view.Menu, * org.commcare.android.framework.CommCareActivity.ActionBarInstantiator)} * tryToAddActionSearchBar} method. */ public interface ActionBarInstantiator { void onActionBarFound(MenuItem searchItem, SearchView searchView); } /** * Tries to add actionBar to current Activity and hides the current search * widget and runs ActionBarInstantiator if it exists. Used in * EntitySelectActivity and FormRecordListActivity. * * @param act Current activity * @param menu Menu passed through onCreateOptionsMenu * @param instantiator Optional ActionBarInstantiator for additional setup * code. */ public void tryToAddActionSearchBar(Activity act, Menu menu, ActionBarInstantiator instantiator) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { MenuInflater inflater = act.getMenuInflater(); inflater.inflate(org.commcare.dalvik.R.menu.activity_report_problem, menu); MenuItem searchItem = menu.findItem(org.commcare.dalvik.R.id.search_action_bar); SearchView searchView = (SearchView)searchItem.getActionView(); if (searchView != null) { int[] searchViewStyle = AndroidUtil.getThemeColorIDs(this, new int[]{org.commcare.dalvik.R.attr.searchbox_action_bar_color}); int id = searchView.getContext() .getResources() .getIdentifier("android:id/search_src_text", null, null); TextView textView = (TextView)searchView.findViewById(id); textView.setTextColor(searchViewStyle[0]); if (instantiator != null) { instantiator.onActionBarFound(searchItem, searchView); } } View bottomSearchWidget = act.findViewById(org.commcare.dalvik.R.id.searchfooter); if (bottomSearchWidget != null) { bottomSearchWidget.setVisibility(View.GONE); } } } /** * Whether or not the "Back" action makes sense for this activity. * * @return True if "Back" is a valid concept for the Activity ande should be shown * in the action bar if available. False otherwise. */ public boolean isBackEnabled() { return true; } @Override public boolean dispatchTouchEvent(MotionEvent mv) { return !(mGestureDetector == null || !mGestureDetector.onTouchEvent(mv)) || super.dispatchTouchEvent(mv); } @Override public boolean onDown(MotionEvent arg0) { return false; } @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { if (isHorizontalSwipe(this, e1, e2)) { if (velocityX <= 0) { return onForwardSwipe(); } return onBackwardSwipe(); } return false; } /** * Action to take when user swipes forward during activity. * @return Whether or not the swipe was handled */ protected boolean onForwardSwipe() { return false; } /** * Action to take when user swipes backward during activity. * @return Whether or not the swipe was handled */ protected boolean onBackwardSwipe() { return false; } @Override public void onLongPress(MotionEvent arg0) { // ignore } @Override public boolean onScroll(MotionEvent arg0, MotionEvent arg1, float arg2, float arg3) { return false; } @Override public void onShowPress(MotionEvent arg0) { // ignore } @Override public boolean onSingleTapUp(MotionEvent arg0) { return false; } /** * Decide if two given MotionEvents represent a swipe. * * @return True iff the movement is a definitive horizontal swipe. */ public static boolean isHorizontalSwipe(Activity activity, MotionEvent e1, MotionEvent e2) { DisplayMetrics dm = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(dm); //details of the motion itself float xMov = Math.abs(e1.getX() - e2.getX()); float yMov = Math.abs(e1.getY() - e2.getY()); double angleOfMotion = ((Math.atan(yMov / xMov) / Math.PI) * 180); // for all screens a swipe is left/right of at least .25" and at an angle of no more than 30 //degrees int xPixelLimit = (int) (dm.xdpi * .25); return xMov > xPixelLimit && angleOfMotion < 30; } /** * Rebuild the activity's menu options based on the current state of the activity. */ @TargetApi(Build.VERSION_CODES.HONEYCOMB) public void rebuildMenus() { // CommCare-159047: this method call rebuilds the options menu if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { invalidateOptionsMenu(); } else { supportInvalidateOptionsMenu(); } } public Spannable localize(String key){ return MarkupUtil.localizeStyleSpannable(this, key); } public Spannable localize(String key, String[] args){ return MarkupUtil.localizeStyleSpannable(this, key, args); } }
app/src/org/commcare/android/framework/CommCareActivity.java
package org.commcare.android.framework; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.SharedPreferences; import android.os.Build; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.text.Spannable; import android.util.DisplayMetrics; import android.util.Pair; import android.view.GestureDetector; import android.view.GestureDetector.OnGestureListener; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.widget.SearchView; import android.widget.TextView; import android.widget.Toast; import org.commcare.android.database.user.models.ACase; import org.commcare.android.javarosa.AndroidLogger; import org.commcare.android.tasks.templates.CommCareTask; import org.commcare.android.tasks.templates.CommCareTaskConnector; import org.commcare.android.util.AndroidUtil; import org.commcare.android.util.MarkupUtil; import org.commcare.android.util.SessionStateUninitException; import org.commcare.android.util.StringUtils; import org.commcare.dalvik.BuildConfig; import org.commcare.dalvik.application.CommCareApplication; import org.commcare.dalvik.dialogs.CustomProgressDialog; import org.commcare.dalvik.dialogs.DialogController; import org.commcare.dalvik.preferences.CommCarePreferences; import org.commcare.suite.model.Detail; import org.commcare.suite.model.StackFrameStep; import org.commcare.util.SessionFrame; import org.javarosa.core.model.instance.TreeReference; import org.javarosa.core.services.Logger; import org.javarosa.core.services.locale.Localization; import org.javarosa.core.util.NoLocalizedTextException; import org.odk.collect.android.views.media.AudioController; import android.annotation.TargetApi; import android.util.Log; import java.lang.reflect.Field; /** * Base class for CommCareActivities to simplify * common localization and workflow tasks * * @author ctsims */ public abstract class CommCareActivity<R> extends FragmentActivity implements CommCareTaskConnector<R>, DialogController, OnGestureListener { private static final String TAG = CommCareActivity.class.getSimpleName(); private final static String KEY_DIALOG_FRAG = "dialog_fragment"; StateFragment stateHolder; //fields for implementing task transitions for CommCareTaskConnector private boolean inTaskTransition; /** * Used to indicate that the (progress) dialog associated with a task * should be dismissed because the task has completed or been canceled. */ private boolean shouldDismissDialog = true; private GestureDetector mGestureDetector; public static final String KEY_LAST_QUERY_STRING = "LAST_QUERY_STRING"; protected String lastQueryString; /** * Activity has been put in the background. This is used to prevent dialogs * from being shown while activity isn't active. */ private boolean activityPaused; /** * Stores the id of a dialog that tried to be shown when the activity * wasn't active. When the activity resumes, create this dialog if the * associated task is still running and the id is non-negative. */ private int showDialogIdOnResume = -1; @Override @TargetApi(14) protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); activityPaused = false; if (showDialogIdOnResume > 0 && !shouldDismissDialog) { startBlockingForTask(showDialogIdOnResume); } showDialogIdOnResume = -1; FragmentManager fm = this.getSupportFragmentManager(); stateHolder = (StateFragment) fm.findFragmentByTag("state"); // stateHolder and its previous state aren't null if the activity is // being created due to an orientation change. if (stateHolder == null) { stateHolder = new StateFragment(); fm.beginTransaction().add(stateHolder, "state").commit(); // entering new activity, not just rotating one, so release old // media AudioController.INSTANCE.releaseCurrentMediaEntity(); } if(this.getClass().isAnnotationPresent(ManagedUi.class)) { this.setContentView(this.getClass().getAnnotation(ManagedUi.class).value()); loadFields(); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { getActionBar().setDisplayShowCustomEnabled(true); // Add breadcrumb bar BreadcrumbBarFragment bar = (BreadcrumbBarFragment) fm.findFragmentByTag("breadcrumbs"); // If the state holder is null, create a new one for this activity if (bar == null) { bar = new BreadcrumbBarFragment(); fm.beginTransaction().add(bar, "breadcrumbs").commit(); } } mGestureDetector = new GestureDetector(this, this); } protected void restoreLastQueryString(String key) { SharedPreferences settings = getSharedPreferences(CommCarePreferences.ACTIONBAR_PREFS, 0); lastQueryString = settings.getString(key, null); if (BuildConfig.DEBUG) { Log.v(TAG, "Recovered lastQueryString: (" + lastQueryString + ")"); } } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: this.onBackPressed(); return true; default: return super.onOptionsItemSelected(item); } } private void loadFields() { CommCareActivity oldActivity = stateHolder.getPreviousState(); Class c = this.getClass(); for(Field f : c.getDeclaredFields()) { if(f.isAnnotationPresent(UiElement.class)) { UiElement element = f.getAnnotation(UiElement.class); try{ f.setAccessible(true); try { View v = this.findViewById(element.value()); f.set(this, v); if(oldActivity != null) { View oldView = (View)f.get(oldActivity); if(oldView != null) { if(v instanceof TextView) { ((TextView)v).setText(((TextView)oldView).getText()); } if (v == null) { Log.d("loadFields", "NullPointerException when trying to find view with id: " + + element.value() + " (" + getResources().getResourceEntryName(element.value()) + ") " + " oldView is " + oldView + " for activity " + oldActivity + ", element is: " + f + " (" + f.getName() + ")"); } v.setVisibility(oldView.getVisibility()); v.setEnabled(oldView.isEnabled()); continue; } } if(!"".equals(element.locale())) { if(v instanceof TextView) { ((TextView)v).setText(Localization.get(element.locale())); } else { throw new RuntimeException("Can't set the text for a " + v.getClass().getName() + " View!"); } } } catch (IllegalArgumentException e) { e.printStackTrace(); throw new RuntimeException("Bad Object type for field " + f.getName()); } catch (IllegalAccessException e) { throw new RuntimeException("Couldn't access the activity field for some reason"); } } finally { f.setAccessible(false); } } } } protected CommCareActivity getDestroyedActivityState() { return stateHolder.getPreviousState(); } protected boolean isTopNavEnabled() { return false; } @Override @TargetApi(11) protected void onResume() { super.onResume(); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { // In honeycomb and above the fragment takes care of this this.setTitle(getTitle(this, getActivityTitle())); } AudioController.INSTANCE.playPreviousAudio(); } @Override protected void onPause() { super.onPause(); activityPaused = true; AudioController.INSTANCE.systemInducedPause(); } @Override public <A, B, C> void connectTask(CommCareTask<A, B, C, R> task) { //If stateHolder is null here, it's because it is restoring itself, it doesn't need //this step wakelock(); stateHolder.connectTask(task); //If we've left an old dialog showing during the task transition and it was from the same task //as the one that is starting, don't dismiss it CustomProgressDialog currDialog = getCurrentDialog(); if (currDialog != null && currDialog.getTaskId() == task.getTaskId()) { shouldDismissDialog = false; } } @Override public R getReceiver() { return (R)this; } /** * Override these to control the UI for your task */ @Override public void startBlockingForTask(int id) { if (activityPaused) { // don't show the dialog if the activity is in the background showDialogIdOnResume = id; return; } // attempt to dismiss the dialog from the last task before showing this // one attemptDismissDialog(); // ONLY if shouldDismissDialog = true, i.e. if we chose to dismiss the // last dialog during transition, show a new one if (id >= 0 && shouldDismissDialog) { this.showProgressDialog(id); } } @Override public void stopBlockingForTask(int id) { if (id >= 0) { if (inTaskTransition) { shouldDismissDialog = true; } else { dismissProgressDialog(); } } unlock(); } @Override public void startTaskTransition() { inTaskTransition = true; } @Override public void stopTaskTransition() { inTaskTransition = false; attemptDismissDialog(); //reset shouldDismissDialog to true after this transition cycle is over shouldDismissDialog = true; } //if shouldDismiss flag has not been set to false in the course of a task transition, //then dismiss the dialog void attemptDismissDialog() { if (shouldDismissDialog) { dismissProgressDialog(); } } /** * Handle an error in task execution. */ protected void taskError(Exception e) { //TODO: For forms with good error reporting, integrate that Toast.makeText(this, Localization.get("activity.task.error.generic", new String[] {e.getMessage()}), Toast.LENGTH_LONG).show(); Logger.log(AndroidLogger.TYPE_ERROR_WORKFLOW, e.getMessage()); } /** * Display exception details as a pop-up to the user. * * @param e Exception to handle */ protected void displayException(Exception e) { String mErrorMessage = e.getMessage(); AlertDialog mAlertDialog = new AlertDialog.Builder(this).create(); mAlertDialog.setIcon(android.R.drawable.ic_dialog_info); mAlertDialog.setTitle(Localization.get("notification.case.predicate.title")); mAlertDialog.setMessage(Localization.get("notification.case.predicate.action", new String[] {mErrorMessage})); DialogInterface.OnClickListener errorListener = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int i) { switch (i) { case DialogInterface.BUTTON1: finish(); break; } } }; mAlertDialog.setCancelable(false); mAlertDialog.setButton(Localization.get("dialog.ok"), errorListener); mAlertDialog.show(); } @Override public void taskCancelled(int id) { } public void cancelCurrentTask() { stateHolder.cancelTask(); } protected void saveLastQueryString(String key) { SharedPreferences settings = getSharedPreferences(CommCarePreferences.ACTIONBAR_PREFS, 0); SharedPreferences.Editor editor = settings.edit(); editor.putString(key, lastQueryString); editor.commit(); if (BuildConfig.DEBUG) { Log.v(TAG, "Saving lastQueryString: (" + lastQueryString + ") in file: " + CommCarePreferences.ACTIONBAR_PREFS); } } private void wakelock() { int lockLevel = getWakeLockingLevel(); if(lockLevel == -1) { return;} stateHolder.wakelock(lockLevel); } private void unlock() { stateHolder.unlock(); } /** * @return The WakeLock flags that should be used for this activity's tasks. -1 * if this activity should not acquire/use the wakelock for tasks */ protected int getWakeLockingLevel() { return -1; } //Graphical stuff below, needs to get modularized public void transplantStyle(TextView target, int resource) { //get styles from here TextView tv = (TextView)View.inflate(this, resource, null); int[] padding = {target.getPaddingLeft(), target.getPaddingTop(), target.getPaddingRight(),target.getPaddingBottom() }; target.setTextColor(tv.getTextColors().getDefaultColor()); target.setTypeface(tv.getTypeface()); target.setBackgroundDrawable(tv.getBackground()); target.setPadding(padding[0], padding[1], padding[2], padding[3]); } /** * The right-hand side of the title associated with this activity. * * This will update dynamically as the activity loads/updates, but if * it will ever have a value it must return a blank string when one * isn't available. */ public String getActivityTitle() { return null; } public static String getTopLevelTitleName(Context c) { try { return Localization.get("app.display.name"); } catch(NoLocalizedTextException nlte) { return c.getString(org.commcare.dalvik.R.string.title_bar_name); } } public static String getTitle(Context c, String local) { String topLevel = getTopLevelTitleName(c); String[] stepTitles = new String[0]; try { stepTitles = CommCareApplication._().getCurrentSession().getHeaderTitles(); //See if we can insert any case hacks int i = 0; for(StackFrameStep step : CommCareApplication._().getCurrentSession().getFrame().getSteps()){ try { if(SessionFrame.STATE_DATUM_VAL.equals(step.getType())) { //Haaack if(step.getId() != null && step.getId().contains("case_id")) { ACase foundCase = CommCareApplication._().getUserStorage(ACase.STORAGE_KEY, ACase.class).getRecordForValue(ACase.INDEX_CASE_ID, step.getValue()); stepTitles[i] = Localization.get("title.datum.wrapper", new String[] { foundCase.getName()}); } } } catch(Exception e) { //TODO: Your error handling is bad and you should feel bad } ++i; } } catch(SessionStateUninitException e) { } StringBuilder titleBuf = new StringBuilder(topLevel); for(String title : stepTitles) { if(title != null) { titleBuf.append(" > ").append(title); } } if(local != null) { titleBuf.append(" > ").append(local); } return titleBuf.toString(); } protected void createErrorDialog(String errorMsg, boolean shouldExit) { createErrorDialog(this, errorMsg, shouldExit); } /** * Pop up a semi-friendly error dialog rather than crashing outright. * @param activity Activity to which to attach the dialog. * @param shouldExit If true, cancel activity when user exits dialog. */ public static void createErrorDialog(final Activity activity, String errorMsg, final boolean shouldExit) { AlertDialog dialog = new AlertDialog.Builder(activity).create(); dialog.setIcon(android.R.drawable.ic_dialog_info); dialog.setTitle(StringUtils.getStringRobust(activity, org.commcare.dalvik.R.string.error_occured)); dialog.setMessage(errorMsg); DialogInterface.OnClickListener errorListener = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int i) { switch (i) { case DialogInterface.BUTTON_POSITIVE: if (shouldExit) { activity.setResult(RESULT_CANCELED); activity.finish(); } break; } } }; dialog.setCancelable(false); dialog.setButton(AlertDialog.BUTTON_POSITIVE, StringUtils.getStringSpannableRobust(activity, org.commcare.dalvik.R.string.ok), errorListener); dialog.show(); } /** All methods for implementation of DialogController **/ @Override public void updateProgress(String updateText, int taskId) { CustomProgressDialog mProgressDialog = getCurrentDialog(); if (mProgressDialog != null) { if (mProgressDialog.getTaskId() == taskId) { mProgressDialog.updateMessage(updateText); } else { Logger.log(AndroidLogger.TYPE_ERROR_ASSERTION, "Attempting to update a progress dialog whose taskId does not match the" + "task for which the update message was intended."); } } } @Override public void updateProgressBar(int progress, int max, int taskId) { CustomProgressDialog mProgressDialog = getCurrentDialog(); if (mProgressDialog != null) { if (mProgressDialog.getTaskId() == taskId) { mProgressDialog.updateProgressBar(progress, max); } else { Logger.log(AndroidLogger.TYPE_ERROR_ASSERTION, "Attempting to update a progress dialog whose taskId does not match the" + "task for which the update message was intended."); } } } @Override public void showProgressDialog(int taskId) { CustomProgressDialog dialog = generateProgressDialog(taskId); if (dialog != null) { dialog.show(getSupportFragmentManager(), KEY_DIALOG_FRAG); } } @Override public CustomProgressDialog getCurrentDialog() { return (CustomProgressDialog) getSupportFragmentManager(). findFragmentByTag(KEY_DIALOG_FRAG); } @Override public void dismissProgressDialog() { CustomProgressDialog mProgressDialog = getCurrentDialog(); if (mProgressDialog != null && mProgressDialog.isAdded()) { mProgressDialog.dismissAllowingStateLoss(); } } @Override public CustomProgressDialog generateProgressDialog(int taskId) { //dummy method for compilation, implementation handled in those subclasses that need it return null; } public Pair<Detail, TreeReference> requestEntityContext() { return null; } /** * Interface to perform additional setup code when adding an ActionBar * using the {@link #tryToAddActionSearchBar(android.app.Activity, * android.view.Menu, * org.commcare.android.framework.CommCareActivity.ActionBarInstantiator)} * tryToAddActionSearchBar} method. */ public interface ActionBarInstantiator { void onActionBarFound(MenuItem searchItem, SearchView searchView); } /** * Tries to add actionBar to current Activity and hides the current search * widget and runs ActionBarInstantiator if it exists. Used in * EntitySelectActivity and FormRecordListActivity. * * @param act Current activity * @param menu Menu passed through onCreateOptionsMenu * @param instantiator Optional ActionBarInstantiator for additional setup * code. */ public void tryToAddActionSearchBar(Activity act, Menu menu, ActionBarInstantiator instantiator) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { MenuInflater inflater = act.getMenuInflater(); inflater.inflate(org.commcare.dalvik.R.menu.activity_report_problem, menu); MenuItem searchItem = menu.findItem(org.commcare.dalvik.R.id.search_action_bar); SearchView searchView = (SearchView)searchItem.getActionView(); if (searchView != null) { int[] searchViewStyle = AndroidUtil.getThemeColorIDs(this, new int[]{org.commcare.dalvik.R.attr.searchbox_action_bar_color}); int id = searchView.getContext() .getResources() .getIdentifier("android:id/search_src_text", null, null); TextView textView = (TextView)searchView.findViewById(id); textView.setTextColor(searchViewStyle[0]); if (instantiator != null) { instantiator.onActionBarFound(searchItem, searchView); } } View bottomSearchWidget = act.findViewById(org.commcare.dalvik.R.id.searchfooter); if (bottomSearchWidget != null) { bottomSearchWidget.setVisibility(View.GONE); } } } /** * Whether or not the "Back" action makes sense for this activity. * * @return True if "Back" is a valid concept for the Activity ande should be shown * in the action bar if available. False otherwise. */ public boolean isBackEnabled() { return true; } @Override public boolean dispatchTouchEvent(MotionEvent mv) { return !(mGestureDetector == null || !mGestureDetector.onTouchEvent(mv)) || super.dispatchTouchEvent(mv); } @Override public boolean onDown(MotionEvent arg0) { return false; } @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { if (isHorizontalSwipe(this, e1, e2)) { if (velocityX <= 0) { return onForwardSwipe(); } return onBackwardSwipe(); } return false; } /** * Action to take when user swipes forward during activity. * @return Whether or not the swipe was handled */ protected boolean onForwardSwipe() { return false; } /** * Action to take when user swipes backward during activity. * @return Whether or not the swipe was handled */ protected boolean onBackwardSwipe() { return false; } @Override public void onLongPress(MotionEvent arg0) { // ignore } @Override public boolean onScroll(MotionEvent arg0, MotionEvent arg1, float arg2, float arg3) { return false; } @Override public void onShowPress(MotionEvent arg0) { // ignore } @Override public boolean onSingleTapUp(MotionEvent arg0) { return false; } /** * Decide if two given MotionEvents represent a swipe. * * @return True iff the movement is a definitive horizontal swipe. */ public static boolean isHorizontalSwipe(Activity activity, MotionEvent e1, MotionEvent e2) { DisplayMetrics dm = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(dm); //details of the motion itself float xMov = Math.abs(e1.getX() - e2.getX()); float yMov = Math.abs(e1.getY() - e2.getY()); double angleOfMotion = ((Math.atan(yMov / xMov) / Math.PI) * 180); // for all screens a swipe is left/right of at least .25" and at an angle of no more than 30 //degrees int xPixelLimit = (int) (dm.xdpi * .25); return xMov > xPixelLimit && angleOfMotion < 30; } /** * Rebuild the activity's menu options based on the current state of the activity. */ @TargetApi(Build.VERSION_CODES.HONEYCOMB) public void rebuildMenus() { // CommCare-159047: this method call rebuilds the options menu if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { invalidateOptionsMenu(); } else { supportInvalidateOptionsMenu(); } } public Spannable localize(String key){ return MarkupUtil.localizeStyleSpannable(this, key); } public Spannable localize(String key, String[] args){ return MarkupUtil.localizeStyleSpannable(this, key, args); } }
Move 'activityPaused' from onCreate to onResume
app/src/org/commcare/android/framework/CommCareActivity.java
Move 'activityPaused' from onCreate to onResume
<ide><path>pp/src/org/commcare/android/framework/CommCareActivity.java <ide> @TargetApi(14) <ide> protected void onCreate(Bundle savedInstanceState) { <ide> super.onCreate(savedInstanceState); <del> activityPaused = false; <ide> <ide> if (showDialogIdOnResume > 0 && !shouldDismissDialog) { <ide> startBlockingForTask(showDialogIdOnResume); <ide> protected void onResume() { <ide> super.onResume(); <ide> <add> activityPaused = false; <add> <ide> if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { <ide> // In honeycomb and above the fragment takes care of this <ide> this.setTitle(getTitle(this, getActivityTitle()));
Java
agpl-3.0
585e60d712d61e29d600dd38e142269d6e3a46b3
0
KinshipSoftware/KinOathKinshipArchiver,PeterWithers/temp-to-delete1,KinshipSoftware/KinOathKinshipArchiver,PeterWithers/temp-to-delete1
src/main/java/nl/mpi/kinnate/svg/GraphPlacementHandler.java
package nl.mpi.kinnate.svg; import nl.mpi.kinnate.kindata.EntityData; import org.w3c.dom.Element; /** * Document : GraphPlacementHandler * Created on : May 30, 2011, 4:43:45 PM * Author : Peter Withers */ public class GraphPlacementHandler { public void placeAllNodes(GraphPanel graphPanel, EntityData[] allEntitys, Element entityGroupNode, int hSpacing, int vSpacing) { for (EntityData currentNode : allEntitys) { if (currentNode.isVisible) { entityGroupNode.appendChild(graphPanel.entitySvg.createEntitySymbol(graphPanel, currentNode, hSpacing, vSpacing)); } } } }
Removed redundant classes.
src/main/java/nl/mpi/kinnate/svg/GraphPlacementHandler.java
Removed redundant classes.
<ide><path>rc/main/java/nl/mpi/kinnate/svg/GraphPlacementHandler.java <del>package nl.mpi.kinnate.svg; <del> <del>import nl.mpi.kinnate.kindata.EntityData; <del>import org.w3c.dom.Element; <del> <del>/** <del> * Document : GraphPlacementHandler <del> * Created on : May 30, 2011, 4:43:45 PM <del> * Author : Peter Withers <del> */ <del>public class GraphPlacementHandler { <del> <del> public void placeAllNodes(GraphPanel graphPanel, EntityData[] allEntitys, Element entityGroupNode, int hSpacing, int vSpacing) { <del> for (EntityData currentNode : allEntitys) { <del> if (currentNode.isVisible) { <del> entityGroupNode.appendChild(graphPanel.entitySvg.createEntitySymbol(graphPanel, currentNode, hSpacing, vSpacing)); <del> } <del> } <del> } <del>}
Java
apache-2.0
f6823259cb22b4c34ae8e44719284c3dbf3a31e0
0
ibinti/intellij-community,wreckJ/intellij-community,ol-loginov/intellij-community,hurricup/intellij-community,diorcety/intellij-community,allotria/intellij-community,mglukhikh/intellij-community,vvv1559/intellij-community,fitermay/intellij-community,kdwink/intellij-community,asedunov/intellij-community,allotria/intellij-community,nicolargo/intellij-community,fitermay/intellij-community,petteyg/intellij-community,alphafoobar/intellij-community,muntasirsyed/intellij-community,da1z/intellij-community,idea4bsd/idea4bsd,fitermay/intellij-community,petteyg/intellij-community,orekyuu/intellij-community,ibinti/intellij-community,robovm/robovm-studio,ahb0327/intellij-community,akosyakov/intellij-community,alphafoobar/intellij-community,ThiagoGarciaAlves/intellij-community,suncycheng/intellij-community,salguarnieri/intellij-community,Distrotech/intellij-community,ftomassetti/intellij-community,FHannes/intellij-community,ThiagoGarciaAlves/intellij-community,diorcety/intellij-community,ThiagoGarciaAlves/intellij-community,caot/intellij-community,asedunov/intellij-community,signed/intellij-community,da1z/intellij-community,ahb0327/intellij-community,ibinti/intellij-community,signed/intellij-community,gnuhub/intellij-community,jagguli/intellij-community,adedayo/intellij-community,jagguli/intellij-community,pwoodworth/intellij-community,ibinti/intellij-community,Distrotech/intellij-community,Distrotech/intellij-community,ivan-fedorov/intellij-community,ahb0327/intellij-community,tmpgit/intellij-community,asedunov/intellij-community,asedunov/intellij-community,ivan-fedorov/intellij-community,ibinti/intellij-community,vladmm/intellij-community,samthor/intellij-community,FHannes/intellij-community,fengbaicanhe/intellij-community,suncycheng/intellij-community,robovm/robovm-studio,vvv1559/intellij-community,dslomov/intellij-community,tmpgit/intellij-community,Distrotech/intellij-community,robovm/robovm-studio,TangHao1987/intellij-community,fitermay/intellij-community,michaelgallacher/intellij-community,holmes/intellij-community,orekyuu/intellij-community,robovm/robovm-studio,ftomassetti/intellij-community,youdonghai/intellij-community,izonder/intellij-community,ftomassetti/intellij-community,ahb0327/intellij-community,izonder/intellij-community,SerCeMan/intellij-community,allotria/intellij-community,ThiagoGarciaAlves/intellij-community,SerCeMan/intellij-community,salguarnieri/intellij-community,mglukhikh/intellij-community,MER-GROUP/intellij-community,alphafoobar/intellij-community,muntasirsyed/intellij-community,caot/intellij-community,holmes/intellij-community,asedunov/intellij-community,ryano144/intellij-community,samthor/intellij-community,pwoodworth/intellij-community,adedayo/intellij-community,akosyakov/intellij-community,tmpgit/intellij-community,FHannes/intellij-community,MER-GROUP/intellij-community,kool79/intellij-community,petteyg/intellij-community,diorcety/intellij-community,supersven/intellij-community,adedayo/intellij-community,ThiagoGarciaAlves/intellij-community,diorcety/intellij-community,izonder/intellij-community,ol-loginov/intellij-community,amith01994/intellij-community,fitermay/intellij-community,clumsy/intellij-community,suncycheng/intellij-community,ftomassetti/intellij-community,blademainer/intellij-community,akosyakov/intellij-community,idea4bsd/idea4bsd,semonte/intellij-community,ryano144/intellij-community,semonte/intellij-community,petteyg/intellij-community,michaelgallacher/intellij-community,youdonghai/intellij-community,retomerz/intellij-community,retomerz/intellij-community,semonte/intellij-community,apixandru/intellij-community,akosyakov/intellij-community,holmes/intellij-community,blademainer/intellij-community,muntasirsyed/intellij-community,fnouama/intellij-community,michaelgallacher/intellij-community,lucafavatella/intellij-community,dslomov/intellij-community,salguarnieri/intellij-community,semonte/intellij-community,semonte/intellij-community,semonte/intellij-community,apixandru/intellij-community,samthor/intellij-community,da1z/intellij-community,ol-loginov/intellij-community,blademainer/intellij-community,da1z/intellij-community,akosyakov/intellij-community,signed/intellij-community,da1z/intellij-community,muntasirsyed/intellij-community,TangHao1987/intellij-community,ryano144/intellij-community,idea4bsd/idea4bsd,fnouama/intellij-community,jagguli/intellij-community,youdonghai/intellij-community,pwoodworth/intellij-community,idea4bsd/idea4bsd,FHannes/intellij-community,izonder/intellij-community,samthor/intellij-community,idea4bsd/idea4bsd,clumsy/intellij-community,vladmm/intellij-community,SerCeMan/intellij-community,ftomassetti/intellij-community,salguarnieri/intellij-community,nicolargo/intellij-community,signed/intellij-community,lucafavatella/intellij-community,kdwink/intellij-community,supersven/intellij-community,xfournet/intellij-community,xfournet/intellij-community,salguarnieri/intellij-community,dslomov/intellij-community,TangHao1987/intellij-community,pwoodworth/intellij-community,youdonghai/intellij-community,MER-GROUP/intellij-community,izonder/intellij-community,TangHao1987/intellij-community,ibinti/intellij-community,petteyg/intellij-community,vladmm/intellij-community,fitermay/intellij-community,slisson/intellij-community,retomerz/intellij-community,signed/intellij-community,retomerz/intellij-community,MichaelNedzelsky/intellij-community,vladmm/intellij-community,SerCeMan/intellij-community,nicolargo/intellij-community,adedayo/intellij-community,pwoodworth/intellij-community,FHannes/intellij-community,ryano144/intellij-community,muntasirsyed/intellij-community,robovm/robovm-studio,MichaelNedzelsky/intellij-community,fitermay/intellij-community,ibinti/intellij-community,caot/intellij-community,fengbaicanhe/intellij-community,semonte/intellij-community,clumsy/intellij-community,tmpgit/intellij-community,ThiagoGarciaAlves/intellij-community,amith01994/intellij-community,kool79/intellij-community,alphafoobar/intellij-community,suncycheng/intellij-community,ftomassetti/intellij-community,apixandru/intellij-community,adedayo/intellij-community,Distrotech/intellij-community,vladmm/intellij-community,kdwink/intellij-community,michaelgallacher/intellij-community,ThiagoGarciaAlves/intellij-community,samthor/intellij-community,allotria/intellij-community,caot/intellij-community,adedayo/intellij-community,adedayo/intellij-community,supersven/intellij-community,alphafoobar/intellij-community,alphafoobar/intellij-community,lucafavatella/intellij-community,dslomov/intellij-community,ryano144/intellij-community,ibinti/intellij-community,kdwink/intellij-community,supersven/intellij-community,petteyg/intellij-community,xfournet/intellij-community,Lekanich/intellij-community,hurricup/intellij-community,diorcety/intellij-community,nicolargo/intellij-community,holmes/intellij-community,fengbaicanhe/intellij-community,asedunov/intellij-community,clumsy/intellij-community,TangHao1987/intellij-community,fnouama/intellij-community,hurricup/intellij-community,suncycheng/intellij-community,signed/intellij-community,hurricup/intellij-community,nicolargo/intellij-community,diorcety/intellij-community,blademainer/intellij-community,youdonghai/intellij-community,holmes/intellij-community,orekyuu/intellij-community,ibinti/intellij-community,SerCeMan/intellij-community,mglukhikh/intellij-community,gnuhub/intellij-community,supersven/intellij-community,gnuhub/intellij-community,caot/intellij-community,wreckJ/intellij-community,caot/intellij-community,fitermay/intellij-community,clumsy/intellij-community,FHannes/intellij-community,petteyg/intellij-community,muntasirsyed/intellij-community,slisson/intellij-community,lucafavatella/intellij-community,clumsy/intellij-community,youdonghai/intellij-community,jagguli/intellij-community,vvv1559/intellij-community,da1z/intellij-community,jagguli/intellij-community,MER-GROUP/intellij-community,kool79/intellij-community,ftomassetti/intellij-community,fnouama/intellij-community,retomerz/intellij-community,ol-loginov/intellij-community,Lekanich/intellij-community,idea4bsd/idea4bsd,vvv1559/intellij-community,pwoodworth/intellij-community,supersven/intellij-community,alphafoobar/intellij-community,ol-loginov/intellij-community,MER-GROUP/intellij-community,supersven/intellij-community,signed/intellij-community,lucafavatella/intellij-community,apixandru/intellij-community,gnuhub/intellij-community,robovm/robovm-studio,da1z/intellij-community,izonder/intellij-community,Lekanich/intellij-community,fnouama/intellij-community,asedunov/intellij-community,vladmm/intellij-community,allotria/intellij-community,asedunov/intellij-community,jagguli/intellij-community,retomerz/intellij-community,vvv1559/intellij-community,Lekanich/intellij-community,xfournet/intellij-community,slisson/intellij-community,muntasirsyed/intellij-community,michaelgallacher/intellij-community,MER-GROUP/intellij-community,orekyuu/intellij-community,fengbaicanhe/intellij-community,samthor/intellij-community,clumsy/intellij-community,michaelgallacher/intellij-community,retomerz/intellij-community,ftomassetti/intellij-community,gnuhub/intellij-community,kool79/intellij-community,idea4bsd/idea4bsd,suncycheng/intellij-community,SerCeMan/intellij-community,fnouama/intellij-community,gnuhub/intellij-community,idea4bsd/idea4bsd,youdonghai/intellij-community,izonder/intellij-community,fengbaicanhe/intellij-community,fengbaicanhe/intellij-community,ahb0327/intellij-community,apixandru/intellij-community,vvv1559/intellij-community,suncycheng/intellij-community,TangHao1987/intellij-community,xfournet/intellij-community,signed/intellij-community,Lekanich/intellij-community,retomerz/intellij-community,holmes/intellij-community,MichaelNedzelsky/intellij-community,gnuhub/intellij-community,xfournet/intellij-community,dslomov/intellij-community,xfournet/intellij-community,izonder/intellij-community,signed/intellij-community,hurricup/intellij-community,akosyakov/intellij-community,slisson/intellij-community,ftomassetti/intellij-community,xfournet/intellij-community,adedayo/intellij-community,akosyakov/intellij-community,mglukhikh/intellij-community,dslomov/intellij-community,allotria/intellij-community,signed/intellij-community,fengbaicanhe/intellij-community,ol-loginov/intellij-community,MichaelNedzelsky/intellij-community,amith01994/intellij-community,tmpgit/intellij-community,holmes/intellij-community,michaelgallacher/intellij-community,semonte/intellij-community,kool79/intellij-community,ol-loginov/intellij-community,izonder/intellij-community,petteyg/intellij-community,caot/intellij-community,blademainer/intellij-community,tmpgit/intellij-community,semonte/intellij-community,wreckJ/intellij-community,pwoodworth/intellij-community,youdonghai/intellij-community,ol-loginov/intellij-community,mglukhikh/intellij-community,hurricup/intellij-community,da1z/intellij-community,petteyg/intellij-community,diorcety/intellij-community,nicolargo/intellij-community,michaelgallacher/intellij-community,allotria/intellij-community,vladmm/intellij-community,supersven/intellij-community,apixandru/intellij-community,diorcety/intellij-community,amith01994/intellij-community,alphafoobar/intellij-community,lucafavatella/intellij-community,retomerz/intellij-community,kool79/intellij-community,kdwink/intellij-community,asedunov/intellij-community,muntasirsyed/intellij-community,michaelgallacher/intellij-community,kdwink/intellij-community,amith01994/intellij-community,supersven/intellij-community,TangHao1987/intellij-community,jagguli/intellij-community,clumsy/intellij-community,wreckJ/intellij-community,MichaelNedzelsky/intellij-community,supersven/intellij-community,caot/intellij-community,vladmm/intellij-community,ryano144/intellij-community,akosyakov/intellij-community,Distrotech/intellij-community,izonder/intellij-community,jagguli/intellij-community,gnuhub/intellij-community,holmes/intellij-community,gnuhub/intellij-community,ibinti/intellij-community,akosyakov/intellij-community,robovm/robovm-studio,ryano144/intellij-community,blademainer/intellij-community,xfournet/intellij-community,Distrotech/intellij-community,muntasirsyed/intellij-community,mglukhikh/intellij-community,slisson/intellij-community,ryano144/intellij-community,vvv1559/intellij-community,izonder/intellij-community,Lekanich/intellij-community,holmes/intellij-community,lucafavatella/intellij-community,SerCeMan/intellij-community,tmpgit/intellij-community,youdonghai/intellij-community,kdwink/intellij-community,Lekanich/intellij-community,ivan-fedorov/intellij-community,lucafavatella/intellij-community,vvv1559/intellij-community,michaelgallacher/intellij-community,retomerz/intellij-community,allotria/intellij-community,suncycheng/intellij-community,Lekanich/intellij-community,gnuhub/intellij-community,ThiagoGarciaAlves/intellij-community,akosyakov/intellij-community,idea4bsd/idea4bsd,xfournet/intellij-community,fnouama/intellij-community,michaelgallacher/intellij-community,tmpgit/intellij-community,salguarnieri/intellij-community,signed/intellij-community,pwoodworth/intellij-community,vladmm/intellij-community,tmpgit/intellij-community,samthor/intellij-community,orekyuu/intellij-community,amith01994/intellij-community,FHannes/intellij-community,TangHao1987/intellij-community,wreckJ/intellij-community,signed/intellij-community,ftomassetti/intellij-community,hurricup/intellij-community,fitermay/intellij-community,kdwink/intellij-community,semonte/intellij-community,slisson/intellij-community,retomerz/intellij-community,da1z/intellij-community,fnouama/intellij-community,vvv1559/intellij-community,clumsy/intellij-community,Distrotech/intellij-community,youdonghai/intellij-community,Lekanich/intellij-community,hurricup/intellij-community,mglukhikh/intellij-community,da1z/intellij-community,MER-GROUP/intellij-community,izonder/intellij-community,adedayo/intellij-community,ol-loginov/intellij-community,nicolargo/intellij-community,asedunov/intellij-community,apixandru/intellij-community,holmes/intellij-community,wreckJ/intellij-community,vvv1559/intellij-community,petteyg/intellij-community,caot/intellij-community,alphafoobar/intellij-community,ahb0327/intellij-community,allotria/intellij-community,apixandru/intellij-community,apixandru/intellij-community,samthor/intellij-community,slisson/intellij-community,allotria/intellij-community,vladmm/intellij-community,fitermay/intellij-community,blademainer/intellij-community,blademainer/intellij-community,mglukhikh/intellij-community,salguarnieri/intellij-community,caot/intellij-community,apixandru/intellij-community,orekyuu/intellij-community,ahb0327/intellij-community,pwoodworth/intellij-community,slisson/intellij-community,adedayo/intellij-community,vladmm/intellij-community,Distrotech/intellij-community,mglukhikh/intellij-community,ftomassetti/intellij-community,FHannes/intellij-community,ivan-fedorov/intellij-community,ivan-fedorov/intellij-community,adedayo/intellij-community,lucafavatella/intellij-community,vvv1559/intellij-community,lucafavatella/intellij-community,orekyuu/intellij-community,salguarnieri/intellij-community,clumsy/intellij-community,ibinti/intellij-community,robovm/robovm-studio,clumsy/intellij-community,nicolargo/intellij-community,da1z/intellij-community,petteyg/intellij-community,asedunov/intellij-community,ivan-fedorov/intellij-community,robovm/robovm-studio,suncycheng/intellij-community,jagguli/intellij-community,samthor/intellij-community,nicolargo/intellij-community,dslomov/intellij-community,kool79/intellij-community,blademainer/intellij-community,amith01994/intellij-community,tmpgit/intellij-community,kdwink/intellij-community,alphafoobar/intellij-community,idea4bsd/idea4bsd,ftomassetti/intellij-community,suncycheng/intellij-community,allotria/intellij-community,ThiagoGarciaAlves/intellij-community,FHannes/intellij-community,ahb0327/intellij-community,hurricup/intellij-community,retomerz/intellij-community,nicolargo/intellij-community,xfournet/intellij-community,mglukhikh/intellij-community,ahb0327/intellij-community,asedunov/intellij-community,fnouama/intellij-community,samthor/intellij-community,suncycheng/intellij-community,Distrotech/intellij-community,signed/intellij-community,ol-loginov/intellij-community,jagguli/intellij-community,apixandru/intellij-community,xfournet/intellij-community,slisson/intellij-community,hurricup/intellij-community,dslomov/intellij-community,MichaelNedzelsky/intellij-community,ryano144/intellij-community,fengbaicanhe/intellij-community,samthor/intellij-community,muntasirsyed/intellij-community,supersven/intellij-community,SerCeMan/intellij-community,diorcety/intellij-community,idea4bsd/idea4bsd,nicolargo/intellij-community,apixandru/intellij-community,SerCeMan/intellij-community,Lekanich/intellij-community,kool79/intellij-community,Distrotech/intellij-community,ahb0327/intellij-community,jagguli/intellij-community,MichaelNedzelsky/intellij-community,salguarnieri/intellij-community,fengbaicanhe/intellij-community,ol-loginov/intellij-community,dslomov/intellij-community,suncycheng/intellij-community,hurricup/intellij-community,pwoodworth/intellij-community,MER-GROUP/intellij-community,TangHao1987/intellij-community,youdonghai/intellij-community,akosyakov/intellij-community,kdwink/intellij-community,holmes/intellij-community,petteyg/intellij-community,MichaelNedzelsky/intellij-community,orekyuu/intellij-community,caot/intellij-community,TangHao1987/intellij-community,supersven/intellij-community,ivan-fedorov/intellij-community,ryano144/intellij-community,fengbaicanhe/intellij-community,ol-loginov/intellij-community,ryano144/intellij-community,FHannes/intellij-community,retomerz/intellij-community,muntasirsyed/intellij-community,FHannes/intellij-community,orekyuu/intellij-community,amith01994/intellij-community,hurricup/intellij-community,kool79/intellij-community,robovm/robovm-studio,youdonghai/intellij-community,fengbaicanhe/intellij-community,tmpgit/intellij-community,lucafavatella/intellij-community,orekyuu/intellij-community,Lekanich/intellij-community,alphafoobar/intellij-community,mglukhikh/intellij-community,amith01994/intellij-community,apixandru/intellij-community,xfournet/intellij-community,MER-GROUP/intellij-community,dslomov/intellij-community,salguarnieri/intellij-community,fnouama/intellij-community,MER-GROUP/intellij-community,Distrotech/intellij-community,FHannes/intellij-community,amith01994/intellij-community,dslomov/intellij-community,mglukhikh/intellij-community,adedayo/intellij-community,vvv1559/intellij-community,semonte/intellij-community,idea4bsd/idea4bsd,MichaelNedzelsky/intellij-community,blademainer/intellij-community,slisson/intellij-community,diorcety/intellij-community,amith01994/intellij-community,lucafavatella/intellij-community,SerCeMan/intellij-community,SerCeMan/intellij-community,vladmm/intellij-community,wreckJ/intellij-community,holmes/intellij-community,idea4bsd/idea4bsd,robovm/robovm-studio,gnuhub/intellij-community,dslomov/intellij-community,fnouama/intellij-community,MichaelNedzelsky/intellij-community,mglukhikh/intellij-community,lucafavatella/intellij-community,ivan-fedorov/intellij-community,diorcety/intellij-community,allotria/intellij-community,fitermay/intellij-community,fitermay/intellij-community,samthor/intellij-community,Lekanich/intellij-community,alphafoobar/intellij-community,blademainer/intellij-community,da1z/intellij-community,ibinti/intellij-community,kool79/intellij-community,kool79/intellij-community,ivan-fedorov/intellij-community,apixandru/intellij-community,ThiagoGarciaAlves/intellij-community,salguarnieri/intellij-community,ibinti/intellij-community,fnouama/intellij-community,fitermay/intellij-community,orekyuu/intellij-community,fengbaicanhe/intellij-community,allotria/intellij-community,semonte/intellij-community,akosyakov/intellij-community,TangHao1987/intellij-community,wreckJ/intellij-community,jagguli/intellij-community,MER-GROUP/intellij-community,tmpgit/intellij-community,nicolargo/intellij-community,ivan-fedorov/intellij-community,amith01994/intellij-community,semonte/intellij-community,SerCeMan/intellij-community,pwoodworth/intellij-community,wreckJ/intellij-community,robovm/robovm-studio,MichaelNedzelsky/intellij-community,ahb0327/intellij-community,caot/intellij-community,asedunov/intellij-community,FHannes/intellij-community,hurricup/intellij-community,salguarnieri/intellij-community,ivan-fedorov/intellij-community,da1z/intellij-community,youdonghai/intellij-community,wreckJ/intellij-community,wreckJ/intellij-community,kool79/intellij-community,ThiagoGarciaAlves/intellij-community,clumsy/intellij-community,wreckJ/intellij-community,blademainer/intellij-community,orekyuu/intellij-community,ThiagoGarciaAlves/intellij-community,ahb0327/intellij-community,MER-GROUP/intellij-community,vvv1559/intellij-community,gnuhub/intellij-community,ivan-fedorov/intellij-community,muntasirsyed/intellij-community,MichaelNedzelsky/intellij-community,ryano144/intellij-community,pwoodworth/intellij-community,slisson/intellij-community,diorcety/intellij-community,slisson/intellij-community,michaelgallacher/intellij-community,TangHao1987/intellij-community,kdwink/intellij-community,kdwink/intellij-community
/* * Copyright 2000-2009 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.xdebugger.impl.breakpoints; import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.components.PersistentStateComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.startup.StartupManager; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.JDOMUtil; import com.intellij.openapi.util.MultiValuesMap; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.ex.http.HttpFileSystem; import com.intellij.openapi.vfs.ex.http.HttpVirtualFileListener; import com.intellij.util.EventDispatcher; import com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters; import com.intellij.util.xmlb.XmlSerializer; import com.intellij.util.xmlb.annotations.AbstractCollection; import com.intellij.util.xmlb.annotations.Tag; import com.intellij.xdebugger.XSourcePosition; import com.intellij.xdebugger.breakpoints.*; import com.intellij.xdebugger.impl.XDebuggerManagerImpl; import org.jdom.Element; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.util.*; /** * @author nik */ public class XBreakpointManagerImpl implements XBreakpointManager, PersistentStateComponent<XBreakpointManagerImpl.BreakpointManagerState> { private static final Logger LOG = Logger.getInstance("#com.intellij.xdebugger.impl.breakpoints.XBreakpointManagerImpl"); public static final SkipDefaultValuesSerializationFilters SERIALIZATION_FILTER = new SkipDefaultValuesSerializationFilters(); private final MultiValuesMap<XBreakpointType, XBreakpointBase<?,?,?>> myBreakpoints = new MultiValuesMap<XBreakpointType, XBreakpointBase<?,?,?>>(true); private final Map<XBreakpointType, XBreakpointBase<?,?,?>> myDefaultBreakpoints = new LinkedHashMap<XBreakpointType, XBreakpointBase<?, ?, ?>>(); private final Map<XBreakpointType, BreakpointState<?,?,?>> myBreakpointsDefaults = new LinkedHashMap<XBreakpointType, BreakpointState<?, ?, ?>>(); private final Set<XBreakpointBase<?,?,?>> myAllBreakpoints = new HashSet<XBreakpointBase<?, ?, ?>>(); private final Map<XBreakpointType, EventDispatcher<XBreakpointListener>> myDispatchers = new HashMap<XBreakpointType, EventDispatcher<XBreakpointListener>>(); private XBreakpointsDialogState myBreakpointsDialogSettings; private final EventDispatcher<XBreakpointListener> myAllBreakpointsDispatcher; private final XLineBreakpointManager myLineBreakpointManager; private final Project myProject; private final XDebuggerManagerImpl myDebuggerManager; private final XDependentBreakpointManager myDependentBreakpointManager; private long myTime; private String myDefaultGroup; public XBreakpointManagerImpl(final Project project, final XDebuggerManagerImpl debuggerManager, StartupManager startupManager) { myProject = project; myDebuggerManager = debuggerManager; myAllBreakpointsDispatcher = EventDispatcher.create(XBreakpointListener.class); myDependentBreakpointManager = new XDependentBreakpointManager(this); myLineBreakpointManager = new XLineBreakpointManager(project, myDependentBreakpointManager, startupManager); if (!project.isDefault()) { if (!ApplicationManager.getApplication().isUnitTestMode()) { HttpVirtualFileListener httpVirtualFileListener = new HttpVirtualFileListener() { @Override public void fileDownloaded(@NotNull final VirtualFile file) { updateBreakpointInFile(file); } }; HttpFileSystem.getInstance().addFileListener(httpVirtualFileListener, project); } for (XBreakpointType<?, ?> type : XBreakpointUtil.getBreakpointTypes()) { addDefaultBreakpoint(type); } } } private void updateBreakpointInFile(final VirtualFile file) { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { XBreakpointBase<?, ?, ?>[] breakpoints = getAllBreakpoints(); for (XBreakpointBase<?, ?, ?> breakpoint : breakpoints) { XSourcePosition position = breakpoint.getSourcePosition(); if (position != null && Comparing.equal(position.getFile(), file)) { fireBreakpointChanged(breakpoint); } } } }); } public XLineBreakpointManager getLineBreakpointManager() { return myLineBreakpointManager; } public XDependentBreakpointManager getDependentBreakpointManager() { return myDependentBreakpointManager; } public XDebuggerManagerImpl getDebuggerManager() { return myDebuggerManager; } public Project getProject() { return myProject; } @Override @NotNull public <T extends XBreakpointProperties> XBreakpoint<T> addBreakpoint(final XBreakpointType<XBreakpoint<T>,T> type, @Nullable final T properties) { ApplicationManager.getApplication().assertWriteAccessAllowed(); XBreakpointBase<?, T, ?> breakpoint = createBreakpoint(type, properties, true, false); addBreakpoint(breakpoint, false, true); return breakpoint; } private <T extends XBreakpointProperties> XBreakpointBase<?, T, ?> createBreakpoint(XBreakpointType<XBreakpoint<T>, T> type, T properties, final boolean enabled, boolean defaultBreakpoint) { BreakpointState<?,T,?> state = new BreakpointState<XBreakpoint<T>,T,XBreakpointType<XBreakpoint<T>,T>>(enabled, type.getId(), defaultBreakpoint ? 0 : myTime++); getBreakpointDefaults(type).applyDefaults(state); state.setGroup(myDefaultGroup); return new XBreakpointBase<XBreakpoint<T>,T, BreakpointState<?,T,?>>(type, this, properties, state); } private <T extends XBreakpointProperties> void addBreakpoint(final XBreakpointBase<?, T, ?> breakpoint, final boolean defaultBreakpoint, boolean initUI) { XBreakpointType type = breakpoint.getType(); if (defaultBreakpoint) { LOG.assertTrue(!myDefaultBreakpoints.containsKey(type), "Cannot have more than one default breakpoint (type " + type.getId() + ")"); myDefaultBreakpoints.put(type, breakpoint); } else { myBreakpoints.put(type, breakpoint); } myAllBreakpoints.add(breakpoint); if (breakpoint instanceof XLineBreakpointImpl) { myLineBreakpointManager.registerBreakpoint((XLineBreakpointImpl)breakpoint, initUI); } EventDispatcher<XBreakpointListener> dispatcher = myDispatchers.get(type); if (dispatcher != null) { //noinspection unchecked dispatcher.getMulticaster().breakpointAdded(breakpoint); } getBreakpointDispatcherMulticaster().breakpointAdded(breakpoint); } private XBreakpointListener<XBreakpoint<?>> getBreakpointDispatcherMulticaster() { //noinspection unchecked return myAllBreakpointsDispatcher.getMulticaster(); } public void fireBreakpointChanged(XBreakpointBase<?, ?, ?> breakpoint) { if (!myAllBreakpoints.contains(breakpoint)) { return; } if (breakpoint instanceof XLineBreakpointImpl) { myLineBreakpointManager.breakpointChanged((XLineBreakpointImpl)breakpoint); } EventDispatcher<XBreakpointListener> dispatcher = myDispatchers.get(breakpoint.getType()); if (dispatcher != null) { //noinspection unchecked dispatcher.getMulticaster().breakpointChanged(breakpoint); } getBreakpointDispatcherMulticaster().breakpointChanged(breakpoint); } @Override public void removeBreakpoint(@NotNull final XBreakpoint<?> breakpoint) { ApplicationManager.getApplication().assertWriteAccessAllowed(); doRemoveBreakpoint(breakpoint); } private void doRemoveBreakpoint(XBreakpoint<?> breakpoint) { if (isDefaultBreakpoint(breakpoint)) { // removing default breakpoint should just disable it breakpoint.setEnabled(false); } else { XBreakpointType type = breakpoint.getType(); XBreakpointBase<?,?,?> breakpointBase = (XBreakpointBase<?,?,?>)breakpoint; myBreakpoints.remove(type, breakpointBase); myAllBreakpoints.remove(breakpointBase); if (breakpointBase instanceof XLineBreakpointImpl) { myLineBreakpointManager.unregisterBreakpoint((XLineBreakpointImpl)breakpointBase); } breakpointBase.dispose(); EventDispatcher<XBreakpointListener> dispatcher = myDispatchers.get(type); if (dispatcher != null) { //noinspection unchecked dispatcher.getMulticaster().breakpointRemoved(breakpoint); } getBreakpointDispatcherMulticaster().breakpointRemoved(breakpoint); } } @Override @NotNull public <T extends XBreakpointProperties> XLineBreakpoint<T> addLineBreakpoint(final XLineBreakpointType<T> type, @NotNull final String fileUrl, final int line, @Nullable final T properties) { return addLineBreakpoint(type, fileUrl, line, properties, false); } @Override @NotNull public <T extends XBreakpointProperties> XLineBreakpoint<T> addLineBreakpoint(final XLineBreakpointType<T> type, @NotNull final String fileUrl, final int line, @Nullable final T properties, boolean temporary) { ApplicationManager.getApplication().assertWriteAccessAllowed(); LineBreakpointState<T> state = new LineBreakpointState<T>(true, type.getId(), fileUrl, line, temporary, myTime++); getBreakpointDefaults(type).applyDefaults(state); state.setGroup(myDefaultGroup); XLineBreakpointImpl<T> breakpoint = new XLineBreakpointImpl<T>(type, this, properties, state); addBreakpoint(breakpoint, false, true); return breakpoint; } @Override @NotNull public XBreakpointBase<?,?,?>[] getAllBreakpoints() { ApplicationManager.getApplication().assertReadAccessAllowed(); return myAllBreakpoints.toArray(new XBreakpointBase[myAllBreakpoints.size()]); } @Override @SuppressWarnings({"unchecked"}) @NotNull public <B extends XBreakpoint<?>> Collection<? extends B> getBreakpoints(@NotNull final XBreakpointType<B,?> type) { ApplicationManager.getApplication().assertReadAccessAllowed(); Collection<? extends XBreakpointBase<?,?,?>> breakpoints = myBreakpoints.get(type); Collection<? extends B> regular = breakpoints != null ? Collections.unmodifiableCollection((Collection<? extends B>)breakpoints) : Collections.<B>emptyList(); final XBreakpointBase<?, ?, ?> defaultBreakpoint = myDefaultBreakpoints.get(type); if (defaultBreakpoint == null) return regular; List<B> result = new ArrayList<B>(); result.add((B)defaultBreakpoint); result.addAll(regular); return result; } @NotNull @Override public <B extends XBreakpoint<?>> Collection<? extends B> getBreakpoints(@NotNull Class<? extends XBreakpointType<B, ?>> typeClass) { return getBreakpoints(XBreakpointType.EXTENSION_POINT_NAME.findExtension(typeClass)); } @Override @Nullable public <B extends XBreakpoint<?>> B getDefaultBreakpoint(@NotNull XBreakpointType<B, ?> type) { //noinspection unchecked return (B)myDefaultBreakpoints.get(type); } @Override @Nullable public <P extends XBreakpointProperties> XLineBreakpoint<P> findBreakpointAtLine(@NotNull final XLineBreakpointType<P> type, @NotNull final VirtualFile file, final int line) { Collection<XBreakpointBase<?,?,?>> breakpoints = myBreakpoints.get(type); if (breakpoints == null) return null; for (XBreakpointBase<?, ?, ?> breakpoint : breakpoints) { XLineBreakpoint lineBreakpoint = (XLineBreakpoint)breakpoint; if (lineBreakpoint.getFileUrl().equals(file.getUrl()) && lineBreakpoint.getLine() == line) { //noinspection unchecked return lineBreakpoint; } } return null; } @Override public boolean isDefaultBreakpoint(@NotNull XBreakpoint<?> breakpoint) { //noinspection SuspiciousMethodCalls return myDefaultBreakpoints.values().contains(breakpoint); } private <T extends XBreakpointProperties> EventDispatcher<XBreakpointListener> getOrCreateDispatcher(final XBreakpointType<?,T> type) { EventDispatcher<XBreakpointListener> dispatcher = myDispatchers.get(type); if (dispatcher == null) { dispatcher = EventDispatcher.create(XBreakpointListener.class); myDispatchers.put(type, dispatcher); } return dispatcher; } @Override public <B extends XBreakpoint<P>, P extends XBreakpointProperties> void addBreakpointListener(@NotNull final XBreakpointType<B,P> type, @NotNull final XBreakpointListener<B> listener) { getOrCreateDispatcher(type).addListener(listener); } @Override public <B extends XBreakpoint<P>, P extends XBreakpointProperties> void removeBreakpointListener(@NotNull final XBreakpointType<B,P> type, @NotNull final XBreakpointListener<B> listener) { getOrCreateDispatcher(type).removeListener(listener); } @Override public <B extends XBreakpoint<P>, P extends XBreakpointProperties> void addBreakpointListener(@NotNull final XBreakpointType<B,P> type, @NotNull final XBreakpointListener<B> listener, final Disposable parentDisposable) { getOrCreateDispatcher(type).addListener(listener, parentDisposable); } @Override public void addBreakpointListener(@NotNull final XBreakpointListener<XBreakpoint<?>> listener) { myAllBreakpointsDispatcher.addListener(listener); } @Override public void removeBreakpointListener(@NotNull final XBreakpointListener<XBreakpoint<?>> listener) { myAllBreakpointsDispatcher.removeListener(listener); } @Override public void addBreakpointListener(@NotNull final XBreakpointListener<XBreakpoint<?>> listener, @NotNull final Disposable parentDisposable) { myAllBreakpointsDispatcher.addListener(listener, parentDisposable); } @Override public void updateBreakpointPresentation(@NotNull XLineBreakpoint<?> breakpoint, @Nullable Icon icon, @Nullable String errorMessage) { XLineBreakpointImpl lineBreakpoint = (XLineBreakpointImpl)breakpoint; CustomizedBreakpointPresentation presentation = lineBreakpoint.getCustomizedPresentation(); if (presentation == null) { if (icon == null && errorMessage == null) { return; } presentation = new CustomizedBreakpointPresentation(); } else if (Comparing.equal(presentation.getIcon(), icon) && Comparing.strEqual(presentation.getErrorMessage(), errorMessage)) { return; } presentation.setErrorMessage(errorMessage); presentation.setIcon(icon); lineBreakpoint.setCustomizedPresentation(presentation); myLineBreakpointManager.queueBreakpointUpdate(breakpoint); } @Override public BreakpointManagerState getState() { myDependentBreakpointManager.saveState(); BreakpointManagerState state = new BreakpointManagerState(); for (XBreakpointBase<?, ?, ?> breakpoint : myDefaultBreakpoints.values()) { final BreakpointState breakpointState = breakpoint.getState(); if (differsFromDefault(breakpoint.getType(), breakpointState)) { state.getDefaultBreakpoints().add(breakpointState); } } for (XBreakpointBase<?,?,?> breakpoint : myBreakpoints.values()) { state.getBreakpoints().add(breakpoint.getState()); } for (Map.Entry<XBreakpointType, BreakpointState<?,?,?>> entry : myBreakpointsDefaults.entrySet()) { if (statesAreDifferent(entry.getValue(), createBreakpointDefaults(entry.getKey()))) { state.getBreakpointsDefaults().add(entry.getValue()); } } state.setBreakpointsDialogProperties(myBreakpointsDialogSettings); state.setTime(myTime); state.setDefaultGroup(myDefaultGroup); return state; } private <P extends XBreakpointProperties> boolean differsFromDefault(XBreakpointType<?, P> type, BreakpointState state) { final XBreakpoint<P> defaultBreakpoint = createDefaultBreakpoint(type); if (defaultBreakpoint == null) { return false; } BreakpointState defaultState = ((XBreakpointBase)defaultBreakpoint).getState(); return statesAreDifferent(state, defaultState); } private static boolean statesAreDifferent(BreakpointState state1, BreakpointState state2) { Element elem1 = XmlSerializer.serialize(state1, SERIALIZATION_FILTER); Element elem2 = XmlSerializer.serialize(state2, SERIALIZATION_FILTER); return !JDOMUtil.areElementsEqual(elem1, elem2); } @Override public void loadState(final BreakpointManagerState state) { myBreakpointsDialogSettings = state.getBreakpointsDialogProperties(); myAllBreakpoints.clear(); myDefaultBreakpoints.clear(); myBreakpointsDefaults.clear(); for (BreakpointState breakpointState : state.getDefaultBreakpoints()) { loadBreakpoint(breakpointState, true); } for (XBreakpointType<?, ?> type : XBreakpointUtil.getBreakpointTypes()) { if (!myDefaultBreakpoints.containsKey(type)) { addDefaultBreakpoint(type); } } for (XBreakpointBase<?,?,?> breakpoint : myBreakpoints.values()) { doRemoveBreakpoint(breakpoint); } for (BreakpointState breakpointState : state.getBreakpoints()) { loadBreakpoint(breakpointState, false); } for (BreakpointState defaults : state.getBreakpointsDefaults()) { XBreakpointType<?,?> type = XBreakpointUtil.findType(defaults.getTypeId()); if (type != null) { myBreakpointsDefaults.put(type, defaults); } else { LOG.warn("Unknown breakpoint type " + defaults.getTypeId()); } } myDependentBreakpointManager.loadState(); myLineBreakpointManager.updateBreakpointsUI(); myTime = state.getTime(); myDefaultGroup = state.getDefaultGroup(); } private <P extends XBreakpointProperties> void addDefaultBreakpoint(XBreakpointType<?, P> type) { final XBreakpoint<P> breakpoint = createDefaultBreakpoint(type); if (breakpoint != null) { addBreakpoint((XBreakpointBase<?, P, ?>)breakpoint, true, false); } } @Nullable private <P extends XBreakpointProperties> XBreakpoint<P> createDefaultBreakpoint(final XBreakpointType<? extends XBreakpoint<P>, P> type) { return type.createDefaultBreakpoint(new XBreakpointType.XBreakpointCreator<P>() { @NotNull @Override public XBreakpoint<P> createBreakpoint(@Nullable P properties) { //noinspection unchecked return XBreakpointManagerImpl.this.createBreakpoint((XBreakpointType<XBreakpoint<P>, P>)type, properties, false, true); } }); } private void loadBreakpoint(BreakpointState breakpointState, final boolean defaultBreakpoint) { XBreakpointBase<?,?,?> breakpoint = createBreakpoint(breakpointState); if (breakpoint != null) { addBreakpoint(breakpoint, defaultBreakpoint, false); } } public XBreakpointsDialogState getBreakpointsDialogSettings() { return myBreakpointsDialogSettings; } public void setBreakpointsDialogSettings(XBreakpointsDialogState breakpointsDialogSettings) { myBreakpointsDialogSettings = breakpointsDialogSettings; } public Set<String> getAllGroups() { HashSet<String> res = new HashSet<String>(); for (XBreakpointBase breakpoint : myAllBreakpoints) { String group = breakpoint.getGroup(); if (group != null) { res.add(group); } } return res; } public String getDefaultGroup() { return myDefaultGroup; } public void setDefaultGroup(String defaultGroup) { myDefaultGroup = defaultGroup; } @Nullable private XBreakpointBase<?,?,?> createBreakpoint(final BreakpointState breakpointState) { XBreakpointType<?,?> type = XBreakpointUtil.findType(breakpointState.getTypeId()); if (type == null) { LOG.warn("Unknown breakpoint type " + breakpointState.getTypeId()); return null; } //noinspection unchecked return breakpointState.createBreakpoint(type, this); } @NotNull public BreakpointState getBreakpointDefaults(@NotNull XBreakpointType type) { BreakpointState defaultState = myBreakpointsDefaults.get(type); if (defaultState == null) { defaultState = createBreakpointDefaults(type); myBreakpointsDefaults.put(type, defaultState); } return defaultState; } @NotNull private static BreakpointState createBreakpointDefaults(@NotNull XBreakpointType type) { BreakpointState state = new BreakpointState(); state.setTypeId(type.getId()); return state; } @Tag("breakpoint-manager") public static class BreakpointManagerState { private List<BreakpointState> myDefaultBreakpoints = new ArrayList<BreakpointState>(); private List<BreakpointState> myBreakpoints = new ArrayList<BreakpointState>(); private List<BreakpointState> myBreakpointsDefaults = new ArrayList<BreakpointState>(); private XBreakpointsDialogState myBreakpointsDialogProperties; private long myTime; private String myDefaultGroup; @Tag("default-breakpoints") @AbstractCollection(surroundWithTag = false) public List<BreakpointState> getDefaultBreakpoints() { return myDefaultBreakpoints; } @Tag("breakpoints") @AbstractCollection(surroundWithTag = false, elementTypes = {BreakpointState.class, LineBreakpointState.class}) public List<BreakpointState> getBreakpoints() { return myBreakpoints; } @Tag("breakpoints-defaults") @AbstractCollection(surroundWithTag = false, elementTypes = {BreakpointState.class, LineBreakpointState.class}) public List<BreakpointState> getBreakpointsDefaults() { return myBreakpointsDefaults; } @Tag("breakpoints-dialog") public XBreakpointsDialogState getBreakpointsDialogProperties() { return myBreakpointsDialogProperties; } public void setBreakpoints(final List<BreakpointState> breakpoints) { myBreakpoints = breakpoints; } @SuppressWarnings("UnusedDeclaration") public void setDefaultBreakpoints(List<BreakpointState> defaultBreakpoints) { myDefaultBreakpoints = defaultBreakpoints; } public void setBreakpointsDefaults(List<BreakpointState> breakpointsDefaults) { myBreakpointsDefaults = breakpointsDefaults; } public void setBreakpointsDialogProperties(XBreakpointsDialogState breakpointsDialogProperties) { myBreakpointsDialogProperties = breakpointsDialogProperties; } public long getTime() { return myTime; } public void setTime(long time) { myTime = time; } public String getDefaultGroup() { return myDefaultGroup; } public void setDefaultGroup(String defaultGroup) { myDefaultGroup = defaultGroup; } } }
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointManagerImpl.java
/* * Copyright 2000-2009 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.xdebugger.impl.breakpoints; import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.components.PersistentStateComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.startup.StartupManager; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.JDOMUtil; import com.intellij.openapi.util.MultiValuesMap; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.ex.http.HttpFileSystem; import com.intellij.openapi.vfs.ex.http.HttpVirtualFileListener; import com.intellij.util.EventDispatcher; import com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters; import com.intellij.util.xmlb.XmlSerializer; import com.intellij.util.xmlb.annotations.AbstractCollection; import com.intellij.util.xmlb.annotations.Tag; import com.intellij.xdebugger.XSourcePosition; import com.intellij.xdebugger.breakpoints.*; import com.intellij.xdebugger.impl.XDebuggerManagerImpl; import org.jdom.Element; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.util.*; /** * @author nik */ public class XBreakpointManagerImpl implements XBreakpointManager, PersistentStateComponent<XBreakpointManagerImpl.BreakpointManagerState> { private static final Logger LOG = Logger.getInstance("#com.intellij.xdebugger.impl.breakpoints.XBreakpointManagerImpl"); public static final SkipDefaultValuesSerializationFilters SERIALIZATION_FILTER = new SkipDefaultValuesSerializationFilters(); private final MultiValuesMap<XBreakpointType, XBreakpointBase<?,?,?>> myBreakpoints = new MultiValuesMap<XBreakpointType, XBreakpointBase<?,?,?>>(true); private final Map<XBreakpointType, XBreakpointBase<?,?,?>> myDefaultBreakpoints = new LinkedHashMap<XBreakpointType, XBreakpointBase<?, ?, ?>>(); private final Map<XBreakpointType, BreakpointState<?,?,?>> myBreakpointsDefaults = new LinkedHashMap<XBreakpointType, BreakpointState<?, ?, ?>>(); private final Set<XBreakpointBase<?,?,?>> myAllBreakpoints = new HashSet<XBreakpointBase<?, ?, ?>>(); private final Map<XBreakpointType, EventDispatcher<XBreakpointListener>> myDispatchers = new HashMap<XBreakpointType, EventDispatcher<XBreakpointListener>>(); private XBreakpointsDialogState myBreakpointsDialogSettings; private final EventDispatcher<XBreakpointListener> myAllBreakpointsDispatcher; private final XLineBreakpointManager myLineBreakpointManager; private final Project myProject; private final XDebuggerManagerImpl myDebuggerManager; private final XDependentBreakpointManager myDependentBreakpointManager; private long myTime; private String myDefaultGroup; public XBreakpointManagerImpl(final Project project, final XDebuggerManagerImpl debuggerManager, StartupManager startupManager) { myProject = project; myDebuggerManager = debuggerManager; myAllBreakpointsDispatcher = EventDispatcher.create(XBreakpointListener.class); myDependentBreakpointManager = new XDependentBreakpointManager(this); myLineBreakpointManager = new XLineBreakpointManager(project, myDependentBreakpointManager, startupManager); if (!project.isDefault()) { if (!ApplicationManager.getApplication().isUnitTestMode()) { HttpVirtualFileListener httpVirtualFileListener = new HttpVirtualFileListener() { @Override public void fileDownloaded(@NotNull final VirtualFile file) { updateBreakpointInFile(file); } }; HttpFileSystem.getInstance().addFileListener(httpVirtualFileListener, project); } for (XBreakpointType<?, ?> type : XBreakpointUtil.getBreakpointTypes()) { addDefaultBreakpoint(type); } } } private void updateBreakpointInFile(final VirtualFile file) { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { XBreakpointBase<?, ?, ?>[] breakpoints = getAllBreakpoints(); for (XBreakpointBase<?, ?, ?> breakpoint : breakpoints) { XSourcePosition position = breakpoint.getSourcePosition(); if (position != null && Comparing.equal(position.getFile(), file)) { fireBreakpointChanged(breakpoint); } } } }); } public XLineBreakpointManager getLineBreakpointManager() { return myLineBreakpointManager; } public XDependentBreakpointManager getDependentBreakpointManager() { return myDependentBreakpointManager; } public XDebuggerManagerImpl getDebuggerManager() { return myDebuggerManager; } public Project getProject() { return myProject; } @Override @NotNull public <T extends XBreakpointProperties> XBreakpoint<T> addBreakpoint(final XBreakpointType<XBreakpoint<T>,T> type, @Nullable final T properties) { ApplicationManager.getApplication().assertWriteAccessAllowed(); XBreakpointBase<?, T, ?> breakpoint = createBreakpoint(type, properties, true, false); addBreakpoint(breakpoint, false, true); return breakpoint; } private <T extends XBreakpointProperties> XBreakpointBase<?, T, ?> createBreakpoint(XBreakpointType<XBreakpoint<T>, T> type, T properties, final boolean enabled, boolean defaultBreakpoint) { BreakpointState<?,T,?> state = new BreakpointState<XBreakpoint<T>,T,XBreakpointType<XBreakpoint<T>,T>>(enabled, type.getId(), defaultBreakpoint ? 0 : myTime++); getBreakpointDefaults(type).applyDefaults(state); state.setGroup(myDefaultGroup); return new XBreakpointBase<XBreakpoint<T>,T, BreakpointState<?,T,?>>(type, this, properties, state); } private <T extends XBreakpointProperties> void addBreakpoint(final XBreakpointBase<?, T, ?> breakpoint, final boolean defaultBreakpoint, boolean initUI) { XBreakpointType type = breakpoint.getType(); if (defaultBreakpoint) { LOG.assertTrue(!myDefaultBreakpoints.containsKey(type), "Cannot have more than one default breakpoint (type " + type.getId() + ")"); myDefaultBreakpoints.put(type, breakpoint); } else { myBreakpoints.put(type, breakpoint); } myAllBreakpoints.add(breakpoint); if (breakpoint instanceof XLineBreakpointImpl) { myLineBreakpointManager.registerBreakpoint((XLineBreakpointImpl)breakpoint, initUI); } EventDispatcher<XBreakpointListener> dispatcher = myDispatchers.get(type); if (dispatcher != null) { //noinspection unchecked dispatcher.getMulticaster().breakpointAdded(breakpoint); } getBreakpointDispatcherMulticaster().breakpointAdded(breakpoint); } private XBreakpointListener<XBreakpoint<?>> getBreakpointDispatcherMulticaster() { //noinspection unchecked return myAllBreakpointsDispatcher.getMulticaster(); } public void fireBreakpointChanged(XBreakpointBase<?, ?, ?> breakpoint) { if (!myAllBreakpoints.contains(breakpoint)) { return; } if (breakpoint instanceof XLineBreakpointImpl) { myLineBreakpointManager.breakpointChanged((XLineBreakpointImpl)breakpoint); } EventDispatcher<XBreakpointListener> dispatcher = myDispatchers.get(breakpoint.getType()); if (dispatcher != null) { //noinspection unchecked dispatcher.getMulticaster().breakpointChanged(breakpoint); } getBreakpointDispatcherMulticaster().breakpointChanged(breakpoint); } @Override public void removeBreakpoint(@NotNull final XBreakpoint<?> breakpoint) { ApplicationManager.getApplication().assertWriteAccessAllowed(); doRemoveBreakpoint(breakpoint); } private void doRemoveBreakpoint(XBreakpoint<?> breakpoint) { XBreakpointType type = breakpoint.getType(); XBreakpointBase<?,?,?> breakpointBase = (XBreakpointBase<?,?,?>)breakpoint; myBreakpoints.remove(type, breakpointBase); myAllBreakpoints.remove(breakpointBase); if (breakpointBase instanceof XLineBreakpointImpl) { myLineBreakpointManager.unregisterBreakpoint((XLineBreakpointImpl)breakpointBase); } breakpointBase.dispose(); EventDispatcher<XBreakpointListener> dispatcher = myDispatchers.get(type); if (dispatcher != null) { //noinspection unchecked dispatcher.getMulticaster().breakpointRemoved(breakpoint); } getBreakpointDispatcherMulticaster().breakpointRemoved(breakpoint); } @Override @NotNull public <T extends XBreakpointProperties> XLineBreakpoint<T> addLineBreakpoint(final XLineBreakpointType<T> type, @NotNull final String fileUrl, final int line, @Nullable final T properties) { return addLineBreakpoint(type, fileUrl, line, properties, false); } @Override @NotNull public <T extends XBreakpointProperties> XLineBreakpoint<T> addLineBreakpoint(final XLineBreakpointType<T> type, @NotNull final String fileUrl, final int line, @Nullable final T properties, boolean temporary) { ApplicationManager.getApplication().assertWriteAccessAllowed(); LineBreakpointState<T> state = new LineBreakpointState<T>(true, type.getId(), fileUrl, line, temporary, myTime++); getBreakpointDefaults(type).applyDefaults(state); state.setGroup(myDefaultGroup); XLineBreakpointImpl<T> breakpoint = new XLineBreakpointImpl<T>(type, this, properties, state); addBreakpoint(breakpoint, false, true); return breakpoint; } @Override @NotNull public XBreakpointBase<?,?,?>[] getAllBreakpoints() { ApplicationManager.getApplication().assertReadAccessAllowed(); return myAllBreakpoints.toArray(new XBreakpointBase[myAllBreakpoints.size()]); } @Override @SuppressWarnings({"unchecked"}) @NotNull public <B extends XBreakpoint<?>> Collection<? extends B> getBreakpoints(@NotNull final XBreakpointType<B,?> type) { ApplicationManager.getApplication().assertReadAccessAllowed(); Collection<? extends XBreakpointBase<?,?,?>> breakpoints = myBreakpoints.get(type); Collection<? extends B> regular = breakpoints != null ? Collections.unmodifiableCollection((Collection<? extends B>)breakpoints) : Collections.<B>emptyList(); final XBreakpointBase<?, ?, ?> defaultBreakpoint = myDefaultBreakpoints.get(type); if (defaultBreakpoint == null) return regular; List<B> result = new ArrayList<B>(); result.add((B)defaultBreakpoint); result.addAll(regular); return result; } @NotNull @Override public <B extends XBreakpoint<?>> Collection<? extends B> getBreakpoints(@NotNull Class<? extends XBreakpointType<B, ?>> typeClass) { return getBreakpoints(XBreakpointType.EXTENSION_POINT_NAME.findExtension(typeClass)); } @Override @Nullable public <B extends XBreakpoint<?>> B getDefaultBreakpoint(@NotNull XBreakpointType<B, ?> type) { //noinspection unchecked return (B)myDefaultBreakpoints.get(type); } @Override @Nullable public <P extends XBreakpointProperties> XLineBreakpoint<P> findBreakpointAtLine(@NotNull final XLineBreakpointType<P> type, @NotNull final VirtualFile file, final int line) { Collection<XBreakpointBase<?,?,?>> breakpoints = myBreakpoints.get(type); if (breakpoints == null) return null; for (XBreakpointBase<?, ?, ?> breakpoint : breakpoints) { XLineBreakpoint lineBreakpoint = (XLineBreakpoint)breakpoint; if (lineBreakpoint.getFileUrl().equals(file.getUrl()) && lineBreakpoint.getLine() == line) { //noinspection unchecked return lineBreakpoint; } } return null; } @Override public boolean isDefaultBreakpoint(@NotNull XBreakpoint<?> breakpoint) { //noinspection SuspiciousMethodCalls return myDefaultBreakpoints.values().contains(breakpoint); } private <T extends XBreakpointProperties> EventDispatcher<XBreakpointListener> getOrCreateDispatcher(final XBreakpointType<?,T> type) { EventDispatcher<XBreakpointListener> dispatcher = myDispatchers.get(type); if (dispatcher == null) { dispatcher = EventDispatcher.create(XBreakpointListener.class); myDispatchers.put(type, dispatcher); } return dispatcher; } @Override public <B extends XBreakpoint<P>, P extends XBreakpointProperties> void addBreakpointListener(@NotNull final XBreakpointType<B,P> type, @NotNull final XBreakpointListener<B> listener) { getOrCreateDispatcher(type).addListener(listener); } @Override public <B extends XBreakpoint<P>, P extends XBreakpointProperties> void removeBreakpointListener(@NotNull final XBreakpointType<B,P> type, @NotNull final XBreakpointListener<B> listener) { getOrCreateDispatcher(type).removeListener(listener); } @Override public <B extends XBreakpoint<P>, P extends XBreakpointProperties> void addBreakpointListener(@NotNull final XBreakpointType<B,P> type, @NotNull final XBreakpointListener<B> listener, final Disposable parentDisposable) { getOrCreateDispatcher(type).addListener(listener, parentDisposable); } @Override public void addBreakpointListener(@NotNull final XBreakpointListener<XBreakpoint<?>> listener) { myAllBreakpointsDispatcher.addListener(listener); } @Override public void removeBreakpointListener(@NotNull final XBreakpointListener<XBreakpoint<?>> listener) { myAllBreakpointsDispatcher.removeListener(listener); } @Override public void addBreakpointListener(@NotNull final XBreakpointListener<XBreakpoint<?>> listener, @NotNull final Disposable parentDisposable) { myAllBreakpointsDispatcher.addListener(listener, parentDisposable); } @Override public void updateBreakpointPresentation(@NotNull XLineBreakpoint<?> breakpoint, @Nullable Icon icon, @Nullable String errorMessage) { XLineBreakpointImpl lineBreakpoint = (XLineBreakpointImpl)breakpoint; CustomizedBreakpointPresentation presentation = lineBreakpoint.getCustomizedPresentation(); if (presentation == null) { if (icon == null && errorMessage == null) { return; } presentation = new CustomizedBreakpointPresentation(); } else if (Comparing.equal(presentation.getIcon(), icon) && Comparing.strEqual(presentation.getErrorMessage(), errorMessage)) { return; } presentation.setErrorMessage(errorMessage); presentation.setIcon(icon); lineBreakpoint.setCustomizedPresentation(presentation); myLineBreakpointManager.queueBreakpointUpdate(breakpoint); } @Override public BreakpointManagerState getState() { myDependentBreakpointManager.saveState(); BreakpointManagerState state = new BreakpointManagerState(); for (XBreakpointBase<?, ?, ?> breakpoint : myDefaultBreakpoints.values()) { final BreakpointState breakpointState = breakpoint.getState(); if (differsFromDefault(breakpoint.getType(), breakpointState)) { state.getDefaultBreakpoints().add(breakpointState); } } for (XBreakpointBase<?,?,?> breakpoint : myBreakpoints.values()) { state.getBreakpoints().add(breakpoint.getState()); } for (Map.Entry<XBreakpointType, BreakpointState<?,?,?>> entry : myBreakpointsDefaults.entrySet()) { if (statesAreDifferent(entry.getValue(), createBreakpointDefaults(entry.getKey()))) { state.getBreakpointsDefaults().add(entry.getValue()); } } state.setBreakpointsDialogProperties(myBreakpointsDialogSettings); state.setTime(myTime); state.setDefaultGroup(myDefaultGroup); return state; } private <P extends XBreakpointProperties> boolean differsFromDefault(XBreakpointType<?, P> type, BreakpointState state) { final XBreakpoint<P> defaultBreakpoint = createDefaultBreakpoint(type); if (defaultBreakpoint == null) { return false; } BreakpointState defaultState = ((XBreakpointBase)defaultBreakpoint).getState(); return statesAreDifferent(state, defaultState); } private static boolean statesAreDifferent(BreakpointState state1, BreakpointState state2) { Element elem1 = XmlSerializer.serialize(state1, SERIALIZATION_FILTER); Element elem2 = XmlSerializer.serialize(state2, SERIALIZATION_FILTER); return !JDOMUtil.areElementsEqual(elem1, elem2); } @Override public void loadState(final BreakpointManagerState state) { myBreakpointsDialogSettings = state.getBreakpointsDialogProperties(); myAllBreakpoints.clear(); myDefaultBreakpoints.clear(); myBreakpointsDefaults.clear(); for (BreakpointState breakpointState : state.getDefaultBreakpoints()) { loadBreakpoint(breakpointState, true); } for (XBreakpointType<?, ?> type : XBreakpointUtil.getBreakpointTypes()) { if (!myDefaultBreakpoints.containsKey(type)) { addDefaultBreakpoint(type); } } for (XBreakpointBase<?,?,?> breakpoint : myBreakpoints.values()) { doRemoveBreakpoint(breakpoint); } for (BreakpointState breakpointState : state.getBreakpoints()) { loadBreakpoint(breakpointState, false); } for (BreakpointState defaults : state.getBreakpointsDefaults()) { XBreakpointType<?,?> type = XBreakpointUtil.findType(defaults.getTypeId()); if (type != null) { myBreakpointsDefaults.put(type, defaults); } else { LOG.warn("Unknown breakpoint type " + defaults.getTypeId()); } } myDependentBreakpointManager.loadState(); myLineBreakpointManager.updateBreakpointsUI(); myTime = state.getTime(); myDefaultGroup = state.getDefaultGroup(); } private <P extends XBreakpointProperties> void addDefaultBreakpoint(XBreakpointType<?, P> type) { final XBreakpoint<P> breakpoint = createDefaultBreakpoint(type); if (breakpoint != null) { addBreakpoint((XBreakpointBase<?, P, ?>)breakpoint, true, false); } } @Nullable private <P extends XBreakpointProperties> XBreakpoint<P> createDefaultBreakpoint(final XBreakpointType<? extends XBreakpoint<P>, P> type) { return type.createDefaultBreakpoint(new XBreakpointType.XBreakpointCreator<P>() { @NotNull @Override public XBreakpoint<P> createBreakpoint(@Nullable P properties) { //noinspection unchecked return XBreakpointManagerImpl.this.createBreakpoint((XBreakpointType<XBreakpoint<P>, P>)type, properties, false, true); } }); } private void loadBreakpoint(BreakpointState breakpointState, final boolean defaultBreakpoint) { XBreakpointBase<?,?,?> breakpoint = createBreakpoint(breakpointState); if (breakpoint != null) { addBreakpoint(breakpoint, defaultBreakpoint, false); } } public XBreakpointsDialogState getBreakpointsDialogSettings() { return myBreakpointsDialogSettings; } public void setBreakpointsDialogSettings(XBreakpointsDialogState breakpointsDialogSettings) { myBreakpointsDialogSettings = breakpointsDialogSettings; } public Set<String> getAllGroups() { HashSet<String> res = new HashSet<String>(); for (XBreakpointBase breakpoint : myAllBreakpoints) { String group = breakpoint.getGroup(); if (group != null) { res.add(group); } } return res; } public String getDefaultGroup() { return myDefaultGroup; } public void setDefaultGroup(String defaultGroup) { myDefaultGroup = defaultGroup; } @Nullable private XBreakpointBase<?,?,?> createBreakpoint(final BreakpointState breakpointState) { XBreakpointType<?,?> type = XBreakpointUtil.findType(breakpointState.getTypeId()); if (type == null) { LOG.warn("Unknown breakpoint type " + breakpointState.getTypeId()); return null; } //noinspection unchecked return breakpointState.createBreakpoint(type, this); } @NotNull public BreakpointState getBreakpointDefaults(@NotNull XBreakpointType type) { BreakpointState defaultState = myBreakpointsDefaults.get(type); if (defaultState == null) { defaultState = createBreakpointDefaults(type); myBreakpointsDefaults.put(type, defaultState); } return defaultState; } @NotNull private static BreakpointState createBreakpointDefaults(@NotNull XBreakpointType type) { BreakpointState state = new BreakpointState(); state.setTypeId(type.getId()); return state; } @Tag("breakpoint-manager") public static class BreakpointManagerState { private List<BreakpointState> myDefaultBreakpoints = new ArrayList<BreakpointState>(); private List<BreakpointState> myBreakpoints = new ArrayList<BreakpointState>(); private List<BreakpointState> myBreakpointsDefaults = new ArrayList<BreakpointState>(); private XBreakpointsDialogState myBreakpointsDialogProperties; private long myTime; private String myDefaultGroup; @Tag("default-breakpoints") @AbstractCollection(surroundWithTag = false) public List<BreakpointState> getDefaultBreakpoints() { return myDefaultBreakpoints; } @Tag("breakpoints") @AbstractCollection(surroundWithTag = false, elementTypes = {BreakpointState.class, LineBreakpointState.class}) public List<BreakpointState> getBreakpoints() { return myBreakpoints; } @Tag("breakpoints-defaults") @AbstractCollection(surroundWithTag = false, elementTypes = {BreakpointState.class, LineBreakpointState.class}) public List<BreakpointState> getBreakpointsDefaults() { return myBreakpointsDefaults; } @Tag("breakpoints-dialog") public XBreakpointsDialogState getBreakpointsDialogProperties() { return myBreakpointsDialogProperties; } public void setBreakpoints(final List<BreakpointState> breakpoints) { myBreakpoints = breakpoints; } @SuppressWarnings("UnusedDeclaration") public void setDefaultBreakpoints(List<BreakpointState> defaultBreakpoints) { myDefaultBreakpoints = defaultBreakpoints; } public void setBreakpointsDefaults(List<BreakpointState> breakpointsDefaults) { myBreakpointsDefaults = breakpointsDefaults; } public void setBreakpointsDialogProperties(XBreakpointsDialogState breakpointsDialogProperties) { myBreakpointsDialogProperties = breakpointsDialogProperties; } public long getTime() { return myTime; } public void setTime(long time) { myTime = time; } public String getDefaultGroup() { return myDefaultGroup; } public void setDefaultGroup(String defaultGroup) { myDefaultGroup = defaultGroup; } } }
IDEA-65205 Clicking on exception breakpoint mark should switch this breakpoint off instead of creating new line breakpoint
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointManagerImpl.java
IDEA-65205 Clicking on exception breakpoint mark should switch this breakpoint off instead of creating new line breakpoint
<ide><path>latform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointManagerImpl.java <ide> } <ide> <ide> private void doRemoveBreakpoint(XBreakpoint<?> breakpoint) { <del> XBreakpointType type = breakpoint.getType(); <del> XBreakpointBase<?,?,?> breakpointBase = (XBreakpointBase<?,?,?>)breakpoint; <del> myBreakpoints.remove(type, breakpointBase); <del> myAllBreakpoints.remove(breakpointBase); <del> if (breakpointBase instanceof XLineBreakpointImpl) { <del> myLineBreakpointManager.unregisterBreakpoint((XLineBreakpointImpl)breakpointBase); <del> } <del> breakpointBase.dispose(); <del> EventDispatcher<XBreakpointListener> dispatcher = myDispatchers.get(type); <del> if (dispatcher != null) { <del> //noinspection unchecked <del> dispatcher.getMulticaster().breakpointRemoved(breakpoint); <del> } <del> getBreakpointDispatcherMulticaster().breakpointRemoved(breakpoint); <add> if (isDefaultBreakpoint(breakpoint)) { <add> // removing default breakpoint should just disable it <add> breakpoint.setEnabled(false); <add> } <add> else { <add> XBreakpointType type = breakpoint.getType(); <add> XBreakpointBase<?,?,?> breakpointBase = (XBreakpointBase<?,?,?>)breakpoint; <add> myBreakpoints.remove(type, breakpointBase); <add> myAllBreakpoints.remove(breakpointBase); <add> if (breakpointBase instanceof XLineBreakpointImpl) { <add> myLineBreakpointManager.unregisterBreakpoint((XLineBreakpointImpl)breakpointBase); <add> } <add> breakpointBase.dispose(); <add> EventDispatcher<XBreakpointListener> dispatcher = myDispatchers.get(type); <add> if (dispatcher != null) { <add> //noinspection unchecked <add> dispatcher.getMulticaster().breakpointRemoved(breakpoint); <add> } <add> getBreakpointDispatcherMulticaster().breakpointRemoved(breakpoint); <add> } <ide> } <ide> <ide> @Override
Java
apache-2.0
eb18ac8742cbb135ac1e3cfae1af159bf518879f
0
google/conscrypt,google/conscrypt,google/conscrypt,google/conscrypt,google/conscrypt,google/conscrypt
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.harmony.xnet.provider.jsse; import java.security.GeneralSecurityException; import java.util.Hashtable; import javax.crypto.Cipher; /** * Represents Cipher Suite as defined in TLS 1.0 spec., * A.5. The CipherSuite; * C. CipherSuite definitions. * @see <a href="http://www.ietf.org/rfc/rfc2246.txt">TLS 1.0 spec.</a> * */ public class CipherSuite { /** * true if this cipher suite is supported */ boolean supported = true; /** * cipher suite key exchange */ final int keyExchange; /** * cipher */ final String cipherName; /** * Cipher information */ final int keyMaterial; final int expandedKeyMaterial; final int effectiveKeyBytes; final int IVSize; final private int blockSize; // cipher suite code private final byte[] cipherSuiteCode; // cipher suite name private final String name; // true if cipher suite is exportable private final boolean isExportable; // Hash algorithm final private String hashName; // MAC algorithm final private String hmacName; // Hash size final private int hashSize; /** * key exchange values */ static int KeyExchange_RSA = 1; static int KeyExchange_RSA_EXPORT = 2; static int KeyExchange_DHE_DSS = 3; static int KeyExchange_DHE_DSS_EXPORT = 4; static int KeyExchange_DHE_RSA = 5; static int KeyExchange_DHE_RSA_EXPORT = 6; static int KeyExchange_DH_DSS = 7; static int KeyExchange_DH_RSA = 8; static int KeyExchange_DH_anon = 9; static int KeyExchange_DH_anon_EXPORT = 10; static int KeyExchange_DH_DSS_EXPORT = 11; static int KeyExchange_DH_RSA_EXPORT = 12; /** * TLS cipher suite codes */ static byte[] code_TLS_NULL_WITH_NULL_NULL = { 0x00, 0x00 }; static byte[] code_TLS_RSA_WITH_NULL_MD5 = { 0x00, 0x01 }; static byte[] code_TLS_RSA_WITH_NULL_SHA = { 0x00, 0x02 }; static byte[] code_TLS_RSA_EXPORT_WITH_RC4_40_MD5 = { 0x00, 0x03 }; static byte[] code_TLS_RSA_WITH_RC4_128_MD5 = { 0x00, 0x04 }; static byte[] code_TLS_RSA_WITH_RC4_128_SHA = { 0x00, 0x05 }; static byte[] code_TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = { 0x00, 0x06 }; static byte[] code_TLS_RSA_WITH_IDEA_CBC_SHA = { 0x00, 0x07 }; static byte[] code_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = { 0x00, 0x08 }; static byte[] code_TLS_RSA_WITH_DES_CBC_SHA = { 0x00, 0x09 }; static byte[] code_TLS_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00, 0x0A }; static byte[] code_TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = { 0x00, 0x0B }; static byte[] code_TLS_DH_DSS_WITH_DES_CBC_SHA = { 0x00, 0x0C }; static byte[] code_TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = { 0x00, 0x0D }; static byte[] code_TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = { 0x00, 0x0E }; static byte[] code_TLS_DH_RSA_WITH_DES_CBC_SHA = { 0x00, 0x0F }; static byte[] code_TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00, 0x10 }; static byte[] code_TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = { 0x00, 0x11 }; static byte[] code_TLS_DHE_DSS_WITH_DES_CBC_SHA = { 0x00, 0x12 }; static byte[] code_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = { 0x00, 0x13 }; static byte[] code_TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = { 0x00, 0x14 }; static byte[] code_TLS_DHE_RSA_WITH_DES_CBC_SHA = { 0x00, 0x15 }; static byte[] code_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00, 0x16 }; static byte[] code_TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = { 0x00, 0x17 }; static byte[] code_TLS_DH_anon_WITH_RC4_128_MD5 = { 0x00, 0x18 }; static byte[] code_TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = { 0x00, 0x19 }; static byte[] code_TLS_DH_anon_WITH_DES_CBC_SHA = { 0x00, 0x1A }; static byte[] code_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = { 0x00, 0x1B }; static CipherSuite TLS_NULL_WITH_NULL_NULL = new CipherSuite( "SSL_NULL_WITH_NULL_NULL", true, 0, null, null, code_TLS_NULL_WITH_NULL_NULL); static CipherSuite TLS_RSA_WITH_NULL_MD5 = new CipherSuite( "SSL_RSA_WITH_NULL_MD5", true, KeyExchange_RSA, null, "MD5", code_TLS_RSA_WITH_NULL_MD5); static CipherSuite TLS_RSA_WITH_NULL_SHA = new CipherSuite( "SSL_RSA_WITH_NULL_SHA", true, KeyExchange_RSA, null, "SHA", code_TLS_RSA_WITH_NULL_SHA); static CipherSuite TLS_RSA_EXPORT_WITH_RC4_40_MD5 = new CipherSuite( "SSL_RSA_EXPORT_WITH_RC4_40_MD5", true, KeyExchange_RSA_EXPORT, "RC4_40", "MD5", code_TLS_RSA_EXPORT_WITH_RC4_40_MD5); static CipherSuite TLS_RSA_WITH_RC4_128_MD5 = new CipherSuite( "SSL_RSA_WITH_RC4_128_MD5", false, KeyExchange_RSA, "RC4_128", "MD5", code_TLS_RSA_WITH_RC4_128_MD5); static CipherSuite TLS_RSA_WITH_RC4_128_SHA = new CipherSuite( "SSL_RSA_WITH_RC4_128_SHA", false, KeyExchange_RSA, "RC4_128", "SHA", code_TLS_RSA_WITH_RC4_128_SHA); static CipherSuite TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = new CipherSuite( "SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5", true, KeyExchange_RSA_EXPORT, "RC2_CBC_40", "MD5", code_TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5); static CipherSuite TLS_RSA_WITH_IDEA_CBC_SHA = new CipherSuite( "TLS_RSA_WITH_IDEA_CBC_SHA", false, KeyExchange_RSA, "IDEA_CBC", "SHA", code_TLS_RSA_WITH_IDEA_CBC_SHA); static CipherSuite TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", true, KeyExchange_RSA_EXPORT, "DES40_CBC", "SHA", code_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA); static CipherSuite TLS_RSA_WITH_DES_CBC_SHA = new CipherSuite( "SSL_RSA_WITH_DES_CBC_SHA", false, KeyExchange_RSA, "DES_CBC", "SHA", code_TLS_RSA_WITH_DES_CBC_SHA); static CipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA = new CipherSuite( "SSL_RSA_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_RSA, "3DES_EDE_CBC", "SHA", code_TLS_RSA_WITH_3DES_EDE_CBC_SHA); static CipherSuite TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( "SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", true, KeyExchange_DH_DSS_EXPORT, "DES40_CBC", "SHA", code_TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA); static CipherSuite TLS_DH_DSS_WITH_DES_CBC_SHA = new CipherSuite( "TLS_DH_DSS_WITH_DES_CBC_SHA", false, KeyExchange_DH_DSS, "DES_CBC", "SHA", code_TLS_DH_DSS_WITH_DES_CBC_SHA); static CipherSuite TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = new CipherSuite( "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DH_DSS, "3DES_EDE_CBC", "SHA", code_TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA); static CipherSuite TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( "SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", true, KeyExchange_DH_RSA_EXPORT, "DES40_CBC", "SHA", code_TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA); static CipherSuite TLS_DH_RSA_WITH_DES_CBC_SHA = new CipherSuite( "TLS_DH_RSA_WITH_DES_CBC_SHA", false, KeyExchange_DH_RSA, "DES_CBC", "SHA", code_TLS_DH_RSA_WITH_DES_CBC_SHA); static CipherSuite TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = new CipherSuite( "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DH_RSA, "3DES_EDE_CBC", "SHA", code_TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA); static CipherSuite TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", true, KeyExchange_DHE_DSS_EXPORT, "DES40_CBC", "SHA", code_TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA); static CipherSuite TLS_DHE_DSS_WITH_DES_CBC_SHA = new CipherSuite( "SSL_DHE_DSS_WITH_DES_CBC_SHA", false, KeyExchange_DHE_DSS, "DES_CBC", "SHA", code_TLS_DHE_DSS_WITH_DES_CBC_SHA); static CipherSuite TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = new CipherSuite( "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DHE_DSS, "3DES_EDE_CBC", "SHA", code_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA); static CipherSuite TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", true, KeyExchange_DHE_RSA_EXPORT, "DES40_CBC", "SHA", code_TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA); static CipherSuite TLS_DHE_RSA_WITH_DES_CBC_SHA = new CipherSuite( "SSL_DHE_RSA_WITH_DES_CBC_SHA", false, KeyExchange_DHE_RSA, "DES_CBC", "SHA", code_TLS_DHE_RSA_WITH_DES_CBC_SHA); static CipherSuite TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = new CipherSuite( "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DHE_RSA, "3DES_EDE_CBC", "SHA", code_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA); static CipherSuite TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = new CipherSuite( "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", true, KeyExchange_DH_anon_EXPORT, "RC4_40", "MD5", code_TLS_DH_anon_EXPORT_WITH_RC4_40_MD5); static CipherSuite TLS_DH_anon_WITH_RC4_128_MD5 = new CipherSuite( "SSL_DH_anon_WITH_RC4_128_MD5", false, KeyExchange_DH_anon, "RC4_128", "MD5", code_TLS_DH_anon_WITH_RC4_128_MD5); static CipherSuite TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", true, KeyExchange_DH_anon_EXPORT, "DES40_CBC", "SHA", code_TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA); static CipherSuite TLS_DH_anon_WITH_DES_CBC_SHA = new CipherSuite( "SSL_DH_anon_WITH_DES_CBC_SHA", false, KeyExchange_DH_anon, "DES_CBC", "SHA", code_TLS_DH_anon_WITH_DES_CBC_SHA); static CipherSuite TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = new CipherSuite( "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DH_anon, "3DES_EDE_CBC", "SHA", code_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA); // array for quick access to cipher suite by code private static CipherSuite[] cuitesByCode = { TLS_NULL_WITH_NULL_NULL, TLS_RSA_WITH_NULL_MD5, TLS_RSA_WITH_NULL_SHA, TLS_RSA_EXPORT_WITH_RC4_40_MD5, TLS_RSA_WITH_RC4_128_MD5, TLS_RSA_WITH_RC4_128_SHA, TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5, TLS_RSA_WITH_IDEA_CBC_SHA, TLS_RSA_EXPORT_WITH_DES40_CBC_SHA, TLS_RSA_WITH_DES_CBC_SHA, TLS_RSA_WITH_3DES_EDE_CBC_SHA, TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA, TLS_DH_DSS_WITH_DES_CBC_SHA, TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA, TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA, TLS_DH_RSA_WITH_DES_CBC_SHA, TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA, TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, TLS_DHE_DSS_WITH_DES_CBC_SHA, TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, TLS_DHE_RSA_WITH_DES_CBC_SHA, TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_DH_anon_EXPORT_WITH_RC4_40_MD5, TLS_DH_anon_WITH_RC4_128_MD5, TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA, TLS_DH_anon_WITH_DES_CBC_SHA, TLS_DH_anon_WITH_3DES_EDE_CBC_SHA }; // hash for quick access to cipher suite by name private static Hashtable<String, CipherSuite> cuitesByName; /** * array of supported cipher suites. * Set of supported suites is defined at the moment provider's start */ // TODO Dynamically supported suites: new providers may be dynamically // added/removed and the set of supported suites may be changed static CipherSuite[] supportedCipherSuites; /** * array of supported cipher suites names */ static String[] supportedCipherSuiteNames; /** * default cipher suites */ static CipherSuite[] defaultCipherSuites; static { int count = 0; cuitesByName = new Hashtable<String, CipherSuite>(); for (int i = 0; i < cuitesByCode.length; i++) { cuitesByName.put(cuitesByCode[i].getName(), cuitesByCode[i]); if (cuitesByCode[i].supported) { count++; } } supportedCipherSuites = new CipherSuite[count]; supportedCipherSuiteNames = new String[count]; count = 0; for (int i = 0; i < cuitesByCode.length; i++) { if (cuitesByCode[i].supported) { supportedCipherSuites[count] = cuitesByCode[i]; supportedCipherSuiteNames[count] = supportedCipherSuites[count].getName(); count++; } } CipherSuite[] defaultPretendent = { TLS_RSA_WITH_RC4_128_MD5, TLS_RSA_WITH_RC4_128_SHA, // TLS_RSA_WITH_AES_128_CBC_SHA, // TLS_DHE_RSA_WITH_AES_128_CBC_SHA, // LS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_3DES_EDE_CBC_SHA, TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_RSA_WITH_DES_CBC_SHA, TLS_DHE_RSA_WITH_DES_CBC_SHA, TLS_DHE_DSS_WITH_DES_CBC_SHA, TLS_RSA_EXPORT_WITH_RC4_40_MD5, TLS_RSA_EXPORT_WITH_DES40_CBC_SHA, TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA }; count = 0; for (int i = 0; i < defaultPretendent.length; i++) { if (defaultPretendent[i].supported) { count++; } } defaultCipherSuites = new CipherSuite[count]; count = 0; for (int i = 0; i < defaultPretendent.length; i++) { if (defaultPretendent[i].supported) { defaultCipherSuites[count++] = defaultPretendent[i]; } } } /** * Returns CipherSuite by name * @param name * @return */ public static CipherSuite getByName(String name) { return cuitesByName.get(name); } /** * Returns CipherSuite based on TLS CipherSuite code * @see <a href="http://www.ietf.org/rfc/rfc2246.txt">TLS 1.0 spec., A.5. The CipherSuite</a> * @param b1 * @param b2 * @return */ public static CipherSuite getByCode(byte b1, byte b2) { if (b1 != 0 || (b2 & 0xFF) > cuitesByCode.length) { // Unknown return new CipherSuite("UNKNOUN_" + b1 + "_" + b2, false, 0, "", "", new byte[] { b1, b2 }); } return cuitesByCode[b2]; } /** * Returns CipherSuite based on V2CipherSpec code * as described in TLS 1.0 spec., E. Backward Compatibility With SSL * * @param b1 * @param b2 * @param b3 * @return CipherSuite */ public static CipherSuite getByCode(byte b1, byte b2, byte b3) { if (b1 == 0 && b2 == 0) { if ((b3 & 0xFF) <= cuitesByCode.length) { return cuitesByCode[b3]; } } // as TLSv1 equivalent of V2CipherSpec should be included in // V2ClientHello, ignore V2CipherSpec return new CipherSuite("UNKNOUN_" + b1 + "_" + b2 + "_" + b3, false, 0, "", "", new byte[] { b1, b2, b3 }); } /** * Creates CipherSuite * @param name * @param isExportable * @param keyExchange * @param cipherName * @param hash * @param code */ public CipherSuite(String name, boolean isExportable, int keyExchange, String cipherName, String hash, byte[] code) { this.name = name; this.keyExchange = keyExchange; this.isExportable = isExportable; if (cipherName == null) { this.cipherName = null; keyMaterial = 0; expandedKeyMaterial = 0; effectiveKeyBytes = 0; IVSize = 0; blockSize = 0; } else if ("IDEA_CBC".equals(cipherName)) { this.cipherName = "IDEA/CBC/NoPadding"; keyMaterial = 16; expandedKeyMaterial = 16; effectiveKeyBytes = 16; IVSize = 8; blockSize = 8; } else if ("RC2_CBC_40".equals(cipherName)) { this.cipherName = "RC2/CBC/NoPadding"; keyMaterial = 5; expandedKeyMaterial = 16; effectiveKeyBytes = 5; IVSize = 8; blockSize = 8; } else if ("RC4_40".equals(cipherName)) { this.cipherName = "RC4"; keyMaterial = 5; expandedKeyMaterial = 16; effectiveKeyBytes = 5; IVSize = 0; blockSize = 0; } else if ("RC4_128".equals(cipherName)) { this.cipherName = "RC4"; keyMaterial = 16; expandedKeyMaterial = 16; effectiveKeyBytes = 16; IVSize = 0; blockSize = 0; } else if ("DES40_CBC".equals(cipherName)) { this.cipherName = "DES/CBC/NoPadding"; keyMaterial = 5; expandedKeyMaterial = 8; effectiveKeyBytes = 5; IVSize = 8; blockSize = 8; } else if ("DES_CBC".equals(cipherName)) { this.cipherName = "DES/CBC/NoPadding"; keyMaterial = 8; expandedKeyMaterial = 8; effectiveKeyBytes = 7; IVSize = 8; blockSize = 8; } else if ("3DES_EDE_CBC".equals(cipherName)) { this.cipherName = "DESede/CBC/NoPadding"; keyMaterial = 24; expandedKeyMaterial = 24; effectiveKeyBytes = 24; IVSize = 8; blockSize = 8; } else { this.cipherName = cipherName; keyMaterial = 0; expandedKeyMaterial = 0; effectiveKeyBytes = 0; IVSize = 0; blockSize = 0; } if ("MD5".equals(hash)) { this.hmacName = "HmacMD5"; this.hashName = "MD5"; hashSize = 16; } else if ("SHA".equals(hash)) { this.hmacName = "HmacSHA1"; this.hashName = "SHA-1"; hashSize = 20; } else { this.hmacName = null; this.hashName = null; hashSize = 0; } cipherSuiteCode = code; if (this.cipherName != null) { try { Cipher.getInstance(this.cipherName); } catch (GeneralSecurityException e) { supported = false; } } } /** * Returns true if cipher suite is anonymous * @return */ public boolean isAnonymous() { if (keyExchange == KeyExchange_DH_anon || keyExchange == KeyExchange_DH_anon_EXPORT) { return true; } return false; } /** * Returns array of supported CipherSuites * @return */ public static CipherSuite[] getSupported() { return supportedCipherSuites; } /** * Returns array of supported cipher suites names * @return */ public static String[] getSupportedCipherSuiteNames() { return supportedCipherSuiteNames.clone(); } /** * Returns cipher suite name * @return */ public String getName() { return name; } /** * Returns cipher suite code as byte array * @return */ public byte[] toBytes() { return cipherSuiteCode; } /** * Returns cipher suite description */ @Override public String toString() { return name + ": " + cipherSuiteCode[0] + " " + cipherSuiteCode[1]; } /** * Compares this cipher suite to the specified object. */ @Override public boolean equals(Object obj) { if (obj instanceof CipherSuite && this.cipherSuiteCode[0] == ((CipherSuite) obj).cipherSuiteCode[0] && this.cipherSuiteCode[1] == ((CipherSuite) obj).cipherSuiteCode[1]) { return true; } return false; } /** * Returns cipher algorithm name * @return */ public String getBulkEncryptionAlgorithm() { return cipherName; } /** * Returns cipher block size * @return */ public int getBlockSize() { return blockSize; } /** * Returns MAC algorithm name * @return */ public String getHmacName() { return hmacName; } /** * Returns hash algorithm name * @return */ public String getHashName() { return hashName; } /** * Returns hash size * @return */ public int getMACLength() { return hashSize; } /** * Indicates whether this cipher suite is exportable * @return */ public boolean isExportable() { return isExportable; } }
luni/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.harmony.xnet.provider.jsse; import java.security.GeneralSecurityException; import java.util.Hashtable; import javax.crypto.Cipher; /** * Represents Cipher Suite as defined in TLS 1.0 spec., * A.5. The CipherSuite; * C. CipherSuite definitions. * @see <a href="http://www.ietf.org/rfc/rfc2246.txt">TLS 1.0 spec.</a> * */ public class CipherSuite { /** * true if this cipher suite is supported */ boolean supported = true; /** * cipher suite key exchange */ final int keyExchange; /** * cipher */ final String cipherName; /** * Cipher information */ final int keyMaterial; final int expandedKeyMaterial; final int effectiveKeyBytes; final int IVSize; final private int blockSize; // cipher suite code private final byte[] cipherSuiteCode; // cipher suite name private final String name; // true if cipher suite is exportable private final boolean isExportable; // Hash algorithm final private String hashName; // MAC algorithm final private String hmacName; // Hash size final private int hashSize; /** * key exchange values */ static int KeyExchange_RSA = 1; static int KeyExchange_RSA_EXPORT = 2; static int KeyExchange_DHE_DSS = 3; static int KeyExchange_DHE_DSS_EXPORT = 4; static int KeyExchange_DHE_RSA = 5; static int KeyExchange_DHE_RSA_EXPORT = 6; static int KeyExchange_DH_DSS = 7; static int KeyExchange_DH_RSA = 8; static int KeyExchange_DH_anon = 9; static int KeyExchange_DH_anon_EXPORT = 10; static int KeyExchange_DH_DSS_EXPORT = 11; static int KeyExchange_DH_RSA_EXPORT = 12; /** * TLS cipher suite codes */ static byte[] code_TLS_NULL_WITH_NULL_NULL = { 0x00, 0x00 }; static byte[] code_TLS_RSA_WITH_NULL_MD5 = { 0x00, 0x01 }; static byte[] code_TLS_RSA_WITH_NULL_SHA = { 0x00, 0x02 }; static byte[] code_TLS_RSA_EXPORT_WITH_RC4_40_MD5 = { 0x00, 0x03 }; static byte[] code_TLS_RSA_WITH_RC4_128_MD5 = { 0x00, 0x04 }; static byte[] code_TLS_RSA_WITH_RC4_128_SHA = { 0x00, 0x05 }; static byte[] code_TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = { 0x00, 0x06 }; static byte[] code_TLS_RSA_WITH_IDEA_CBC_SHA = { 0x00, 0x07 }; static byte[] code_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = { 0x00, 0x08 }; static byte[] code_TLS_RSA_WITH_DES_CBC_SHA = { 0x00, 0x09 }; static byte[] code_TLS_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00, 0x0A }; static byte[] code_TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = { 0x00, 0x0B }; static byte[] code_TLS_DH_DSS_WITH_DES_CBC_SHA = { 0x00, 0x0C }; static byte[] code_TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = { 0x00, 0x0D }; static byte[] code_TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = { 0x00, 0x0E }; static byte[] code_TLS_DH_RSA_WITH_DES_CBC_SHA = { 0x00, 0x0F }; static byte[] code_TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00, 0x10 }; static byte[] code_TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = { 0x00, 0x11 }; static byte[] code_TLS_DHE_DSS_WITH_DES_CBC_SHA = { 0x00, 0x12 }; static byte[] code_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = { 0x00, 0x13 }; static byte[] code_TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = { 0x00, 0x14 }; static byte[] code_TLS_DHE_RSA_WITH_DES_CBC_SHA = { 0x00, 0x15 }; static byte[] code_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = { 0x00, 0x16 }; static byte[] code_TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = { 0x00, 0x17 }; static byte[] code_TLS_DH_anon_WITH_RC4_128_MD5 = { 0x00, 0x18 }; static byte[] code_TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = { 0x00, 0x19 }; static byte[] code_TLS_DH_anon_WITH_DES_CBC_SHA = { 0x00, 0x1A }; static byte[] code_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = { 0x00, 0x1B }; static CipherSuite TLS_NULL_WITH_NULL_NULL = new CipherSuite( "TLS_NULL_WITH_NULL_NULL", true, 0, null, null, code_TLS_NULL_WITH_NULL_NULL); static CipherSuite TLS_RSA_WITH_NULL_MD5 = new CipherSuite( "TLS_RSA_WITH_NULL_MD5", true, KeyExchange_RSA, null, "MD5", code_TLS_RSA_WITH_NULL_MD5); static CipherSuite TLS_RSA_WITH_NULL_SHA = new CipherSuite( "TLS_RSA_WITH_NULL_SHA", true, KeyExchange_RSA, null, "SHA", code_TLS_RSA_WITH_NULL_SHA); static CipherSuite TLS_RSA_EXPORT_WITH_RC4_40_MD5 = new CipherSuite( "TLS_RSA_EXPORT_WITH_RC4_40_MD5", true, KeyExchange_RSA_EXPORT, "RC4_40", "MD5", code_TLS_RSA_EXPORT_WITH_RC4_40_MD5); static CipherSuite TLS_RSA_WITH_RC4_128_MD5 = new CipherSuite( "TLS_RSA_WITH_RC4_128_MD5", false, KeyExchange_RSA, "RC4_128", "MD5", code_TLS_RSA_WITH_RC4_128_MD5); static CipherSuite TLS_RSA_WITH_RC4_128_SHA = new CipherSuite( "TLS_RSA_WITH_RC4_128_SHA", false, KeyExchange_RSA, "RC4_128", "SHA", code_TLS_RSA_WITH_RC4_128_SHA); static CipherSuite TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = new CipherSuite( "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5", true, KeyExchange_RSA_EXPORT, "RC2_CBC_40", "MD5", code_TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5); static CipherSuite TLS_RSA_WITH_IDEA_CBC_SHA = new CipherSuite( "TLS_RSA_WITH_IDEA_CBC_SHA", false, KeyExchange_RSA, "IDEA_CBC", "SHA", code_TLS_RSA_WITH_IDEA_CBC_SHA); static CipherSuite TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA", true, KeyExchange_RSA_EXPORT, "DES40_CBC", "SHA", code_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA); static CipherSuite TLS_RSA_WITH_DES_CBC_SHA = new CipherSuite( "TLS_RSA_WITH_DES_CBC_SHA", false, KeyExchange_RSA, "DES_CBC", "SHA", code_TLS_RSA_WITH_DES_CBC_SHA); static CipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA = new CipherSuite( "TLS_RSA_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_RSA, "3DES_EDE_CBC", "SHA", code_TLS_RSA_WITH_3DES_EDE_CBC_SHA); static CipherSuite TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", true, KeyExchange_DH_DSS_EXPORT, "DES40_CBC", "SHA", code_TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA); static CipherSuite TLS_DH_DSS_WITH_DES_CBC_SHA = new CipherSuite( "TLS_DH_DSS_WITH_DES_CBC_SHA", false, KeyExchange_DH_DSS, "DES_CBC", "SHA", code_TLS_DH_DSS_WITH_DES_CBC_SHA); static CipherSuite TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = new CipherSuite( "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DH_DSS, "3DES_EDE_CBC", "SHA", code_TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA); static CipherSuite TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( "TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", true, KeyExchange_DH_RSA_EXPORT, "DES40_CBC", "SHA", code_TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA); static CipherSuite TLS_DH_RSA_WITH_DES_CBC_SHA = new CipherSuite( "TLS_DH_RSA_WITH_DES_CBC_SHA", false, KeyExchange_DH_RSA, "DES_CBC", "SHA", code_TLS_DH_RSA_WITH_DES_CBC_SHA); static CipherSuite TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = new CipherSuite( "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DH_RSA, "3DES_EDE_CBC", "SHA", code_TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA); static CipherSuite TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", true, KeyExchange_DHE_DSS_EXPORT, "DES40_CBC", "SHA", code_TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA); static CipherSuite TLS_DHE_DSS_WITH_DES_CBC_SHA = new CipherSuite( "TLS_DHE_DSS_WITH_DES_CBC_SHA", false, KeyExchange_DHE_DSS, "DES_CBC", "SHA", code_TLS_DHE_DSS_WITH_DES_CBC_SHA); static CipherSuite TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = new CipherSuite( "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DHE_DSS, "3DES_EDE_CBC", "SHA", code_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA); static CipherSuite TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", true, KeyExchange_DHE_RSA_EXPORT, "DES40_CBC", "SHA", code_TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA); static CipherSuite TLS_DHE_RSA_WITH_DES_CBC_SHA = new CipherSuite( "TLS_DHE_RSA_WITH_DES_CBC_SHA", false, KeyExchange_DHE_RSA, "DES_CBC", "SHA", code_TLS_DHE_RSA_WITH_DES_CBC_SHA); static CipherSuite TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = new CipherSuite( "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DHE_RSA, "3DES_EDE_CBC", "SHA", code_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA); static CipherSuite TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = new CipherSuite( "TLS_DH_anon_EXPORT_WITH_RC4_40_MD5", true, KeyExchange_DH_anon_EXPORT, "RC4_40", "MD5", code_TLS_DH_anon_EXPORT_WITH_RC4_40_MD5); static CipherSuite TLS_DH_anon_WITH_RC4_128_MD5 = new CipherSuite( "TLS_DH_anon_WITH_RC4_128_MD5", false, KeyExchange_DH_anon, "RC4_128", "MD5", code_TLS_DH_anon_WITH_RC4_128_MD5); static CipherSuite TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( "TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA", true, KeyExchange_DH_anon_EXPORT, "DES40_CBC", "SHA", code_TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA); static CipherSuite TLS_DH_anon_WITH_DES_CBC_SHA = new CipherSuite( "TLS_DH_anon_WITH_DES_CBC_SHA", false, KeyExchange_DH_anon, "DES_CBC", "SHA", code_TLS_DH_anon_WITH_DES_CBC_SHA); static CipherSuite TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = new CipherSuite( "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DH_anon, "3DES_EDE_CBC", "SHA", code_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA); // array for quick access to cipher suite by code private static CipherSuite[] cuitesByCode = { TLS_NULL_WITH_NULL_NULL, TLS_RSA_WITH_NULL_MD5, TLS_RSA_WITH_NULL_SHA, TLS_RSA_EXPORT_WITH_RC4_40_MD5, TLS_RSA_WITH_RC4_128_MD5, TLS_RSA_WITH_RC4_128_SHA, TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5, TLS_RSA_WITH_IDEA_CBC_SHA, TLS_RSA_EXPORT_WITH_DES40_CBC_SHA, TLS_RSA_WITH_DES_CBC_SHA, TLS_RSA_WITH_3DES_EDE_CBC_SHA, TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA, TLS_DH_DSS_WITH_DES_CBC_SHA, TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA, TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA, TLS_DH_RSA_WITH_DES_CBC_SHA, TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA, TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, TLS_DHE_DSS_WITH_DES_CBC_SHA, TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, TLS_DHE_RSA_WITH_DES_CBC_SHA, TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_DH_anon_EXPORT_WITH_RC4_40_MD5, TLS_DH_anon_WITH_RC4_128_MD5, TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA, TLS_DH_anon_WITH_DES_CBC_SHA, TLS_DH_anon_WITH_3DES_EDE_CBC_SHA }; // hash for quick access to cipher suite by name private static Hashtable<String, CipherSuite> cuitesByName; /** * array of supported cipher suites. * Set of supported suites is defined at the moment provider's start */ // TODO Dynamically supported suites: new providers may be dynamically // added/removed and the set of supported suites may be changed static CipherSuite[] supportedCipherSuites; /** * array of supported cipher suites names */ static String[] supportedCipherSuiteNames; /** * default cipher suites */ static CipherSuite[] defaultCipherSuites; static { int count = 0; cuitesByName = new Hashtable<String, CipherSuite>(); for (int i = 0; i < cuitesByCode.length; i++) { cuitesByName.put(cuitesByCode[i].getName(), cuitesByCode[i]); if (cuitesByCode[i].supported) { count++; } } supportedCipherSuites = new CipherSuite[count]; supportedCipherSuiteNames = new String[count]; count = 0; for (int i = 0; i < cuitesByCode.length; i++) { if (cuitesByCode[i].supported) { supportedCipherSuites[count] = cuitesByCode[i]; supportedCipherSuiteNames[count] = supportedCipherSuites[count].getName(); count++; } } CipherSuite[] defaultPretendent = { TLS_RSA_WITH_RC4_128_MD5, TLS_RSA_WITH_RC4_128_SHA, // TLS_RSA_WITH_AES_128_CBC_SHA, // TLS_DHE_RSA_WITH_AES_128_CBC_SHA, // LS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_3DES_EDE_CBC_SHA, TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_RSA_WITH_DES_CBC_SHA, TLS_DHE_RSA_WITH_DES_CBC_SHA, TLS_DHE_DSS_WITH_DES_CBC_SHA, TLS_RSA_EXPORT_WITH_RC4_40_MD5, TLS_RSA_EXPORT_WITH_DES40_CBC_SHA, TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA }; count = 0; for (int i = 0; i < defaultPretendent.length; i++) { if (defaultPretendent[i].supported) { count++; } } defaultCipherSuites = new CipherSuite[count]; count = 0; for (int i = 0; i < defaultPretendent.length; i++) { if (defaultPretendent[i].supported) { defaultCipherSuites[count++] = defaultPretendent[i]; } } } /** * Returns CipherSuite by name * @param name * @return */ public static CipherSuite getByName(String name) { return cuitesByName.get(name); } /** * Returns CipherSuite based on TLS CipherSuite code * @see <a href="http://www.ietf.org/rfc/rfc2246.txt">TLS 1.0 spec., A.5. The CipherSuite</a> * @param b1 * @param b2 * @return */ public static CipherSuite getByCode(byte b1, byte b2) { if (b1 != 0 || (b2 & 0xFF) > cuitesByCode.length) { // Unknown return new CipherSuite("UNKNOUN_" + b1 + "_" + b2, false, 0, "", "", new byte[] { b1, b2 }); } return cuitesByCode[b2]; } /** * Returns CipherSuite based on V2CipherSpec code * as described in TLS 1.0 spec., E. Backward Compatibility With SSL * * @param b1 * @param b2 * @param b3 * @return CipherSuite */ public static CipherSuite getByCode(byte b1, byte b2, byte b3) { if (b1 == 0 && b2 == 0) { if ((b3 & 0xFF) <= cuitesByCode.length) { return cuitesByCode[b3]; } } // as TLSv1 equivalent of V2CipherSpec should be included in // V2ClientHello, ignore V2CipherSpec return new CipherSuite("UNKNOUN_" + b1 + "_" + b2 + "_" + b3, false, 0, "", "", new byte[] { b1, b2, b3 }); } /** * Creates CipherSuite * @param name * @param isExportable * @param keyExchange * @param cipherName * @param hash * @param code */ public CipherSuite(String name, boolean isExportable, int keyExchange, String cipherName, String hash, byte[] code) { this.name = name; this.keyExchange = keyExchange; this.isExportable = isExportable; if (cipherName == null) { this.cipherName = null; keyMaterial = 0; expandedKeyMaterial = 0; effectiveKeyBytes = 0; IVSize = 0; blockSize = 0; } else if ("IDEA_CBC".equals(cipherName)) { this.cipherName = "IDEA/CBC/NoPadding"; keyMaterial = 16; expandedKeyMaterial = 16; effectiveKeyBytes = 16; IVSize = 8; blockSize = 8; } else if ("RC2_CBC_40".equals(cipherName)) { this.cipherName = "RC2/CBC/NoPadding"; keyMaterial = 5; expandedKeyMaterial = 16; effectiveKeyBytes = 5; IVSize = 8; blockSize = 8; } else if ("RC4_40".equals(cipherName)) { this.cipherName = "RC4"; keyMaterial = 5; expandedKeyMaterial = 16; effectiveKeyBytes = 5; IVSize = 0; blockSize = 0; } else if ("RC4_128".equals(cipherName)) { this.cipherName = "RC4"; keyMaterial = 16; expandedKeyMaterial = 16; effectiveKeyBytes = 16; IVSize = 0; blockSize = 0; } else if ("DES40_CBC".equals(cipherName)) { this.cipherName = "DES/CBC/NoPadding"; keyMaterial = 5; expandedKeyMaterial = 8; effectiveKeyBytes = 5; IVSize = 8; blockSize = 8; } else if ("DES_CBC".equals(cipherName)) { this.cipherName = "DES/CBC/NoPadding"; keyMaterial = 8; expandedKeyMaterial = 8; effectiveKeyBytes = 7; IVSize = 8; blockSize = 8; } else if ("3DES_EDE_CBC".equals(cipherName)) { this.cipherName = "DESede/CBC/NoPadding"; keyMaterial = 24; expandedKeyMaterial = 24; effectiveKeyBytes = 24; IVSize = 8; blockSize = 8; } else { this.cipherName = cipherName; keyMaterial = 0; expandedKeyMaterial = 0; effectiveKeyBytes = 0; IVSize = 0; blockSize = 0; } if ("MD5".equals(hash)) { this.hmacName = "HmacMD5"; this.hashName = "MD5"; hashSize = 16; } else if ("SHA".equals(hash)) { this.hmacName = "HmacSHA1"; this.hashName = "SHA-1"; hashSize = 20; } else { this.hmacName = null; this.hashName = null; hashSize = 0; } cipherSuiteCode = code; if (this.cipherName != null) { try { Cipher.getInstance(this.cipherName); } catch (GeneralSecurityException e) { supported = false; } } } /** * Returns true if cipher suite is anonymous * @return */ public boolean isAnonymous() { if (keyExchange == KeyExchange_DH_anon || keyExchange == KeyExchange_DH_anon_EXPORT) { return true; } return false; } /** * Returns array of supported CipherSuites * @return */ public static CipherSuite[] getSupported() { return supportedCipherSuites; } /** * Returns array of supported cipher suites names * @return */ public static String[] getSupportedCipherSuiteNames() { return supportedCipherSuiteNames.clone(); } /** * Returns cipher suite name * @return */ public String getName() { return name; } /** * Returns cipher suite code as byte array * @return */ public byte[] toBytes() { return cipherSuiteCode; } /** * Returns cipher suite description */ @Override public String toString() { return name + ": " + cipherSuiteCode[0] + " " + cipherSuiteCode[1]; } /** * Compares this cipher suite to the specified object. */ @Override public boolean equals(Object obj) { if (obj instanceof CipherSuite && this.cipherSuiteCode[0] == ((CipherSuite) obj).cipherSuiteCode[0] && this.cipherSuiteCode[1] == ((CipherSuite) obj).cipherSuiteCode[1]) { return true; } return false; } /** * Returns cipher algorithm name * @return */ public String getBulkEncryptionAlgorithm() { return cipherName; } /** * Returns cipher block size * @return */ public int getBlockSize() { return blockSize; } /** * Returns MAC algorithm name * @return */ public String getHmacName() { return hmacName; } /** * Returns hash algorithm name * @return */ public String getHashName() { return hashName; } /** * Returns hash size * @return */ public int getMACLength() { return hashSize; } /** * Indicates whether this cipher suite is exportable * @return */ public boolean isExportable() { return isExportable; } }
Change Harmony CipherSuite to use JSSE names Change text names of Harmony CipherSuite's (used by SSLEngine and some places with OpenSSL code) to match JSSE names. luni/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java Added StandardName constant for SSL_NULL_WITH_NULL_NULL support/src/test/java/javax/net/ssl/StandardNames.java Marked test as working with above fix, changed to use newly defined constant. luni/src/test/java/javax/net/ssl/SSLSessionTest.java Change-Id: Id48d2adcbbff71306296f1fdf8ff970c618fdcc6
luni/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java
Change Harmony CipherSuite to use JSSE names
<ide><path>uni/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java <ide> static byte[] code_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = { 0x00, 0x1B }; <ide> <ide> static CipherSuite TLS_NULL_WITH_NULL_NULL = new CipherSuite( <del> "TLS_NULL_WITH_NULL_NULL", true, 0, null, null, <add> "SSL_NULL_WITH_NULL_NULL", true, 0, null, null, <ide> code_TLS_NULL_WITH_NULL_NULL); <ide> <ide> static CipherSuite TLS_RSA_WITH_NULL_MD5 = new CipherSuite( <del> "TLS_RSA_WITH_NULL_MD5", true, KeyExchange_RSA, null, "MD5", <add> "SSL_RSA_WITH_NULL_MD5", true, KeyExchange_RSA, null, "MD5", <ide> code_TLS_RSA_WITH_NULL_MD5); <ide> <ide> static CipherSuite TLS_RSA_WITH_NULL_SHA = new CipherSuite( <del> "TLS_RSA_WITH_NULL_SHA", true, KeyExchange_RSA, null, "SHA", <add> "SSL_RSA_WITH_NULL_SHA", true, KeyExchange_RSA, null, "SHA", <ide> code_TLS_RSA_WITH_NULL_SHA); <ide> <ide> static CipherSuite TLS_RSA_EXPORT_WITH_RC4_40_MD5 = new CipherSuite( <del> "TLS_RSA_EXPORT_WITH_RC4_40_MD5", true, KeyExchange_RSA_EXPORT, <add> "SSL_RSA_EXPORT_WITH_RC4_40_MD5", true, KeyExchange_RSA_EXPORT, <ide> "RC4_40", "MD5", code_TLS_RSA_EXPORT_WITH_RC4_40_MD5); <ide> <ide> static CipherSuite TLS_RSA_WITH_RC4_128_MD5 = new CipherSuite( <del> "TLS_RSA_WITH_RC4_128_MD5", false, KeyExchange_RSA, "RC4_128", <add> "SSL_RSA_WITH_RC4_128_MD5", false, KeyExchange_RSA, "RC4_128", <ide> "MD5", code_TLS_RSA_WITH_RC4_128_MD5); <ide> <ide> static CipherSuite TLS_RSA_WITH_RC4_128_SHA = new CipherSuite( <del> "TLS_RSA_WITH_RC4_128_SHA", false, KeyExchange_RSA, "RC4_128", <add> "SSL_RSA_WITH_RC4_128_SHA", false, KeyExchange_RSA, "RC4_128", <ide> "SHA", code_TLS_RSA_WITH_RC4_128_SHA); <ide> <ide> static CipherSuite TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = new CipherSuite( <del> "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5", true, KeyExchange_RSA_EXPORT, <add> "SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5", true, KeyExchange_RSA_EXPORT, <ide> "RC2_CBC_40", "MD5", code_TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5); <ide> <ide> static CipherSuite TLS_RSA_WITH_IDEA_CBC_SHA = new CipherSuite( <ide> "SHA", code_TLS_RSA_WITH_IDEA_CBC_SHA); <ide> <ide> static CipherSuite TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( <del> "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA", true, KeyExchange_RSA_EXPORT, <add> "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", true, KeyExchange_RSA_EXPORT, <ide> "DES40_CBC", "SHA", code_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA); <ide> <ide> static CipherSuite TLS_RSA_WITH_DES_CBC_SHA = new CipherSuite( <del> "TLS_RSA_WITH_DES_CBC_SHA", false, KeyExchange_RSA, "DES_CBC", <add> "SSL_RSA_WITH_DES_CBC_SHA", false, KeyExchange_RSA, "DES_CBC", <ide> "SHA", code_TLS_RSA_WITH_DES_CBC_SHA); <ide> <ide> static CipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA = new CipherSuite( <del> "TLS_RSA_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_RSA, <add> "SSL_RSA_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_RSA, <ide> "3DES_EDE_CBC", "SHA", code_TLS_RSA_WITH_3DES_EDE_CBC_SHA); <ide> <ide> static CipherSuite TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( <del> "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", true, <add> "SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", true, <ide> KeyExchange_DH_DSS_EXPORT, "DES40_CBC", "SHA", <ide> code_TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA); <ide> <ide> "3DES_EDE_CBC", "SHA", code_TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA); <ide> <ide> static CipherSuite TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( <del> "TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", true, <add> "SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", true, <ide> KeyExchange_DH_RSA_EXPORT, "DES40_CBC", "SHA", <ide> code_TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA); <ide> <ide> "3DES_EDE_CBC", "SHA", code_TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA); <ide> <ide> static CipherSuite TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( <del> "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", true, <add> "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", true, <ide> KeyExchange_DHE_DSS_EXPORT, "DES40_CBC", "SHA", <ide> code_TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA); <ide> <ide> static CipherSuite TLS_DHE_DSS_WITH_DES_CBC_SHA = new CipherSuite( <del> "TLS_DHE_DSS_WITH_DES_CBC_SHA", false, KeyExchange_DHE_DSS, <add> "SSL_DHE_DSS_WITH_DES_CBC_SHA", false, KeyExchange_DHE_DSS, <ide> "DES_CBC", "SHA", code_TLS_DHE_DSS_WITH_DES_CBC_SHA); <ide> <ide> static CipherSuite TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = new CipherSuite( <del> "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DHE_DSS, <add> "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DHE_DSS, <ide> "3DES_EDE_CBC", "SHA", code_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA); <ide> <ide> static CipherSuite TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( <del> "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", true, <add> "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", true, <ide> KeyExchange_DHE_RSA_EXPORT, "DES40_CBC", "SHA", <ide> code_TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA); <ide> <ide> static CipherSuite TLS_DHE_RSA_WITH_DES_CBC_SHA = new CipherSuite( <del> "TLS_DHE_RSA_WITH_DES_CBC_SHA", false, KeyExchange_DHE_RSA, <add> "SSL_DHE_RSA_WITH_DES_CBC_SHA", false, KeyExchange_DHE_RSA, <ide> "DES_CBC", "SHA", code_TLS_DHE_RSA_WITH_DES_CBC_SHA); <ide> <ide> static CipherSuite TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = new CipherSuite( <del> "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DHE_RSA, <add> "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DHE_RSA, <ide> "3DES_EDE_CBC", "SHA", code_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA); <ide> <ide> static CipherSuite TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = new CipherSuite( <del> "TLS_DH_anon_EXPORT_WITH_RC4_40_MD5", true, <add> "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", true, <ide> KeyExchange_DH_anon_EXPORT, "RC4_40", "MD5", <ide> code_TLS_DH_anon_EXPORT_WITH_RC4_40_MD5); <ide> <ide> static CipherSuite TLS_DH_anon_WITH_RC4_128_MD5 = new CipherSuite( <del> "TLS_DH_anon_WITH_RC4_128_MD5", false, KeyExchange_DH_anon, <add> "SSL_DH_anon_WITH_RC4_128_MD5", false, KeyExchange_DH_anon, <ide> "RC4_128", "MD5", code_TLS_DH_anon_WITH_RC4_128_MD5); <ide> <ide> static CipherSuite TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = new CipherSuite( <del> "TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA", true, <add> "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", true, <ide> KeyExchange_DH_anon_EXPORT, "DES40_CBC", "SHA", <ide> code_TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA); <ide> <ide> static CipherSuite TLS_DH_anon_WITH_DES_CBC_SHA = new CipherSuite( <del> "TLS_DH_anon_WITH_DES_CBC_SHA", false, KeyExchange_DH_anon, <add> "SSL_DH_anon_WITH_DES_CBC_SHA", false, KeyExchange_DH_anon, <ide> "DES_CBC", "SHA", code_TLS_DH_anon_WITH_DES_CBC_SHA); <ide> <ide> static CipherSuite TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = new CipherSuite( <del> "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DH_anon, <add> "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", false, KeyExchange_DH_anon, <ide> "3DES_EDE_CBC", "SHA", code_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA); <ide> <ide> // array for quick access to cipher suite by code
Java
apache-2.0
50148187731de0a7e8bc1da3ebe7bdba5fabd766
0
samgurtman/LeanSecurity
import leansecurity.acl.exception.LacksPermissionException; import leansecurity.acl.exception.LacksRoleException; import leansecurity.acl.exception.NotLogggedInException; import leansecurity.aspects.SecurityEvaluator; import leansecurity.filters.SecurityFilter; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mindrot.jbcrypt.BCrypt; import store.InMemoryPermissionStore; import store.InMemoryRoleStore; import store.InMemoryTokenStore; import store.InMemoryUserStore; import java.time.Duration; import java.util.Collections; import java.util.UUID; import static org.junit.Assert.fail; /** * tests for security evaluator */ public class EvaluatorTests { private InMemoryUserStore userStore = new InMemoryUserStore(); private InMemoryTokenStore tokenStore = new InMemoryTokenStore(); private SecurityFilter filter; private SecurityEvaluator securityEvaluator; @Before public void setup(){ InMemoryUserStore.InMemoryUser user = new InMemoryUserStore.InMemoryUser(); user.setId(UUID.randomUUID().toString()); user.setPasswordHash(BCrypt.hashpw("password",BCrypt.gensalt())); user.setUsername("test"); user.setRoles(Collections.singleton("testrole")); user.addPermission("type", "id", "permission"); userStore.addUser(user); this.filter = new SecurityFilter(tokenStore, userStore); this.securityEvaluator = new SecurityEvaluator(filter, new InMemoryRoleStore(), new InMemoryPermissionStore()); } @Test public void testGetLoggedInUser(){ Assert.assertNull(filter.getLoggedInUser()); loginStandardUser(); Assert.assertNotNull(filter.getLoggedInUser()); Assert.assertEquals(filter.getLoggedInUser().getUsername(), "test"); } @Test public void testLoggedInEvaluator() { try { securityEvaluator.evaluateLoggedIn(); fail("Should throw UserNotLoggedInException"); } catch (NotLogggedInException ignore) { } loginStandardUser(); securityEvaluator.evaluateLoggedIn(); } @Test public void testRoleEvaluator(){ try{ securityEvaluator.evaluateRole("testrole"); fail("Should throw UserNotLoggedInException"); } catch (NotLogggedInException ignore) { } loginStandardUser(); try{ securityEvaluator.evaluateRole("testrole2"); fail("Should throw LacksRoleException"); } catch (LacksRoleException ignore) { } securityEvaluator.evaluateRole("testrole"); } @Test public void testPermissionEvaluator(){ try{ securityEvaluator.evaluatePermission("type","id","permission"); fail("Should throw UserNotLoggedInException"); }catch(NotLogggedInException ignore){} loginStandardUser(); try{ securityEvaluator.evaluatePermission("type","id","permission2"); fail("Should throw LacksPermissionException"); }catch(LacksPermissionException ignore){} try{ securityEvaluator.evaluatePermission("type2","id","permission"); fail("Should throw LacksPermissionException"); }catch(LacksPermissionException ignore){} try{ securityEvaluator.evaluatePermission("type","id2","permission"); fail("Should throw LacksPermissionException"); }catch(LacksPermissionException ignore){} securityEvaluator.evaluatePermission("type","id","permission"); } private void loginStandardUser(){ filter.login("test", "password", Duration.ofHours(1), Duration.ofHours(2)); } }
core/src/test/java/EvaluatorTests.java
import leansecurity.acl.exception.LacksPermissionException; import leansecurity.acl.exception.LacksRoleException; import leansecurity.acl.exception.NotLogggedInException; import leansecurity.aspects.SecurityEvaluator; import leansecurity.filters.SecurityFilter; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mindrot.jbcrypt.BCrypt; import store.InMemoryPermissionStore; import store.InMemoryRoleStore; import store.InMemoryTokenStore; import store.InMemoryUserStore; import java.time.Duration; import java.util.Collections; import java.util.UUID; import static org.junit.Assert.fail; /** * Created by sam on 12/06/16. */ public class EvaluatorTests { private InMemoryUserStore userStore = new InMemoryUserStore(); private InMemoryTokenStore tokenStore = new InMemoryTokenStore(); private SecurityFilter filter; private SecurityEvaluator securityEvaluator; @Before public void setup(){ InMemoryUserStore.InMemoryUser user = new InMemoryUserStore.InMemoryUser(); user.setId(UUID.randomUUID().toString()); user.setPasswordHash(BCrypt.hashpw("password",BCrypt.gensalt())); user.setUsername("test"); user.setRoles(Collections.singleton("testrole")); user.addPermission("type", "id", "permission"); userStore.addUser(user); this.filter = new SecurityFilter(tokenStore, userStore); this.securityEvaluator = new SecurityEvaluator(filter, new InMemoryRoleStore(), new InMemoryPermissionStore()); } @Test public void testGetLoggedInUser(){ Assert.assertNull(filter.getLoggedInUser()); loginStandardUser(); Assert.assertNotNull(filter.getLoggedInUser()); Assert.assertEquals(filter.getLoggedInUser().getUsername(), "test"); } @Test public void testLoggedInEvaluator() { try { securityEvaluator.evaluateLoggedIn(); fail("Should throw UserNotLoggedInException"); } catch (NotLogggedInException ignore) { } loginStandardUser(); securityEvaluator.evaluateLoggedIn(); } @Test public void testRoleEvaluator(){ try{ securityEvaluator.evaluateRole("testrole"); fail("Should throw UserNotLoggedInException"); } catch (NotLogggedInException ignore) { } loginStandardUser(); try{ securityEvaluator.evaluateRole("testrole2"); fail("Should throw LacksRoleException"); } catch (LacksRoleException ignore) { } securityEvaluator.evaluateRole("testrole"); } @Test public void testPermissionEvaluator(){ try{ securityEvaluator.evaluatePermission("type","id","permission"); fail("Should throw UserNotLoggedInException"); }catch(NotLogggedInException ignore){} loginStandardUser(); try{ securityEvaluator.evaluatePermission("type","id","permission2"); fail("Should throw LacksPermissionException"); }catch(LacksPermissionException ignore){} try{ securityEvaluator.evaluatePermission("type2","id","permission"); fail("Should throw LacksPermissionException"); }catch(LacksPermissionException ignore){} try{ securityEvaluator.evaluatePermission("type","id2","permission"); fail("Should throw LacksPermissionException"); }catch(LacksPermissionException ignore){} securityEvaluator.evaluatePermission("type","id","permission"); } private void loginStandardUser(){ filter.login("test", "password", Duration.ofHours(1), Duration.ofHours(2)); } }
LS-2 Renamed file
core/src/test/java/EvaluatorTests.java
LS-2
<ide><path>ore/src/test/java/EvaluatorTests.java <ide> import static org.junit.Assert.fail; <ide> <ide> /** <del> * Created by sam on 12/06/16. <add> * tests for security evaluator <ide> */ <ide> public class EvaluatorTests { <ide> private InMemoryUserStore userStore = new InMemoryUserStore();
Java
apache-2.0
e4cb163be2dc6cf6bd417acd62d3cc4e74f7473b
0
Apache9/netty,tbrooks8/netty,skyao/netty,s-gheldd/netty,mcobrien/netty,ngocdaothanh/netty,bryce-anderson/netty,kiril-me/netty,s-gheldd/netty,Apache9/netty,skyao/netty,KatsuraKKKK/netty,netty/netty,NiteshKant/netty,Techcable/netty,jchambers/netty,Apache9/netty,maliqq/netty,SinaTadayon/netty,mikkokar/netty,artgon/netty,jongyeol/netty,andsel/netty,fenik17/netty,ejona86/netty,fenik17/netty,Spikhalskiy/netty,tbrooks8/netty,Scottmitch/netty,jongyeol/netty,netty/netty,golovnin/netty,zer0se7en/netty,ichaki5748/netty,andsel/netty,johnou/netty,andsel/netty,carl-mastrangelo/netty,NiteshKant/netty,ichaki5748/netty,Squarespace/netty,idelpivnitskiy/netty,windie/netty,louxiu/netty,jchambers/netty,cnoldtree/netty,tbrooks8/netty,bryce-anderson/netty,NiteshKant/netty,KatsuraKKKK/netty,windie/netty,SinaTadayon/netty,luyiisme/netty,netty/netty,artgon/netty,doom369/netty,SinaTadayon/netty,mikkokar/netty,jchambers/netty,yrcourage/netty,Techcable/netty,idelpivnitskiy/netty,ngocdaothanh/netty,artgon/netty,jongyeol/netty,johnou/netty,skyao/netty,joansmith/netty,mx657649013/netty,bryce-anderson/netty,Spikhalskiy/netty,johnou/netty,windie/netty,carl-mastrangelo/netty,s-gheldd/netty,cnoldtree/netty,bryce-anderson/netty,kiril-me/netty,joansmith/netty,maliqq/netty,ejona86/netty,ichaki5748/netty,KatsuraKKKK/netty,tbrooks8/netty,Squarespace/netty,fengjiachun/netty,Spikhalskiy/netty,fenik17/netty,golovnin/netty,fengjiachun/netty,Squarespace/netty,Apache9/netty,andsel/netty,Scottmitch/netty,louxiu/netty,johnou/netty,doom369/netty,mx657649013/netty,Scottmitch/netty,idelpivnitskiy/netty,fengjiachun/netty,gerdriesselmann/netty,idelpivnitskiy/netty,ichaki5748/netty,artgon/netty,ejona86/netty,s-gheldd/netty,luyiisme/netty,carl-mastrangelo/netty,mx657649013/netty,mikkokar/netty,zer0se7en/netty,maliqq/netty,yrcourage/netty,netty/netty,Scottmitch/netty,artgon/netty,Techcable/netty,mx657649013/netty,gerdriesselmann/netty,KatsuraKKKK/netty,jchambers/netty,mx657649013/netty,KatsuraKKKK/netty,louxiu/netty,fengjiachun/netty,tbrooks8/netty,fenik17/netty,yrcourage/netty,carl-mastrangelo/netty,NiteshKant/netty,luyiisme/netty,jongyeol/netty,zer0se7en/netty,mcobrien/netty,doom369/netty,gerdriesselmann/netty,Squarespace/netty,andsel/netty,gerdriesselmann/netty,carl-mastrangelo/netty,Spikhalskiy/netty,louxiu/netty,ngocdaothanh/netty,maliqq/netty,Squarespace/netty,Scottmitch/netty,cnoldtree/netty,fenik17/netty,bryce-anderson/netty,luyiisme/netty,yrcourage/netty,mikkokar/netty,yrcourage/netty,netty/netty,SinaTadayon/netty,golovnin/netty,blucas/netty,Techcable/netty,s-gheldd/netty,mcobrien/netty,luyiisme/netty,joansmith/netty,skyao/netty,blucas/netty,jchambers/netty,blucas/netty,johnou/netty,zer0se7en/netty,Spikhalskiy/netty,doom369/netty,golovnin/netty,mikkokar/netty,NiteshKant/netty,gerdriesselmann/netty,doom369/netty,mcobrien/netty,SinaTadayon/netty,ngocdaothanh/netty,ejona86/netty,windie/netty,ichaki5748/netty,joansmith/netty,windie/netty,skyao/netty,kiril-me/netty,mcobrien/netty,jongyeol/netty,cnoldtree/netty,blucas/netty,blucas/netty,zer0se7en/netty,ejona86/netty,maliqq/netty,kiril-me/netty,kiril-me/netty,cnoldtree/netty,joansmith/netty,idelpivnitskiy/netty,louxiu/netty,Apache9/netty,Techcable/netty,fengjiachun/netty,ngocdaothanh/netty,golovnin/netty
/* * Copyright 2012 The Netty Project * * The Netty Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package io.netty.channel; import io.netty.buffer.ByteBuf; import io.netty.util.concurrent.DefaultEventExecutorGroup; import io.netty.util.concurrent.EventExecutor; import io.netty.util.concurrent.EventExecutorGroup; import java.net.ConnectException; import java.net.SocketAddress; import java.nio.ByteBuffer; import java.nio.channels.SocketChannel; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.NoSuchElementException; /** * A list of {@link ChannelHandler}s which handles or intercepts inbound events and outbound operations of a * {@link Channel}. {@link ChannelPipeline} implements an advanced form of the * <a href="http://www.oracle.com/technetwork/java/interceptingfilter-142169.html">Intercepting Filter</a> pattern * to give a user full control over how an event is handled and how the {@link ChannelHandler}s in a pipeline * interact with each other. * * <h3>Creation of a pipeline</h3> * * Each channel has its own pipeline and it is created automatically when a new channel is created. * * <h3>How an event flows in a pipeline</h3> * * The following diagram describes how I/O events are processed by {@link ChannelHandler}s in a {@link ChannelPipeline} * typically. An I/O event is handled by either a {@link ChannelInboundHandler} or a {@link ChannelOutboundHandler} * and be forwarded to its closest handler by calling the event propagation methods defined in * {@link ChannelHandlerContext}, such as {@link ChannelHandlerContext#fireChannelRead(Object)} and * {@link ChannelHandlerContext#write(Object)}. * * <pre> * I/O Request * via {@link Channel} or * {@link ChannelHandlerContext} * | * +---------------------------------------------------+---------------+ * | ChannelPipeline | | * | \|/ | * | +---------------------+ +-----------+----------+ | * | | Inbound Handler N | | Outbound Handler 1 | | * | +----------+----------+ +-----------+----------+ | * | /|\ | | * | | \|/ | * | +----------+----------+ +-----------+----------+ | * | | Inbound Handler N-1 | | Outbound Handler 2 | | * | +----------+----------+ +-----------+----------+ | * | /|\ . | * | . . | * | ChannelHandlerContext.fireIN_EVT() ChannelHandlerContext.OUT_EVT()| * | [ method call] [method call] | * | . . | * | . \|/ | * | +----------+----------+ +-----------+----------+ | * | | Inbound Handler 2 | | Outbound Handler M-1 | | * | +----------+----------+ +-----------+----------+ | * | /|\ | | * | | \|/ | * | +----------+----------+ +-----------+----------+ | * | | Inbound Handler 1 | | Outbound Handler M | | * | +----------+----------+ +-----------+----------+ | * | /|\ | | * +---------------+-----------------------------------+---------------+ * | \|/ * +---------------+-----------------------------------+---------------+ * | | | | * | [ Socket.read() ] [ Socket.write() ] | * | | * | Netty Internal I/O Threads (Transport Implementation) | * +-------------------------------------------------------------------+ * </pre> * An inbound event is handled by the inbound handlers in the bottom-up direction as shown on the left side of the * diagram. An inbound handler usually handles the inbound data generated by the I/O thread on the bottom of the * diagram. The inbound data is often read from a remote peer via the actual input operation such as * {@link SocketChannel#read(ByteBuffer)}. If an inbound event goes beyond the top inbound handler, it is discarded * silently, or logged if it needs your attention. * <p> * An outbound event is handled by the outbound handler in the top-down direction as shown on the right side of the * diagram. An outbound handler usually generates or transforms the outbound traffic such as write requests. * If an outbound event goes beyond the bottom outbound handler, it is handled by an I/O thread associated with the * {@link Channel}. The I/O thread often performs the actual output operation such as * {@link SocketChannel#write(ByteBuffer)}. * <p> * For example, let us assume that we created the following pipeline: * <pre> * {@link ChannelPipeline} p = ...; * p.addLast("1", new InboundHandlerA()); * p.addLast("2", new InboundHandlerB()); * p.addLast("3", new OutboundHandlerA()); * p.addLast("4", new OutboundHandlerB()); * p.addLast("5", new InboundOutboundHandlerX()); * </pre> * In the example above, the class whose name starts with {@code Inbound} means it is an inbound handler. * The class whose name starts with {@code Outbound} means it is a outbound handler. * <p> * In the given example configuration, the handler evaluation order is 1, 2, 3, 4, 5 when an event goes inbound. * When an event goes outbound, the order is 5, 4, 3, 2, 1. On top of this principle, {@link ChannelPipeline} skips * the evaluation of certain handlers to shorten the stack depth: * <ul> * <li>3 and 4 don't implement {@link ChannelInboundHandler}, and therefore the actual evaluation order of an inbound * event will be: 1, 2, and 5.</li> * <li>1 and 2 don't implement {@link ChannelOutboundHandler}, and therefore the actual evaluation order of a * outbound event will be: 5, 4, and 3.</li> * <li>If 5 implements both {@link ChannelInboundHandler} and {@link ChannelOutboundHandler}, the evaluation order of * an inbound and a outbound event could be 125 and 543 respectively.</li> * </ul> * * <h3>Forwarding an event to the next handler</h3> * * As you might noticed in the diagram shows, a handler has to invoke the event propagation methods in * {@link ChannelHandlerContext} to forward an event to its next handler. Those methods include: * <ul> * <li>Inbound event propagation methods: * <ul> * <li>{@link ChannelHandlerContext#fireChannelRegistered()}</li> * <li>{@link ChannelHandlerContext#fireChannelActive()}</li> * <li>{@link ChannelHandlerContext#fireChannelRead(Object)}</li> * <li>{@link ChannelHandlerContext#fireChannelReadComplete()}</li> * <li>{@link ChannelHandlerContext#fireExceptionCaught(Throwable)}</li> * <li>{@link ChannelHandlerContext#fireUserEventTriggered(Object)}</li> * <li>{@link ChannelHandlerContext#fireChannelWritabilityChanged()}</li> * <li>{@link ChannelHandlerContext#fireChannelInactive()}</li> * <li>{@link ChannelHandlerContext#fireChannelUnregistered()}</li> * </ul> * </li> * <li>Outbound event propagation methods: * <ul> * <li>{@link ChannelHandlerContext#bind(SocketAddress, ChannelPromise)}</li> * <li>{@link ChannelHandlerContext#connect(SocketAddress, SocketAddress, ChannelPromise)}</li> * <li>{@link ChannelHandlerContext#write(Object, ChannelPromise)}</li> * <li>{@link ChannelHandlerContext#flush()}</li> * <li>{@link ChannelHandlerContext#read()}</li> * <li>{@link ChannelHandlerContext#disconnect(ChannelPromise)}</li> * <li>{@link ChannelHandlerContext#close(ChannelPromise)}</li> * <li>{@link ChannelHandlerContext#deregister(ChannelPromise)}</li> * </ul> * </li> * </ul> * * and the following example shows how the event propagation is usually done: * * <pre> * public class MyInboundHandler extends {@link ChannelInboundHandlerAdapter} { * {@code @Override} * public void channelActive({@link ChannelHandlerContext} ctx) { * System.out.println("Connected!"); * ctx.fireChannelActive(); * } * } * * public clas MyOutboundHandler extends {@link ChannelOutboundHandlerAdapter} { * {@code @Override} * public void close({@link ChannelHandlerContext} ctx, {@link ChannelPromise} promise) { * System.out.println("Closing .."); * ctx.close(promise); * } * } * </pre> * * <h3>Building a pipeline</h3> * <p> * A user is supposed to have one or more {@link ChannelHandler}s in a pipeline to receive I/O events (e.g. read) and * to request I/O operations (e.g. write and close). For example, a typical server will have the following handlers * in each channel's pipeline, but your mileage may vary depending on the complexity and characteristics of the * protocol and business logic: * * <ol> * <li>Protocol Decoder - translates binary data (e.g. {@link ByteBuf}) into a Java object.</li> * <li>Protocol Encoder - translates a Java object into binary data.</li> * <li>Business Logic Handler - performs the actual business logic (e.g. database access).</li> * </ol> * * and it could be represented as shown in the following example: * * <pre> * static final {@link EventExecutorGroup} group = new {@link DefaultEventExecutorGroup}(16); * ... * * {@link ChannelPipeline} pipeline = ch.pipeline(); * * pipeline.addLast("decoder", new MyProtocolDecoder()); * pipeline.addLast("encoder", new MyProtocolEncoder()); * * // Tell the pipeline to run MyBusinessLogicHandler's event handler methods * // in a different thread than an I/O thread so that the I/O thread is not blocked by * // a time-consuming task. * // If your business logic is fully asynchronous or finished very quickly, you don't * // need to specify a group. * pipeline.addLast(group, "handler", new MyBusinessLogicHandler()); * </pre> * * <h3>Thread safety</h3> * <p> * A {@link ChannelHandler} can be added or removed at any time because a {@link ChannelPipeline} is thread safe. * For example, you can insert an encryption handler when sensitive information is about to be exchanged, and remove it * after the exchange. */ public interface ChannelPipeline extends Iterable<Entry<String, ChannelHandler>> { /** * Inserts a {@link ChannelHandler} at the first position of this pipeline. * * @param name the name of the handler to insert first. {@code null} to let the name auto-generated. * @param handler the handler to insert first * * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified handler is {@code null} */ ChannelPipeline addFirst(String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} at the first position of this pipeline. * * @param group the {@link EventExecutorGroup} which will be used to execute the {@link ChannelHandler} * methods * @param name the name of the handler to insert first. {@code null} to let the name auto-generated. * @param handler the handler to insert first * * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified handler is {@code null} */ ChannelPipeline addFirst(EventExecutorGroup group, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} at the first position of this pipeline. * * @param invoker the {@link ChannelHandlerInvoker} which invokes the {@code handler}s event handler methods * @param name the name of the handler to insert first. {@code null} to let the name auto-generated. * @param handler the handler to insert first * * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified handler is {@code null} */ ChannelPipeline addFirst(ChannelHandlerInvoker invoker, String name, ChannelHandler handler); /** * Appends a {@link ChannelHandler} at the last position of this pipeline. * * @param name the name of the handler to append. {@code null} to let the name auto-generated. * @param handler the handler to append * * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified handler is {@code null} */ ChannelPipeline addLast(String name, ChannelHandler handler); /** * Appends a {@link ChannelHandler} at the last position of this pipeline. * * @param group the {@link EventExecutorGroup} which will be used to execute the {@link ChannelHandler} * methods * @param name the name of the handler to append. {@code null} to let the name auto-generated. * @param handler the handler to append * * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified handler is {@code null} */ ChannelPipeline addLast(EventExecutorGroup group, String name, ChannelHandler handler); /** * Appends a {@link ChannelHandler} at the last position of this pipeline. * * @param invoker the {@link ChannelHandlerInvoker} which invokes the {@code handler}s event handler methods * @param name the name of the handler to append. {@code null} to let the name auto-generated. * @param handler the handler to append * * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified handler is {@code null} */ ChannelPipeline addLast(ChannelHandlerInvoker invoker, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} before an existing handler of this * pipeline. * * @param baseName the name of the existing handler * @param name the name of the handler to insert before. {@code null} to let the name auto-generated. * @param handler the handler to insert before * * @throws NoSuchElementException * if there's no such entry with the specified {@code baseName} * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified baseName or handler is {@code null} */ ChannelPipeline addBefore(String baseName, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} before an existing handler of this * pipeline. * * @param group the {@link EventExecutorGroup} which will be used to execute the {@link ChannelHandler} * methods * @param baseName the name of the existing handler * @param name the name of the handler to insert before. {@code null} to let the name auto-generated. * @param handler the handler to insert before * * @throws NoSuchElementException * if there's no such entry with the specified {@code baseName} * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified baseName or handler is {@code null} */ ChannelPipeline addBefore(EventExecutorGroup group, String baseName, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} before an existing handler of this * pipeline. * * @param invoker the {@link ChannelHandlerInvoker} which invokes the {@code handler}s event handler methods * @param baseName the name of the existing handler * @param name the name of the handler to insert before. {@code null} to let the name auto-generated. * @param handler the handler to insert before * * @throws NoSuchElementException * if there's no such entry with the specified {@code baseName} * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified baseName or handler is {@code null} */ ChannelPipeline addBefore(ChannelHandlerInvoker invoker, String baseName, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} after an existing handler of this * pipeline. * * @param baseName the name of the existing handler * @param name the name of the handler to insert after. {@code null} to let the name auto-generated. * @param handler the handler to insert after * * @throws NoSuchElementException * if there's no such entry with the specified {@code baseName} * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified baseName or handler is {@code null} */ ChannelPipeline addAfter(String baseName, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} after an existing handler of this * pipeline. * * @param group the {@link EventExecutorGroup} which will be used to execute the {@link ChannelHandler} * methods * @param baseName the name of the existing handler * @param name the name of the handler to insert after. {@code null} to let the name auto-generated. * @param handler the handler to insert after * * @throws NoSuchElementException * if there's no such entry with the specified {@code baseName} * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified baseName or handler is {@code null} */ ChannelPipeline addAfter(EventExecutorGroup group, String baseName, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} after an existing handler of this * pipeline. * * @param invoker the {@link ChannelHandlerInvoker} which invokes the {@code handler}s event handler methods * @param baseName the name of the existing handler * @param name the name of the handler to insert after. {@code null} to let the name auto-generated. * @param handler the handler to insert after * * @throws NoSuchElementException * if there's no such entry with the specified {@code baseName} * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified baseName or handler is {@code null} */ ChannelPipeline addAfter(ChannelHandlerInvoker invoker, String baseName, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler}s at the first position of this pipeline. * * @param handlers the handlers to insert first * */ ChannelPipeline addFirst(ChannelHandler... handlers); /** * Inserts a {@link ChannelHandler}s at the first position of this pipeline. * * @param group the {@link EventExecutorGroup} which will be used to execute the {@link ChannelHandler}s * methods. * @param handlers the handlers to insert first * */ ChannelPipeline addFirst(EventExecutorGroup group, ChannelHandler... handlers); /** * Inserts a {@link ChannelHandler}s at the first position of this pipeline. * * @param invoker the {@link ChannelHandlerInvoker} which invokes the {@code handler}s event handler methods * @param handlers the handlers to insert first * */ ChannelPipeline addFirst(ChannelHandlerInvoker invoker, ChannelHandler... handlers); /** * Inserts a {@link ChannelHandler}s at the last position of this pipeline. * * @param handlers the handlers to insert last * */ ChannelPipeline addLast(ChannelHandler... handlers); /** * Inserts a {@link ChannelHandler}s at the last position of this pipeline. * * @param group the {@link EventExecutorGroup} which will be used to execute the {@link ChannelHandler}s * methods. * @param handlers the handlers to insert last * */ ChannelPipeline addLast(EventExecutorGroup group, ChannelHandler... handlers); /** * Inserts a {@link ChannelHandler}s at the last position of this pipeline. * * @param invoker the {@link ChannelHandlerInvoker} which invokes the {@code handler}s event handler methods * @param handlers the handlers to insert last * */ ChannelPipeline addLast(ChannelHandlerInvoker invoker, ChannelHandler... handlers); /** * Removes the specified {@link ChannelHandler} from this pipeline. * * @param handler the {@link ChannelHandler} to remove * * @throws NoSuchElementException * if there's no such handler in this pipeline * @throws NullPointerException * if the specified handler is {@code null} */ ChannelPipeline remove(ChannelHandler handler); /** * Removes the {@link ChannelHandler} with the specified name from this pipeline. * * @param name the name under which the {@link ChannelHandler} was stored. * * @return the removed handler * * @throws NoSuchElementException * if there's no such handler with the specified name in this pipeline * @throws NullPointerException * if the specified name is {@code null} */ ChannelHandler remove(String name); /** * Removes the {@link ChannelHandler} of the specified type from this pipeline. * * @param <T> the type of the handler * @param handlerType the type of the handler * * @return the removed handler * * @throws NoSuchElementException * if there's no such handler of the specified type in this pipeline * @throws NullPointerException * if the specified handler type is {@code null} */ <T extends ChannelHandler> T remove(Class<T> handlerType); /** * Removes the first {@link ChannelHandler} in this pipeline. * * @return the removed handler * * @throws NoSuchElementException * if this pipeline is empty */ ChannelHandler removeFirst(); /** * Removes the last {@link ChannelHandler} in this pipeline. * * @return the removed handler * * @throws NoSuchElementException * if this pipeline is empty */ ChannelHandler removeLast(); /** * Replaces the specified {@link ChannelHandler} with a new handler in this pipeline. * * @param oldHandler the {@link ChannelHandler} to be replaced * @param newName the name under which the replacement should be added. * {@code null} to use the same name with the handler being replaced. * @param newHandler the {@link ChannelHandler} which is used as replacement * * @return itself * @throws NoSuchElementException * if the specified old handler does not exist in this pipeline * @throws IllegalArgumentException * if a handler with the specified new name already exists in this * pipeline, except for the handler to be replaced * @throws NullPointerException * if the specified old handler or new handler is {@code null} */ ChannelPipeline replace(ChannelHandler oldHandler, String newName, ChannelHandler newHandler); /** * Replaces the {@link ChannelHandler} of the specified name with a new handler in this pipeline. * * @param oldName the name of the {@link ChannelHandler} to be replaced * @param newName the name under which the replacement should be added. * {@code null} to use the same name with the handler being replaced. * @param newHandler the {@link ChannelHandler} which is used as replacement * * @return the removed handler * * @throws NoSuchElementException * if the handler with the specified old name does not exist in this pipeline * @throws IllegalArgumentException * if a handler with the specified new name already exists in this * pipeline, except for the handler to be replaced * @throws NullPointerException * if the specified old handler or new handler is {@code null} */ ChannelHandler replace(String oldName, String newName, ChannelHandler newHandler); /** * Replaces the {@link ChannelHandler} of the specified type with a new handler in this pipeline. * * @param oldHandlerType the type of the handler to be removed * @param newName the name under which the replacement should be added. * {@code null} to use the same name with the handler being replaced. * @param newHandler the {@link ChannelHandler} which is used as replacement * * @return the removed handler * * @throws NoSuchElementException * if the handler of the specified old handler type does not exist * in this pipeline * @throws IllegalArgumentException * if a handler with the specified new name already exists in this * pipeline, except for the handler to be replaced * @throws NullPointerException * if the specified old handler or new handler is {@code null} */ <T extends ChannelHandler> T replace(Class<T> oldHandlerType, String newName, ChannelHandler newHandler); /** * Returns the first {@link ChannelHandler} in this pipeline. * * @return the first handler. {@code null} if this pipeline is empty. */ ChannelHandler first(); /** * Returns the context of the first {@link ChannelHandler} in this pipeline. * * @return the context of the first handler. {@code null} if this pipeline is empty. */ ChannelHandlerContext firstContext(); /** * Returns the last {@link ChannelHandler} in this pipeline. * * @return the last handler. {@code null} if this pipeline is empty. */ ChannelHandler last(); /** * Returns the context of the last {@link ChannelHandler} in this pipeline. * * @return the context of the last handler. {@code null} if this pipeline is empty. */ ChannelHandlerContext lastContext(); /** * Returns the {@link ChannelHandler} with the specified name in this * pipeline. * * @return the handler with the specified name. * {@code null} if there's no such handler in this pipeline. */ ChannelHandler get(String name); /** * Returns the {@link ChannelHandler} of the specified type in this * pipeline. * * @return the handler of the specified handler type. * {@code null} if there's no such handler in this pipeline. */ <T extends ChannelHandler> T get(Class<T> handlerType); /** * Returns the context object of the specified {@link ChannelHandler} in * this pipeline. * * @return the context object of the specified handler. * {@code null} if there's no such handler in this pipeline. */ ChannelHandlerContext context(ChannelHandler handler); /** * Returns the context object of the {@link ChannelHandler} with the * specified name in this pipeline. * * @return the context object of the handler with the specified name. * {@code null} if there's no such handler in this pipeline. */ ChannelHandlerContext context(String name); /** * Returns the context object of the {@link ChannelHandler} of the * specified type in this pipeline. * * @return the context object of the handler of the specified type. * {@code null} if there's no such handler in this pipeline. */ ChannelHandlerContext context(Class<? extends ChannelHandler> handlerType); /** * Returns the {@link Channel} that this pipeline is attached to. * * @return the channel. {@code null} if this pipeline is not attached yet. */ Channel channel(); /** * Returns the {@link List} of the handler names. */ List<String> names(); /** * Converts this pipeline into an ordered {@link Map} whose keys are * handler names and whose values are handlers. */ Map<String, ChannelHandler> toMap(); /** * A {@link Channel} was registered to its {@link EventLoop}. * * This will result in having the {@link ChannelInboundHandler#channelRegistered(ChannelHandlerContext)} method * called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline fireChannelRegistered(); /** * A {@link Channel} was unregistered from its {@link EventLoop}. * * This will result in having the {@link ChannelInboundHandler#channelUnregistered(ChannelHandlerContext)} method * called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline fireChannelUnregistered(); /** * A {@link Channel} is active now, which means it is connected. * * This will result in having the {@link ChannelInboundHandler#channelActive(ChannelHandlerContext)} method * called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline fireChannelActive(); /** * A {@link Channel} is inactive now, which means it is closed. * * This will result in having the {@link ChannelInboundHandler#channelInactive(ChannelHandlerContext)} method * called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline fireChannelInactive(); /** * A {@link Channel} received an {@link Throwable} in one of its inbound operations. * * This will result in having the {@link ChannelInboundHandler#exceptionCaught(ChannelHandlerContext, Throwable)} * method called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline fireExceptionCaught(Throwable cause); /** * A {@link Channel} received an user defined event. * * This will result in having the {@link ChannelInboundHandler#userEventTriggered(ChannelHandlerContext, Object)} * method called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline fireUserEventTriggered(Object event); /** * A {@link Channel} received a message. * * This will result in having the {@link ChannelInboundHandler#channelRead(ChannelHandlerContext, Object)} * method called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline fireChannelRead(Object msg); /** * Triggers an {@link ChannelInboundHandler#channelReadComplete(ChannelHandlerContext)} * event to the next {@link ChannelInboundHandler} in the {@link ChannelPipeline}. */ ChannelPipeline fireChannelReadComplete(); /** * Triggers an {@link ChannelInboundHandler#channelWritabilityChanged(ChannelHandlerContext)} * event to the next {@link ChannelInboundHandler} in the {@link ChannelPipeline}. */ ChannelPipeline fireChannelWritabilityChanged(); /** * Request to bind to the given {@link SocketAddress} and notify the {@link ChannelFuture} once the operation * completes, either because the operation was successful or because of an error. * <p> * This will result in having the * {@link ChannelOutboundHandler#bind(ChannelHandlerContext, SocketAddress, ChannelPromise)} method * called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture bind(SocketAddress localAddress); /** * Request to connect to the given {@link SocketAddress} and notify the {@link ChannelFuture} once the operation * completes, either because the operation was successful or because of an error. * <p> * If the connection fails because of a connection timeout, the {@link ChannelFuture} will get failed with * a {@link ConnectTimeoutException}. If it fails because of connection refused a {@link ConnectException} * will be used. * <p> * This will result in having the * {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture connect(SocketAddress remoteAddress); /** * Request to connect to the given {@link SocketAddress} while bind to the localAddress and notify the * {@link ChannelFuture} once the operation completes, either because the operation was successful or because of * an error. * <p> * This will result in having the * {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress); /** * Request to disconnect from the remote peer and notify the {@link ChannelFuture} once the operation completes, * either because the operation was successful or because of an error. * <p> * This will result in having the * {@link ChannelOutboundHandler#disconnect(ChannelHandlerContext, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture disconnect(); /** * Request to close the {@link Channel} and notify the {@link ChannelFuture} once the operation completes, * either because the operation was successful or because of * an error. * * After it is closed it is not possible to reuse it again. * <p> * This will result in having the * {@link ChannelOutboundHandler#close(ChannelHandlerContext, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture close(); /** * Request to deregister the {@link Channel} from the previous assigned {@link EventExecutor} and notify the * {@link ChannelFuture} once the operation completes, either because the operation was successful or because of * an error. * <p> * This will result in having the * {@link ChannelOutboundHandler#deregister(ChannelHandlerContext, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. * */ ChannelFuture deregister(); /** * Request to bind to the given {@link SocketAddress} and notify the {@link ChannelFuture} once the operation * completes, either because the operation was successful or because of an error. * * The given {@link ChannelPromise} will be notified. * <p> * This will result in having the * {@link ChannelOutboundHandler#bind(ChannelHandlerContext, SocketAddress, ChannelPromise)} method * called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture bind(SocketAddress localAddress, ChannelPromise promise); /** * Request to connect to the given {@link SocketAddress} and notify the {@link ChannelFuture} once the operation * completes, either because the operation was successful or because of an error. * * The given {@link ChannelFuture} will be notified. * * <p> * If the connection fails because of a connection timeout, the {@link ChannelFuture} will get failed with * a {@link ConnectTimeoutException}. If it fails because of connection refused a {@link ConnectException} * will be used. * <p> * This will result in having the * {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture connect(SocketAddress remoteAddress, ChannelPromise promise); /** * Request to connect to the given {@link SocketAddress} while bind to the localAddress and notify the * {@link ChannelFuture} once the operation completes, either because the operation was successful or because of * an error. * * The given {@link ChannelPromise} will be notified and also returned. * <p> * This will result in having the * {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise); /** * Request to disconnect from the remote peer and notify the {@link ChannelFuture} once the operation completes, * either because the operation was successful or because of an error. * * The given {@link ChannelPromise} will be notified. * <p> * This will result in having the * {@link ChannelOutboundHandler#disconnect(ChannelHandlerContext, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture disconnect(ChannelPromise promise); /** * Request to close the {@link Channel} bound to this {@link ChannelPipeline} and notify the {@link ChannelFuture} * once the operation completes, either because the operation was successful or because of * an error. * * After it is closed it is not possible to reuse it again. * The given {@link ChannelPromise} will be notified. * <p> * This will result in having the * {@link ChannelOutboundHandler#close(ChannelHandlerContext, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture close(ChannelPromise promise); /** * Request to deregister the {@link Channel} bound this {@link ChannelPipeline} from the previous assigned * {@link EventExecutor} and notify the {@link ChannelFuture} once the operation completes, either because the * operation was successful or because of an error. * * The given {@link ChannelPromise} will be notified. * <p> * This will result in having the * {@link ChannelOutboundHandler#deregister(ChannelHandlerContext, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture deregister(ChannelPromise promise); /** * Request to Read data from the {@link Channel} into the first inbound buffer, triggers an * {@link ChannelInboundHandler#channelRead(ChannelHandlerContext, Object)} event if data was * read, and triggers a * {@link ChannelInboundHandler#channelReadComplete(ChannelHandlerContext) channelReadComplete} event so the * handler can decide to continue reading. If there's a pending read operation already, this method does nothing. * <p> * This will result in having the * {@link ChannelOutboundHandler#read(ChannelHandlerContext)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline read(); /** * Request to write a message via this {@link ChannelPipeline}. * This method will not request to actual flush, so be sure to call {@link #flush()} * once you want to request to flush all pending data to the actual transport. */ ChannelFuture write(Object msg); /** * Request to write a message via this {@link ChannelPipeline}. * This method will not request to actual flush, so be sure to call {@link #flush()} * once you want to request to flush all pending data to the actual transport. */ ChannelFuture write(Object msg, ChannelPromise promise); /** * Request to flush all pending messages. */ ChannelPipeline flush(); /** * Shortcut for call {@link #write(Object, ChannelPromise)} and {@link #flush()}. */ ChannelFuture writeAndFlush(Object msg, ChannelPromise promise); /** * Shortcut for call {@link #write(Object)} and {@link #flush()}. */ ChannelFuture writeAndFlush(Object msg); }
transport/src/main/java/io/netty/channel/ChannelPipeline.java
/* * Copyright 2012 The Netty Project * * The Netty Project licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package io.netty.channel; import io.netty.buffer.ByteBuf; import io.netty.util.concurrent.DefaultEventExecutorGroup; import io.netty.util.concurrent.EventExecutor; import io.netty.util.concurrent.EventExecutorGroup; import java.net.ConnectException; import java.net.SocketAddress; import java.nio.ByteBuffer; import java.nio.channels.SocketChannel; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.NoSuchElementException; /** * A list of {@link ChannelHandler}s which handles or intercepts inbound events and outbound operations of a * {@link Channel}. {@link ChannelPipeline} implements an advanced form of the * <a href="http://www.oracle.com/technetwork/java/interceptingfilter-142169.html">Intercepting Filter</a> pattern * to give a user full control over how an event is handled and how the {@link ChannelHandler}s in a pipeline * interact with each other. * * <h3>Creation of a pipeline</h3> * * Each channel has its own pipeline and it is created automatically when a new channel is created. * * <h3>How an event flows in a pipeline</h3> * * The following diagram describes how I/O events are processed by {@link ChannelHandler}s in a {@link ChannelPipeline} * typically. An I/O event is handled by either a {@link ChannelInboundHandler} or a {@link ChannelOutboundHandler} * and be forwarded to its closest handler by calling the event propagation methods defined in * {@link ChannelHandlerContext}, such as {@link ChannelHandlerContext#fireChannelRead(Object)} and * {@link ChannelHandlerContext#write(Object)}. * * <pre> * I/O Request * via {@link Channel} or * {@link ChannelHandlerContext} * | * +---------------------------------------------------+---------------+ * | ChannelPipeline | | * | \|/ | * | +---------------------+ +-----------+----------+ | * | | Inbound Handler N | | Outbound Handler 1 | | * | +----------+----------+ +-----------+----------+ | * | /|\ | | * | | \|/ | * | +----------+----------+ +-----------+----------+ | * | | Inbound Handler N-1 | | Outbound Handler 2 | | * | +----------+----------+ +-----------+----------+ | * | /|\ . | * | . . | * | ChannelHandlerContext.fireIN_EVT() ChannelHandlerContext.OUT_EVT()| * | [ method call] [method call] | * | . . | * | . \|/ | * | +----------+----------+ +-----------+----------+ | * | | Inbound Handler 2 | | Outbound Handler M-1 | | * | +----------+----------+ +-----------+----------+ | * | /|\ | | * | | \|/ | * | +----------+----------+ +-----------+----------+ | * | | Inbound Handler 1 | | Outbound Handler M | | * | +----------+----------+ +-----------+----------+ | * | /|\ | | * +---------------+-----------------------------------+---------------+ * | \|/ * +---------------+-----------------------------------+---------------+ * | | | | * | [ Socket.read() ] [ Socket.write() ] | * | | * | Netty Internal I/O Threads (Transport Implementation) | * +-------------------------------------------------------------------+ * </pre> * An inbound event is handled by the inbound handlers in the bottom-up direction as shown on the left side of the * diagram. An inbound handler usually handles the inbound data generated by the I/O thread on the bottom of the * diagram. The inbound data is often read from a remote peer via the actual input operation such as * {@link SocketChannel#read(ByteBuffer)}. If an inbound event goes beyond the top inbound handler, it is discarded * silently, or logged if it needs your attention. * <p> * An outbound event is handled by the outbound handler in the top-down direction as shown on the right side of the * diagram. An outbound handler usually generates or transforms the outbound traffic such as write requests. * If an outbound event goes beyond the bottom outbound handler, it is handled by an I/O thread associated with the * {@link Channel}. The I/O thread often performs the actual output operation such as * {@link SocketChannel#write(ByteBuffer)}. * <p> * For example, let us assume that we created the following pipeline: * <pre> * {@link ChannelPipeline} p = ...; * p.addLast("1", new InboundHandlerA()); * p.addLast("2", new InboundHandlerB()); * p.addLast("3", new OutboundHandlerA()); * p.addLast("4", new OutboundHandlerB()); * p.addLast("5", new InboundOutboundHandlerX()); * </pre> * In the example above, the class whose name starts with {@code Inbound} means it is an inbound handler. * The class whose name starts with {@code Outbound} means it is a outbound handler. * <p> * In the given example configuration, the handler evaluation order is 1, 2, 3, 4, 5 when an event goes inbound. * When an event goes outbound, the order is 5, 4, 3, 2, 1. On top of this principle, {@link ChannelPipeline} skips * the evaluation of certain handlers to shorten the stack depth: * <ul> * <li>3 and 4 don't implement {@link ChannelInboundHandler}, and therefore the actual evaluation order of an inbound * event will be: 1, 2, and 5.</li> * <li>1 and 2 don't implement {@link ChannelOutboundHandler}, and therefore the actual evaluation order of a * outbound event will be: 5, 4, and 3.</li> * <li>If 5 implements both {@link ChannelInboundHandler} and {@link ChannelOutboundHandler}, the evaluation order of * an inbound and a outbound event could be 125 and 543 respectively.</li> * </ul> * * <h3>Forwarding an event to the next handler</h3> * * As you might noticed in the diagram shows, a handler has to invoke the event propagation methods in * {@link ChannelHandlerContext} to forward an event to its next handler. Those methods include: * <ul> * <li>Inbound event propagation methods: * <ul> * <li>{@link ChannelHandlerContext#fireChannelRegistered()}</li> * <li>{@link ChannelHandlerContext#fireChannelActive()}</li> * <li>{@link ChannelHandlerContext#fireChannelRead(Object)}</li> * <li>{@link ChannelHandlerContext#fireChannelReadComplete()}</li> * <li>{@link ChannelHandlerContext#fireExceptionCaught(Throwable)}</li> * <li>{@link ChannelHandlerContext#fireUserEventTriggered(Object)}</li> * <li>{@link ChannelHandlerContext#fireChannelWritabilityChanged()}</li> * <li>{@link ChannelHandlerContext#fireChannelInactive()}</li> * <li>{@link ChannelHandlerContext#fireChannelUnregistered()}</li> * </ul> * </li> * <li>Outbound event propagation methods: * <ul> * <li>{@link ChannelHandlerContext#bind(SocketAddress, ChannelPromise)}</li> * <li>{@link ChannelHandlerContext#connect(SocketAddress, SocketAddress, ChannelPromise)}</li> * <li>{@link ChannelHandlerContext#write(Object, ChannelPromise)}</li> * <li>{@link ChannelHandlerContext#flush()}</li> * <li>{@link ChannelHandlerContext#read()}</li> * <li>{@link ChannelHandlerContext#disconnect(ChannelPromise)}</li> * <li>{@link ChannelHandlerContext#close(ChannelPromise)}</li> * <li>{@link ChannelHandlerContext#deregister(ChannelPromise)}</li> * </ul> * </li> * </ul> * * and the following example shows how the event propagation is usually done: * * <pre> * public class MyInboundHandler extends {@link ChannelInboundHandlerAdapter} { * {@code @Override} * public void channelActive({@link ChannelHandlerContext} ctx) { * System.out.println("Connected!"); * ctx.fireChannelActive(); * } * } * * public clas MyOutboundHandler extends {@link ChannelOutboundHandlerAdapter} { * {@code @Override} * public void close({@link ChannelHandlerContext} ctx, {@link ChannelPromise} promise) { * System.out.println("Closing .."); * ctx.close(promise); * } * } * </pre> * * <h3>Building a pipeline</h3> * <p> * A user is supposed to have one or more {@link ChannelHandler}s in a pipeline to receive I/O events (e.g. read) and * to request I/O operations (e.g. write and close). For example, a typical server will have the following handlers * in each channel's pipeline, but your mileage may vary depending on the complexity and characteristics of the * protocol and business logic: * * <ol> * <li>Protocol Decoder - translates binary data (e.g. {@link ByteBuf}) into a Java object.</li> * <li>Protocol Encoder - translates a Java object into binary data.</li> * <li>Business Logic Handler - performs the actual business logic (e.g. database access).</li> * </ol> * * and it could be represented as shown in the following example: * * <pre> * static final {@link EventExecutorGroup} group = new {@link DefaultEventExecutorGroup}(16); * ... * * {@link ChannelPipeline} pipeline = ch.pipeline(); * * pipeline.addLast("decoder", new MyProtocolDecoder()); * pipeline.addLast("encoder", new MyProtocolEncoder()); * * // Tell the pipeline to run MyBusinessLogicHandler's event handler methods * // in a different thread than an I/O thread so that the I/O thread is not blocked by * // a time-consuming task. * // If your business logic is fully asynchronous or finished very quickly, you don't * // need to specify a group. * pipeline.addLast(group, "handler", new MyBusinessLogicHandler()); * </pre> * * <h3>Thread safety</h3> * <p> * A {@link ChannelHandler} can be added or removed at any time because a {@link ChannelPipeline} is thread safe. * For example, you can insert an encryption handler when sensitive information is about to be exchanged, and remove it * after the exchange. */ public interface ChannelPipeline extends Iterable<Entry<String, ChannelHandler>> { /** * Inserts a {@link ChannelHandler} at the first position of this pipeline. * * @param name the name of the handler to insert first. {@code null} to let the name auto-generated. * @param handler the handler to insert first * * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified handler is {@code null} */ ChannelPipeline addFirst(String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} at the first position of this pipeline. * * @param group the {@link EventExecutorGroup} which will be used to execute the {@link ChannelHandler} * methods * @param name the name of the handler to insert first. {@code null} to let the name auto-generated. * @param handler the handler to insert first * * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified handler is {@code null} */ ChannelPipeline addFirst(EventExecutorGroup group, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} at the first position of this pipeline. * * @param invoker the {@link ChannelHandlerInvoker} which invokes the {@code handler}s event handler methods * @param name the name of the handler to insert first. {@code null} to let the name auto-generated. * @param handler the handler to insert first * * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified handler is {@code null} */ ChannelPipeline addFirst(ChannelHandlerInvoker invoker, String name, ChannelHandler handler); /** * Appends a {@link ChannelHandler} at the last position of this pipeline. * * @param name the name of the handler to append. {@code null} to let the name auto-generated. * @param handler the handler to append * * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified handler is {@code null} */ ChannelPipeline addLast(String name, ChannelHandler handler); /** * Appends a {@link ChannelHandler} at the last position of this pipeline. * * @param group the {@link EventExecutorGroup} which will be used to execute the {@link ChannelHandler} * methods * @param name the name of the handler to append. {@code null} to let the name auto-generated. * @param handler the handler to append * * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified handler is {@code null} */ ChannelPipeline addLast(EventExecutorGroup group, String name, ChannelHandler handler); /** * Appends a {@link ChannelHandler} at the last position of this pipeline. * * @param invoker the {@link ChannelHandlerInvoker} which invokes the {@code handler}s event handler methods * @param name the name of the handler to append. {@code null} to let the name auto-generated. * @param handler the handler to append * * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified handler is {@code null} */ ChannelPipeline addLast(ChannelHandlerInvoker invoker, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} before an existing handler of this * pipeline. * * @param baseName the name of the existing handler * @param name the name of the handler to insert before. {@code null} to let the name auto-generated. * @param handler the handler to insert before * * @throws NoSuchElementException * if there's no such entry with the specified {@code baseName} * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified baseName or handler is {@code null} */ ChannelPipeline addBefore(String baseName, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} before an existing handler of this * pipeline. * * @param group the {@link EventExecutorGroup} which will be used to execute the {@link ChannelHandler} * methods * @param baseName the name of the existing handler * @param name the name of the handler to insert before. {@code null} to let the name auto-generated. * @param handler the handler to insert before * * @throws NoSuchElementException * if there's no such entry with the specified {@code baseName} * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified baseName or handler is {@code null} */ ChannelPipeline addBefore(EventExecutorGroup group, String baseName, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} before an existing handler of this * pipeline. * * @param invoker the {@link ChannelHandlerInvoker} which invokes the {@code handler}s event handler methods * @param baseName the name of the existing handler * @param name the name of the handler to insert before. {@code null} to let the name auto-generated. * @param handler the handler to insert before * * @throws NoSuchElementException * if there's no such entry with the specified {@code baseName} * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified baseName or handler is {@code null} */ ChannelPipeline addBefore(ChannelHandlerInvoker invoker, String baseName, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} after an existing handler of this * pipeline. * * @param baseName the name of the existing handler * @param name the name of the handler to insert after. {@code null} to let the name auto-generated. * @param handler the handler to insert after * * @throws NoSuchElementException * if there's no such entry with the specified {@code baseName} * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified baseName or handler is {@code null} */ ChannelPipeline addAfter(String baseName, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} after an existing handler of this * pipeline. * * @param group the {@link EventExecutorGroup} which will be used to execute the {@link ChannelHandler} * methods * @param baseName the name of the existing handler * @param name the name of the handler to insert after. {@code null} to let the name auto-generated. * @param handler the handler to insert after * * @throws NoSuchElementException * if there's no such entry with the specified {@code baseName} * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified baseName or handler is {@code null} */ ChannelPipeline addAfter(EventExecutorGroup group, String baseName, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler} after an existing handler of this * pipeline. * * @param invoker the {@link ChannelHandlerInvoker} which invokes the {@code handler}s event handler methods * @param baseName the name of the existing handler * @param name the name of the handler to insert after. {@code null} to let the name auto-generated. * @param handler the handler to insert after * * @throws NoSuchElementException * if there's no such entry with the specified {@code baseName} * @throws IllegalArgumentException * if there's an entry with the same name already in the pipeline * @throws NullPointerException * if the specified baseName or handler is {@code null} */ ChannelPipeline addAfter(ChannelHandlerInvoker invoker, String baseName, String name, ChannelHandler handler); /** * Inserts a {@link ChannelHandler}s at the first position of this pipeline. * * @param handlers the handlers to insert first * */ ChannelPipeline addFirst(ChannelHandler... handlers); /** * Inserts a {@link ChannelHandler}s at the first position of this pipeline. * * @param group the {@link EventExecutorGroup} which will be used to execute the {@link ChannelHandler}s * methods. * @param handlers the handlers to insert first * */ ChannelPipeline addFirst(EventExecutorGroup group, ChannelHandler... handlers); /** * Inserts a {@link ChannelHandler}s at the first position of this pipeline. * * @param invoker the {@link ChannelHandlerInvoker} which invokes the {@code handler}s event handler methods * @param handlers the handlers to insert first * */ ChannelPipeline addFirst(ChannelHandlerInvoker invoker, ChannelHandler... handlers); /** * Inserts a {@link ChannelHandler}s at the last position of this pipeline. * * @param handlers the handlers to insert last * */ ChannelPipeline addLast(ChannelHandler... handlers); /** * Inserts a {@link ChannelHandler}s at the last position of this pipeline. * * @param group the {@link EventExecutorGroup} which will be used to execute the {@link ChannelHandler}s * methods. * @param handlers the handlers to insert last * */ ChannelPipeline addLast(EventExecutorGroup group, ChannelHandler... handlers); /** * Inserts a {@link ChannelHandler}s at the last position of this pipeline. * * @param invoker the {@link ChannelHandlerInvoker} which invokes the {@code handler}s event handler methods * @param handlers the handlers to insert last * */ ChannelPipeline addLast(ChannelHandlerInvoker invoker, ChannelHandler... handlers); /** * Removes the specified {@link ChannelHandler} from this pipeline. * * @param handler the {@link ChannelHandler} to remove * * @throws NoSuchElementException * if there's no such handler in this pipeline * @throws NullPointerException * if the specified handler is {@code null} */ ChannelPipeline remove(ChannelHandler handler); /** * Removes the {@link ChannelHandler} with the specified name from this pipeline. * * @param name the name under which the {@link ChannelHandler} was stored. * * @return the removed handler * * @throws NoSuchElementException * if there's no such handler with the specified name in this pipeline * @throws NullPointerException * if the specified name is {@code null} */ ChannelHandler remove(String name); /** * Removes the {@link ChannelHandler} of the specified type from this pipeline. * * @param <T> the type of the handler * @param handlerType the type of the handler * * @return the removed handler * * @throws NoSuchElementException * if there's no such handler of the specified type in this pipeline * @throws NullPointerException * if the specified handler type is {@code null} */ <T extends ChannelHandler> T remove(Class<T> handlerType); /** * Removes the first {@link ChannelHandler} in this pipeline. * * @return the removed handler * * @throws NoSuchElementException * if this pipeline is empty */ ChannelHandler removeFirst(); /** * Removes the last {@link ChannelHandler} in this pipeline. * * @return the removed handler * * @throws NoSuchElementException * if this pipeline is empty */ ChannelHandler removeLast(); /** * Replaces the specified {@link ChannelHandler} with a new handler in this pipeline. * * @param oldHandler the {@link ChannelHandler} to be replaced * @param newName the name under which the replacement should be added. * {@code null} to use the same name with the handler being replaced. * @param newHandler the {@link ChannelHandler} which is used as replacement * * @return itself * @throws NoSuchElementException * if the specified old handler does not exist in this pipeline * @throws IllegalArgumentException * if a handler with the specified new name already exists in this * pipeline, except for the handler to be replaced * @throws NullPointerException * if the specified old handler or new handler is {@code null} */ ChannelPipeline replace(ChannelHandler oldHandler, String newName, ChannelHandler newHandler); /** * Replaces the {@link ChannelHandler} of the specified name with a new handler in this pipeline. * * @param oldName the name of the {@link ChannelHandler} to be replaced * @param newName the name under which the replacement should be added. * {@code null} to use the same name with the handler being replaced. * @param newHandler the {@link ChannelHandler} which is used as replacement * * @return the removed handler * * @throws NoSuchElementException * if the handler with the specified old name does not exist in this pipeline * @throws IllegalArgumentException * if a handler with the specified new name already exists in this * pipeline, except for the handler to be replaced * @throws NullPointerException * if the specified old handler or new handler is {@code null} */ ChannelHandler replace(String oldName, String newName, ChannelHandler newHandler); /** * Replaces the {@link ChannelHandler} of the specified type with a new handler in this pipeline. * * @param oldHandlerType the type of the handler to be removed * @param newName the name under which the replacement should be added. * {@code null} to use the same name with the handler being replaced. * @param newHandler the {@link ChannelHandler} which is used as replacement * * @return the removed handler * * @throws NoSuchElementException * if the handler of the specified old handler type does not exist * in this pipeline * @throws IllegalArgumentException * if a handler with the specified new name already exists in this * pipeline, except for the handler to be replaced * @throws NullPointerException * if the specified old handler or new handler is {@code null} */ <T extends ChannelHandler> T replace(Class<T> oldHandlerType, String newName, ChannelHandler newHandler); /** * Returns the first {@link ChannelHandler} in this pipeline. * * @return the first handler. {@code null} if this pipeline is empty. */ ChannelHandler first(); /** * Returns the context of the first {@link ChannelHandler} in this pipeline. * * @return the context of the first handler. {@code null} if this pipeline is empty. */ ChannelHandlerContext firstContext(); /** * Returns the last {@link ChannelHandler} in this pipeline. * * @return the last handler. {@code null} if this pipeline is empty. */ ChannelHandler last(); /** * Returns the context of the last {@link ChannelHandler} in this pipeline. * * @return the context of the last handler. {@code null} if this pipeline is empty. */ ChannelHandlerContext lastContext(); /** * Returns the {@link ChannelHandler} with the specified name in this * pipeline. * * @return the handler with the specified name. * {@code null} if there's no such handler in this pipeline. */ ChannelHandler get(String name); /** * Returns the {@link ChannelHandler} of the specified type in this * pipeline. * * @return the handler of the specified handler type. * {@code null} if there's no such handler in this pipeline. */ <T extends ChannelHandler> T get(Class<T> handlerType); /** * Returns the context object of the specified {@link ChannelHandler} in * this pipeline. * * @return the context object of the specified handler. * {@code null} if there's no such handler in this pipeline. */ ChannelHandlerContext context(ChannelHandler handler); /** * Returns the context object of the {@link ChannelHandler} with the * specified name in this pipeline. * * @return the context object of the handler with the specified name. * {@code null} if there's no such handler in this pipeline. */ ChannelHandlerContext context(String name); /** * Returns the context object of the {@link ChannelHandler} of the * specified type in this pipeline. * * @return the context object of the handler of the specified type. * {@code null} if there's no such handler in this pipeline. */ ChannelHandlerContext context(Class<? extends ChannelHandler> handlerType); /** * Returns the {@link Channel} that this pipeline is attached to. * * @return the channel. {@code null} if this pipeline is not attached yet. */ Channel channel(); /** * Returns the {@link List} of the handler names. */ List<String> names(); /** * Converts this pipeline into an ordered {@link Map} whose keys are * handler names and whose values are handlers. */ Map<String, ChannelHandler> toMap(); /** * A {@link Channel} was registered to its {@link EventLoop}. * * This will result in having the {@link ChannelInboundHandler#channelRegistered(ChannelHandlerContext)} method * called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline fireChannelRegistered(); /** * A {@link Channel} was unregistered from its {@link EventLoop}. * * This will result in having the {@link ChannelInboundHandler#channelUnregistered(ChannelHandlerContext)} method * called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline fireChannelUnregistered(); /** * A {@link Channel} is active now, which means it is connected. * * This will result in having the {@link ChannelInboundHandler#channelActive(ChannelHandlerContext)} method * called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline fireChannelActive(); /** * A {@link Channel} is inactive now, which means it is closed. * * This will result in having the {@link ChannelInboundHandler#channelInactive(ChannelHandlerContext)} method * called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline fireChannelInactive(); /** * A {@link Channel} received an {@link Throwable} in one of its inbound operations. * * This will result in having the {@link ChannelInboundHandler#exceptionCaught(ChannelHandlerContext, Throwable)} * method called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline fireExceptionCaught(Throwable cause); /** * A {@link Channel} received an user defined event. * * This will result in having the {@link ChannelInboundHandler#userEventTriggered(ChannelHandlerContext, Object)} * method called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline fireUserEventTriggered(Object event); /** * A {@link Channel} received a message. * * This will result in having the {@link ChannelInboundHandler#channelRead(ChannelHandlerContext, Object)} * method called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline fireChannelRead(Object msg); /** * Triggers an {@link ChannelInboundHandler#channelWritabilityChanged(ChannelHandlerContext)} * event to the next {@link ChannelInboundHandler} in the {@link ChannelPipeline}. */ ChannelPipeline fireChannelReadComplete(); /** * Triggers an {@link ChannelInboundHandler#channelWritabilityChanged(ChannelHandlerContext)} * event to the next {@link ChannelInboundHandler} in the {@link ChannelPipeline}. */ ChannelPipeline fireChannelWritabilityChanged(); /** * Request to bind to the given {@link SocketAddress} and notify the {@link ChannelFuture} once the operation * completes, either because the operation was successful or because of an error. * <p> * This will result in having the * {@link ChannelOutboundHandler#bind(ChannelHandlerContext, SocketAddress, ChannelPromise)} method * called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture bind(SocketAddress localAddress); /** * Request to connect to the given {@link SocketAddress} and notify the {@link ChannelFuture} once the operation * completes, either because the operation was successful or because of an error. * <p> * If the connection fails because of a connection timeout, the {@link ChannelFuture} will get failed with * a {@link ConnectTimeoutException}. If it fails because of connection refused a {@link ConnectException} * will be used. * <p> * This will result in having the * {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture connect(SocketAddress remoteAddress); /** * Request to connect to the given {@link SocketAddress} while bind to the localAddress and notify the * {@link ChannelFuture} once the operation completes, either because the operation was successful or because of * an error. * <p> * This will result in having the * {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress); /** * Request to disconnect from the remote peer and notify the {@link ChannelFuture} once the operation completes, * either because the operation was successful or because of an error. * <p> * This will result in having the * {@link ChannelOutboundHandler#disconnect(ChannelHandlerContext, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture disconnect(); /** * Request to close the {@link Channel} and notify the {@link ChannelFuture} once the operation completes, * either because the operation was successful or because of * an error. * * After it is closed it is not possible to reuse it again. * <p> * This will result in having the * {@link ChannelOutboundHandler#close(ChannelHandlerContext, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture close(); /** * Request to deregister the {@link Channel} from the previous assigned {@link EventExecutor} and notify the * {@link ChannelFuture} once the operation completes, either because the operation was successful or because of * an error. * <p> * This will result in having the * {@link ChannelOutboundHandler#deregister(ChannelHandlerContext, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. * */ ChannelFuture deregister(); /** * Request to bind to the given {@link SocketAddress} and notify the {@link ChannelFuture} once the operation * completes, either because the operation was successful or because of an error. * * The given {@link ChannelPromise} will be notified. * <p> * This will result in having the * {@link ChannelOutboundHandler#bind(ChannelHandlerContext, SocketAddress, ChannelPromise)} method * called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture bind(SocketAddress localAddress, ChannelPromise promise); /** * Request to connect to the given {@link SocketAddress} and notify the {@link ChannelFuture} once the operation * completes, either because the operation was successful or because of an error. * * The given {@link ChannelFuture} will be notified. * * <p> * If the connection fails because of a connection timeout, the {@link ChannelFuture} will get failed with * a {@link ConnectTimeoutException}. If it fails because of connection refused a {@link ConnectException} * will be used. * <p> * This will result in having the * {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture connect(SocketAddress remoteAddress, ChannelPromise promise); /** * Request to connect to the given {@link SocketAddress} while bind to the localAddress and notify the * {@link ChannelFuture} once the operation completes, either because the operation was successful or because of * an error. * * The given {@link ChannelPromise} will be notified and also returned. * <p> * This will result in having the * {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise); /** * Request to disconnect from the remote peer and notify the {@link ChannelFuture} once the operation completes, * either because the operation was successful or because of an error. * * The given {@link ChannelPromise} will be notified. * <p> * This will result in having the * {@link ChannelOutboundHandler#disconnect(ChannelHandlerContext, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture disconnect(ChannelPromise promise); /** * Request to close the {@link Channel} bound to this {@link ChannelPipeline} and notify the {@link ChannelFuture} * once the operation completes, either because the operation was successful or because of * an error. * * After it is closed it is not possible to reuse it again. * The given {@link ChannelPromise} will be notified. * <p> * This will result in having the * {@link ChannelOutboundHandler#close(ChannelHandlerContext, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture close(ChannelPromise promise); /** * Request to deregister the {@link Channel} bound this {@link ChannelPipeline} from the previous assigned * {@link EventExecutor} and notify the {@link ChannelFuture} once the operation completes, either because the * operation was successful or because of an error. * * The given {@link ChannelPromise} will be notified. * <p> * This will result in having the * {@link ChannelOutboundHandler#deregister(ChannelHandlerContext, ChannelPromise)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture deregister(ChannelPromise promise); /** * Request to Read data from the {@link Channel} into the first inbound buffer, triggers an * {@link ChannelInboundHandler#channelRead(ChannelHandlerContext, Object)} event if data was * read, and triggers a * {@link ChannelInboundHandler#channelReadComplete(ChannelHandlerContext) channelReadComplete} event so the * handler can decide to continue reading. If there's a pending read operation already, this method does nothing. * <p> * This will result in having the * {@link ChannelOutboundHandler#read(ChannelHandlerContext)} * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelPipeline read(); /** * Request to write a message via this {@link ChannelPipeline}. * This method will not request to actual flush, so be sure to call {@link #flush()} * once you want to request to flush all pending data to the actual transport. */ ChannelFuture write(Object msg); /** * Request to write a message via this {@link ChannelPipeline}. * This method will not request to actual flush, so be sure to call {@link #flush()} * once you want to request to flush all pending data to the actual transport. */ ChannelFuture write(Object msg, ChannelPromise promise); /** * Request to flush all pending messages. */ ChannelPipeline flush(); /** * Shortcut for call {@link #write(Object, ChannelPromise)} and {@link #flush()}. */ ChannelFuture writeAndFlush(Object msg, ChannelPromise promise); /** * Shortcut for call {@link #write(Object)} and {@link #flush()}. */ ChannelFuture writeAndFlush(Object msg); }
Fix javadoc link
transport/src/main/java/io/netty/channel/ChannelPipeline.java
Fix javadoc link
<ide><path>ransport/src/main/java/io/netty/channel/ChannelPipeline.java <ide> ChannelPipeline fireChannelRead(Object msg); <ide> <ide> /** <del> * Triggers an {@link ChannelInboundHandler#channelWritabilityChanged(ChannelHandlerContext)} <add> * Triggers an {@link ChannelInboundHandler#channelReadComplete(ChannelHandlerContext)} <ide> * event to the next {@link ChannelInboundHandler} in the {@link ChannelPipeline}. <ide> */ <ide> ChannelPipeline fireChannelReadComplete();
Java
apache-2.0
097e14b0ff5beb1a3ac354f82f82cce7970e341c
0
apache/jmeter,apache/jmeter,ham1/jmeter,benbenw/jmeter,ham1/jmeter,apache/jmeter,apache/jmeter,etnetera/jmeter,ham1/jmeter,etnetera/jmeter,benbenw/jmeter,ham1/jmeter,etnetera/jmeter,benbenw/jmeter,ham1/jmeter,apache/jmeter,etnetera/jmeter,benbenw/jmeter,etnetera/jmeter
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.jmeter.protocol.http.sampler; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.RequestEntity; import org.apache.commons.io.IOUtils; import org.apache.jmeter.protocol.http.control.CacheManager; import org.apache.jmeter.protocol.http.control.Header; import org.apache.jmeter.protocol.http.control.HeaderManager; import org.apache.jmeter.protocol.http.util.HTTPConstants; import org.apache.jorphan.logging.LoggingManager; import org.apache.jorphan.util.JOrphanUtils; import org.apache.log.Logger; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URL; import java.util.zip.GZIPInputStream; /** * Commons HTTPClient based soap sampler */ public class SoapSampler extends HTTPSampler2 { private static final Logger log = LoggingManager.getLoggerForClass(); public static final String XML_DATA = "HTTPSamper.xml_data"; //$NON-NLS-1$ public static final String URL_DATA = "SoapSampler.URL_DATA"; //$NON-NLS-1$ public static final String SOAP_ACTION = "SoapSampler.SOAP_ACTION"; //$NON-NLS-1$ public static final String SEND_SOAP_ACTION = "SoapSampler.SEND_SOAP_ACTION"; //$NON-NLS-1$ public static final String XML_DATA_FILE = "SoapSampler.xml_data_file"; //$NON-NLS-1$ private static final String DOUBLE_QUOTE = "\""; //$NON-NLS-1$ private static final String SOAPACTION = "SOAPAction"; //$NON-NLS-1$ private static final String ENCODING = "utf-8"; //$NON-NLS-1$ TODO should this be variable? private static final String DEFAULT_CONTENT_TYPE = "text/xml"; //$NON-NLS-1$ public void setXmlData(String data) { setProperty(XML_DATA, data); } public String getXmlData() { return getPropertyAsString(XML_DATA); } /** * it's kinda obvious, but we state it anyways. Set the xml file with a * string path. * * @param filename */ public void setXmlFile(String filename) { setProperty(XML_DATA_FILE, filename); } /** * Get the file location of the xml file. * * @return String file path. */ public String getXmlFile() { return getPropertyAsString(XML_DATA_FILE); } public String getURLData() { return getPropertyAsString(URL_DATA); } public void setURLData(String url) { setProperty(URL_DATA, url); } public String getSOAPAction() { return getPropertyAsString(SOAP_ACTION); } public String getSOAPActionQuoted() { String action = getSOAPAction(); StringBuffer sb = new StringBuffer(action.length()+2); sb.append(DOUBLE_QUOTE); sb.append(action); sb.append(DOUBLE_QUOTE); return sb.toString(); } public void setSOAPAction(String action) { setProperty(SOAP_ACTION, action); } public boolean getSendSOAPAction() { return getPropertyAsBoolean(SEND_SOAP_ACTION); } public void setSendSOAPAction(boolean action) { setProperty(SEND_SOAP_ACTION, String.valueOf(action)); } protected int setPostHeaders(PostMethod post) { int length=0;// Take length from file if (getHeaderManager() != null) { // headerManager was set, so let's set the connection // to use it. HeaderManager mngr = getHeaderManager(); int headerSize = mngr.size(); for (int idx = 0; idx < headerSize; idx++) { Header hd = mngr.getHeader(idx); if (HEADER_CONTENT_LENGTH.equalsIgnoreCase(hd.getName())) {// Use this to override file length length = Integer.parseInt(hd.getValue()); } // All the other headers are set up by HTTPSampler2.setupConnection() } } else { // otherwise we use "text/xml" as the default post.addParameter(HEADER_CONTENT_TYPE, DEFAULT_CONTENT_TYPE); //$NON-NLS-1$ } if (getSendSOAPAction()) { post.setRequestHeader(SOAPACTION, getSOAPActionQuoted()); } return length; } /** * Send POST data from <code>Entry</code> to the open connection. * * @param post * @throws IOException if an I/O exception occurs */ private String sendPostData(PostMethod post, final int length) { // Buffer to hold the post body, except file content StringBuffer postedBody = new StringBuffer(1000); final String xmlFile = getXmlFile(); if (xmlFile != null && xmlFile.length() > 0) { // We just add placeholder text for file content postedBody.append("Filename: ").append(xmlFile).append("\n"); postedBody.append("<actual file content, not shown here>"); post.setRequestEntity(new RequestEntity() { public boolean isRepeatable() { return true; } public void writeRequest(OutputStream out) throws IOException { InputStream in = null; try{ in = new FileInputStream(xmlFile); IOUtils.copy(in, out); out.flush(); } finally { IOUtils.closeQuietly(in); } } public long getContentLength() { switch(length){ case -1: return -1; case 0: // No header provided return (new File(xmlFile)).length(); default: return length; } } public String getContentType() { // TODO do we need to add a charset for the file contents? return DEFAULT_CONTENT_TYPE; // $NON-NLS-1$ } }); } else { postedBody.append(getXmlData()); post.setRequestEntity(new RequestEntity() { public boolean isRepeatable() { return true; } public void writeRequest(OutputStream out) throws IOException { // charset must agree with content-type below IOUtils.write(getXmlData(), out, ENCODING); // $NON-NLS-1$ out.flush(); } public long getContentLength() { try { return getXmlData().getBytes(ENCODING).length; // so we don't generate chunked encoding } catch (UnsupportedEncodingException e) { log.warn(e.getLocalizedMessage()); return -1; // will use chunked encoding } } public String getContentType() { return DEFAULT_CONTENT_TYPE+"; charset="+ENCODING; // $NON-NLS-1$ } }); } return postedBody.toString(); } protected HTTPSampleResult sample(URL url, String method, boolean areFollowingRedirect, int frameDepth) { String urlStr = url.toString(); log.debug("Start : sample " + urlStr); PostMethod httpMethod; httpMethod = new PostMethod(urlStr); HTTPSampleResult res = new HTTPSampleResult(); res.setMonitor(false); res.setSampleLabel(urlStr); // May be replaced later res.setHTTPMethod(HTTPConstants.POST); res.sampleStart(); // Count the retries as well in the time HttpClient client = null; InputStream instream = null; try { int content_len = setPostHeaders(httpMethod); client = setupConnection(url, httpMethod, res); res.setQueryString(sendPostData(httpMethod,content_len)); int statusCode = client.executeMethod(httpMethod); // Some headers are set by executeMethod() res.setRequestHeaders(getConnectionHeaders(httpMethod)); // Request sent. Now get the response: instream = httpMethod.getResponseBodyAsStream(); if (instream != null) {// will be null for HEAD org.apache.commons.httpclient.Header responseHeader = httpMethod.getResponseHeader(TRANSFER_ENCODING); if (responseHeader != null && ENCODING_GZIP.equals(responseHeader.getValue())) { instream = new GZIPInputStream(instream); } //int contentLength = httpMethod.getResponseContentLength();Not visible ... //TODO size ouststream according to actual content length ByteArrayOutputStream outstream = new ByteArrayOutputStream(4 * 1024); //contentLength > 0 ? contentLength : DEFAULT_INITIAL_BUFFER_SIZE); byte[] buffer = new byte[4096]; int len; boolean first = true;// first response while ((len = instream.read(buffer)) > 0) { if (first) { // save the latency res.latencyEnd(); first = false; } outstream.write(buffer, 0, len); } res.setResponseData(outstream.toByteArray()); outstream.close(); } res.sampleEnd(); // Done with the sampling proper. // Now collect the results into the HTTPSampleResult: res.setSampleLabel(httpMethod.getURI().toString()); // Pick up Actual path (after redirects) res.setResponseCode(Integer.toString(statusCode)); res.setSuccessful(isSuccessCode(statusCode)); res.setResponseMessage(httpMethod.getStatusText()); // Set up the defaults (may be overridden below) res.setDataEncoding(ENCODING); res.setContentType(DEFAULT_CONTENT_TYPE); String ct = null; org.apache.commons.httpclient.Header h = httpMethod.getResponseHeader(HEADER_CONTENT_TYPE); if (h != null)// Can be missing, e.g. on redirect { ct = h.getValue(); res.setContentType(ct);// e.g. text/html; charset=ISO-8859-1 res.setEncodingAndType(ct); } res.setResponseHeaders(getResponseHeaders(httpMethod)); if (res.isRedirect()) { res.setRedirectLocation(httpMethod.getResponseHeader(HEADER_LOCATION).getValue()); } // If we redirected automatically, the URL may have changed if (getAutoRedirects()) { res.setURL(new URL(httpMethod.getURI().toString())); } // Store any cookies received in the cookie manager: saveConnectionCookies(httpMethod, res.getURL(), getCookieManager()); // Save cache information final CacheManager cacheManager = getCacheManager(); if (cacheManager != null){ cacheManager.saveDetails(httpMethod, res); } // Follow redirects and download page resources if appropriate: res = resultProcessing(areFollowingRedirect, frameDepth, res); log.debug("End : sample"); httpMethod.releaseConnection(); return res; } catch (IllegalArgumentException e)// e.g. some kinds of invalid URL { res.sampleEnd(); HTTPSampleResult err = errorResult(e, res); err.setSampleLabel("Error: " + url.toString()); return err; } catch (IOException e) { res.sampleEnd(); HTTPSampleResult err = errorResult(e, res); err.setSampleLabel("Error: " + url.toString()); return err; } finally { JOrphanUtils.closeQuietly(instream); httpMethod.releaseConnection(); } } public URL getUrl() throws MalformedURLException { return new URL(getURLData()); } }
src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.jmeter.protocol.http.sampler; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.RequestEntity; import org.apache.commons.io.IOUtils; import org.apache.jmeter.protocol.http.control.CacheManager; import org.apache.jmeter.protocol.http.control.Header; import org.apache.jmeter.protocol.http.control.HeaderManager; import org.apache.jmeter.protocol.http.util.HTTPConstants; import org.apache.jorphan.logging.LoggingManager; import org.apache.jorphan.util.JOrphanUtils; import org.apache.log.Logger; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.net.MalformedURLException; import java.net.URL; import java.util.zip.GZIPInputStream; /** * Commons HTTPClient based soap sampler */ public class SoapSampler extends HTTPSampler2 { private static final Logger log = LoggingManager.getLoggerForClass(); public static final String XML_DATA = "HTTPSamper.xml_data"; //$NON-NLS-1$ public static final String URL_DATA = "SoapSampler.URL_DATA"; //$NON-NLS-1$ public static final String SOAP_ACTION = "SoapSampler.SOAP_ACTION"; //$NON-NLS-1$ public static final String SEND_SOAP_ACTION = "SoapSampler.SEND_SOAP_ACTION"; //$NON-NLS-1$ public static final String XML_DATA_FILE = "SoapSampler.xml_data_file"; //$NON-NLS-1$ private static final String DOUBLE_QUOTE = "\""; //$NON-NLS-1$ private static final String SOAPACTION = "SOAPAction"; //$NON-NLS-1$ public void setXmlData(String data) { setProperty(XML_DATA, data); } public String getXmlData() { return getPropertyAsString(XML_DATA); } /** * it's kinda obvious, but we state it anyways. Set the xml file with a * string path. * * @param filename */ public void setXmlFile(String filename) { setProperty(XML_DATA_FILE, filename); } /** * Get the file location of the xml file. * * @return String file path. */ public String getXmlFile() { return getPropertyAsString(XML_DATA_FILE); } public String getURLData() { return getPropertyAsString(URL_DATA); } public void setURLData(String url) { setProperty(URL_DATA, url); } public String getSOAPAction() { return getPropertyAsString(SOAP_ACTION); } public String getSOAPActionQuoted() { String action = getSOAPAction(); StringBuffer sb = new StringBuffer(action.length()+2); sb.append(DOUBLE_QUOTE); sb.append(action); sb.append(DOUBLE_QUOTE); return sb.toString(); } public void setSOAPAction(String action) { setProperty(SOAP_ACTION, action); } public boolean getSendSOAPAction() { return getPropertyAsBoolean(SEND_SOAP_ACTION); } public void setSendSOAPAction(boolean action) { setProperty(SEND_SOAP_ACTION, String.valueOf(action)); } protected int setPostHeaders(PostMethod post) { int length=0;// Take length from file if (getHeaderManager() != null) { // headerManager was set, so let's set the connection // to use it. HeaderManager mngr = getHeaderManager(); int headerSize = mngr.size(); for (int idx = 0; idx < headerSize; idx++) { Header hd = mngr.getHeader(idx); if (HEADER_CONTENT_LENGTH.equalsIgnoreCase(hd.getName())) {// Use this to override file length length = Integer.parseInt(hd.getValue()); } // All the other headers are set up by HTTPSampler2.setupConnection() } } else { // otherwise we use "text/xml" as the default post.addParameter(HEADER_CONTENT_TYPE, "text/xml"); //$NON-NLS-1$ } if (getSendSOAPAction()) { post.setRequestHeader(SOAPACTION, getSOAPActionQuoted()); } return length; } /** * Send POST data from <code>Entry</code> to the open connection. * * @param post * @throws IOException if an I/O exception occurs */ private String sendPostData(PostMethod post, final int length) { // Buffer to hold the post body, except file content StringBuffer postedBody = new StringBuffer(1000); final String xmlFile = getXmlFile(); if (xmlFile != null && xmlFile.length() > 0) { // We just add placeholder text for file content postedBody.append("Filename: ").append(xmlFile).append("\n"); postedBody.append("<actual file content, not shown here>"); post.setRequestEntity(new RequestEntity() { public boolean isRepeatable() { return true; } public void writeRequest(OutputStream out) throws IOException { InputStream in = null; try{ in = new FileInputStream(xmlFile); IOUtils.copy(in, out); out.flush(); } finally { IOUtils.closeQuietly(in); } } public long getContentLength() { switch(length){ case -1: return -1; case 0: // No header provided return (new File(xmlFile)).length(); default: return length; } } public String getContentType() { // TODO do we need to add a charset for the file contents? return "text/xml"; // $NON-NLS-1$ } }); } else { postedBody.append(getXmlData()); post.setRequestEntity(new RequestEntity() { public boolean isRepeatable() { return true; } public void writeRequest(OutputStream out) throws IOException { // charset must agree with content-type below IOUtils.write(getXmlData(), out, "utf-8"); // $NON-NLS-1$ out.flush(); } public long getContentLength() { return getXmlData().getBytes().length;// so we don't generate chunked encoding } public String getContentType() { return "text/xml; charset=utf-8"; // $NON-NLS-1$ } }); } return postedBody.toString(); } protected HTTPSampleResult sample(URL url, String method, boolean areFollowingRedirect, int frameDepth) { String urlStr = url.toString(); log.debug("Start : sample " + urlStr); PostMethod httpMethod; httpMethod = new PostMethod(urlStr); HTTPSampleResult res = new HTTPSampleResult(); res.setMonitor(false); res.setSampleLabel(urlStr); // May be replaced later res.setHTTPMethod(HTTPConstants.POST); res.sampleStart(); // Count the retries as well in the time HttpClient client = null; InputStream instream = null; try { int content_len = setPostHeaders(httpMethod); client = setupConnection(url, httpMethod, res); res.setQueryString(sendPostData(httpMethod,content_len)); int statusCode = client.executeMethod(httpMethod); // Some headers are set by executeMethod() res.setRequestHeaders(getConnectionHeaders(httpMethod)); // Request sent. Now get the response: instream = httpMethod.getResponseBodyAsStream(); if (instream != null) {// will be null for HEAD org.apache.commons.httpclient.Header responseHeader = httpMethod.getResponseHeader(TRANSFER_ENCODING); if (responseHeader != null && ENCODING_GZIP.equals(responseHeader.getValue())) { instream = new GZIPInputStream(instream); } //int contentLength = httpMethod.getResponseContentLength();Not visible ... //TODO size ouststream according to actual content length ByteArrayOutputStream outstream = new ByteArrayOutputStream(4 * 1024); //contentLength > 0 ? contentLength : DEFAULT_INITIAL_BUFFER_SIZE); byte[] buffer = new byte[4096]; int len; boolean first = true;// first response while ((len = instream.read(buffer)) > 0) { if (first) { // save the latency res.latencyEnd(); first = false; } outstream.write(buffer, 0, len); } res.setResponseData(outstream.toByteArray()); outstream.close(); } res.sampleEnd(); // Done with the sampling proper. // Now collect the results into the HTTPSampleResult: res.setSampleLabel(httpMethod.getURI().toString()); // Pick up Actual path (after redirects) res.setResponseCode(Integer.toString(statusCode)); res.setSuccessful(isSuccessCode(statusCode)); res.setResponseMessage(httpMethod.getStatusText()); String ct = null; org.apache.commons.httpclient.Header h = httpMethod.getResponseHeader(HEADER_CONTENT_TYPE); if (h != null)// Can be missing, e.g. on redirect { ct = h.getValue(); res.setContentType(ct);// e.g. text/html; charset=ISO-8859-1 res.setEncodingAndType(ct); } res.setResponseHeaders(getResponseHeaders(httpMethod)); if (res.isRedirect()) { res.setRedirectLocation(httpMethod.getResponseHeader(HEADER_LOCATION).getValue()); } // If we redirected automatically, the URL may have changed if (getAutoRedirects()) { res.setURL(new URL(httpMethod.getURI().toString())); } // Store any cookies received in the cookie manager: saveConnectionCookies(httpMethod, res.getURL(), getCookieManager()); // Save cache information final CacheManager cacheManager = getCacheManager(); if (cacheManager != null){ cacheManager.saveDetails(httpMethod, res); } // Follow redirects and download page resources if appropriate: res = resultProcessing(areFollowingRedirect, frameDepth, res); log.debug("End : sample"); httpMethod.releaseConnection(); return res; } catch (IllegalArgumentException e)// e.g. some kinds of invalid URL { res.sampleEnd(); HTTPSampleResult err = errorResult(e, res); err.setSampleLabel("Error: " + url.toString()); return err; } catch (IOException e) { res.sampleEnd(); HTTPSampleResult err = errorResult(e, res); err.setSampleLabel("Error: " + url.toString()); return err; } finally { JOrphanUtils.closeQuietly(instream); httpMethod.releaseConnection(); } } public URL getUrl() throws MalformedURLException { return new URL(getURLData()); } }
Ensure getContentLength() uses same encoding as will be used later Set a default for the response content-type in case one is not provided in the response git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/trunk@703669 13f79535-47bb-0310-9956-ffa450edef68 Former-commit-id: 46069a4346e94e46225192bec2836662d1961598
src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java
Ensure getContentLength() uses same encoding as will be used later Set a default for the response content-type in case one is not provided in the response
<ide><path>rc/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java <ide> import java.io.IOException; <ide> import java.io.InputStream; <ide> import java.io.OutputStream; <del>import java.io.PrintWriter; <add>import java.io.UnsupportedEncodingException; <ide> import java.net.MalformedURLException; <ide> import java.net.URL; <ide> import java.util.zip.GZIPInputStream; <ide> private static final String DOUBLE_QUOTE = "\""; //$NON-NLS-1$ <ide> <ide> private static final String SOAPACTION = "SOAPAction"; //$NON-NLS-1$ <add> <add> private static final String ENCODING = "utf-8"; //$NON-NLS-1$ TODO should this be variable? <add> <add> private static final String DEFAULT_CONTENT_TYPE = "text/xml"; //$NON-NLS-1$ <ide> <ide> public void setXmlData(String data) { <ide> setProperty(XML_DATA, data); <ide> } <ide> } else { <ide> // otherwise we use "text/xml" as the default <del> post.addParameter(HEADER_CONTENT_TYPE, "text/xml"); //$NON-NLS-1$ <add> post.addParameter(HEADER_CONTENT_TYPE, DEFAULT_CONTENT_TYPE); //$NON-NLS-1$ <ide> } <ide> if (getSendSOAPAction()) { <ide> post.setRequestHeader(SOAPACTION, getSOAPActionQuoted()); <ide> <ide> public String getContentType() { <ide> // TODO do we need to add a charset for the file contents? <del> return "text/xml"; // $NON-NLS-1$ <add> return DEFAULT_CONTENT_TYPE; // $NON-NLS-1$ <ide> } <ide> }); <ide> } else { <ide> <ide> public void writeRequest(OutputStream out) throws IOException { <ide> // charset must agree with content-type below <del> IOUtils.write(getXmlData(), out, "utf-8"); // $NON-NLS-1$ <add> IOUtils.write(getXmlData(), out, ENCODING); // $NON-NLS-1$ <ide> out.flush(); <ide> } <ide> <ide> public long getContentLength() { <del> return getXmlData().getBytes().length;// so we don't generate chunked encoding <add> try { <add> return getXmlData().getBytes(ENCODING).length; // so we don't generate chunked encoding <add> } catch (UnsupportedEncodingException e) { <add> log.warn(e.getLocalizedMessage()); <add> return -1; // will use chunked encoding <add> } <ide> } <ide> <ide> public String getContentType() { <del> return "text/xml; charset=utf-8"; // $NON-NLS-1$ <add> return DEFAULT_CONTENT_TYPE+"; charset="+ENCODING; // $NON-NLS-1$ <ide> } <ide> }); <ide> } <ide> <ide> res.setResponseMessage(httpMethod.getStatusText()); <ide> <add> // Set up the defaults (may be overridden below) <add> res.setDataEncoding(ENCODING); <add> res.setContentType(DEFAULT_CONTENT_TYPE); <ide> String ct = null; <ide> org.apache.commons.httpclient.Header h <ide> = httpMethod.getResponseHeader(HEADER_CONTENT_TYPE);
JavaScript
mit
e514383b1e4b142ba5e47818ce76420456673552
0
pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS
/* * Author: Pierre-Henry Soria <[email protected]> * Copyright: (c) 2012-2018, Pierre-Henry Soria. All Rights Reserved. * License: GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. */ function showField(sName, mShow) { if ($('#' + sName).css("display") == "none" && (typeof mShow == 'undefined' || mShow == '') || mShow == 1) { $('#' + sName).fadeIn("fast"); } else { $('#' + sName).fadeOut("fast"); } } const $goBox = (function () { // Video Popup (video tag) $("a[data-popup=video]").colorbox({ speed: 500, scrolling: false, inline: true }); // Video Box (Youtube, Vimeo, ...) $("a[data-popup=frame-video]").colorbox({ innerWidth: 525, innerHeight: 444, iframe: true }); // Box Popup (iframe) $("a[data-popup=frame]").colorbox({ width: '100%', maxWidth: '600px', height: '680px', iframe: true, close: 'esc' }); // Block popup page (iframe) $("a[data-popup=block-page]").click(function (oEvent) { oEvent.preventDefault(); $.get($(this).attr("href"), function (oData) { $.colorbox({ width: '100%', maxWidth: '400px', maxHeight: '85%', html: $(oData).find('#block_page') }) }) }); // Classic Box Popup (no frame) $("a[data-popup=classic]").colorbox({ scrolling: false }); // Picture Popup (img tag) $("a[data-popup=image]").colorbox({ maxWidth: '85%', maxHeight: '85%', scrolling: false, transition: 'fade', photo: true }); // Picture Slideshow Popup (img tag) $("a[data-popup=slideshow]").colorbox({ maxWidth: '95%', maxHeight: '95%', transition: 'fade', rel: 'photo', slideshow: true }); }); $goBox(); // Setup tooltips // Title of the links $('a[title],img[title],abbr[title]').each(function () { // "bIsDataPopup" checks that only for links that do not possess the attribute "data-popup", otherwise not the title of the popup (colorbox) cannot appear because of the plugin (tipTip). const bIsDataPopup = $(this).data('popup'); if (!bIsDataPopup) { const oE = $(this); let pos = "top"; if (oE.hasClass("tttop")) { pos = "top"; } if (oE.hasClass("ttbottom")) { pos = "bottom"; } if (oE.hasClass("ttleft")) { pos = "left"; } if (oE.hasClass("ttright")) { pos = "right"; } oE.tipTip({defaultPosition: pos}); $(this).tipTip( { maxWidth: 'auto', edgeOffset: 5, fadeIn: 400, fadeOut: 400, defaultPosition: pos } ); } }); // Title of the Forms $('form input[title],textarea[title],select[title]').each(function () { $(this).tipTip({ activation: 'focus', edgeOffset: 5, maxWidth: 'auto', fadeIn: 0, fadeOut: 0, delay: 0, defaultPosition: 'right' }) }); function openBox(sFile) { if (sFile) { $('div#box').dialog({ show: 'slide', hide: 'puff', resizable: false, stack: false, zIndex: 10999, open: function (oEvent) { $(this).load(sFile); } }); } } function loadingImg(iStatus, sIdContainer) { if (iStatus) { const sHtml = '<img src="' + pH7Url.tplImg + 'icon/loading2.gif" alt="' + pH7LangCore.loading + '" border="0" />'; $("#" + sIdContainer).html(sHtml); } else { $("#" + sIdContainer).html(''); } } if ($('div[role=alert]').length) { $('div[role=alert]').fadeOut(15000); }
templates/themes/base/js/global.js
/* * Author: Pierre-Henry Soria <[email protected]> * Copyright: (c) 2012-2018, Pierre-Henry Soria. All Rights Reserved. * License: GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. */ function showField(sName, mShow) { if ($('#' + sName).css("display") == "none" && (typeof mShow == 'undefined' || mShow == '') || mShow == 1) { $('#' + sName).fadeIn("fast"); } else { $('#' + sName).fadeOut("fast"); } } var $goBox = (function () { // Video Popup (video tag) $("a[data-popup=video]").colorbox({ speed: 500, scrolling: false, inline: true }); // Video Box (Youtube, Vimeo, ...) $("a[data-popup=frame-video]").colorbox({ innerWidth: 525, innerHeight: 444, iframe: true }); // Box Popup (iframe) $("a[data-popup=frame]").colorbox({ width: '100%', maxWidth: '600px', height: '680px', iframe: true, close: 'esc' }); // Block popup page (iframe) $("a[data-popup=block-page]").click(function (oEvent) { oEvent.preventDefault(); $.get($(this).attr("href"), function (oData) { $.colorbox({ width: '100%', maxWidth: '400px', maxHeight: '85%', html: $(oData).find('#block_page') }) }) }); // Classic Box Popup (no frame) $("a[data-popup=classic]").colorbox({ scrolling: false }); // Picture Popup (img tag) $("a[data-popup=image]").colorbox({ maxWidth: '85%', maxHeight: '85%', scrolling: false, transition: 'fade', photo: true }); // Picture Slideshow Popup (img tag) $("a[data-popup=slideshow]").colorbox({ maxWidth: '95%', maxHeight: '95%', transition: 'fade', rel: 'photo', slideshow: true }); }); $goBox(); // Setup tooltips // Title of the links $('a[title],img[title],abbr[title]').each(function () { // "bIsDataPopup" checks that only for links that do not possess the attribute "data-popup", otherwise not the title of the popup (colorbox) cannot appear because of the plugin (tipTip). var bIsDataPopup = $(this).data('popup'); if (!bIsDataPopup) { var oE = $(this); var pos = "top"; if (oE.hasClass("tttop")) pos = "top"; if (oE.hasClass("ttbottom")) pos = "bottom"; if (oE.hasClass("ttleft")) pos = "left"; if (oE.hasClass("ttright")) pos = "right"; oE.tipTip({defaultPosition: pos}); $(this).tipTip( { maxWidth: 'auto', edgeOffset: 5, fadeIn: 400, fadeOut: 400, defaultPosition: pos } ); } }); // Title of the Forms $('form input[title],textarea[title],select[title]').each(function () { $(this).tipTip({ activation: 'focus', edgeOffset: 5, maxWidth: 'auto', fadeIn: 0, fadeOut: 0, delay: 0, defaultPosition: 'right' }) }); function openBox(sFile) { if (sFile) { $('div#box').dialog({ show: 'slide', hide: 'puff', resizable: false, stack: false, zIndex: 10999, open: function (oEvent) { $(this).load(sFile); } }); } } function loadingImg(iStatus, sIdContainer) { if (iStatus) $("#" + sIdContainer).html('<img src="' + pH7Url.tplImg + 'icon/loading2.gif" alt="' + pH7LangCore.loading + '" border="0" />'); else $("#" + sIdContainer).html(''); } if ($('div[role=alert]').length) { $('div[role=alert]').fadeOut(15000); }
[ES6][global.js] Improve file; Indentation; Use const/let
templates/themes/base/js/global.js
[ES6][global.js] Improve file; Indentation; Use const/let
<ide><path>emplates/themes/base/js/global.js <ide> } <ide> } <ide> <del>var $goBox = (function () { <add>const $goBox = (function () { <ide> // Video Popup (video tag) <ide> $("a[data-popup=video]").colorbox({ <ide> speed: 500, <ide> <ide> $('a[title],img[title],abbr[title]').each(function () { <ide> // "bIsDataPopup" checks that only for links that do not possess the attribute "data-popup", otherwise not the title of the popup (colorbox) cannot appear because of the plugin (tipTip). <del> var bIsDataPopup = $(this).data('popup'); <add> const bIsDataPopup = $(this).data('popup'); <ide> <ide> if (!bIsDataPopup) { <del> var oE = $(this); <del> var pos = "top"; <del> if (oE.hasClass("tttop")) pos = "top"; <del> if (oE.hasClass("ttbottom")) pos = "bottom"; <del> if (oE.hasClass("ttleft")) pos = "left"; <del> if (oE.hasClass("ttright")) pos = "right"; <add> const oE = $(this); <add> let pos = "top"; <add> <add> if (oE.hasClass("tttop")) { <add> pos = "top"; <add> } <add> if (oE.hasClass("ttbottom")) { <add> pos = "bottom"; <add> } <add> if (oE.hasClass("ttleft")) { <add> pos = "left"; <add> } <add> if (oE.hasClass("ttright")) { <add> pos = "right"; <add> } <ide> oE.tipTip({defaultPosition: pos}); <add> <ide> $(this).tipTip( <ide> { <ide> maxWidth: 'auto', <ide> } <ide> <ide> function loadingImg(iStatus, sIdContainer) { <del> if (iStatus) <del> $("#" + sIdContainer).html('<img src="' + pH7Url.tplImg + 'icon/loading2.gif" alt="' + pH7LangCore.loading + '" border="0" />'); <del> else <add> if (iStatus) { <add> const sHtml = '<img src="' + pH7Url.tplImg + 'icon/loading2.gif" alt="' + pH7LangCore.loading + '" border="0" />'; <add> $("#" + sIdContainer).html(sHtml); <add> } else { <ide> $("#" + sIdContainer).html(''); <add> } <ide> } <ide> <ide> if ($('div[role=alert]').length) {
JavaScript
mit
error: pathspec 'league.js' did not match any file(s) known to git
096ec9205c8a199960d9e9f8d97ef72ba96b3fa7
1
sama2/Viridian-Pokemon-Showdown,sama2/Viridian-Pokemon-Showdown
//Viridian League const leagueDataFile = './config/league.json'; var fs = require('fs'); function defaultData() { var data = {}; data['main'] = { leader: '', desc: 'Liga Viridian', htmlDesc: 'placeholder', winners: {}, medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Liga-Viridian_zpsafe6664d.png', defaultTier: 'ou', colorGym: 'green' }; data['elite4steel'] = { leader: 'Dark Labyrinth', desc: 'Elite 4 de tipo Acero', htmlDesc: 'placeholder', winners: {}, medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymacercopy_zps5f3379c6.png', defaultTier: 'ou', colorGym: 'grey' }; data['elite4poison'] = { leader: 'Mr.Reptile', desc: 'Elite 4 de tipo Veneno', htmlDesc: 'placeholder', winners: {}, medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gympoiscopy_zps9d5f2293.png', defaultTier: 'ou', colorGym: 'purple' }; data['elite4dark'] = { leader: 'Tohsaka Rin', desc: 'Elite 4 de tipo Siniestro', htmlDesc: 'placeholder', winners: {}, medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymdark_zps321a00b7.png', defaultTier: 'ou', colorGym: 'black' }; data['elite4fighting'] = { leader: 'Misicloud', desc: 'Elite 4 de tipo Lucha', htmlDesc: 'placeholder', winners: {}, medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymfightcopy_zpseb4af77d.png', defaultTier: 'ou', colorGym: 'orange' }; data['gymfire'] = { leader: 'Law Yuuichi', desc: 'Líder de Gimnasio de tipo Fuego', htmlDesc: 'placeholder', winners: {}, medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymfirecopy_zps512fd6ad.png', defaultTier: 'ou', colorGym: 'red' }; data['gymflying'] = { leader: 'Licor43', desc: 'Líder de Gimnasio de tipo Volador', htmlDesc: 'placeholder', winners: {}, medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymflycopy_zps79f43ddb.png', defaultTier: 'ou', colorGym: 'cyan' }; data['gymwater'] = { leader: 'Chan00b', desc: 'Líder de Gimnasio de tipo Agua', htmlDesc: 'placeholder', winners: {}, medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymwatcopy_zps492773cd.png', defaultTier: 'ou', colorGym: 'blue' }; data['gymelectric'] = { leader: 'OdinWinterWolf', desc: 'Líder de Gimnasio de tipo Eléctrico', htmlDesc: 'placeholder', winners: {}, medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymeleccopy_zps8fc0fd06.png', defaultTier: 'ou', colorGym: 'yellow' }; data['gymdragon'] = { leader: 'Senky', desc: 'Líder de Gimnasio de tipo Dragón', htmlDesc: 'placeholder', winners: {}, medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymdrakecopy_zps72e5d6c3.png', defaultTier: 'ou', colorGym: 'garnet' }; data['gymbug'] = { leader: 'Campizzo', desc: 'Líder de Gimnasio de tipo Bicho', htmlDesc: 'placeholder', winners: {}, medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymbugcopy_zps8dabd34d.png', defaultTier: 'ou', colorGym: 'orange' }; data['gymgrass'] = { leader: 'Lemmy', desc: 'Líder de Gimnasio de tipo Planta', htmlDesc: 'placeholder', winners: {}, medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymgrass_zpsd4c561d6.png', defaultTier: 'ou', colorGym: 'green' }; data['gymground'] = { leader: 'Zng', desc: 'Líder de Gimnasio de tipo Tierra', htmlDesc: 'placeholder', winners: {}, medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymgroundcopy_zpse9d7bd8b.png', defaultTier: 'ou', colorGym: 'brown' }; return data; } if (!fs.existsSync(leagueDataFile)) fs.writeFileSync(leagueDataFile, JSON.stringify(defaultData())); var league = JSON.parse(fs.readFileSync(leagueDataFile).toString()); exports.league = league; exports.leagueRoom = 'ligaviridian'; function writeLeagueData() { exports.league = league; fs.writeFileSync(leagueDataFile, JSON.stringify(league)); } exports.getData = function (medalId) { medalId = toId(medalId); if (!league[medalId]) return false; return { leader: league[medalId].leader, desc: league[medalId].desc, htmlDesc: league[medalId].htmlDesc, winners: league[medalId].winners, medalImage: league[medalId].medalImage, colorGym: league[medalId].colorGym }; }; exports.findMedalFromLeader = function (leader) { leaderId = toId(leader); for (var i in league) { if (toId(league[i].leader) === leaderId) return i; } return false; }; exports.getGymTable = function () { var html = '<center><img width="200" src="http://i1224.photobucket.com/albums/ee376/DarkythePro/Liga-Viridian_zpsafe6664d.png" title="Liga Viridian" /><h2>Elite 4</h2>'; html += '<table border="0"><tr><td><img width="180" src="' + encodeURI(league['elite4steel'].medalImage) + '" title="Élite 4 de tipo Acero: ' + league['elite4steel'].leader + '" /></td>'; html += '<td><img width="180" src="' + encodeURI(league['elite4fighting'].medalImage) + '" title="Élite 4 de tipo Lucha: ' + league['elite4fighting'].leader + '" /></td></tr><tr>'; html += '<td><img width="180" src="' + encodeURI(league['elite4dark'].medalImage) + '" title="Élite 4 de tipo Siniestro: ' + league['elite4dark'].leader + '" /></td>'; html += '<td><img width="180" src="' + encodeURI(league['elite4poison'].medalImage) + '" title="Élite 4 de tipo Veneno: ' + league['elite4poison'].leader + '" /></td></tr></table><h2>Gimnasios</h2>'; html += '<table border="0"><tr><td><img width="160" src="' + encodeURI(league['gymfire'].medalImage) + '" title="Gimnasio de tipo Fuego: ' + league['gymfire'].leader + '" /></td>'; html += '<td><img width="160" src="' + encodeURI(league['gymwater'].medalImage) + '" title="Gimnasio de tipo Agua: ' + league['gymwater'].leader + '" /></td></tr><tr>'; html += '<td><img width="160" src="' + encodeURI(league['gymgrass'].medalImage) + '" title="Gimnasio de tipo Planta: ' + league['gymgrass'].leader + '" /></td>'; html += '<td><img width="160" src="' + encodeURI(league['gymground'].medalImage) + '" title="Gimnasio de tipo Tierra: ' + league['gymground'].leader + '" /></td></tr><tr>'; html += '<td><img width="160" src="' + encodeURI(league['gymflying'].medalImage) + '" title="Gimnasio de tipo Volador: ' + league['gymflying'].leader + '" /></td>'; html += '<td><img width="160" src="' + encodeURI(league['gymelectric'].medalImage) + '" title="Gimnasio de tipo Eléctrico: ' + league['gymelectric'].leader + '" /></td></tr><tr>'; html += '<td><img width="160" src="' + encodeURI(league['gymbug'].medalImage) + '" title="Gimnasio de tipo Bicho: ' + league['gymbug'].leader + '" /></td>'; html += '<td><img width="160" src="' + encodeURI(league['gymdragon'].medalImage) + '" title="Gimnasio de tipo Dragón: ' + league['gymdragon'].leader + '" /></td></tr></table>'; html += '<br /><b>&iexcl;Desafía a los miembros de la liga Viridian y gana sus medallas! </b><br /> Recuerda leer las reglas de un Gimnasio o Élite antes de desafiar a un miembro de la liga. Para más información sobre los comandos escribe /liga ayuda</center>'; return html; }; exports.haveMedal = function (user, medalId) { medalId = toId(medalId); var userId = toId(user); if (!league[medalId]) return false; if (!league[medalId].winners[userId]) return false; return true; }; exports.giveMedal = function (user, medalId) { medalId = toId(medalId); var userId = toId(user); if (!league[medalId]) return false; if (league[medalId].winners[userId]) return false; league[medalId].winners[userId] = 1; writeLeagueData(); return true; }; exports.removeMedal = function (user, medalId) { medalId = toId(medalId); var userId = toId(user); if (!league[medalId]) return false; if (!league[medalId].winners[userId]) return false; delete league[medalId].winners[userId]; writeLeagueData(); return true; }; exports.setMedalImage = function (medalId, image) { medalId = toId(medalId); if (!league[medalId]) return false; league[medalId].medalImage = Tools.escapeHTML(image); writeLeagueData(); return true; }; exports.setGymColor = function (medalId, color) { medalId = toId(medalId); if (!league[medalId]) return false; league[medalId].colorGym = Tools.escapeHTML(color); writeLeagueData(); return true; }; exports.setGymTier = function (medalId, tier) { medalId = toId(medalId); if (!league[medalId]) return false; league[medalId].defaultTier = toId(tier); writeLeagueData(); return true; }; exports.setGymLeader = function (medalId, leader) { medalId = toId(medalId); if (!league[medalId]) return false; if (leader !== '' && exports.findMedalFromLeader(leader)) return false; league[medalId].leader = leader; writeLeagueData(); return true; }; exports.setGymDesc = function (medalId, desc) { medalId = toId(medalId); if (!league[medalId]) return false; league[medalId].desc = Tools.escapeHTML(desc); writeLeagueData(); return true; }; exports.setGymDescHTML = function (medalId, html) { medalId = toId(medalId); if (!league[medalId]) return false; league[medalId].htmlDesc = html; writeLeagueData(); return true; };
league.js
Add Viridian League Data
league.js
Add Viridian League Data
<ide><path>eague.js <add>//Viridian League <add> <add>const leagueDataFile = './config/league.json'; <add> <add>var fs = require('fs'); <add> <add>function defaultData() { <add> var data = {}; <add> data['main'] = { <add> leader: '', <add> desc: 'Liga Viridian', <add> htmlDesc: 'placeholder', <add> winners: {}, <add> medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Liga-Viridian_zpsafe6664d.png', <add> defaultTier: 'ou', <add> colorGym: 'green' <add> <add> }; <add> data['elite4steel'] = { <add> leader: 'Dark Labyrinth', <add> desc: 'Elite 4 de tipo Acero', <add> htmlDesc: 'placeholder', <add> winners: {}, <add> medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymacercopy_zps5f3379c6.png', <add> defaultTier: 'ou', <add> colorGym: 'grey' <add> <add> }; <add> data['elite4poison'] = { <add> leader: 'Mr.Reptile', <add> desc: 'Elite 4 de tipo Veneno', <add> htmlDesc: 'placeholder', <add> winners: {}, <add> medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gympoiscopy_zps9d5f2293.png', <add> defaultTier: 'ou', <add> colorGym: 'purple' <add> <add> }; <add> data['elite4dark'] = { <add> leader: 'Tohsaka Rin', <add> desc: 'Elite 4 de tipo Siniestro', <add> htmlDesc: 'placeholder', <add> winners: {}, <add> medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymdark_zps321a00b7.png', <add> defaultTier: 'ou', <add> colorGym: 'black' <add> <add> }; <add> data['elite4fighting'] = { <add> leader: 'Misicloud', <add> desc: 'Elite 4 de tipo Lucha', <add> htmlDesc: 'placeholder', <add> winners: {}, <add> medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymfightcopy_zpseb4af77d.png', <add> defaultTier: 'ou', <add> colorGym: 'orange' <add> <add> }; <add> data['gymfire'] = { <add> leader: 'Law Yuuichi', <add> desc: 'Líder de Gimnasio de tipo Fuego', <add> htmlDesc: 'placeholder', <add> winners: {}, <add> medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymfirecopy_zps512fd6ad.png', <add> defaultTier: 'ou', <add> colorGym: 'red' <add> <add> }; <add> data['gymflying'] = { <add> leader: 'Licor43', <add> desc: 'Líder de Gimnasio de tipo Volador', <add> htmlDesc: 'placeholder', <add> winners: {}, <add> medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymflycopy_zps79f43ddb.png', <add> defaultTier: 'ou', <add> colorGym: 'cyan' <add> <add> }; <add> data['gymwater'] = { <add> leader: 'Chan00b', <add> desc: 'Líder de Gimnasio de tipo Agua', <add> htmlDesc: 'placeholder', <add> winners: {}, <add> medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymwatcopy_zps492773cd.png', <add> defaultTier: 'ou', <add> colorGym: 'blue' <add> <add> }; <add> data['gymelectric'] = { <add> leader: 'OdinWinterWolf', <add> desc: 'Líder de Gimnasio de tipo Eléctrico', <add> htmlDesc: 'placeholder', <add> winners: {}, <add> medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymeleccopy_zps8fc0fd06.png', <add> defaultTier: 'ou', <add> colorGym: 'yellow' <add> <add> }; <add> data['gymdragon'] = { <add> leader: 'Senky', <add> desc: 'Líder de Gimnasio de tipo Dragón', <add> htmlDesc: 'placeholder', <add> winners: {}, <add> medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymdrakecopy_zps72e5d6c3.png', <add> defaultTier: 'ou', <add> colorGym: 'garnet' <add> <add> }; <add> data['gymbug'] = { <add> leader: 'Campizzo', <add> desc: 'Líder de Gimnasio de tipo Bicho', <add> htmlDesc: 'placeholder', <add> winners: {}, <add> medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymbugcopy_zps8dabd34d.png', <add> defaultTier: 'ou', <add> colorGym: 'orange' <add> <add> }; <add> data['gymgrass'] = { <add> leader: 'Lemmy', <add> desc: 'Líder de Gimnasio de tipo Planta', <add> htmlDesc: 'placeholder', <add> winners: {}, <add> medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymgrass_zpsd4c561d6.png', <add> defaultTier: 'ou', <add> colorGym: 'green' <add> <add> }; <add> data['gymground'] = { <add> leader: 'Zng', <add> desc: 'Líder de Gimnasio de tipo Tierra', <add> htmlDesc: 'placeholder', <add> winners: {}, <add> medalImage: 'http://i1224.photobucket.com/albums/ee376/DarkythePro/Gymgroundcopy_zpse9d7bd8b.png', <add> defaultTier: 'ou', <add> colorGym: 'brown' <add> <add> }; <add> return data; <add>} <add> <add>if (!fs.existsSync(leagueDataFile)) <add> fs.writeFileSync(leagueDataFile, JSON.stringify(defaultData())); <add> <add>var league = JSON.parse(fs.readFileSync(leagueDataFile).toString()); <add> <add>exports.league = league; <add>exports.leagueRoom = 'ligaviridian'; <add> <add>function writeLeagueData() { <add> exports.league = league; <add> fs.writeFileSync(leagueDataFile, JSON.stringify(league)); <add>} <add> <add>exports.getData = function (medalId) { <add> medalId = toId(medalId); <add> if (!league[medalId]) return false; <add> return { <add> leader: league[medalId].leader, <add> desc: league[medalId].desc, <add> htmlDesc: league[medalId].htmlDesc, <add> winners: league[medalId].winners, <add> medalImage: league[medalId].medalImage, <add> colorGym: league[medalId].colorGym <add> }; <add>}; <add> <add>exports.findMedalFromLeader = function (leader) { <add> leaderId = toId(leader); <add> for (var i in league) { <add> if (toId(league[i].leader) === leaderId) return i; <add> } <add> return false; <add>}; <add> <add>exports.getGymTable = function () { <add> var html = '<center><img width="200" src="http://i1224.photobucket.com/albums/ee376/DarkythePro/Liga-Viridian_zpsafe6664d.png" title="Liga Viridian" /><h2>Elite 4</h2>'; <add> html += '<table border="0"><tr><td><img width="180" src="' + encodeURI(league['elite4steel'].medalImage) + '" title="Élite 4 de tipo Acero: ' + league['elite4steel'].leader + '" /></td>'; <add> html += '<td><img width="180" src="' + encodeURI(league['elite4fighting'].medalImage) + '" title="Élite 4 de tipo Lucha: ' + league['elite4fighting'].leader + '" /></td></tr><tr>'; <add> html += '<td><img width="180" src="' + encodeURI(league['elite4dark'].medalImage) + '" title="Élite 4 de tipo Siniestro: ' + league['elite4dark'].leader + '" /></td>'; <add> html += '<td><img width="180" src="' + encodeURI(league['elite4poison'].medalImage) + '" title="Élite 4 de tipo Veneno: ' + league['elite4poison'].leader + '" /></td></tr></table><h2>Gimnasios</h2>'; <add> html += '<table border="0"><tr><td><img width="160" src="' + encodeURI(league['gymfire'].medalImage) + '" title="Gimnasio de tipo Fuego: ' + league['gymfire'].leader + '" /></td>'; <add> html += '<td><img width="160" src="' + encodeURI(league['gymwater'].medalImage) + '" title="Gimnasio de tipo Agua: ' + league['gymwater'].leader + '" /></td></tr><tr>'; <add> html += '<td><img width="160" src="' + encodeURI(league['gymgrass'].medalImage) + '" title="Gimnasio de tipo Planta: ' + league['gymgrass'].leader + '" /></td>'; <add> html += '<td><img width="160" src="' + encodeURI(league['gymground'].medalImage) + '" title="Gimnasio de tipo Tierra: ' + league['gymground'].leader + '" /></td></tr><tr>'; <add> html += '<td><img width="160" src="' + encodeURI(league['gymflying'].medalImage) + '" title="Gimnasio de tipo Volador: ' + league['gymflying'].leader + '" /></td>'; <add> html += '<td><img width="160" src="' + encodeURI(league['gymelectric'].medalImage) + '" title="Gimnasio de tipo Eléctrico: ' + league['gymelectric'].leader + '" /></td></tr><tr>'; <add> html += '<td><img width="160" src="' + encodeURI(league['gymbug'].medalImage) + '" title="Gimnasio de tipo Bicho: ' + league['gymbug'].leader + '" /></td>'; <add> html += '<td><img width="160" src="' + encodeURI(league['gymdragon'].medalImage) + '" title="Gimnasio de tipo Dragón: ' + league['gymdragon'].leader + '" /></td></tr></table>'; <add> html += '<br /><b>&iexcl;Desafía a los miembros de la liga Viridian y gana sus medallas! </b><br /> Recuerda leer las reglas de un Gimnasio o Élite antes de desafiar a un miembro de la liga. Para más información sobre los comandos escribe /liga ayuda</center>'; <add> return html; <add>}; <add> <add>exports.haveMedal = function (user, medalId) { <add> medalId = toId(medalId); <add> var userId = toId(user); <add> if (!league[medalId]) return false; <add> if (!league[medalId].winners[userId]) return false; <add> return true; <add>}; <add> <add>exports.giveMedal = function (user, medalId) { <add> medalId = toId(medalId); <add> var userId = toId(user); <add> if (!league[medalId]) return false; <add> if (league[medalId].winners[userId]) return false; <add> league[medalId].winners[userId] = 1; <add> writeLeagueData(); <add> return true; <add>}; <add> <add>exports.removeMedal = function (user, medalId) { <add> medalId = toId(medalId); <add> var userId = toId(user); <add> if (!league[medalId]) return false; <add> if (!league[medalId].winners[userId]) return false; <add> delete league[medalId].winners[userId]; <add> writeLeagueData(); <add> return true; <add>}; <add> <add>exports.setMedalImage = function (medalId, image) { <add> medalId = toId(medalId); <add> if (!league[medalId]) return false; <add> league[medalId].medalImage = Tools.escapeHTML(image); <add> writeLeagueData(); <add> return true; <add>}; <add> <add>exports.setGymColor = function (medalId, color) { <add> medalId = toId(medalId); <add> if (!league[medalId]) return false; <add> league[medalId].colorGym = Tools.escapeHTML(color); <add> writeLeagueData(); <add> return true; <add>}; <add> <add>exports.setGymTier = function (medalId, tier) { <add> medalId = toId(medalId); <add> if (!league[medalId]) return false; <add> league[medalId].defaultTier = toId(tier); <add> writeLeagueData(); <add> return true; <add>}; <add> <add>exports.setGymLeader = function (medalId, leader) { <add> medalId = toId(medalId); <add> if (!league[medalId]) return false; <add> if (leader !== '' && exports.findMedalFromLeader(leader)) return false; <add> league[medalId].leader = leader; <add> writeLeagueData(); <add> return true; <add>}; <add> <add>exports.setGymDesc = function (medalId, desc) { <add> medalId = toId(medalId); <add> if (!league[medalId]) return false; <add> league[medalId].desc = Tools.escapeHTML(desc); <add> writeLeagueData(); <add> return true; <add>}; <add> <add>exports.setGymDescHTML = function (medalId, html) { <add> medalId = toId(medalId); <add> if (!league[medalId]) return false; <add> league[medalId].htmlDesc = html; <add> writeLeagueData(); <add> return true; <add>};
Java
mit
dc3303ec670dbf456bb458795513e225a9efa2cf
0
OreCruncher/DynamicSurroundings,OreCruncher/DynamicSurroundings
/* * This file is part of Dynamic Surroundings, licensed under the MIT License (MIT). * * Copyright (c) OreCruncher * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.blockartistry.mod.DynSurround.scripts.json; import java.io.Reader; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import javax.annotation.Nonnull; import org.blockartistry.mod.DynSurround.ModLog; import org.blockartistry.mod.DynSurround.data.xface.BiomeConfig; import org.blockartistry.mod.DynSurround.data.xface.BlockConfig; import org.blockartistry.mod.DynSurround.data.xface.DimensionConfig; import org.blockartistry.mod.DynSurround.data.xface.ItemConfig; import org.blockartistry.mod.DynSurround.registry.BiomeRegistry; import org.blockartistry.mod.DynSurround.registry.BlockRegistry; import org.blockartistry.mod.DynSurround.registry.DimensionRegistry; import org.blockartistry.mod.DynSurround.registry.FootstepsRegistry; import org.blockartistry.mod.DynSurround.registry.ItemRegistry; import org.blockartistry.mod.DynSurround.registry.RegistryManager; import org.blockartistry.mod.DynSurround.registry.RegistryManager.RegistryType; import org.blockartistry.mod.DynSurround.util.JsonUtils; import com.google.common.collect.ImmutableList; import com.google.gson.annotations.SerializedName; import net.minecraftforge.fml.relauncher.Side; public final class ConfigurationScript { public static class ForgeEntry { @SerializedName("acousticProfile") public String acousticProfile = null; @SerializedName("dictionaryEntries") public List<String> dictionaryEntries = ImmutableList.of(); } @SerializedName("biomes") public List<BiomeConfig> biomes = ImmutableList.of(); @SerializedName("biomeAlias") public Map<String, String> biomeAlias = new HashMap<String, String>(); @SerializedName("blocks") public List<BlockConfig> blocks = ImmutableList.of(); @SerializedName("dimensions") public List<DimensionConfig> dimensions = ImmutableList.of(); @SerializedName("footsteps") public Map<String, String> footsteps = new HashMap<String, String>(); @SerializedName("forgeMappings") public List<ForgeEntry> forgeMappings = ImmutableList.of(); @SerializedName("itemConfig") public ItemConfig itemConfig = new ItemConfig(); public static void process(@Nonnull Side side, @Nonnull final Reader reader) { try { final ConfigurationScript script = JsonUtils.load(reader, ConfigurationScript.class); final DimensionRegistry dimensions = RegistryManager.get(RegistryType.DIMENSION); for (final DimensionConfig dimension : script.dimensions) dimensions.register(dimension); // Do this first - config may want to alias biomes and that // needs to happen before processing actual biomes final BiomeRegistry biomes = RegistryManager.get(RegistryType.BIOME); for (final Entry<String, String> entry : script.biomeAlias.entrySet()) biomes.registerBiomeAlias(entry.getKey(), entry.getValue()); for (final BiomeConfig biome : script.biomes) biomes.register(biome); // We don't want to process these items if the mod is running // on the server - they apply only to client side. if(side == Side.SERVER) return; final BlockRegistry blocks = RegistryManager.get(RegistryType.BLOCK); for (final BlockConfig block : script.blocks) blocks.register(block); final FootstepsRegistry footsteps = RegistryManager.get(RegistryType.FOOTSTEPS); for (final ForgeEntry entry : script.forgeMappings) { for (final String name : entry.dictionaryEntries) footsteps.registerForgeEntries(entry.acousticProfile, name); } for (final Entry<String, String> entry : script.footsteps.entrySet()) { footsteps.registerBlocks(entry.getValue(), entry.getKey()); } final ItemRegistry itemRegistry = RegistryManager.get(RegistryType.ITEMS); itemRegistry.register(script.itemConfig); } catch (final Throwable t) { ModLog.error("Unable to process configuration script", t); } } }
src/main/java/org/blockartistry/mod/DynSurround/scripts/json/ConfigurationScript.java
/* * This file is part of Dynamic Surroundings, licensed under the MIT License (MIT). * * Copyright (c) OreCruncher * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.blockartistry.mod.DynSurround.scripts.json; import java.io.Reader; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import javax.annotation.Nonnull; import org.blockartistry.mod.DynSurround.ModLog; import org.blockartistry.mod.DynSurround.data.xface.BiomeConfig; import org.blockartistry.mod.DynSurround.data.xface.BlockConfig; import org.blockartistry.mod.DynSurround.data.xface.DimensionConfig; import org.blockartistry.mod.DynSurround.data.xface.ItemConfig; import org.blockartistry.mod.DynSurround.registry.BiomeRegistry; import org.blockartistry.mod.DynSurround.registry.BlockRegistry; import org.blockartistry.mod.DynSurround.registry.DimensionRegistry; import org.blockartistry.mod.DynSurround.registry.FootstepsRegistry; import org.blockartistry.mod.DynSurround.registry.ItemRegistry; import org.blockartistry.mod.DynSurround.registry.RegistryManager; import org.blockartistry.mod.DynSurround.registry.RegistryManager.RegistryType; import org.blockartistry.mod.DynSurround.util.JsonUtils; import com.google.common.collect.ImmutableList; import com.google.gson.annotations.SerializedName; import net.minecraftforge.fml.relauncher.Side; public final class ConfigurationScript { public static class ForgeEntry { @SerializedName("acousticProfile") public String acousticProfile = null; @SerializedName("dictionaryEntries") public List<String> dictionaryEntries = ImmutableList.of(); } @SerializedName("biomes") public List<BiomeConfig> biomes = ImmutableList.of(); @SerializedName("biomeAlias") public Map<String, String> biomeAlias = new HashMap<String, String>(); @SerializedName("blocks") public List<BlockConfig> blocks = ImmutableList.of(); @SerializedName("dimensions") public List<DimensionConfig> dimensions = ImmutableList.of(); @SerializedName("footsteps") public Map<String, String> footsteps = new HashMap<String, String>(); @SerializedName("forgeMappings") public List<ForgeEntry> forgeMappings = ImmutableList.of(); @SerializedName("itemConfig") public ItemConfig itemConfig = new ItemConfig(); public static void process(@Nonnull Side side, @Nonnull final Reader reader) { try { final ConfigurationScript script = JsonUtils.load(reader, ConfigurationScript.class); final DimensionRegistry dimensions = RegistryManager.get(RegistryType.DIMENSION); for (final DimensionConfig dimension : script.dimensions) dimensions.register(dimension); // Do this first - config may want to alias biomes and that // needs to happen before processing actual biomes final BiomeRegistry biomes = RegistryManager.get(RegistryType.BIOME); for (final Entry<String, String> entry : script.biomeAlias.entrySet()) biomes.registerBiomeAlias(entry.getKey(), entry.getValue()); for (final BiomeConfig biome : script.biomes) biomes.register(biome); // We don't want to process these items if the mod is running // on the server - they apply only to client side. if(side == Side.SERVER) return; final BlockRegistry blocks = RegistryManager.get(RegistryType.BLOCK); for (final BlockConfig block : script.blocks) blocks.register(block); final FootstepsRegistry footsteps = RegistryManager.get(RegistryType.FOOTSTEPS); for (final Entry<String, String> entry : script.footsteps.entrySet()) { footsteps.registerBlocks(entry.getValue(), entry.getKey()); } for (final ForgeEntry entry : script.forgeMappings) { for (final String name : entry.dictionaryEntries) footsteps.registerForgeEntries(entry.acousticProfile, name); } final ItemRegistry itemRegistry = RegistryManager.get(RegistryType.ITEMS); itemRegistry.register(script.itemConfig); } catch (final Throwable t) { ModLog.error("Unable to process configuration script", t); } } }
Init forge dictionary acoustics before block specific
src/main/java/org/blockartistry/mod/DynSurround/scripts/json/ConfigurationScript.java
Init forge dictionary acoustics before block specific
<ide><path>rc/main/java/org/blockartistry/mod/DynSurround/scripts/json/ConfigurationScript.java <ide> blocks.register(block); <ide> <ide> final FootstepsRegistry footsteps = RegistryManager.get(RegistryType.FOOTSTEPS); <del> for (final Entry<String, String> entry : script.footsteps.entrySet()) { <del> footsteps.registerBlocks(entry.getValue(), entry.getKey()); <del> } <del> <ide> for (final ForgeEntry entry : script.forgeMappings) { <ide> for (final String name : entry.dictionaryEntries) <ide> footsteps.registerForgeEntries(entry.acousticProfile, name); <ide> } <ide> <add> for (final Entry<String, String> entry : script.footsteps.entrySet()) { <add> footsteps.registerBlocks(entry.getValue(), entry.getKey()); <add> } <add> <ide> final ItemRegistry itemRegistry = RegistryManager.get(RegistryType.ITEMS); <ide> itemRegistry.register(script.itemConfig); <ide>
Java
agpl-3.0
008d18e6f6acb65d99c6c87ae8e82a531e526a6c
0
bluestreak01/questdb,bluestreak01/questdb,bluestreak01/questdb,bluestreak01/questdb,bluestreak01/questdb
/* * Copyright (c) 2014. Vlad Ilyushchenko * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.nfsdb.journal.net; import com.nfsdb.journal.exceptions.JournalNetworkException; import com.nfsdb.journal.logging.Logger; import com.nfsdb.journal.net.config.SslConfig; import com.nfsdb.journal.utils.ByteBuffers; import javax.net.ssl.*; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.ByteChannel; public class SecureByteChannel implements ByteChannel { private static final Logger LOGGER = Logger.getLogger(SecureByteChannel.class); private final ByteChannel underlying; private final SSLEngine engine; private final ByteBuffer inBuf; private final ByteBuffer outBuf; private final int sslDataLimit; private final boolean client; private boolean inData = false; private SSLEngineResult.HandshakeStatus handshakeStatus = SSLEngineResult.HandshakeStatus.NEED_WRAP; private ByteBuffer swapBuf; private boolean fillInBuf = true; public SecureByteChannel(ByteChannel underlying, SslConfig sslConfig) throws JournalNetworkException { this.underlying = underlying; SSLContext sslc = sslConfig.getSslContext(); this.engine = sslc.createSSLEngine(); this.engine.setEnableSessionCreation(true); this.engine.setUseClientMode(sslConfig.isClient()); this.engine.setNeedClientAuth(sslConfig.isRequireClientAuth()); this.client = sslConfig.isClient(); SSLSession session = engine.getSession(); this.sslDataLimit = session.getApplicationBufferSize(); inBuf = ByteBuffer.allocateDirect(session.getPacketBufferSize()); outBuf = ByteBuffer.allocateDirect(session.getPacketBufferSize()); swapBuf = ByteBuffer.allocate(sslDataLimit * 2); } @Override public int read(ByteBuffer dst) throws IOException { handshake(); int p = dst.position(); while (true) { int limit = dst.remaining(); if (limit == 0) { break; } // check if anything is remaining in swapBuf if (swapBuf.hasRemaining()) { ByteBuffers.copy(swapBuf, dst); } else { if (fillInBuf) { // read from channel inBuf.clear(); int result = underlying.read(inBuf); if (result == -1) { throw new IOException("Did not expect -1 from socket channel"); } if (result == 0) { throw new IOException("Blocking connection must not return 0"); } inBuf.flip(); } // dst is larger than minimum? if (limit < sslDataLimit) { // no, dst is small, use swap swapBuf.clear(); fillInBuf = unwrap(swapBuf); swapBuf.flip(); ByteBuffers.copy(swapBuf, dst); } else { fillInBuf = unwrap(dst); } } } return dst.position() - p; } @Override public int write(ByteBuffer src) throws IOException { handshake(); int count = src.remaining(); while (src.hasRemaining()) { outBuf.clear(); SSLEngineResult result = engine.wrap(src, outBuf); if (result.getStatus() != SSLEngineResult.Status.OK) { throw new IOException("Expected OK, got: " + result.getStatus()); } outBuf.flip(); try { ByteBuffers.copy(outBuf, underlying); } catch (JournalNetworkException e) { throw new IOException(e); } } return count; } @Override public boolean isOpen() { return underlying.isOpen(); } @Override public void close() throws IOException { underlying.close(); if (engine.isOutboundDone()) { engine.closeOutbound(); } while (!engine.isInboundDone()) { try { engine.closeInbound(); } catch (SSLException e) { // ignore } } } private void handshake() throws IOException { if (handshakeStatus == SSLEngineResult.HandshakeStatus.FINISHED) { return; } engine.beginHandshake(); while (handshakeStatus != SSLEngineResult.HandshakeStatus.FINISHED) { switch (handshakeStatus) { case NOT_HANDSHAKING: throw new IOException("Not handshaking"); case NEED_WRAP: outBuf.clear(); swapBuf.clear(); try { handshakeStatus = engine.wrap(swapBuf, outBuf).getHandshakeStatus(); } catch (SSLException e) { LOGGER.error("Server handshake failed: %s", e.getMessage()); closureOnException(); throw e; } outBuf.flip(); underlying.write(outBuf); LOGGER.info("WRAP: %s", client ? "CLIENT" : "SERVER"); break; case NEED_UNWRAP: if (!inData || !inBuf.hasRemaining()) { inBuf.clear(); underlying.read(inBuf); inBuf.flip(); inData = true; } try { handshakeStatus = engine.unwrap(inBuf, swapBuf).getHandshakeStatus(); } catch (SSLException e) { LOGGER.error("Client handshake failed: %s", e.getMessage()); throw e; } LOGGER.info("UNWRAP: %s", client ? "CLIENT" : "SERVER"); break; case NEED_TASK: Runnable task; while ((task = engine.getDelegatedTask()) != null) { task.run(); } handshakeStatus = engine.getHandshakeStatus(); LOGGER.info("TASK: %s", client ? "CLIENT" : "SERVER"); break; } } inBuf.clear(); // make sure swapBuf starts by having remaining() == false swapBuf.position(swapBuf.limit()); LOGGER.info("Handshake complete: %s", client ? "CLIENT" : "SERVER"); } private void closureOnException() throws IOException { swapBuf.position(0); swapBuf.limit(0); SSLEngineResult sslEngineResult; do { outBuf.clear(); sslEngineResult = engine.wrap(swapBuf, outBuf); outBuf.flip(); underlying.write(outBuf); if (sslEngineResult.getStatus() == SSLEngineResult.Status.CLOSED) { break; } } while (sslEngineResult.getStatus() != SSLEngineResult.Status.CLOSED && !engine.isInboundDone()); engine.closeOutbound(); } private boolean unwrap(ByteBuffer dst) throws IOException { while (inBuf.hasRemaining()) { SSLEngineResult.Status status = engine.unwrap(inBuf, dst).getStatus(); switch (status) { case BUFFER_UNDERFLOW: LOGGER.info("UNDERFL: %s", client ? "CLIENT" : "SERVER"); inBuf.compact(); underlying.read(inBuf); inBuf.flip(); break; case BUFFER_OVERFLOW: LOGGER.info("OVERFL: %s", client ? "CLIENT" : "SERVER"); return false; case OK: LOGGER.info("OK: %s", client ? "CLIENT" : "SERVER"); break; case CLOSED: throw new IOException("Did not expect CLOSED"); } } return true; } }
nfsdb-core/src/main/java/com/nfsdb/journal/net/SecureByteChannel.java
/* * Copyright (c) 2014. Vlad Ilyushchenko * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.nfsdb.journal.net; import com.nfsdb.journal.exceptions.JournalNetworkException; import com.nfsdb.journal.logging.Logger; import com.nfsdb.journal.net.config.SslConfig; import com.nfsdb.journal.utils.ByteBuffers; import javax.net.ssl.*; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.ByteChannel; public class SecureByteChannel implements ByteChannel { private static final Logger LOGGER = Logger.getLogger(SecureByteChannel.class); private final ByteChannel underlying; private final SSLEngine engine; private final ByteBuffer inBuf; private final ByteBuffer outBuf; private final int sslDataLimit; private boolean inData = false; private SSLEngineResult.HandshakeStatus handshakeStatus = SSLEngineResult.HandshakeStatus.NEED_WRAP; private ByteBuffer swapBuf; private boolean fillInBuf = true; public SecureByteChannel(ByteChannel underlying, SslConfig sslConfig) throws JournalNetworkException { this.underlying = underlying; SSLContext sslc = sslConfig.getSslContext(); this.engine = sslc.createSSLEngine(); this.engine.setEnableSessionCreation(true); this.engine.setUseClientMode(sslConfig.isClient()); this.engine.setNeedClientAuth(sslConfig.isRequireClientAuth()); SSLSession session = engine.getSession(); this.sslDataLimit = session.getApplicationBufferSize(); inBuf = ByteBuffer.allocateDirect(session.getPacketBufferSize()); outBuf = ByteBuffer.allocateDirect(session.getPacketBufferSize()); swapBuf = ByteBuffer.allocate(sslDataLimit * 2); } @Override public int read(ByteBuffer dst) throws IOException { handshake(); int p = dst.position(); while (true) { int limit = dst.remaining(); if (limit == 0) { break; } // check if anything is remaining in swapBuf if (swapBuf.hasRemaining()) { ByteBuffers.copy(swapBuf, dst); } else { if (fillInBuf) { // read from channel inBuf.clear(); int result = underlying.read(inBuf); if (result == -1) { throw new IOException("Did not expect -1 from socket channel"); } if (result == 0) { throw new IOException("Blocking connection must not return 0"); } inBuf.flip(); } // dst is larger than minimum? if (limit < sslDataLimit) { // no, dst is small, use swap swapBuf.clear(); fillInBuf = unwrap(swapBuf); swapBuf.flip(); ByteBuffers.copy(swapBuf, dst); } else { fillInBuf = unwrap(dst); } } } return dst.position() - p; } @Override public int write(ByteBuffer src) throws IOException { handshake(); int count = src.remaining(); while (src.hasRemaining()) { outBuf.clear(); SSLEngineResult result = engine.wrap(src, outBuf); if (result.getStatus() != SSLEngineResult.Status.OK) { throw new IOException("Expected OK, got: " + result.getStatus()); } outBuf.flip(); try { ByteBuffers.copy(outBuf, underlying); } catch (JournalNetworkException e) { throw new IOException(e); } } return count; } @Override public boolean isOpen() { return underlying.isOpen(); } @Override public void close() throws IOException { underlying.close(); if (engine.isOutboundDone()) { engine.closeOutbound(); } while (!engine.isInboundDone()) { try { engine.closeInbound(); } catch (SSLException e) { // ignore } } } private void handshake() throws IOException { if (handshakeStatus == SSLEngineResult.HandshakeStatus.FINISHED) { return; } engine.beginHandshake(); while (handshakeStatus != SSLEngineResult.HandshakeStatus.FINISHED) { switch (handshakeStatus) { case NOT_HANDSHAKING: throw new IOException("Not handshaking"); case NEED_WRAP: outBuf.clear(); swapBuf.clear(); try { handshakeStatus = engine.wrap(swapBuf, outBuf).getHandshakeStatus(); } catch (SSLException e) { LOGGER.error("Server handshake failed: %s", e.getMessage()); closureOnException(); throw e; } outBuf.flip(); underlying.write(outBuf); break; case NEED_UNWRAP: if (!inData || !inBuf.hasRemaining()) { inBuf.clear(); underlying.read(inBuf); inBuf.flip(); inData = true; } try { handshakeStatus = engine.unwrap(inBuf, swapBuf).getHandshakeStatus(); } catch (SSLException e) { LOGGER.error("Client handshake failed: %s", e.getMessage()); throw e; } break; case NEED_TASK: Runnable task; while ((task = engine.getDelegatedTask()) != null) { task.run(); } handshakeStatus = engine.getHandshakeStatus(); break; } } inBuf.clear(); // make sure swapBuf starts by having remaining() == false swapBuf.position(swapBuf.limit()); } private void closureOnException() throws IOException { swapBuf.position(0); swapBuf.limit(0); SSLEngineResult sslEngineResult; do { outBuf.clear(); sslEngineResult = engine.wrap(swapBuf, outBuf); outBuf.flip(); underlying.write(outBuf); if (sslEngineResult.getStatus() == SSLEngineResult.Status.CLOSED) { break; } } while (sslEngineResult.getStatus() != SSLEngineResult.Status.CLOSED && !engine.isInboundDone()); engine.closeOutbound(); } private boolean unwrap(ByteBuffer dst) throws IOException { while (inBuf.hasRemaining()) { SSLEngineResult.Status status = engine.unwrap(inBuf, dst).getStatus(); switch (status) { case BUFFER_UNDERFLOW: inBuf.compact(); underlying.read(inBuf); inBuf.flip(); break; case BUFFER_OVERFLOW: return false; case OK: break; case CLOSED: throw new IOException("Did not expect CLOSED"); } } return true; } }
debugging hanging ssl test
nfsdb-core/src/main/java/com/nfsdb/journal/net/SecureByteChannel.java
debugging hanging ssl test
<ide><path>fsdb-core/src/main/java/com/nfsdb/journal/net/SecureByteChannel.java <ide> private final ByteBuffer inBuf; <ide> private final ByteBuffer outBuf; <ide> private final int sslDataLimit; <add> private final boolean client; <ide> private boolean inData = false; <ide> private SSLEngineResult.HandshakeStatus handshakeStatus = SSLEngineResult.HandshakeStatus.NEED_WRAP; <ide> private ByteBuffer swapBuf; <ide> this.engine.setEnableSessionCreation(true); <ide> this.engine.setUseClientMode(sslConfig.isClient()); <ide> this.engine.setNeedClientAuth(sslConfig.isRequireClientAuth()); <del> <add> this.client = sslConfig.isClient(); <ide> SSLSession session = engine.getSession(); <ide> this.sslDataLimit = session.getApplicationBufferSize(); <ide> inBuf = ByteBuffer.allocateDirect(session.getPacketBufferSize()); <ide> } <ide> outBuf.flip(); <ide> underlying.write(outBuf); <add> LOGGER.info("WRAP: %s", client ? "CLIENT" : "SERVER"); <ide> break; <ide> case NEED_UNWRAP: <ide> if (!inData || !inBuf.hasRemaining()) { <ide> LOGGER.error("Client handshake failed: %s", e.getMessage()); <ide> throw e; <ide> } <add> LOGGER.info("UNWRAP: %s", client ? "CLIENT" : "SERVER"); <ide> break; <ide> case NEED_TASK: <ide> Runnable task; <ide> task.run(); <ide> } <ide> handshakeStatus = engine.getHandshakeStatus(); <add> LOGGER.info("TASK: %s", client ? "CLIENT" : "SERVER"); <ide> break; <ide> } <ide> } <ide> inBuf.clear(); <ide> // make sure swapBuf starts by having remaining() == false <ide> swapBuf.position(swapBuf.limit()); <add> <add> LOGGER.info("Handshake complete: %s", client ? "CLIENT" : "SERVER"); <ide> } <ide> <ide> private void closureOnException() throws IOException { <ide> SSLEngineResult.Status status = engine.unwrap(inBuf, dst).getStatus(); <ide> switch (status) { <ide> case BUFFER_UNDERFLOW: <add> LOGGER.info("UNDERFL: %s", client ? "CLIENT" : "SERVER"); <ide> inBuf.compact(); <ide> underlying.read(inBuf); <ide> inBuf.flip(); <ide> break; <ide> case BUFFER_OVERFLOW: <add> LOGGER.info("OVERFL: %s", client ? "CLIENT" : "SERVER"); <ide> return false; <ide> case OK: <add> LOGGER.info("OK: %s", client ? "CLIENT" : "SERVER"); <ide> break; <ide> case CLOSED: <ide> throw new IOException("Did not expect CLOSED");
Java
apache-2.0
095192797204d0b0fd6b47855395a89ffeb5916e
0
quarkusio/quarkus,quarkusio/quarkus,quarkusio/quarkus,quarkusio/quarkus,quarkusio/quarkus
package io.quarkus.hibernate.search.orm.elasticsearch.test.configuration; import static org.assertj.core.api.Assertions.assertThat; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.runtime.configuration.ConfigurationException; import io.quarkus.test.QuarkusUnitTest; public class ConfigEnabledFalseAndActiveTrueTest { @RegisterExtension static final QuarkusUnitTest config = new QuarkusUnitTest().setArchiveProducer( () -> ShrinkWrap.create(JavaArchive.class).addClass(IndexedEntity.class)) .withConfigurationResource("application.properties") .overrideConfigKey("quarkus.hibernate-search-orm.enabled", "false") .overrideConfigKey("quarkus.hibernate-search-orm.active", "true") .assertException(throwable -> assertThat(throwable) .isInstanceOf(ConfigurationException.class) .hasMessageContainingAll( "Hibernate Search activated explicitly, but Hibernate Search was disabled at build time", "If you want Hibernate Search to be active at runtime, you must set 'quarkus.hibernate-search-orm.enabled' to 'true' at build time", "If you don't want Hibernate Search to be active at runtime, you must leave 'quarkus.hibernate-search-orm.active' unset or set it to 'false'")); @Test public void test() { // Startup should fail } }
extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/ConfigEnabledFalseAndActiveTrueTest.java
package io.quarkus.hibernate.search.orm.elasticsearch.test.configuration; import static org.assertj.core.api.Assertions.assertThat; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.runtime.configuration.ConfigurationException; import io.quarkus.test.QuarkusUnitTest; public class ConfigEnabledFalseAndActiveTrueTest { @RegisterExtension static final QuarkusUnitTest config = new QuarkusUnitTest().setArchiveProducer( () -> ShrinkWrap.create(JavaArchive.class).addClass(IndexedEntity.class)) .withConfigurationResource("application.properties") .overrideConfigKey("quarkus.hibernate-search-orm.enabled", "false") .overrideConfigKey("quarkus.hibernate-search-orm.active", "true") .assertException(throwable -> assertThat(throwable) .isInstanceOf(ConfigurationException.class) .hasMessageContaining( "Hibernate Search activated explicitly, but Hibernate Search was disabled at build time", "If you want Hibernate Search to be active at runtime, you must set 'quarkus.hibernate-search-orm.enabled' to 'true' at build time", "If you don't want Hibernate Search to be active at runtime, you must leave 'quarkus.hibernate-search-orm.active' unset or set it to 'false'")); @Test public void test() { // Startup should fail } }
Fix incomplete assertion in ConfigEnabledFalseAndActiveTrueTest
extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/ConfigEnabledFalseAndActiveTrueTest.java
Fix incomplete assertion in ConfigEnabledFalseAndActiveTrueTest
<ide><path>xtensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/ConfigEnabledFalseAndActiveTrueTest.java <ide> .overrideConfigKey("quarkus.hibernate-search-orm.active", "true") <ide> .assertException(throwable -> assertThat(throwable) <ide> .isInstanceOf(ConfigurationException.class) <del> .hasMessageContaining( <add> .hasMessageContainingAll( <ide> "Hibernate Search activated explicitly, but Hibernate Search was disabled at build time", <ide> "If you want Hibernate Search to be active at runtime, you must set 'quarkus.hibernate-search-orm.enabled' to 'true' at build time", <ide> "If you don't want Hibernate Search to be active at runtime, you must leave 'quarkus.hibernate-search-orm.active' unset or set it to 'false'"));
JavaScript
mit
f5268342250e40b0e144b677ef4e17ed16409277
0
ColorfulCakeChen/query-submit-canvas,ColorfulCakeChen/query-submit-canvas
export { Base, To, Params }; // import * as ParamDesc from "./ParamDesc.js"; // import * as ValueDesc from "./ValueDesc.js"; // import * as ValueRange from "./ValueRange.js"; /** * A base class for extracting and keeping weights. It composes of a Float32Array and a shape. It can * be used as CNN (depthwise, pointwise and bias) filter weights. * * @member {Float32Array} defaultInput * The default input Float32Array. Its byteOffset will be checked against defaultByteOffsetBegin. * Its content will be interpret as weights if privilegeInput is null. Otherwise, its content * will be ignored if privilegeInput is not null. * * @member {number} defaultByteOffsetBegin * The weights[] begins at defaultInput's defaultByteOffsetBegin (relative to defaultInput.buffer, * not to defaultInput.byteOffset). If this value less than defaultInput.byteOffset, the * initialization will fail (i.e. ( isValid() == false ) ). * * @member {number} defaultByteOffsetEnd * The weights[] ends at defaultInput's defaultByteOffsetEnd (not inclusive) (relative to * defaultInput.buffer, not to defaultInput.byteOffset). * * @member {Float32Array} privilegeInput * The privilege input Float32Array. If not null, its content will be interpret as weights and * the content of defaultInput will be ignored. * * @member {number} privilegeByteOffsetBegin * The weights[] begins at privilegeInput's privilegeByteOffsetBegin (relative to privilegeInput.buffer, * not to privilegeInput.byteOffset). If this value less than privilegeInput.byteOffset, the * initialization will fail (i.e. ( isValid() == false ) ). * * @member {number} privilegeByteOffsetEnd * The weights[] ends at privilegeInput's privilegeByteOffsetEnd (not inclusive) (relative * to privilegeInput.buffer, not to privilegeInput.byteOffset). * * @member {(number[]|number|null)} shape * The weights shape (element count for every dimension). The shape could be an array, and the shape.length represents * dimension. The shape could also be a scalar (0-dimension shape), i.e. ( shape.length == 0 ) is legal and means * extracting so many elements from defaultInput or privilegeInput. If shape is too large (exceeds the defaultInput * (or, privilegeInput if not null) bounding) or shape is NaN, the initialization will fail (i.e. ( isValid() == false ) ). * The shape could be null, and means extracting zero element (i.e. extracting nothing) from defaultInput or privilegeInput. * * @member {Float32Array} weights * The values. It is a reference (sub-range) to the underlying defaultInput (or privilegeInput). */ class Base { /** * Create Float32Array weights[] over the defaultInput (or privilegeInput) according to the specific * byteOffsetBegin, shape, and weightConverter. * * The defaultInput and privilegeInput can not both be null. If one of them is null, the non-null is used. * If both are non-null, the privilegeInput will be used. * * @return {boolean} Return false, if initialization failed. */ init( defaultInput, defaultByteOffsetBegin, privilegeInput, privilegeByteOffsetBegin, shape ) { this.defaultInput = defaultInput; this.privilegeInput = privilegeInput; this.shape = shape; this.weights = null; // So that ( isValid() == false ) if re-initialization failed. //let weightCount = ( shape ) ? shape.reduce( ( accumulator, currentValue ) => accumulator * currentValue ) : 0; let weightCount = ( shape ) ? tf.util.sizeFromShape( shape ) : 0; // It can handle ( 0 == shape.length ) (i.e. scalar). let weightByteCount = weightCount * Float32Array.BYTES_PER_ELEMENT; let input, byteOffsetBegin; let byteOffsetEnd; // Not inclusive. It will be used as the next filter's beginning. if ( privilegeInput ) { // privilegeInput first. if ( privilegeByteOffsetBegin < privilegeInput.byteOffset ) return false; // Failed, the privilege beginning position is illegal (less than bounding). input = privilegeInput; byteOffsetBegin = this.privilegeByteOffsetBegin = privilegeByteOffsetBegin; byteOffsetEnd = this.privilegeByteOffsetEnd = privilegeByteOffsetBegin + weightByteCount; this.defaultByteOffsetBegin = this.defaultByteOffsetEnd = defaultByteOffsetBegin; // Stay at beginning for not used. } else if ( defaultInput ) { // defaultInput second. if ( defaultByteOffsetBegin < defaultInput.byteOffset ) return false; // Failed, the default beginning position is illegal (less than bounding). input = defaultInput; byteOffsetBegin = this.defaultByteOffsetBegin = defaultByteOffsetBegin; byteOffsetEnd = this.defaultByteOffsetEnd = defaultByteOffsetBegin + weightByteCount; this.privilegeByteOffsetBegin = this.privilegeByteOffsetEnd = privilegeByteOffsetBegin; // Stay at beginning for not used. } else { return false; // Failed, both privilege and default input are null. } // Bounded by the input.byteLength. let legalByteOffsetEnd = input.byteOffset + input.byteLength; if ( byteOffsetEnd > legalByteOffsetEnd ) return false; // Failed, if shape is too large (or NaN). this.weights = new Float32Array( input.buffer, byteOffsetBegin, weightCount ); // Share the underlying array buffer. return true; // Success. } /** @return Return true, if initialization is success (i.e. ( this.weights != null )). */ isValid() { return ( this.weights ) ? true : false; } get weightByteCount() { return this.weights.byteLength; } get weightCount() { return this.weights.length; } } /** * Provides static methods for converting weight to parameter. */ class To { /** @return {number} Return the absolute value of the trucated value (i.e. integer). */ static IntegerZeroPositive( v ) { return Math.abs( Math.trunc( v ) ); } /** * @param {any[]} lookUpArray * The value will be converted into an integer between [ 0, lookUpArray.length ). Use it as array index. * Return lookUpArray[ index ]. * * @return {any} * Convert number value into an integer between [ 0, lookUpArray.length ). Use it as array index. Return * the looked up element value. */ static ArrayElement( value, lookUpArray ) { let i = To.IntegerZeroPositive( value ) % lookUpArray.length; return lookUpArray[ i ]; } } /** * The parameters for the weights of a neural network layer. * * @member {Map} parameterMapModified * All parameters provided by this object. Its entry is [ key, value ]. The key of the entry [ key, value ] is a ParamDesc.Xxx object * (the same as the key of the init()'s parameterMap). The value of the entry [ key, value ] is adjusted parameter value * which is combined from the value of the init()'s parameterMap and inputFloat32Array (or fixedWeights). * * @member {number} parameterCountExtracted * How many parameters are extracted from inputFloat32Array or fixedWeights in fact. Only existed if init() * successfully. The same as this.weightCount (i.e. length of this.weights[] and this.weightsModified[]). * * @member {number} parameterCount * Always ( parameterMap.size ). This is the total parameter count provided by this object * if init() successfully. * * @member {Float32Array} weightsModified * The copied extracted values. They are copied from inputFloat32Array or fixedWeights, and then adjusted by * ParamDesc.valueDesc.range.adjust(). Its length will be the same as parameterCountExtracted. */ class Params extends Base { /** * * * @param {Float32Array} inputFloat32Array * A Float32Array whose values will be interpret as weights. It should have ( parameterCountExtractedAtLeast ) or * ( parameterCountExtractedAtLeast + 1 ) or ( parameterCountExtractedAtLeast + 2 ) elements according to the * value of channelMultiplier and outChannels. * * @param {number} byteOffsetBegin * The position to start to decode from the inputFloat32Array. This is relative to the inputFloat32Array.buffer * (not to the inputFloat32Array.byteOffset). * * @param {Map} parameterMap * Describe what parameters to be used or extracted. * - The key of this parameterMap's entry [ key, value ] should be a ParamDesc.Xxx object (one of ParamDesc.Base, * ParamDesc.Same, ParamDesc.Bool) describing the parameter. * * - The key.valueDesc should be a ValueDesc.Xxx object (one of ValueDesc.Same, ValueDesc.Bool, ValueDesc.Int). * The key.valueDesc.range should be a ValueRange.Xxx object (one of ValueRange.Same, ValueRange.Bool, ValueRange.Int). * The key.valueDesc.range.adjust() is a function for adjusting the parameter value. * * - The value of this parameterMap's entry [ key, value ]: * * - If ( null != value ), the returned value of key.range.adjust( value ) will be used as the parameter's * value. (i.e. by specifying) * * - If ( null == value ), the parameter will be extracted from inputFloat32Array (or fixedWeights).The * returned value of key.valueDesc.range.adjust( extractedValue ) will be used as the parameter's value. (i.e. by evolution) * * @param {(Float32Array|number[])} fixedWeights * If null, extract parameters from inputFloat32Array. If not null, extract parameters from it instead of * inputFloat32Array. When not null, it should have parameterCountExtracted elements (i.e. the count of non-null values * of parameterMap). * * @return {boolean} Return false, if initialization failed. * * @override */ init( inputFloat32Array, byteOffsetBegin, parameterMap, fixedWeights = null ) { this.weightsModified = this.parameterMapModified = null; // So that distinguishable if re-initialization failed. if ( !parameterMap ) return false; // Do not know what parameters to be used or extracted. this.parameterMapModified = new Map; // Collect all parameters. // Collect what parameters should be extracted from input array (rather than use values in the parameterMap). // At the same time, its array index will also be recorded for extracting its value from array. let arrayIndexMap = new Map(); { let i = 0; for ( let [ paramDesc, value ] of parameterMap ) { // A null value means it should be extracted from inputFloat32Array (or fixedWeights). (i.e. by evolution) // // Note: This is different from ( !value ). If value is 0, ( !value ) is true but ( null == value ) is false. if ( null == value ) { // Record the index (into this.weightsModified[]) and the adjuster. //!!! (2021/03/15 Remarked) Using paramDesc as key directly. // arrayIndexMap.set( paramDesc.key, { arrayIndex: i, paramDesc: paramDesc } ); arrayIndexMap.set( paramDesc, i ); ++i; } else { // A non-null value means it is the parameter's value (which should also be adjusted). let adjustedValue = paramDesc.valueDesc.range.adjust( value ); this.parameterMapModified.set( paramDesc, adjustedValue ); } } } let parameterCountExtracted = arrayIndexMap.size; // Determine how many parameters should be extracted from array. // If has fixedWeights, use it as priviledge input. let privilegeInput; if ( fixedWeights ) { if ( fixedWeights instanceof Float32Array ) privilegeInput = fixedWeights; else privilegeInput = new Float32Array( fixedWeights ); // Convert to Float32Array. } // Extract a block of input array. let bInitOk = super.init( inputFloat32Array, byteOffsetBegin, privilegeInput, 0, [ parameterCountExtracted ] ); if ( !bInitOk ) return false; // Copy the adjusted extracted weights. // // Do not modify the original array data, because the original data is necessary when backtracking (to try // another neural network layer configuration. this.weightsModified = new Float32Array( this.weights.length ); //!!! (2021/03/15 Remarked) Using paramDesc as key directly. // // Extract (by evolution) values from array, convert them, and put back into copied array and copied map. // for ( let [ key, { arrayIndex, paramDesc } ] of arrayIndexMap ) { // let extractedValue = this.weights[ arrayIndex ]; // let adjustedValue = paramDesc.valueDesc.range.adjust( extractedValue ); // this.weightsModified[ arrayIndex ] = adjustedValue; // Record in array. // this.parameterMapModified.set( key, adjustedValue ); // Record in map, too. // } // Extract (by evolution) values from array, convert them, and put back into copied array and copied map. for ( let [ paramDesc, arrayIndex ] of arrayIndexMap ) { let extractedValue = this.weights[ arrayIndex ]; let adjustedValue = paramDesc.valueDesc.range.adjust( extractedValue ); this.weightsModified[ arrayIndex ] = adjustedValue; // Record in array. this.parameterMapModified.set( key, adjustedValue ); // Record in map, too. } return bInitOk; } /** @return {number} The count of the parameters extracted from inputFloat32Array. (i.e. by evolution) */ get parameterCountExtracted() { return this.weightCount; } /** * @return {number} * The count of the all parameters (both directly given (i.e. by specifying) and extracted from inputFloat32Array (i.e. by evolution) ). */ get parameterCount() { return this.parameterMapModified.size; } }
CNN/Unpacker/Weights.js
export { Base, To, Params }; // import * as ParamDesc from "./ParamDesc.js"; // import * as ValueDesc from "./ValueDesc.js"; // import * as ValueRange from "./ValueRange.js"; /** * A base class for extracting and keeping weights. It composes of a Float32Array and a shape. It can * be used as CNN (depthwise, pointwise and bias) filter weights. * * @member {Float32Array} defaultInput * The default input Float32Array. Its byteOffset will be checked against defaultByteOffsetBegin. * Its content will be interpret as weights if privilegeInput is null. Otherwise, its content * will be ignored if privilegeInput is not null. * * @member {number} defaultByteOffsetBegin * The weights[] begins at defaultInput's defaultByteOffsetBegin (relative to defaultInput.buffer, * not to defaultInput.byteOffset). If this value less than defaultInput.byteOffset, the * initialization will fail (i.e. ( isValid() == false ) ). * * @member {number} defaultByteOffsetEnd * The weights[] ends at defaultInput's defaultByteOffsetEnd (not inclusive) (relative to * defaultInput.buffer, not to defaultInput.byteOffset). * * @member {Float32Array} privilegeInput * The privilege input Float32Array. If not null, its content will be interpret as weights and * the content of defaultInput will be ignored. * * @member {number} privilegeByteOffsetBegin * The weights[] begins at privilegeInput's privilegeByteOffsetBegin (relative to privilegeInput.buffer, * not to privilegeInput.byteOffset). If this value less than privilegeInput.byteOffset, the * initialization will fail (i.e. ( isValid() == false ) ). * * @member {number} privilegeByteOffsetEnd * The weights[] ends at privilegeInput's privilegeByteOffsetEnd (not inclusive) (relative * to privilegeInput.buffer, not to privilegeInput.byteOffset). * * @member {(number[]|number|null)} shape * The weights shape (element count for every dimension). The shape could be an array, and the shape.length represents * dimension. The shape could also be a scalar (0-dimension shape), i.e. ( shape.length == 0 ) is legal and means * extracting so many elements from defaultInput or privilegeInput. If shape is too large (exceeds the defaultInput * (or, privilegeInput if not null) bounding) or shape is NaN, the initialization will fail (i.e. ( isValid() == false ) ). * The shape could be null, and means extracting zero element (i.e. extracting nothing) from defaultInput or privilegeInput. * * @member {Float32Array} weights * The values. It is a reference (sub-range) to the underlying defaultInput (or privilegeInput). */ class Base { /** * Create Float32Array weights[] over the defaultInput (or privilegeInput) according to the specific * byteOffsetBegin, shape, and weightConverter. * * The defaultInput and privilegeInput can not both be null. If one of them is null, the non-null is used. * If both are non-null, the privilegeInput will be used. * * @return {boolean} Return false, if initialization failed. */ init( defaultInput, defaultByteOffsetBegin, privilegeInput, privilegeByteOffsetBegin, shape ) { this.defaultInput = defaultInput; this.privilegeInput = privilegeInput; this.shape = shape; this.weights = null; // So that ( isValid() == false ) if re-initialization failed. //let weightCount = ( shape ) ? shape.reduce( ( accumulator, currentValue ) => accumulator * currentValue ) : 0; let weightCount = ( shape ) ? tf.util.sizeFromShape( shape ) : 0; // It can handle ( 0 == shape.length ) (i.e. scalar). let weightByteCount = weightCount * Float32Array.BYTES_PER_ELEMENT; let input, byteOffsetBegin; let byteOffsetEnd; // Not inclusive. It will be used as the next filter's beginning. if ( privilegeInput ) { // privilegeInput first. if ( privilegeByteOffsetBegin < privilegeInput.byteOffset ) return false; // Failed, the privilege beginning position is illegal (less than bounding). input = privilegeInput; byteOffsetBegin = this.privilegeByteOffsetBegin = privilegeByteOffsetBegin; byteOffsetEnd = this.privilegeByteOffsetEnd = privilegeByteOffsetBegin + weightByteCount; this.defaultByteOffsetBegin = this.defaultByteOffsetEnd = defaultByteOffsetBegin; // Stay at beginning for not used. } else if ( defaultInput ) { // defaultInput second. if ( defaultByteOffsetBegin < defaultInput.byteOffset ) return false; // Failed, the default beginning position is illegal (less than bounding). input = defaultInput; byteOffsetBegin = this.defaultByteOffsetBegin = defaultByteOffsetBegin; byteOffsetEnd = this.defaultByteOffsetEnd = defaultByteOffsetBegin + weightByteCount; this.privilegeByteOffsetBegin = this.privilegeByteOffsetEnd = privilegeByteOffsetBegin; // Stay at beginning for not used. } else { return false; // Failed, both privilege and default input are null. } // Bounded by the input.byteLength. let legalByteOffsetEnd = input.byteOffset + input.byteLength; if ( byteOffsetEnd > legalByteOffsetEnd ) return false; // Failed, if shape is too large (or NaN). this.weights = new Float32Array( input.buffer, byteOffsetBegin, weightCount ); // Share the underlying array buffer. return true; // Success. } /** @return Return true, if initialization is success (i.e. ( this.weights != null )). */ isValid() { return ( this.weights ) ? true : false; } get weightByteCount() { return this.weights.byteLength; } get weightCount() { return this.weights.length; } } /** * Provides static methods for converting weight to parameter. */ class To { //!!! (2021/03/14) become SameRange. // /** @return {any} Return the input value directly. */ // static Same( v ) { // return v; // } /** @return {number} Return the absolute value of the trucated value (i.e. integer). */ static IntegerZeroPositive( v ) { return Math.abs( Math.trunc( v ) ); } //!!! (2021/03/14) become BooleanRange. // /** @return {boolean} Convert number value into false or true. */ // static Boolean( value ) { // // If value is not an integer, the remainder will always not zero. So convert it to integer first. // // // // According to negative or positive, the remainder could be one of [ -1, 0, +1 ]. // // So simply check it whether is 0 (instead of check both -1 and +1), could result in false or true. // return ( ( Math.trunc( value ) % 2 ) != 0 ); // } /** * @param {any[]} lookUpArray * The value will be converted into an integer between [ 0, lookUpArray.length ). Use it as array index. * Return lookUpArray[ index ]. * * @return {any} * Convert number value into an integer between [ 0, lookUpArray.length ). Use it as array index. Return * the looked up element value. */ static ArrayElement( value, lookUpArray ) { let i = To.IntegerZeroPositive( value ) % lookUpArray.length; return lookUpArray[ i ]; } } /** * The parameters for the weights of a neural network layer. * * @member {Map} parameterMapModified * All parameters provided by this object. Its entry is [ key, value ]. The key of the entry [ key, value ] is the same as * the key of the init()'s parameterMap. The value of the entry [ key, value ] is parameter_value * (i.e. not [ parameter_value, parameter_converter ] ) which is combined from the parameter_value of the init()'s parameterMap * and inputFloat32Array (or fixedWeights). * * @member {number} parameterCountExtracted * How many parameters are extracted from inputFloat32Array or fixedWeights in fact. Only existed if init() * successfully. The same as this.weightCount (i.e. length of this.weights[] and this.weightsModified[]). * * @member {number} parameterCount * Always ( parameterMap.size ). This is the total parameter count provided by this object * if init() successfully. * * @member {number} inChannels * The input channel count of this neural network layer. * * @member {number} channelMultiplier * Every input channel will be expanded into how many channels. * * @member {number} outChannels * The output channel count of this neural network layer. * * @member {Float32Array} weightsModified * The copied extracted values. They are copied from inputFloat32Array or fixedWeights, and then converted * to positive integer. Its length will be the same as parameterCountExtracted. */ class Params extends Base { /** * * * @param {Float32Array} inputFloat32Array * A Float32Array whose values will be interpret as weights. It should have ( parameterCountExtractedAtLeast ) or * ( parameterCountExtractedAtLeast + 1 ) or ( parameterCountExtractedAtLeast + 2 ) elements according to the * value of channelMultiplier and outChannels. * * @param {number} byteOffsetBegin * The position to start to decode from the inputFloat32Array. This is relative to the inputFloat32Array.buffer * (not to the inputFloat32Array.byteOffset). * * @param {Map} parameterMap * Describe what parameters to be used or extracted. * - The key of this parameterMap's entry [ key, value ] should be a ParamDesc.Xxx object (one of ParamDesc.Base, * ParamDesc.Same, ParamDesc.Bool) describing the parameter. * * - The key.valueDesc should be a ValueDesc.Xxx object (one of ValueDesc.Same, ValueDesc.Bool, ValueDesc.Int). * The key.valueDesc.range should be a ValueRange.Xxx object (one of ValueRange.Same, ValueRange.Bool, ValueRange.Int). * The key.valueDesc.range.adjust() is a function for adjusting the parameter value. * * - The value of this parameterMap's entry [ key, value ]: * * - If ( null != value ), the returned value of key.range.adjust( value ) will be used as the parameter's * value. (i.e. by specifying) * * - If ( null == value ), the parameter will be extracted from inputFloat32Array (or fixedWeights).The * returned value of key.valueDesc.range.adjust( extractedValue ) will be used as the parameter's value. (i.e. by evolution) * * @param {(Float32Array|number[])} fixedWeights * If null, extract parameters from inputFloat32Array. If not null, extract parameters from it instead of * inputFloat32Array. When not null, it should have parameterCountExtracted elements (i.e. the count of non-null values * of parameterMap). * * @return {boolean} Return false, if initialization failed. * * @override */ init( inputFloat32Array, byteOffsetBegin, parameterMap, fixedWeights = null ) { this.weightsModified = this.parameterMapModified = null; // So that distinguishable if re-initialization failed. if ( !parameterMap ) return false; // Do not know what parameters to be used or extracted. this.parameterMapModified = new Map; // Collect all parameters. // Collect what parameters should be extracted from input array (rather than use values in the parameterMap). // At the same time, its array index will also be recorded for extracting its value from array. let arrayIndexMap = new Map(); { let i = 0; //!!! (2021/03/15 Remarked) call XxxDesc.range.adjust() // let parameterValue, parameterAdjuster; // for ( let [ key, value_and_adjuster ] of parameterMap ) { // // // A null (or undefined) value_and_adjuster means it should be extracted from inputFloat32Array or fixedWeights, // // and using To.Same() as adjuster function. (i.e. by evolution) // if ( null == value_and_adjuster ) { // parameterValue = null; // parameterAdjuster = To.Same; // } else { // parameterValue = value_and_adjuster[ 0 ]; // parameterAdjuster = value_and_adjuster[ 1 ]; // } // // // Always should have adjuster function. At least, using the-same-value function. // if ( null == parameterAdjuster ) // parameterAdjuster = To.Same; // // // A null parameterValue means it should be extracted from inputFloat32Array (or fixedWeights). (i.e. by evolution) // // // // Note: This is different from ( !value ). If value is 0, ( !value ) is true but ( null == value ) is false. // if ( null == parameterValue ) { // // Record the index (into this.weightsModified[]) and the adjuster. // arrayIndexMap.set( key, { arrayIndex: i, adjusterFunction: parameterAdjuster } ); // ++i; // } else { // // A non-null value means it is the parameter's value (after adjusted). // let adjustedValue = parameterAdjuster( parameterValue ); // this.parameterMapModified.set( key, adjustedValue ); // } // } for ( let [ paramDesc, value ] of parameterMap ) { // A null value means it should be extracted from inputFloat32Array (or fixedWeights). (i.e. by evolution) // // Note: This is different from ( !value ). If value is 0, ( !value ) is true but ( null == value ) is false. if ( null == value ) { // Record the index (into this.weightsModified[]) and the adjuster. arrayIndexMap.set( paramDesc.key, { arrayIndex: i, paramDesc: paramDesc } ); ++i; } else { // A non-null value means it is the parameter's value (which should also be adjusted). let adjustedValue = paramDesc.valueDesc.range.adjust( value ); this.parameterMapModified.set( paramDesc, adjustedValue ); } } } let parameterCountExtracted = arrayIndexMap.size; // Determine how many parameters should be extracted from array. // If has fixedWeights, use it as priviledge input. let privilegeInput; if ( fixedWeights ) { if ( fixedWeights instanceof Float32Array ) privilegeInput = fixedWeights; else privilegeInput = new Float32Array( fixedWeights ); // Convert to Float32Array. } // Extract a block of input array. let bInitOk = super.init( inputFloat32Array, byteOffsetBegin, privilegeInput, 0, [ parameterCountExtracted ] ); if ( !bInitOk ) return false; // Copy the adjusted extracted weights. // // Do not modify the original array data, because the original data is necessary when backtracking (to try // another neural network layer configuration. this.weightsModified = new Float32Array( this.weights.length ); //!!! (2021/03/15 Remarked) call XxxDesc.range.adjust() // // Extract (by evolution) values from array, convert them, and put back into copied array and copied map. // for ( let [ key, { arrayIndex, adjusterFunction } ] of arrayIndexMap ) { // let extractedValue = this.weights[ arrayIndex ]; // let adjustedValue = adjusterFunction( extractedValue ); // this.weightsModified[ arrayIndex ] = adjustedValue; // Record in array. // this.parameterMapModified.set( key, adjustedValue ); // Record in map, too. // } // Extract (by evolution) values from array, convert them, and put back into copied array and copied map. for ( let [ key, { arrayIndex, paramDesc } ] of arrayIndexMap ) { let extractedValue = this.weights[ arrayIndex ]; let adjustedValue = paramDesc.valueDesc.range.adjust( extractedValue ); this.weightsModified[ arrayIndex ] = adjustedValue; // Record in array. this.parameterMapModified.set( key, adjustedValue ); // Record in map, too. } return bInitOk; } /** @return {number} The count of the parameters extracted from inputFloat32Array. (i.e. by evolution) */ get parameterCountExtracted() { return this.weightCount; } /** * @return {number} * The count of the all parameters (both directly given (i.e. by specifying) and extracted from inputFloat32Array (i.e. by evolution) ). */ get parameterCount() { return this.parameterMapModified.size; } }
Update Weights.js
CNN/Unpacker/Weights.js
Update Weights.js
<ide><path>NN/Unpacker/Weights.js <ide> */ <ide> class To { <ide> <del>//!!! (2021/03/14) become SameRange. <del>// /** @return {any} Return the input value directly. */ <del>// static Same( v ) { <del>// return v; <del>// } <del> <ide> /** @return {number} Return the absolute value of the trucated value (i.e. integer). */ <ide> static IntegerZeroPositive( v ) { <ide> return Math.abs( Math.trunc( v ) ); <ide> } <del> <del>//!!! (2021/03/14) become BooleanRange. <del>// /** @return {boolean} Convert number value into false or true. */ <del>// static Boolean( value ) { <del>// // If value is not an integer, the remainder will always not zero. So convert it to integer first. <del>// // <del>// // According to negative or positive, the remainder could be one of [ -1, 0, +1 ]. <del>// // So simply check it whether is 0 (instead of check both -1 and +1), could result in false or true. <del>// return ( ( Math.trunc( value ) % 2 ) != 0 ); <del>// } <ide> <ide> /** <ide> * @param {any[]} lookUpArray <ide> * The parameters for the weights of a neural network layer. <ide> * <ide> * @member {Map} parameterMapModified <del> * All parameters provided by this object. Its entry is [ key, value ]. The key of the entry [ key, value ] is the same as <del> * the key of the init()'s parameterMap. The value of the entry [ key, value ] is parameter_value <del> * (i.e. not [ parameter_value, parameter_converter ] ) which is combined from the parameter_value of the init()'s parameterMap <del> * and inputFloat32Array (or fixedWeights). <add> * All parameters provided by this object. Its entry is [ key, value ]. The key of the entry [ key, value ] is a ParamDesc.Xxx object <add> * (the same as the key of the init()'s parameterMap). The value of the entry [ key, value ] is adjusted parameter value <add> * which is combined from the value of the init()'s parameterMap and inputFloat32Array (or fixedWeights). <ide> * <ide> * @member {number} parameterCountExtracted <ide> * How many parameters are extracted from inputFloat32Array or fixedWeights in fact. Only existed if init() <ide> * Always ( parameterMap.size ). This is the total parameter count provided by this object <ide> * if init() successfully. <ide> * <del> * @member {number} inChannels <del> * The input channel count of this neural network layer. <del> * <del> * @member {number} channelMultiplier <del> * Every input channel will be expanded into how many channels. <del> * <del> * @member {number} outChannels <del> * The output channel count of this neural network layer. <del> * <ide> * @member {Float32Array} weightsModified <del> * The copied extracted values. They are copied from inputFloat32Array or fixedWeights, and then converted <del> * to positive integer. Its length will be the same as parameterCountExtracted. <add> * The copied extracted values. They are copied from inputFloat32Array or fixedWeights, and then adjusted by <add> * ParamDesc.valueDesc.range.adjust(). Its length will be the same as parameterCountExtracted. <ide> */ <ide> class Params extends Base { <ide> <ide> { <ide> let i = 0; <ide> <del>//!!! (2021/03/15 Remarked) call XxxDesc.range.adjust() <del>// let parameterValue, parameterAdjuster; <del>// for ( let [ key, value_and_adjuster ] of parameterMap ) { <del>// <del>// // A null (or undefined) value_and_adjuster means it should be extracted from inputFloat32Array or fixedWeights, <del>// // and using To.Same() as adjuster function. (i.e. by evolution) <del>// if ( null == value_and_adjuster ) { <del>// parameterValue = null; <del>// parameterAdjuster = To.Same; <del>// } else { <del>// parameterValue = value_and_adjuster[ 0 ]; <del>// parameterAdjuster = value_and_adjuster[ 1 ]; <del>// } <del>// <del>// // Always should have adjuster function. At least, using the-same-value function. <del>// if ( null == parameterAdjuster ) <del>// parameterAdjuster = To.Same; <del>// <del>// // A null parameterValue means it should be extracted from inputFloat32Array (or fixedWeights). (i.e. by evolution) <del>// // <del>// // Note: This is different from ( !value ). If value is 0, ( !value ) is true but ( null == value ) is false. <del>// if ( null == parameterValue ) { <del>// // Record the index (into this.weightsModified[]) and the adjuster. <del>// arrayIndexMap.set( key, { arrayIndex: i, adjusterFunction: parameterAdjuster } ); <del>// ++i; <del>// } else { <del>// // A non-null value means it is the parameter's value (after adjusted). <del>// let adjustedValue = parameterAdjuster( parameterValue ); <del>// this.parameterMapModified.set( key, adjustedValue ); <del>// } <del>// } <del> <ide> for ( let [ paramDesc, value ] of parameterMap ) { <ide> <ide> // A null value means it should be extracted from inputFloat32Array (or fixedWeights). (i.e. by evolution) <ide> // Note: This is different from ( !value ). If value is 0, ( !value ) is true but ( null == value ) is false. <ide> if ( null == value ) { <ide> // Record the index (into this.weightsModified[]) and the adjuster. <del> arrayIndexMap.set( paramDesc.key, { arrayIndex: i, paramDesc: paramDesc } ); <add>//!!! (2021/03/15 Remarked) Using paramDesc as key directly. <add>// arrayIndexMap.set( paramDesc.key, { arrayIndex: i, paramDesc: paramDesc } ); <add> arrayIndexMap.set( paramDesc, i ); <ide> ++i; <ide> } else { <ide> // A non-null value means it is the parameter's value (which should also be adjusted). <ide> // another neural network layer configuration. <ide> this.weightsModified = new Float32Array( this.weights.length ); <ide> <del>//!!! (2021/03/15 Remarked) call XxxDesc.range.adjust() <add>//!!! (2021/03/15 Remarked) Using paramDesc as key directly. <ide> // // Extract (by evolution) values from array, convert them, and put back into copied array and copied map. <del>// for ( let [ key, { arrayIndex, adjusterFunction } ] of arrayIndexMap ) { <add>// for ( let [ key, { arrayIndex, paramDesc } ] of arrayIndexMap ) { <ide> // let extractedValue = this.weights[ arrayIndex ]; <del>// let adjustedValue = adjusterFunction( extractedValue ); <add>// let adjustedValue = paramDesc.valueDesc.range.adjust( extractedValue ); <ide> // this.weightsModified[ arrayIndex ] = adjustedValue; // Record in array. <ide> // this.parameterMapModified.set( key, adjustedValue ); // Record in map, too. <ide> // } <ide> <ide> // Extract (by evolution) values from array, convert them, and put back into copied array and copied map. <del> for ( let [ key, { arrayIndex, paramDesc } ] of arrayIndexMap ) { <add> for ( let [ paramDesc, arrayIndex ] of arrayIndexMap ) { <ide> let extractedValue = this.weights[ arrayIndex ]; <ide> let adjustedValue = paramDesc.valueDesc.range.adjust( extractedValue ); <ide> this.weightsModified[ arrayIndex ] = adjustedValue; // Record in array.
Java
lgpl-2.1
c2f696c3fd4a3e6f7b85a80c927660dbb7cceba8
0
deegree/deegree3,deegree/deegree3,deegree/deegree3,deegree/deegree3,deegree/deegree3
//$HeadURL$ /*---------------------------------------------------------------------------- This file is part of deegree, http://deegree.org/ Copyright (C) 2001-2009 by: Department of Geography, University of Bonn and lat/lon GmbH This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact information: lat/lon GmbH Aennchenstr. 19, 53177 Bonn Germany http://lat-lon.de/ Department of Geography, University of Bonn Prof. Dr. Klaus Greve Postfach 1147, 53001 Bonn Germany http://www.geographie.uni-bonn.de/deegree/ e-mail: [email protected] ----------------------------------------------------------------------------*/ package org.deegree.services.wms.controller.capabilities; import static java.lang.Double.MAX_VALUE; import static java.lang.Double.MIN_VALUE; import static java.lang.Double.NEGATIVE_INFINITY; import static java.lang.Double.POSITIVE_INFINITY; import static org.deegree.commons.xml.CommonNamespaces.XLINK_PREFIX; import static org.deegree.commons.xml.CommonNamespaces.XLNNS; import static org.deegree.cs.CRSRegistry.lookup; import static org.deegree.services.wms.model.Dimension.formatDimensionValueList; import static org.slf4j.LoggerFactory.getLogger; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; import org.deegree.commons.utils.DoublePair; import org.deegree.commons.utils.Pair; import org.deegree.commons.utils.log.LoggingNotes; import org.deegree.commons.xml.XMLAdapter; import org.deegree.cs.CRS; import org.deegree.cs.coordinatesystems.CoordinateSystem; import org.deegree.cs.exceptions.TransformationException; import org.deegree.cs.exceptions.UnknownCRSException; import org.deegree.geometry.Envelope; import org.deegree.geometry.GeometryTransformer; import org.deegree.rendering.r2d.se.unevaluated.Style; import org.deegree.services.jaxb.metadata.AddressType; import org.deegree.services.jaxb.metadata.ServiceContactType; import org.deegree.services.jaxb.metadata.ServiceIdentificationType; import org.deegree.services.jaxb.metadata.ServiceProviderType; import org.deegree.services.jaxb.wms.LanguageStringType; import org.deegree.services.wms.MapService; import org.deegree.services.wms.controller.WMSController; import org.deegree.services.wms.model.Dimension; import org.deegree.services.wms.model.layers.Layer; import org.slf4j.Logger; /** * <code>Capabilities111XMLAdapter</code> * * @author <a href="mailto:[email protected]">Andreas Schmitz</a> * @author last edited by: $Author$ * * @version $Revision$, $Date$ */ @LoggingNotes(warn = "logs problems with CRS when outputting 1.1.1 capabilities", trace = "logs stack traces") public class Capabilities111XMLAdapter extends XMLAdapter { private static final Logger LOG = getLogger( Capabilities111XMLAdapter.class ); private final String getUrl; private final String postUrl; private final ServiceIdentificationType identification; private final ServiceProviderType provider; private MapService service; private WMSController controller; /** * @param identification * @param provider * @param getUrl * @param postUrl * @param service * @param controller */ public Capabilities111XMLAdapter( ServiceIdentificationType identification, ServiceProviderType provider, String getUrl, String postUrl, MapService service, WMSController controller ) { this.identification = identification; this.provider = provider; this.getUrl = getUrl; this.postUrl = postUrl; this.service = service; this.controller = controller; } /** * Writes out a 1.1.1 style capabilities document. * * @param writer * @throws XMLStreamException */ public void export( XMLStreamWriter writer ) throws XMLStreamException { String dtdrequest = getUrl + "?request=DTD"; writer.writeDTD( "<!DOCTYPE WMT_MS_Capabilities SYSTEM \"" + dtdrequest + "\" [<!ELEMENT VendorSpecificCapabilities EMPTY>]>\n" ); writer.writeStartElement( "WMT_MS_Capabilities" ); writer.writeAttribute( "version", "1.1.1" ); writer.writeAttribute( "updateSequence", "" + service.updateSequence ); writeService( writer ); writeCapability( writer ); writer.writeEndElement(); writer.writeEndDocument(); } private void writeCapability( XMLStreamWriter writer ) throws XMLStreamException { writer.writeStartElement( "Capability" ); writeRequest( writer ); writer.writeStartElement( "Exception" ); writeElement( writer, "Format", "application/vnd.ogc.se_xml" ); writeElement( writer, "Format", "application/vnd.ogc.se_inimage" ); writeElement( writer, "Format", "application/vnd.ogc.se_blank" ); writer.writeEndElement(); writeLayers( writer, service.getRootLayer() ); writer.writeEndElement(); } private void writeLayers( XMLStreamWriter writer, Layer layer ) throws XMLStreamException { if ( layer.getTitle() == null || !layer.isAvailable() ) { return; } writer.writeStartElement( "Layer" ); if ( layer.isQueryable() ) { writer.writeAttribute( "queryable", "1" ); } maybeWriteElement( writer, "Name", layer.getName() ); writeElement( writer, "Title", layer.getTitle() ); maybeWriteElement( writer, "Abstract", layer.getAbstract() ); if ( !layer.getKeywords().isEmpty() ) { writer.writeStartElement( "KeywordList" ); for ( LanguageStringType lanString : layer.getKeywords() ) { writeElement( writer, "Keyword", lanString.getValue() ); } writer.writeEndElement(); } for ( CRS crs : layer.getSrs() ) { writeElement( writer, "SRS", crs.getName() ); } CoordinateSystem latlon; try { latlon = lookup( "CRS:84" ); Envelope layerEnv = layer.getBbox(); if ( layerEnv != null && layerEnv.getCoordinateDimension() >= 2 ) { Envelope bbox = new GeometryTransformer( latlon ).transform( layerEnv ); writer.writeStartElement( "LatLonBoundingBox" ); writer.writeAttribute( "minx", Double.toString( bbox.getMin().get0() ) ); writer.writeAttribute( "miny", Double.toString( bbox.getMin().get1() ) ); writer.writeAttribute( "maxx", Double.toString( bbox.getMax().get0() ) ); writer.writeAttribute( "maxy", Double.toString( bbox.getMax().get1() ) ); writer.writeEndElement(); for ( CRS crs : layer.getSrs() ) { if ( crs.getName().startsWith( "AUTO" ) ) { continue; } try { crs.getWrappedCRS(); } catch ( UnknownCRSException e ) { LOG.warn( "Cannot find: {}", e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); continue; } Envelope envelope; try { if ( layerEnv.getCoordinateSystem() == null ) { envelope = new GeometryTransformer( crs.getWrappedCRS() ).transform( layerEnv, latlon ); } else { envelope = new GeometryTransformer( crs.getWrappedCRS() ).transform( layerEnv ); } } catch ( IllegalArgumentException e ) { LOG.warn( "Cannot transform: {}", e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); continue; } catch ( TransformationException e ) { LOG.warn( "Cannot transform: {}", e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); continue; } writer.writeStartElement( "BoundingBox" ); writer.writeAttribute( "SRS", crs.getName() ); writer.writeAttribute( "minx", Double.toString( envelope.getMin().get0() ) ); writer.writeAttribute( "miny", Double.toString( envelope.getMin().get1() ) ); writer.writeAttribute( "maxx", Double.toString( envelope.getMax().get0() ) ); writer.writeAttribute( "maxy", Double.toString( envelope.getMax().get1() ) ); writer.writeEndElement(); } } } catch ( UnknownCRSException e ) { LOG.warn( "Cannot find: {}", e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); } catch ( IllegalArgumentException e ) { LOG.warn( "Cannot transform: {}", e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); } catch ( TransformationException e ) { LOG.warn( "Cannot transform: {}", e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); } final Map<String, Dimension<?>> dims = layer.getDimensions(); for ( Entry<String, Dimension<?>> entry : dims.entrySet() ) { Dimension<?> dim = entry.getValue(); writer.writeStartElement( "Dimension" ); writer.writeAttribute( "name", entry.getKey() ); writer.writeAttribute( "units", dim.getUnits() == null ? "EPSG:4979" : dim.getUnits() ); writer.writeAttribute( "unitSymbol", dim.getUnitSymbol() == null ? "" : dim.getUnitSymbol() ); writer.writeEndElement(); } for ( Entry<String, Dimension<?>> entry : dims.entrySet() ) { String name = entry.getKey(); Dimension<?> dim = entry.getValue(); writer.writeStartElement( "Extent" ); writer.writeAttribute( "name", name ); if ( dim.getDefaultValue() != null ) { writer.writeAttribute( "default", formatDimensionValueList( dim.getDefaultValue(), "time".equals( name ) ) ); } if ( dim.getNearestValue() ) { writer.writeAttribute( "nearestValue", "1" ); } writer.writeCharacters( dim.getExtentAsString() ); writer.writeEndElement(); } Style def = service.getStyles().get( layer.getName(), null ); if ( def != null ) { if ( def.getName() != null && !def.getName().isEmpty() ) { writeStyle( writer, "default", def.getName(), service.getLegendSize( def ), layer.getName(), def.getName() ); // TODO // title/description/whatever } else { writeStyle( writer, "default", "default", service.getLegendSize( def ), layer.getName(), def.getName() ); // TODO // title/description/whatever } } HashSet<Style> visited = new HashSet<Style>(); for ( Style s : service.getStyles().getAll( layer.getName() ) ) { if ( visited.contains( s ) ) { continue; } visited.add( s ); String name = s.getName(); if ( name != null && !name.isEmpty() ) { writeStyle( writer, name, name, service.getLegendSize( s ), layer.getName(), name ); // TODO // title/description/whatever } } DoublePair hint = layer.getScaleHint(); if ( hint.first != NEGATIVE_INFINITY || hint.second != POSITIVE_INFINITY ) { double fac = 0.00028; writer.writeStartElement( "ScaleHint" ); writer.writeAttribute( "min", Double.toString( hint.first == NEGATIVE_INFINITY ? MIN_VALUE : hint.first * fac ) ); writer.writeAttribute( "max", Double.toString( hint.second == POSITIVE_INFINITY ? MAX_VALUE : hint.second * fac ) ); writer.writeEndElement(); } for ( Layer l : new LinkedList<Layer>( layer.getChildren() ) ) { writeLayers( writer, l ); } writer.writeEndElement(); } private void writeStyle( XMLStreamWriter writer, String name, String title, Pair<Integer, Integer> legendSize, String layerName, String styleName ) throws XMLStreamException { writer.writeStartElement( "Style" ); writeElement( writer, "Name", name ); writeElement( writer, "Title", title ); if ( legendSize.first > 0 && legendSize.second > 0 ) { writer.writeStartElement( "LegendURL" ); writer.writeAttribute( "width", "" + legendSize.first ); writer.writeAttribute( "height", "" + legendSize.second ); writeElement( writer, "Format", "image/png" ); writer.writeStartElement( "OnlineResource" ); writer.writeNamespace( XLINK_PREFIX, XLNNS ); writer.writeAttribute( XLNNS, "type", "simple" ); String style = styleName == null ? "" : ( "&style=" + styleName ); writer.writeAttribute( XLNNS, "href", getUrl + "?request=GetLegendGraphic&version=1.1.1&service=WMS&layer=" + layerName + style + "&format=image/png" ); writer.writeEndElement(); writer.writeEndElement(); } writer.writeEndElement(); } private void writeDCP( XMLStreamWriter writer, boolean get, boolean post ) throws XMLStreamException { writer.writeStartElement( "DCPType" ); writer.writeStartElement( "HTTP" ); if ( get ) { writer.writeStartElement( "Get" ); writer.writeStartElement( "OnlineResource" ); writer.writeNamespace( XLINK_PREFIX, XLNNS ); writer.writeAttribute( XLNNS, "type", "simple" ); writer.writeAttribute( XLNNS, "href", getUrl + "?" ); writer.writeEndElement(); writer.writeEndElement(); } if ( post ) { writer.writeStartElement( "Post" ); writer.writeStartElement( "OnlineResource" ); writer.writeNamespace( XLINK_PREFIX, XLNNS ); writer.writeAttribute( XLNNS, "type", "simple" ); writer.writeAttribute( XLNNS, "href", postUrl ); writer.writeEndElement(); writer.writeEndElement(); } writer.writeEndElement(); writer.writeEndElement(); } private void writeRequest( XMLStreamWriter writer ) throws XMLStreamException { writer.writeStartElement( "Request" ); writer.writeStartElement( "GetCapabilities" ); writeElement( writer, "Format", "application/vnd.ogc.wms_xml" ); writeDCP( writer, true, false ); writer.writeEndElement(); writer.writeStartElement( "GetMap" ); writeImageFormats( writer ); writeDCP( writer, true, true ); writer.writeEndElement(); writer.writeStartElement( "GetFeatureInfo" ); writeInfoFormats( writer ); writeDCP( writer, true, false ); writer.writeEndElement(); writer.writeStartElement( "GetLegendGraphic" ); writeInfoFormats( writer ); writeDCP( writer, true, false ); writer.writeEndElement(); writer.writeEndElement(); } private void writeImageFormats( XMLStreamWriter writer ) throws XMLStreamException { for ( String f : controller.supportedImageFormats ) { writeElement( writer, "Format", f ); } } private void writeInfoFormats( XMLStreamWriter writer ) throws XMLStreamException { for ( String f : controller.supportedFeatureInfoFormats.keySet() ) { writeElement( writer, "Format", f ); } } private void writeService( XMLStreamWriter writer ) throws XMLStreamException { writer.writeStartElement( "Service" ); writeElement( writer, "Name", "OGC:WMS" ); List<String> titles = identification == null ? null : identification.getTitle(); String title = ( titles != null && !titles.isEmpty() ) ? titles.get( 0 ) : "deegree 3 WMS"; writeElement( writer, "Title", title ); List<String> abstracts = identification == null ? null : identification.getAbstract(); if ( abstracts != null && !abstracts.isEmpty() ) { writeElement( writer, "Abstract", abstracts.get( 0 ) ); } List<org.deegree.services.jaxb.metadata.KeywordsType> keywords = identification == null ? null : identification.getKeywords(); if ( keywords != null && !keywords.isEmpty() ) { writer.writeStartElement( "KeywordList" ); for ( org.deegree.services.jaxb.metadata.KeywordsType key : keywords ) { for ( org.deegree.services.jaxb.metadata.LanguageStringType lanString : key.getKeyword() ) { writeElement( writer, "Keyword", lanString.getValue() ); } } writer.writeEndElement(); } writer.writeStartElement( "OnlineResource" ); writer.writeNamespace( XLINK_PREFIX, XLNNS ); writer.writeAttribute( XLNNS, "type", "simple" ); writer.writeAttribute( XLNNS, "href", getUrl ); writer.writeEndElement(); if ( provider != null ) { ServiceContactType contact = provider.getServiceContact(); if ( contact != null ) { writer.writeStartElement( "ContactInformation" ); if ( contact.getIndividualName() != null ) { writer.writeStartElement( "ContactPersonPrimary" ); writeElement( writer, "ContactPerson", contact.getIndividualName() ); writeElement( writer, "ContactOrganization", provider.getProviderName() ); writer.writeEndElement(); } maybeWriteElement( writer, "ContactPosition", contact.getPositionName() ); AddressType addr = contact.getAddress(); if ( addr != null ) { writer.writeStartElement( "ContactAddress" ); writeElement( writer, "AddressType", "postal" ); for ( String s : addr.getDeliveryPoint() ) { maybeWriteElement( writer, "Address", s ); } writeElement( writer, "City", addr.getCity() ); writeElement( writer, "StateOrProvince", addr.getAdministrativeArea() ); writeElement( writer, "PostCode", addr.getPostalCode() ); writeElement( writer, "Country", addr.getCountry() ); writer.writeEndElement(); } maybeWriteElement( writer, "ContactVoiceTelephone", contact.getPhone() ); maybeWriteElement( writer, "ContactFacsimileTelephone", contact.getFacsimile() ); for ( String email : contact.getElectronicMailAddress() ) { maybeWriteElement( writer, "ContactElectronicMailAddress", email ); } writer.writeEndElement(); } if ( identification != null ) { maybeWriteElement( writer, "Fees", identification.getFees() ); List<String> constr = identification.getAccessConstraints(); if ( constr != null ) { for ( String cons : constr ) { maybeWriteElement( writer, "AccessConstraints", cons ); } } } } writeElement( writer, "Fees", "none" ); writeElement( writer, "AccessConstraints", "none" ); writer.writeEndElement(); } }
deegree-services/src/main/java/org/deegree/services/wms/controller/capabilities/Capabilities111XMLAdapter.java
//$HeadURL$ /*---------------------------------------------------------------------------- This file is part of deegree, http://deegree.org/ Copyright (C) 2001-2009 by: Department of Geography, University of Bonn and lat/lon GmbH This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact information: lat/lon GmbH Aennchenstr. 19, 53177 Bonn Germany http://lat-lon.de/ Department of Geography, University of Bonn Prof. Dr. Klaus Greve Postfach 1147, 53001 Bonn Germany http://www.geographie.uni-bonn.de/deegree/ e-mail: [email protected] ----------------------------------------------------------------------------*/ package org.deegree.services.wms.controller.capabilities; import static java.lang.Double.MAX_VALUE; import static java.lang.Double.MIN_VALUE; import static java.lang.Double.NEGATIVE_INFINITY; import static java.lang.Double.POSITIVE_INFINITY; import static org.deegree.commons.xml.CommonNamespaces.XLINK_PREFIX; import static org.deegree.commons.xml.CommonNamespaces.XLNNS; import static org.deegree.cs.CRSRegistry.lookup; import static org.deegree.services.wms.model.Dimension.formatDimensionValueList; import static org.slf4j.LoggerFactory.getLogger; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; import org.deegree.commons.utils.DoublePair; import org.deegree.commons.utils.Pair; import org.deegree.commons.utils.log.LoggingNotes; import org.deegree.commons.xml.XMLAdapter; import org.deegree.cs.CRS; import org.deegree.cs.coordinatesystems.CoordinateSystem; import org.deegree.cs.exceptions.TransformationException; import org.deegree.cs.exceptions.UnknownCRSException; import org.deegree.geometry.Envelope; import org.deegree.geometry.GeometryTransformer; import org.deegree.rendering.r2d.se.unevaluated.Style; import org.deegree.services.jaxb.metadata.AddressType; import org.deegree.services.jaxb.metadata.ServiceContactType; import org.deegree.services.jaxb.metadata.ServiceIdentificationType; import org.deegree.services.jaxb.metadata.ServiceProviderType; import org.deegree.services.jaxb.wms.LanguageStringType; import org.deegree.services.wms.MapService; import org.deegree.services.wms.controller.WMSController; import org.deegree.services.wms.model.Dimension; import org.deegree.services.wms.model.layers.Layer; import org.slf4j.Logger; /** * <code>Capabilities111XMLAdapter</code> * * @author <a href="mailto:[email protected]">Andreas Schmitz</a> * @author last edited by: $Author$ * * @version $Revision$, $Date$ */ @LoggingNotes(warn = "logs problems with CRS when outputting 1.1.1 capabilities", trace = "logs stack traces") public class Capabilities111XMLAdapter extends XMLAdapter { private static final Logger LOG = getLogger( Capabilities111XMLAdapter.class ); private final String getUrl; private final String postUrl; private final ServiceIdentificationType identification; private final ServiceProviderType provider; private MapService service; private WMSController controller; /** * @param identification * @param provider * @param getUrl * @param postUrl * @param service * @param controller */ public Capabilities111XMLAdapter( ServiceIdentificationType identification, ServiceProviderType provider, String getUrl, String postUrl, MapService service, WMSController controller ) { this.identification = identification; this.provider = provider; this.getUrl = getUrl; this.postUrl = postUrl; this.service = service; this.controller = controller; } /** * Writes out a 1.1.1 style capabilities document. * * @param writer * @throws XMLStreamException */ public void export( XMLStreamWriter writer ) throws XMLStreamException { String dtdrequest = getUrl + "?request=DTD"; writer.writeDTD( "<!DOCTYPE WMT_MS_Capabilities SYSTEM \"" + dtdrequest + "\" [<!ELEMENT VendorSpecificCapabilities EMPTY>]>\n" ); writer.writeStartElement( "WMT_MS_Capabilities" ); writer.writeAttribute( "version", "1.1.1" ); writer.writeAttribute( "updateSequence", "" + service.updateSequence ); writeService( writer ); writeCapability( writer ); writer.writeEndElement(); writer.writeEndDocument(); } private void writeCapability( XMLStreamWriter writer ) throws XMLStreamException { writer.writeStartElement( "Capability" ); writeRequest( writer ); writer.writeStartElement( "Exception" ); writeElement( writer, "Format", "application/vnd.ogc.se_xml" ); writeElement( writer, "Format", "application/vnd.ogc.se_inimage" ); writeElement( writer, "Format", "application/vnd.ogc.se_blank" ); writer.writeEndElement(); writeLayers( writer, service.getRootLayer() ); writer.writeEndElement(); } private void writeLayers( XMLStreamWriter writer, Layer layer ) throws XMLStreamException { if ( layer.getTitle() == null || !layer.isAvailable() ) { return; } writer.writeStartElement( "Layer" ); if ( layer.isQueryable() ) { writer.writeAttribute( "queryable", "1" ); } maybeWriteElement( writer, "Name", layer.getName() ); writeElement( writer, "Title", layer.getTitle() ); maybeWriteElement( writer, "Abstract", layer.getAbstract() ); if ( !layer.getKeywords().isEmpty() ) { writer.writeStartElement( "KeywordList" ); for ( LanguageStringType lanString : layer.getKeywords() ) { writeElement( writer, "Keyword", lanString.getValue() ); } writer.writeEndElement(); } for ( CRS crs : layer.getSrs() ) { writeElement( writer, "SRS", crs.getName() ); } CoordinateSystem latlon; try { latlon = lookup( "CRS:84" ); Envelope layerEnv = layer.getBbox(); if ( layerEnv != null && layerEnv.getCoordinateDimension() >= 2 ) { Envelope bbox = new GeometryTransformer( latlon ).transform( layerEnv ); writer.writeStartElement( "LatLonBoundingBox" ); writer.writeAttribute( "minx", Double.toString( bbox.getMin().get0() ) ); writer.writeAttribute( "miny", Double.toString( bbox.getMin().get1() ) ); writer.writeAttribute( "maxx", Double.toString( bbox.getMax().get0() ) ); writer.writeAttribute( "maxy", Double.toString( bbox.getMax().get1() ) ); writer.writeEndElement(); for ( CRS crs : layer.getSrs() ) { if ( crs.getName().startsWith( "AUTO" ) ) { continue; } try { crs.getWrappedCRS(); } catch ( UnknownCRSException e ) { LOG.warn( "Cannot find: {}", e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); continue; } Envelope envelope; try { if ( layerEnv.getCoordinateSystem() == null ) { envelope = new GeometryTransformer( crs.getWrappedCRS() ).transform( layerEnv, latlon ); } else { envelope = new GeometryTransformer( crs.getWrappedCRS() ).transform( layerEnv ); } } catch ( IllegalArgumentException e ) { LOG.warn( "Cannot transform: {}", e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); continue; } catch ( TransformationException e ) { LOG.warn( "Cannot transform: {}", e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); continue; } writer.writeStartElement( "BoundingBox" ); writer.writeAttribute( "SRS", crs.getName() ); writer.writeAttribute( "minx", Double.toString( envelope.getMin().get0() ) ); writer.writeAttribute( "miny", Double.toString( envelope.getMin().get1() ) ); writer.writeAttribute( "maxx", Double.toString( envelope.getMax().get0() ) ); writer.writeAttribute( "maxy", Double.toString( envelope.getMax().get1() ) ); writer.writeEndElement(); } } } catch ( UnknownCRSException e ) { LOG.warn( "Cannot find: {}", e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); } catch ( IllegalArgumentException e ) { LOG.warn( "Cannot transform: {}", e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); } catch ( TransformationException e ) { LOG.warn( "Cannot transform: {}", e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); } final Map<String, Dimension<?>> dims = layer.getDimensions(); for ( Entry<String, Dimension<?>> entry : dims.entrySet() ) { Dimension<?> dim = entry.getValue(); writer.writeStartElement( "Dimension" ); writer.writeAttribute( "name", entry.getKey() ); writer.writeAttribute( "units", dim.getUnits() == null ? "EPSG:4979" : dim.getUnits() ); writer.writeAttribute( "unitSymbol", dim.getUnitSymbol() == null ? "" : dim.getUnitSymbol() ); writer.writeEndElement(); } for ( Entry<String, Dimension<?>> entry : dims.entrySet() ) { String name = entry.getKey(); Dimension<?> dim = entry.getValue(); writer.writeStartElement( "Extent" ); writer.writeAttribute( "name", name ); if ( dim.getDefaultValue() != null ) { writer.writeAttribute( "default", formatDimensionValueList( dim.getDefaultValue(), "time".equals( name ) ) ); } if ( dim.getNearestValue() ) { writer.writeAttribute( "nearestValue", "1" ); } writer.writeCharacters( dim.getExtentAsString() ); writer.writeEndElement(); } Style def = service.getStyles().get( layer.getName(), null ); if ( def != null ) { if ( def.getName() != null && !def.getName().isEmpty() ) { writeStyle( writer, "default", def.getName(), service.getLegendSize( def ), layer.getName(), def.getName() ); // TODO // title/description/whatever } else { writeStyle( writer, "default", "default", service.getLegendSize( def ), layer.getName(), def.getName() ); // TODO // title/description/whatever } } HashSet<Style> visited = new HashSet<Style>(); for ( Style s : service.getStyles().getAll( layer.getName() ) ) { if ( visited.contains( s ) ) { continue; } visited.add( s ); String name = s.getName(); if ( name != null && !name.isEmpty() ) { writeStyle( writer, name, name, service.getLegendSize( s ), layer.getName(), name ); // TODO // title/description/whatever } } DoublePair hint = layer.getScaleHint(); if ( hint.first != NEGATIVE_INFINITY || hint.second != POSITIVE_INFINITY ) { double fac = 0.00028; writer.writeStartElement( "ScaleHint" ); writer.writeAttribute( "min", Double.toString( hint.first == NEGATIVE_INFINITY ? MIN_VALUE : hint.first * fac ) ); writer.writeAttribute( "max", Double.toString( hint.second == POSITIVE_INFINITY ? MAX_VALUE : hint.second * fac ) ); writer.writeEndElement(); } for ( Layer l : new LinkedList<Layer>( layer.getChildren() ) ) { writeLayers( writer, l ); } writer.writeEndElement(); } private void writeStyle( XMLStreamWriter writer, String name, String title, Pair<Integer, Integer> legendSize, String layerName, String styleName ) throws XMLStreamException { writer.writeStartElement( "Style" ); writeElement( writer, "Name", name ); writeElement( writer, "Title", title ); if ( legendSize.first > 0 && legendSize.second > 0 ) { writer.writeStartElement( "LegendURL" ); writer.writeAttribute( "width", "" + legendSize.first ); writer.writeAttribute( "height", "" + legendSize.second ); writeElement( writer, "Format", "image/png" ); writer.writeStartElement( "OnlineResource" ); writer.writeNamespace( XLINK_PREFIX, XLNNS); writer.writeAttribute( XLNNS, "type", "simple" ); String style = styleName == null ? "" : ( "&style=" + styleName ); writer.writeAttribute( XLNNS, "href", getUrl + "?request=GetLegendGraphic&version=1.1.1&service=WMS&layer=" + layerName + style + "&format=image/png" ); writer.writeEndElement(); writer.writeEndElement(); } writer.writeEndElement(); } private void writeDCP( XMLStreamWriter writer, boolean get, boolean post ) throws XMLStreamException { writer.writeStartElement( "DCPType" ); writer.writeStartElement( "HTTP" ); if ( get ) { writer.writeStartElement( "Get" ); writer.writeStartElement( "OnlineResource" ); writer.writeNamespace( XLINK_PREFIX, XLNNS); writer.writeAttribute( XLNNS, "type", "simple" ); writer.writeAttribute( XLNNS, "href", getUrl + "?" ); writer.writeEndElement(); writer.writeEndElement(); } if ( post ) { writer.writeStartElement( "Post" ); writer.writeStartElement( "OnlineResource" ); writer.writeAttribute( XLNNS, "type", "simple" ); writer.writeAttribute( XLNNS, "href", postUrl ); writer.writeEndElement(); writer.writeEndElement(); } writer.writeEndElement(); writer.writeEndElement(); } private void writeRequest( XMLStreamWriter writer ) throws XMLStreamException { writer.writeStartElement( "Request" ); writer.writeStartElement( "GetCapabilities" ); writeElement( writer, "Format", "application/vnd.ogc.wms_xml" ); writeDCP( writer, true, false ); writer.writeEndElement(); writer.writeStartElement( "GetMap" ); writeImageFormats( writer ); writeDCP( writer, true, true ); writer.writeEndElement(); writer.writeStartElement( "GetFeatureInfo" ); writeInfoFormats( writer ); writeDCP( writer, true, false ); writer.writeEndElement(); writer.writeStartElement( "GetLegendGraphic" ); writeInfoFormats( writer ); writeDCP( writer, true, false ); writer.writeEndElement(); writer.writeEndElement(); } private void writeImageFormats( XMLStreamWriter writer ) throws XMLStreamException { for ( String f : controller.supportedImageFormats ) { writeElement( writer, "Format", f ); } } private void writeInfoFormats( XMLStreamWriter writer ) throws XMLStreamException { for ( String f : controller.supportedFeatureInfoFormats.keySet() ) { writeElement( writer, "Format", f ); } } private void writeService( XMLStreamWriter writer ) throws XMLStreamException { writer.writeStartElement( "Service" ); writeElement( writer, "Name", "OGC:WMS" ); List<String> titles = identification == null ? null : identification.getTitle(); String title = ( titles != null && !titles.isEmpty() ) ? titles.get( 0 ) : "deegree 3 WMS"; writeElement( writer, "Title", title ); List<String> abstracts = identification == null ? null : identification.getAbstract(); if ( abstracts != null && !abstracts.isEmpty() ) { writeElement( writer, "Abstract", abstracts.get( 0 ) ); } List<org.deegree.services.jaxb.metadata.KeywordsType> keywords = identification == null ? null : identification.getKeywords(); if ( keywords != null && !keywords.isEmpty() ) { writer.writeStartElement( "KeywordList" ); for ( org.deegree.services.jaxb.metadata.KeywordsType key : keywords ) { for ( org.deegree.services.jaxb.metadata.LanguageStringType lanString : key.getKeyword() ) { writeElement( writer, "Keyword", lanString.getValue() ); } } writer.writeEndElement(); } writer.writeStartElement( "OnlineResource" ); writer.writeAttribute( XLNNS, "type", "simple" ); writer.writeAttribute( XLNNS, "href", getUrl ); writer.writeEndElement(); if ( provider != null ) { ServiceContactType contact = provider.getServiceContact(); if ( contact != null ) { writer.writeStartElement( "ContactInformation" ); if ( contact.getIndividualName() != null ) { writer.writeStartElement( "ContactPersonPrimary" ); writeElement( writer, "ContactPerson", contact.getIndividualName() ); writeElement( writer, "ContactOrganization", provider.getProviderName() ); writer.writeEndElement(); } maybeWriteElement( writer, "ContactPosition", contact.getPositionName() ); AddressType addr = contact.getAddress(); if ( addr != null ) { writer.writeStartElement( "ContactAddress" ); writeElement( writer, "AddressType", "postal" ); for ( String s : addr.getDeliveryPoint() ) { maybeWriteElement( writer, "Address", s ); } writeElement( writer, "City", addr.getCity() ); writeElement( writer, "StateOrProvince", addr.getAdministrativeArea() ); writeElement( writer, "PostCode", addr.getPostalCode() ); writeElement( writer, "Country", addr.getCountry() ); writer.writeEndElement(); } maybeWriteElement( writer, "ContactVoiceTelephone", contact.getPhone() ); maybeWriteElement( writer, "ContactFacsimileTelephone", contact.getFacsimile() ); for ( String email : contact.getElectronicMailAddress() ) { maybeWriteElement( writer, "ContactElectronicMailAddress", email ); } writer.writeEndElement(); } if ( identification != null ) { maybeWriteElement( writer, "Fees", identification.getFees() ); List<String> constr = identification.getAccessConstraints(); if ( constr != null ) { for ( String cons : constr ) { maybeWriteElement( writer, "AccessConstraints", cons ); } } } } writeElement( writer, "Fees", "none" ); writeElement( writer, "AccessConstraints", "none" ); writer.writeEndElement(); } }
Fixed namespace binding issues.
deegree-services/src/main/java/org/deegree/services/wms/controller/capabilities/Capabilities111XMLAdapter.java
Fixed namespace binding issues.
<ide><path>eegree-services/src/main/java/org/deegree/services/wms/controller/capabilities/Capabilities111XMLAdapter.java <ide> writer.writeDTD( "<!DOCTYPE WMT_MS_Capabilities SYSTEM \"" + dtdrequest <ide> + "\" [<!ELEMENT VendorSpecificCapabilities EMPTY>]>\n" ); <ide> writer.writeStartElement( "WMT_MS_Capabilities" ); <del> writer.writeAttribute( "version", "1.1.1" ); <add> writer.writeAttribute( "version", "1.1.1" ); <ide> writer.writeAttribute( "updateSequence", "" + service.updateSequence ); <ide> <ide> writeService( writer ); <ide> if ( hint.first != NEGATIVE_INFINITY || hint.second != POSITIVE_INFINITY ) { <ide> double fac = 0.00028; <ide> writer.writeStartElement( "ScaleHint" ); <del> writer.writeAttribute( "min", Double.toString( hint.first == NEGATIVE_INFINITY ? MIN_VALUE : hint.first <del> * fac ) ); <del> writer.writeAttribute( "max", Double.toString( hint.second == POSITIVE_INFINITY ? MAX_VALUE : hint.second <del> * fac ) ); <add> writer.writeAttribute( "min", <add> Double.toString( hint.first == NEGATIVE_INFINITY ? MIN_VALUE : hint.first * fac ) ); <add> writer.writeAttribute( "max", <add> Double.toString( hint.second == POSITIVE_INFINITY ? MAX_VALUE : hint.second * fac ) ); <ide> writer.writeEndElement(); <ide> } <ide> <ide> writer.writeAttribute( "height", "" + legendSize.second ); <ide> writeElement( writer, "Format", "image/png" ); <ide> writer.writeStartElement( "OnlineResource" ); <del> writer.writeNamespace( XLINK_PREFIX, XLNNS); <add> writer.writeNamespace( XLINK_PREFIX, XLNNS ); <ide> writer.writeAttribute( XLNNS, "type", "simple" ); <ide> String style = styleName == null ? "" : ( "&style=" + styleName ); <ide> writer.writeAttribute( XLNNS, "href", getUrl + "?request=GetLegendGraphic&version=1.1.1&service=WMS&layer=" <ide> if ( get ) { <ide> writer.writeStartElement( "Get" ); <ide> writer.writeStartElement( "OnlineResource" ); <del> writer.writeNamespace( XLINK_PREFIX, XLNNS); <add> writer.writeNamespace( XLINK_PREFIX, XLNNS ); <ide> writer.writeAttribute( XLNNS, "type", "simple" ); <ide> writer.writeAttribute( XLNNS, "href", getUrl + "?" ); <ide> writer.writeEndElement(); <ide> if ( post ) { <ide> writer.writeStartElement( "Post" ); <ide> writer.writeStartElement( "OnlineResource" ); <add> writer.writeNamespace( XLINK_PREFIX, XLNNS ); <ide> writer.writeAttribute( XLNNS, "type", "simple" ); <ide> writer.writeAttribute( XLNNS, "href", postUrl ); <ide> writer.writeEndElement(); <ide> } <ide> <ide> writer.writeStartElement( "OnlineResource" ); <add> writer.writeNamespace( XLINK_PREFIX, XLNNS ); <ide> writer.writeAttribute( XLNNS, "type", "simple" ); <ide> writer.writeAttribute( XLNNS, "href", getUrl ); <ide> writer.writeEndElement(); <ide> <ide> writer.writeEndElement(); <ide> } <del> <ide> }
Java
apache-2.0
2ae8b7f2b784f31d26112d824427707a56cde181
0
majorseitan/dataverse,majorseitan/dataverse,quarian/dataverse,jacksonokuhn/dataverse,JayanthyChengan/dataverse,majorseitan/dataverse,leeper/dataverse-1,ekoi/DANS-DVN-4.6.1,leeper/dataverse-1,leeper/dataverse-1,majorseitan/dataverse,quarian/dataverse,JayanthyChengan/dataverse,majorseitan/dataverse,jacksonokuhn/dataverse,quarian/dataverse,ekoi/DANS-DVN-4.6.1,bmckinney/dataverse-canonical,bmckinney/dataverse-canonical,majorseitan/dataverse,majorseitan/dataverse,leeper/dataverse-1,leeper/dataverse-1,quarian/dataverse,jacksonokuhn/dataverse,bmckinney/dataverse-canonical,ekoi/DANS-DVN-4.6.1,leeper/dataverse-1,JayanthyChengan/dataverse,quarian/dataverse,jacksonokuhn/dataverse,JayanthyChengan/dataverse,JayanthyChengan/dataverse,ekoi/DANS-DVN-4.6.1,quarian/dataverse,jacksonokuhn/dataverse,JayanthyChengan/dataverse,bmckinney/dataverse-canonical,bmckinney/dataverse-canonical,quarian/dataverse,bmckinney/dataverse-canonical,majorseitan/dataverse,leeper/dataverse-1,JayanthyChengan/dataverse,jacksonokuhn/dataverse,JayanthyChengan/dataverse,jacksonokuhn/dataverse,ekoi/DANS-DVN-4.6.1,ekoi/DANS-DVN-4.6.1,jacksonokuhn/dataverse,bmckinney/dataverse-canonical,quarian/dataverse,bmckinney/dataverse-canonical,ekoi/DANS-DVN-4.6.1,ekoi/DANS-DVN-4.6.1,leeper/dataverse-1
package edu.harvard.iq.dataverse.util; import edu.harvard.iq.dataverse.authorization.groups.impl.ipaddress.ip.IpAddress; import java.util.logging.Level; import java.util.logging.Logger; import javax.faces.application.FacesMessage; import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; import javax.servlet.ServletRequest; /** * Utility class for common JSF tasks. * @author michael */ public class JsfHelper { private static final Logger logger = Logger.getLogger(JsfHelper.class.getName()); public static final JsfHelper JH = new JsfHelper(); public static void addSuccessMessage(String message) { FacesContext.getCurrentInstance().getExternalContext().getFlash().put("msg", message); } public static void addFlashMessage(String message) { FacesContext.getCurrentInstance().getExternalContext().getFlash().put("msg", message); } public void addMessage( FacesMessage.Severity s, String summary, String details ) { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(s, summary, details)); } public void addMessage( FacesMessage.Severity s, String summary ) { addMessage(s, summary, ""); } public <T extends Enum<T>> T enumValue( String param, Class<T> enmClass, T defaultValue ) { if ( param == null ) return defaultValue; param = param.trim(); try { return Enum.valueOf(enmClass, param); } catch ( IllegalArgumentException iar ) { logger.log(Level.WARNING, "Illegal value for enum {0}: ''{1}''", new Object[]{enmClass.getName(), param}); return defaultValue; } } }
src/main/java/edu/harvard/iq/dataverse/util/JsfHelper.java
package edu.harvard.iq.dataverse.util; import edu.harvard.iq.dataverse.authorization.groups.impl.ipaddress.ip.IpAddress; import java.util.logging.Level; import java.util.logging.Logger; import javax.faces.application.FacesMessage; import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; import javax.servlet.ServletRequest; /** * Utility class for common JSF tasks. * @author michael */ public class JsfHelper { private static final Logger logger = Logger.getLogger(JsfHelper.class.getName()); public static final JsfHelper JH = new JsfHelper(); public static void addFlashMessage(String message) { FacesContext.getCurrentInstance().getExternalContext().getFlash().put("msg", message); } public void addMessage( FacesMessage.Severity s, String summary, String details ) { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(s, summary, details)); } public void addMessage( FacesMessage.Severity s, String summary ) { addMessage(s, summary, ""); } public <T extends Enum<T>> T enumValue( String param, Class<T> enmClass, T defaultValue ) { if ( param == null ) return defaultValue; param = param.trim(); try { return Enum.valueOf(enmClass, param); } catch ( IllegalArgumentException iar ) { logger.log(Level.WARNING, "Illegal value for enum {0}: ''{1}''", new Object[]{enmClass.getName(), param}); return defaultValue; } } }
re added addSuccessMessage
src/main/java/edu/harvard/iq/dataverse/util/JsfHelper.java
re added addSuccessMessage
<ide><path>rc/main/java/edu/harvard/iq/dataverse/util/JsfHelper.java <ide> private static final Logger logger = Logger.getLogger(JsfHelper.class.getName()); <ide> <ide> public static final JsfHelper JH = new JsfHelper(); <add> <add> public static void addSuccessMessage(String message) { <add> FacesContext.getCurrentInstance().getExternalContext().getFlash().put("msg", message); <add> } <ide> <ide> public static void addFlashMessage(String message) { <ide> FacesContext.getCurrentInstance().getExternalContext().getFlash().put("msg", message);
Java
agpl-3.0
5d9f852abd397a8e7e94494c364fecefc68ac74e
0
jounnie/sportchef,jounnie/sportchef
package ch.sportchef.server.services; import org.junit.Assert; import org.junit.Test; import javax.management.ServiceNotFoundException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Modifier; import static org.junit.Assert.assertTrue; public class ServiceRegistryShould { private static class TestService implements Service { } @Test public void notBeInstantiable() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { final Constructor<ServiceRegistry> constructor = ServiceRegistry.class.getDeclaredConstructor(); assertTrue(Modifier.isPrivate(constructor.getModifiers())); constructor.setAccessible(true); constructor.newInstance(); } @Test(expected = NullPointerException.class) public void registerShouldFail () { ServiceRegistry.register(null); } @Test(expected = ServiceNotFoundException.class) public void getServiceShouldFail () throws Exception { ServiceRegistry.getService(TestService.class); } @Test public void registerAndGetService () throws Exception { // create a new TestService and register TestService serviceToRegister = new TestService(); ServiceRegistry.register(serviceToRegister); // get TestService from registry and check TestService registeredService = ServiceRegistry.getService(TestService.class); Assert.assertSame(serviceToRegister, registeredService); } }
src/test/java/ch/sportchef/server/services/ServiceRegistryShould.java
package ch.sportchef.server.services; import org.junit.Assert; import org.junit.Test; import javax.management.ServiceNotFoundException; public class ServiceRegistryShould { private static class TestService implements Service { } @Test(expected = NullPointerException.class) public void registerShouldFail () { ServiceRegistry.register(null); } @Test(expected = ServiceNotFoundException.class) public void getServiceShouldFail () throws Exception { ServiceRegistry.getService(TestService.class); } @Test public void registerAndGetService () throws Exception { // create a new TestService and register TestService serviceToRegister = new TestService(); ServiceRegistry.register(serviceToRegister); // get TestService from registry and check TestService registeredService = ServiceRegistry.getService(TestService.class); Assert.assertSame(serviceToRegister, registeredService); } }
#72 Coverage decreased due to missing contructor test
src/test/java/ch/sportchef/server/services/ServiceRegistryShould.java
#72 Coverage decreased due to missing contructor test
<ide><path>rc/test/java/ch/sportchef/server/services/ServiceRegistryShould.java <ide> import org.junit.Test; <ide> <ide> import javax.management.ServiceNotFoundException; <add>import java.lang.reflect.Constructor; <add>import java.lang.reflect.InvocationTargetException; <add>import java.lang.reflect.Modifier; <add> <add>import static org.junit.Assert.assertTrue; <ide> <ide> public class ServiceRegistryShould { <ide> <ide> private static class TestService implements Service <ide> { <add> } <add> <add> @Test <add> public void notBeInstantiable() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { <add> final Constructor<ServiceRegistry> constructor = ServiceRegistry.class.getDeclaredConstructor(); <add> assertTrue(Modifier.isPrivate(constructor.getModifiers())); <add> constructor.setAccessible(true); <add> constructor.newInstance(); <ide> } <ide> <ide> @Test(expected = NullPointerException.class)
Java
apache-2.0
8c848043af68feef88865a5b5251fe3d442c5410
0
fishercoder1534/Leetcode,fishercoder1534/Leetcode,fishercoder1534/Leetcode,fishercoder1534/Leetcode,fishercoder1534/Leetcode
package com.fishercoder.solutions; /** * 278. First Bad Version * * You are a product manager and currently leading a team to develop a new product. * Unfortunately, the latest version of your product fails the quality check. * Since each version is developed based on the previous version, all the versions after a bad version are also bad. * Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, * which causes all the following ones to be bad. * * You are given an API bool isBadVersion(version) which will return whether version is bad. * Implement a function to find the first bad version. You should minimize the number of calls to the API.*/ public class _278 { public static class Solution1 { public int firstBadVersion(int n) { int left = 1; int right = n; if (isBadVersion(left)) { return left; } while (left + 1 < right) { int mid = left + (right - left) / 2; if (isBadVersion(mid)) { right = mid; } else { left = mid; } } if (isBadVersion(left)) { return left; } return right; } private boolean isBadVersion(int left) { //this is a fake method to make Eclipse happy return false; } } }
src/main/java/com/fishercoder/solutions/_278.java
package com.fishercoder.solutions; /**You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad. Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, which causes all the following ones to be bad. You are given an API bool isBadVersion(version) which will return whether version is bad. Implement a function to find the first bad version. You should minimize the number of calls to the API.*/ public class _278 { public int firstBadVersion(int n) { int left = 1; int right = n; if (isBadVersion(left)) { return left; } while (left + 1 < right) { int mid = left + (right - left) / 2; if (isBadVersion(mid)) { right = mid; } else { left = mid; } } if (isBadVersion(left)) { return left; } return right; } private boolean isBadVersion(int left) { //this is a fake method to make Eclipse happy return false; } }
refactor 278
src/main/java/com/fishercoder/solutions/_278.java
refactor 278
<ide><path>rc/main/java/com/fishercoder/solutions/_278.java <ide> package com.fishercoder.solutions; <ide> <del>/**You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad. <del> <del> Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, which causes all the following ones to be bad. <del> <del> You are given an API bool isBadVersion(version) which will return whether version is bad. Implement a function to find the first bad version. You should minimize the number of calls to the API.*/ <add>/** <add> * 278. First Bad Version <add> * <add> * You are a product manager and currently leading a team to develop a new product. <add> * Unfortunately, the latest version of your product fails the quality check. <add> * Since each version is developed based on the previous version, all the versions after a bad version are also bad. <add> * Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, <add> * which causes all the following ones to be bad. <add> * <add> * You are given an API bool isBadVersion(version) which will return whether version is bad. <add> * Implement a function to find the first bad version. You should minimize the number of calls to the API.*/ <ide> public class _278 { <ide> <del> public int firstBadVersion(int n) { <del> int left = 1; <del> int right = n; <del> if (isBadVersion(left)) { <del> return left; <add> public static class Solution1 { <add> public int firstBadVersion(int n) { <add> int left = 1; <add> int right = n; <add> if (isBadVersion(left)) { <add> return left; <add> } <add> <add> while (left + 1 < right) { <add> int mid = left + (right - left) / 2; <add> if (isBadVersion(mid)) { <add> right = mid; <add> } else { <add> left = mid; <add> } <add> } <add> <add> if (isBadVersion(left)) { <add> return left; <add> } <add> return right; <ide> } <ide> <del> while (left + 1 < right) { <del> int mid = left + (right - left) / 2; <del> if (isBadVersion(mid)) { <del> right = mid; <del> } else { <del> left = mid; <del> } <add> private boolean isBadVersion(int left) { <add> //this is a fake method to make Eclipse happy <add> return false; <ide> } <del> <del> if (isBadVersion(left)) { <del> return left; <del> } <del> return right; <ide> } <del> <del> private boolean isBadVersion(int left) { <del> //this is a fake method to make Eclipse happy <del> return false; <del> } <del> <ide> }
Java
unlicense
error: pathspec 'test/models/GameRoomTests.java' did not match any file(s) known to git
88d1bac78739012f7faa94814b2099a292462330
1
MaciejSzaflik/CharadesAndStuff,MaciejSzaflik/CharadesAndStuff,MaciejSzaflik/CharadesAndStuff
package test.models; import org.junit.Assert; import org.junit.Test; import models.Gamer; import models.Room; import java.util.Date; import java.util.List; import java.util.ArrayList; import play.test.*; import static play.test.Helpers.*; public class GameRoomTests { @Test public void GameRoomTests_AddRoom() { running(fakeApplication(), new Runnable() { public void run() { Room room = getRoom(); room.save(); Assert.assertNotNull(room.id); } }); } private Room getRoom() { Room room = new Room(); room.dateCreation = new Date(); room.dateUpdate = new Date(); room.iStuff = true; room.isRunning = false; room.gameId = new Long(1); room.chatId = new Long(1); room.params = ""; room.players = new ArrayList<Gamer>(); return room; } }
test/models/GameRoomTests.java
Added Simple Model test
test/models/GameRoomTests.java
Added Simple Model test
<ide><path>est/models/GameRoomTests.java <add>package test.models; <add> <add>import org.junit.Assert; <add>import org.junit.Test; <add> <add>import models.Gamer; <add>import models.Room; <add> <add>import java.util.Date; <add>import java.util.List; <add>import java.util.ArrayList; <add> <add>import play.test.*; <add>import static play.test.Helpers.*; <add> <add>public class GameRoomTests { <add> @Test <add> public void GameRoomTests_AddRoom() { <add> running(fakeApplication(), new Runnable() { <add> public void run() { <add> Room room = getRoom(); <add> room.save(); <add> <add> Assert.assertNotNull(room.id); <add> } <add> }); <add> } <add> <add> private Room getRoom() { <add> Room room = new Room(); <add> room.dateCreation = new Date(); <add> room.dateUpdate = new Date(); <add> room.iStuff = true; <add> room.isRunning = false; <add> room.gameId = new Long(1); <add> room.chatId = new Long(1); <add> room.params = ""; <add> room.players = new ArrayList<Gamer>(); <add> <add> return room; <add> } <add>}
Java
apache-2.0
ac3707553d777e3a412cd0b2af73ad071ea028ff
0
firebase/firebase-android-sdk,firebase/firebase-android-sdk,firebase/firebase-android-sdk,firebase/firebase-android-sdk,firebase/firebase-android-sdk,firebase/firebase-android-sdk,firebase/firebase-android-sdk,firebase/firebase-android-sdk
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.firebase.dynamiclinks.internal; import android.net.Uri; import android.os.Parcel; import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable; import com.google.android.gms.common.internal.safeparcel.SafeParcelable; import com.google.firebase.dynamiclinks.ShortDynamicLink; import java.util.Collections; import java.util.List; /** {@link SafeParcelable} implementation of {@link ShortDynamicLink}. */ @SafeParcelable.Class(creator = "ShortDynamicLinkImplCreator") public final class ShortDynamicLinkImpl extends AbstractSafeParcelable implements ShortDynamicLink { public static final Creator<ShortDynamicLinkImpl> CREATOR = new ShortDynamicLinkImplCreator(); @SafeParcelable.Field(id = 1, getter = "getShortLink") private final Uri shortLink; @SafeParcelable.Field(id = 2, getter = "getPreviewLink") private final Uri previewLink; @SafeParcelable.Field(id = 3, getter = "getWarnings") private final List<WarningImpl> warnings; @SafeParcelable.Constructor public ShortDynamicLinkImpl( @Param(id = 1) Uri shortLink, @Param(id = 2) Uri previewLink, @Param(id = 3) List<WarningImpl> warnings) { this.shortLink = shortLink; this.previewLink = previewLink; this.warnings = warnings == null ? Collections.emptyList() : warnings; } @Override public Uri getShortLink() { return shortLink; } @Override public Uri getPreviewLink() { return previewLink; } @Override public List<WarningImpl> getWarnings() { return warnings; } @Override public void writeToParcel(Parcel dest, int flags) { ShortDynamicLinkImplCreator.writeToParcel(this, dest, flags); } /** {@link SafeParcelable} implementation of {@link Warning}. */ @SafeParcelable.Class(creator = "WarningImplCreator") public static class WarningImpl extends AbstractSafeParcelable implements Warning { public static final Creator<WarningImpl> CREATOR = new WarningImplCreator(); @SafeParcelable.Reserved({1 /* code, deprecated */}) @SafeParcelable.Field(id = 2, getter = "getMessage") private final String message; @SafeParcelable.Constructor public WarningImpl(@Param(id = 2) String message) { this.message = message; } @Override public String getCode() { // warningCode deprecated on server, returns non-useful, hard-coded value. return null; } @Override public String getMessage() { return message; } @Override public void writeToParcel(Parcel dest, int flags) { WarningImplCreator.writeToParcel(this, dest, flags); } @Override public String toString() { return message; } } }
firebase-dynamic-links/src/main/java/com/google/firebase/dynamiclinks/internal/ShortDynamicLinkImpl.java
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.firebase.dynamiclinks.internal; import android.net.Uri; import android.os.Parcel; import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable; import com.google.android.gms.common.internal.safeparcel.SafeParcelable; import com.google.firebase.dynamiclinks.ShortDynamicLink; import java.util.Collections; import java.util.List; /** {@link SafeParcelable} implementation of {@link ShortDynamicLink}. */ @SafeParcelable.Class(creator = "ShortDynamicLinkImplCreator") public final class ShortDynamicLinkImpl extends AbstractSafeParcelable implements ShortDynamicLink { public static final Creator<ShortDynamicLinkImpl> CREATOR = new ShortDynamicLinkImplCreator(); @SafeParcelable.Field(id = 1, getter = "getShortLink") private final Uri shortLink; @SafeParcelable.Field(id = 2, getter = "getPreviewLink") private final Uri previewLink; @SafeParcelable.Field(id = 3, getter = "getWarnings") private final List<WarningImpl> warnings; @SafeParcelable.Constructor public ShortDynamicLinkImpl( @Param(id = 1) Uri shortLink, @Param(id = 2) Uri previewLink, @Param(id = 3) List<WarningImpl> warnings) { this.shortLink = shortLink; this.previewLink = previewLink; this.warnings = warnings == null ? Collections.<>emptyList() : warnings; } @Override public Uri getShortLink() { return shortLink; } @Override public Uri getPreviewLink() { return previewLink; } @Override public List<WarningImpl> getWarnings() { return warnings; } @Override public void writeToParcel(Parcel dest, int flags) { ShortDynamicLinkImplCreator.writeToParcel(this, dest, flags); } /** {@link SafeParcelable} implementation of {@link Warning}. */ @SafeParcelable.Class(creator = "WarningImplCreator") public static class WarningImpl extends AbstractSafeParcelable implements Warning { public static final Creator<WarningImpl> CREATOR = new WarningImplCreator(); @SafeParcelable.Reserved({1 /* code, deprecated */}) @SafeParcelable.Field(id = 2, getter = "getMessage") private final String message; @SafeParcelable.Constructor public WarningImpl(@Param(id = 2) String message) { this.message = message; } @Override public String getCode() { // warningCode deprecated on server, returns non-useful, hard-coded value. return null; } @Override public String getMessage() { return message; } @Override public void writeToParcel(Parcel dest, int flags) { WarningImplCreator.writeToParcel(this, dest, flags); } @Override public String toString() { return message; } } }
Fix FDL issue. (#1284)
firebase-dynamic-links/src/main/java/com/google/firebase/dynamiclinks/internal/ShortDynamicLinkImpl.java
Fix FDL issue. (#1284)
<ide><path>irebase-dynamic-links/src/main/java/com/google/firebase/dynamiclinks/internal/ShortDynamicLinkImpl.java <ide> @Param(id = 3) List<WarningImpl> warnings) { <ide> this.shortLink = shortLink; <ide> this.previewLink = previewLink; <del> this.warnings = warnings == null ? Collections.<>emptyList() : warnings; <add> this.warnings = warnings == null ? Collections.emptyList() : warnings; <ide> } <ide> <ide> @Override
Java
apache-2.0
error: pathspec 'core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/query/InQueryTest.java' did not match any file(s) known to git
067dc955352faa61aa512f1f3ff3a2420ca1a39b
1
vladmihalcea/high-performance-java-persistence,vladmihalcea/high-performance-java-persistence
package com.vladmihalcea.book.hpjp.hibernate.query; import com.vladmihalcea.book.hpjp.util.AbstractTest; import com.vladmihalcea.book.hpjp.util.providers.Database; import org.junit.Test; import javax.persistence.*; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Properties; import java.util.stream.Collectors; import static org.junit.Assert.assertEquals; /** * @author Vlad Mihalcea */ public class InQueryTest extends AbstractTest { @Override protected Class<?>[] entities() { return new Class<?>[]{ Post.class }; } @Override protected void additionalProperties(Properties properties) { properties.put("hibernate.jdbc.batch_size", "50"); properties.put("hibernate.order_inserts", "true"); properties.put("hibernate.query.in_clause_parameter_padding", "true"); } @Test public void testPadding() { doInJPA(entityManager -> { for (int i = 1; i <= 15; i++) { Post post = new Post(); post.setId(i); post.setTitle(String.format("Post no. %d", i)); entityManager.persist(post); } }); doInJPA(entityManager -> { assertEquals(3, getPostByIds(entityManager, 1, 2, 3).size()); assertEquals(4, getPostByIds(entityManager, 1, 2, 3, 4).size()); assertEquals(5, getPostByIds(entityManager, 1, 2, 3, 4, 5).size()); assertEquals(6, getPostByIds(entityManager, 1, 2, 3, 4, 5, 6).size()); }); } List<Post> getPostByIds(EntityManager entityManager, Integer... ids) { return entityManager.createQuery( "select p " + "from Post p " + "where p.id in :ids", Post.class) .setParameter("ids", Arrays.asList(ids)) .getResultList(); } @Entity(name = "Post") @Table(name = "post") public static class Post { @Id private Integer id; private String title; public Post() {} public Post(String title) { this.title = title; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } } }
core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/query/InQueryTest.java
Add in clause parameter padding
core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/query/InQueryTest.java
Add in clause parameter padding
<ide><path>ore/src/test/java/com/vladmihalcea/book/hpjp/hibernate/query/InQueryTest.java <add>package com.vladmihalcea.book.hpjp.hibernate.query; <add> <add>import com.vladmihalcea.book.hpjp.util.AbstractTest; <add>import com.vladmihalcea.book.hpjp.util.providers.Database; <add>import org.junit.Test; <add> <add>import javax.persistence.*; <add>import java.util.ArrayList; <add>import java.util.Arrays; <add>import java.util.List; <add>import java.util.Properties; <add>import java.util.stream.Collectors; <add> <add>import static org.junit.Assert.assertEquals; <add> <add>/** <add> * @author Vlad Mihalcea <add> */ <add>public class InQueryTest extends AbstractTest { <add> <add> @Override <add> protected Class<?>[] entities() { <add> return new Class<?>[]{ <add> Post.class <add> }; <add> } <add> <add> @Override <add> protected void additionalProperties(Properties properties) { <add> properties.put("hibernate.jdbc.batch_size", "50"); <add> properties.put("hibernate.order_inserts", "true"); <add> properties.put("hibernate.query.in_clause_parameter_padding", "true"); <add> } <add> <add> @Test <add> public void testPadding() { <add> doInJPA(entityManager -> { <add> for (int i = 1; i <= 15; i++) { <add> Post post = new Post(); <add> post.setId(i); <add> post.setTitle(String.format("Post no. %d", i)); <add> <add> entityManager.persist(post); <add> } <add> }); <add> <add> doInJPA(entityManager -> { <add> assertEquals(3, getPostByIds(entityManager, 1, 2, 3).size()); <add> assertEquals(4, getPostByIds(entityManager, 1, 2, 3, 4).size()); <add> assertEquals(5, getPostByIds(entityManager, 1, 2, 3, 4, 5).size()); <add> assertEquals(6, getPostByIds(entityManager, 1, 2, 3, 4, 5, 6).size()); <add> }); <add> } <add> <add> List<Post> getPostByIds(EntityManager entityManager, Integer... ids) { <add> return entityManager.createQuery( <add> "select p " + <add> "from Post p " + <add> "where p.id in :ids", Post.class) <add> .setParameter("ids", Arrays.asList(ids)) <add> .getResultList(); <add> } <add> <add> @Entity(name = "Post") <add> @Table(name = "post") <add> public static class Post { <add> <add> @Id <add> private Integer id; <add> <add> private String title; <add> <add> public Post() {} <add> <add> public Post(String title) { <add> this.title = title; <add> } <add> <add> public Integer getId() { <add> return id; <add> } <add> <add> public void setId(Integer id) { <add> this.id = id; <add> } <add> <add> public String getTitle() { <add> return title; <add> } <add> <add> public void setTitle(String title) { <add> this.title = title; <add> } <add> } <add>}
Java
apache-2.0
e3112ebfa5ff07486c2acff721f81181d7e036a0
0
fengbaicanhe/intellij-community,youdonghai/intellij-community,semonte/intellij-community,ernestp/consulo,mglukhikh/intellij-community,asedunov/intellij-community,kdwink/intellij-community,kool79/intellij-community,samthor/intellij-community,wreckJ/intellij-community,robovm/robovm-studio,asedunov/intellij-community,vvv1559/intellij-community,lucafavatella/intellij-community,youdonghai/intellij-community,fengbaicanhe/intellij-community,signed/intellij-community,dslomov/intellij-community,ivan-fedorov/intellij-community,signed/intellij-community,jagguli/intellij-community,joewalnes/idea-community,pwoodworth/intellij-community,akosyakov/intellij-community,blademainer/intellij-community,caot/intellij-community,clumsy/intellij-community,blademainer/intellij-community,ibinti/intellij-community,allotria/intellij-community,nicolargo/intellij-community,izonder/intellij-community,pwoodworth/intellij-community,robovm/robovm-studio,hurricup/intellij-community,mglukhikh/intellij-community,joewalnes/idea-community,jexp/idea2,da1z/intellij-community,idea4bsd/idea4bsd,Lekanich/intellij-community,signed/intellij-community,salguarnieri/intellij-community,slisson/intellij-community,retomerz/intellij-community,TangHao1987/intellij-community,ftomassetti/intellij-community,vladmm/intellij-community,lucafavatella/intellij-community,hurricup/intellij-community,fengbaicanhe/intellij-community,pwoodworth/intellij-community,fitermay/intellij-community,idea4bsd/idea4bsd,pwoodworth/intellij-community,alphafoobar/intellij-community,semonte/intellij-community,izonder/intellij-community,pwoodworth/intellij-community,dslomov/intellij-community,ThiagoGarciaAlves/intellij-community,izonder/intellij-community,ryano144/intellij-community,ryano144/intellij-community,slisson/intellij-community,TangHao1987/intellij-community,wreckJ/intellij-community,SerCeMan/intellij-community,FHannes/intellij-community,consulo/consulo,ahb0327/intellij-community,allotria/intellij-community,akosyakov/intellij-community,ryano144/intellij-community,da1z/intellij-community,amith01994/intellij-community,ahb0327/intellij-community,samthor/intellij-community,ibinti/intellij-community,clumsy/intellij-community,MER-GROUP/intellij-community,asedunov/intellij-community,apixandru/intellij-community,hurricup/intellij-community,Lekanich/intellij-community,hurricup/intellij-community,lucafavatella/intellij-community,lucafavatella/intellij-community,xfournet/intellij-community,blademainer/intellij-community,fengbaicanhe/intellij-community,ftomassetti/intellij-community,gnuhub/intellij-community,orekyuu/intellij-community,slisson/intellij-community,ivan-fedorov/intellij-community,signed/intellij-community,alphafoobar/intellij-community,vvv1559/intellij-community,Distrotech/intellij-community,petteyg/intellij-community,kdwink/intellij-community,slisson/intellij-community,xfournet/intellij-community,hurricup/intellij-community,ftomassetti/intellij-community,akosyakov/intellij-community,caot/intellij-community,apixandru/intellij-community,caot/intellij-community,fnouama/intellij-community,caot/intellij-community,nicolargo/intellij-community,retomerz/intellij-community,youdonghai/intellij-community,apixandru/intellij-community,semonte/intellij-community,kool79/intellij-community,alphafoobar/intellij-community,supersven/intellij-community,jagguli/intellij-community,salguarnieri/intellij-community,fnouama/intellij-community,izonder/intellij-community,ryano144/intellij-community,tmpgit/intellij-community,adedayo/intellij-community,pwoodworth/intellij-community,slisson/intellij-community,Distrotech/intellij-community,vvv1559/intellij-community,retomerz/intellij-community,salguarnieri/intellij-community,tmpgit/intellij-community,michaelgallacher/intellij-community,alphafoobar/intellij-community,kdwink/intellij-community,petteyg/intellij-community,lucafavatella/intellij-community,fnouama/intellij-community,ryano144/intellij-community,adedayo/intellij-community,ivan-fedorov/intellij-community,jexp/idea2,ibinti/intellij-community,izonder/intellij-community,suncycheng/intellij-community,petteyg/intellij-community,dslomov/intellij-community,ryano144/intellij-community,holmes/intellij-community,jagguli/intellij-community,semonte/intellij-community,Distrotech/intellij-community,xfournet/intellij-community,blademainer/intellij-community,fengbaicanhe/intellij-community,kdwink/intellij-community,signed/intellij-community,pwoodworth/intellij-community,slisson/intellij-community,xfournet/intellij-community,amith01994/intellij-community,mglukhikh/intellij-community,allotria/intellij-community,mglukhikh/intellij-community,orekyuu/intellij-community,semonte/intellij-community,Lekanich/intellij-community,adedayo/intellij-community,vladmm/intellij-community,ahb0327/intellij-community,gnuhub/intellij-community,ivan-fedorov/intellij-community,asedunov/intellij-community,gnuhub/intellij-community,joewalnes/idea-community,robovm/robovm-studio,holmes/intellij-community,MichaelNedzelsky/intellij-community,ThiagoGarciaAlves/intellij-community,diorcety/intellij-community,lucafavatella/intellij-community,dslomov/intellij-community,adedayo/intellij-community,caot/intellij-community,hurricup/intellij-community,vvv1559/intellij-community,fitermay/intellij-community,retomerz/intellij-community,MichaelNedzelsky/intellij-community,izonder/intellij-community,nicolargo/intellij-community,ol-loginov/intellij-community,da1z/intellij-community,jagguli/intellij-community,diorcety/intellij-community,gnuhub/intellij-community,robovm/robovm-studio,suncycheng/intellij-community,ol-loginov/intellij-community,da1z/intellij-community,fnouama/intellij-community,tmpgit/intellij-community,signed/intellij-community,salguarnieri/intellij-community,diorcety/intellij-community,vladmm/intellij-community,samthor/intellij-community,TangHao1987/intellij-community,muntasirsyed/intellij-community,diorcety/intellij-community,TangHao1987/intellij-community,MER-GROUP/intellij-community,fnouama/intellij-community,orekyuu/intellij-community,xfournet/intellij-community,wreckJ/intellij-community,gnuhub/intellij-community,lucafavatella/intellij-community,wreckJ/intellij-community,wreckJ/intellij-community,joewalnes/idea-community,robovm/robovm-studio,muntasirsyed/intellij-community,gnuhub/intellij-community,petteyg/intellij-community,vladmm/intellij-community,idea4bsd/idea4bsd,MER-GROUP/intellij-community,kool79/intellij-community,allotria/intellij-community,kdwink/intellij-community,vladmm/intellij-community,diorcety/intellij-community,Lekanich/intellij-community,nicolargo/intellij-community,mglukhikh/intellij-community,tmpgit/intellij-community,fitermay/intellij-community,vladmm/intellij-community,kdwink/intellij-community,amith01994/intellij-community,youdonghai/intellij-community,fnouama/intellij-community,adedayo/intellij-community,wreckJ/intellij-community,clumsy/intellij-community,jagguli/intellij-community,TangHao1987/intellij-community,FHannes/intellij-community,vvv1559/intellij-community,signed/intellij-community,wreckJ/intellij-community,asedunov/intellij-community,supersven/intellij-community,SerCeMan/intellij-community,apixandru/intellij-community,orekyuu/intellij-community,ahb0327/intellij-community,alphafoobar/intellij-community,tmpgit/intellij-community,TangHao1987/intellij-community,petteyg/intellij-community,ernestp/consulo,nicolargo/intellij-community,ryano144/intellij-community,ryano144/intellij-community,muntasirsyed/intellij-community,FHannes/intellij-community,dslomov/intellij-community,ol-loginov/intellij-community,fitermay/intellij-community,FHannes/intellij-community,blademainer/intellij-community,hurricup/intellij-community,blademainer/intellij-community,youdonghai/intellij-community,samthor/intellij-community,FHannes/intellij-community,tmpgit/intellij-community,asedunov/intellij-community,mglukhikh/intellij-community,apixandru/intellij-community,fitermay/intellij-community,semonte/intellij-community,MER-GROUP/intellij-community,da1z/intellij-community,orekyuu/intellij-community,ivan-fedorov/intellij-community,fengbaicanhe/intellij-community,vladmm/intellij-community,dslomov/intellij-community,Distrotech/intellij-community,fengbaicanhe/intellij-community,suncycheng/intellij-community,ivan-fedorov/intellij-community,slisson/intellij-community,orekyuu/intellij-community,supersven/intellij-community,kool79/intellij-community,allotria/intellij-community,ahb0327/intellij-community,michaelgallacher/intellij-community,fnouama/intellij-community,Distrotech/intellij-community,ftomassetti/intellij-community,salguarnieri/intellij-community,fitermay/intellij-community,muntasirsyed/intellij-community,ahb0327/intellij-community,caot/intellij-community,idea4bsd/idea4bsd,amith01994/intellij-community,izonder/intellij-community,gnuhub/intellij-community,idea4bsd/idea4bsd,vvv1559/intellij-community,holmes/intellij-community,SerCeMan/intellij-community,fnouama/intellij-community,blademainer/intellij-community,ahb0327/intellij-community,SerCeMan/intellij-community,salguarnieri/intellij-community,MER-GROUP/intellij-community,akosyakov/intellij-community,idea4bsd/idea4bsd,caot/intellij-community,holmes/intellij-community,ThiagoGarciaAlves/intellij-community,robovm/robovm-studio,tmpgit/intellij-community,akosyakov/intellij-community,izonder/intellij-community,TangHao1987/intellij-community,clumsy/intellij-community,retomerz/intellij-community,apixandru/intellij-community,clumsy/intellij-community,retomerz/intellij-community,supersven/intellij-community,ftomassetti/intellij-community,fitermay/intellij-community,vvv1559/intellij-community,blademainer/intellij-community,supersven/intellij-community,ftomassetti/intellij-community,clumsy/intellij-community,vvv1559/intellij-community,FHannes/intellij-community,da1z/intellij-community,petteyg/intellij-community,gnuhub/intellij-community,MichaelNedzelsky/intellij-community,muntasirsyed/intellij-community,ol-loginov/intellij-community,ftomassetti/intellij-community,ernestp/consulo,signed/intellij-community,kool79/intellij-community,semonte/intellij-community,suncycheng/intellij-community,youdonghai/intellij-community,dslomov/intellij-community,robovm/robovm-studio,youdonghai/intellij-community,muntasirsyed/intellij-community,suncycheng/intellij-community,kdwink/intellij-community,mglukhikh/intellij-community,retomerz/intellij-community,MichaelNedzelsky/intellij-community,petteyg/intellij-community,SerCeMan/intellij-community,asedunov/intellij-community,youdonghai/intellij-community,MER-GROUP/intellij-community,FHannes/intellij-community,FHannes/intellij-community,nicolargo/intellij-community,petteyg/intellij-community,holmes/intellij-community,vvv1559/intellij-community,FHannes/intellij-community,signed/intellij-community,apixandru/intellij-community,michaelgallacher/intellij-community,samthor/intellij-community,amith01994/intellij-community,ibinti/intellij-community,muntasirsyed/intellij-community,robovm/robovm-studio,joewalnes/idea-community,joewalnes/idea-community,dslomov/intellij-community,retomerz/intellij-community,xfournet/intellij-community,ernestp/consulo,clumsy/intellij-community,tmpgit/intellij-community,MER-GROUP/intellij-community,lucafavatella/intellij-community,jagguli/intellij-community,Distrotech/intellij-community,holmes/intellij-community,ryano144/intellij-community,holmes/intellij-community,dslomov/intellij-community,orekyuu/intellij-community,semonte/intellij-community,ibinti/intellij-community,MichaelNedzelsky/intellij-community,gnuhub/intellij-community,pwoodworth/intellij-community,Lekanich/intellij-community,ftomassetti/intellij-community,muntasirsyed/intellij-community,vvv1559/intellij-community,salguarnieri/intellij-community,semonte/intellij-community,izonder/intellij-community,allotria/intellij-community,SerCeMan/intellij-community,slisson/intellij-community,Distrotech/intellij-community,pwoodworth/intellij-community,MichaelNedzelsky/intellij-community,pwoodworth/intellij-community,supersven/intellij-community,youdonghai/intellij-community,ThiagoGarciaAlves/intellij-community,xfournet/intellij-community,kool79/intellij-community,apixandru/intellij-community,orekyuu/intellij-community,signed/intellij-community,blademainer/intellij-community,supersven/intellij-community,ivan-fedorov/intellij-community,ivan-fedorov/intellij-community,TangHao1987/intellij-community,ryano144/intellij-community,amith01994/intellij-community,adedayo/intellij-community,diorcety/intellij-community,hurricup/intellij-community,nicolargo/intellij-community,michaelgallacher/intellij-community,fitermay/intellij-community,vladmm/intellij-community,muntasirsyed/intellij-community,ernestp/consulo,pwoodworth/intellij-community,ol-loginov/intellij-community,apixandru/intellij-community,holmes/intellij-community,mglukhikh/intellij-community,clumsy/intellij-community,kool79/intellij-community,Lekanich/intellij-community,da1z/intellij-community,ThiagoGarciaAlves/intellij-community,idea4bsd/idea4bsd,amith01994/intellij-community,diorcety/intellij-community,ThiagoGarciaAlves/intellij-community,samthor/intellij-community,fnouama/intellij-community,petteyg/intellij-community,nicolargo/intellij-community,MichaelNedzelsky/intellij-community,suncycheng/intellij-community,adedayo/intellij-community,muntasirsyed/intellij-community,supersven/intellij-community,izonder/intellij-community,alphafoobar/intellij-community,fnouama/intellij-community,ol-loginov/intellij-community,ahb0327/intellij-community,Distrotech/intellij-community,mglukhikh/intellij-community,dslomov/intellij-community,izonder/intellij-community,jexp/idea2,ryano144/intellij-community,fitermay/intellij-community,slisson/intellij-community,kdwink/intellij-community,nicolargo/intellij-community,ibinti/intellij-community,da1z/intellij-community,akosyakov/intellij-community,lucafavatella/intellij-community,suncycheng/intellij-community,kool79/intellij-community,jagguli/intellij-community,MichaelNedzelsky/intellij-community,ftomassetti/intellij-community,caot/intellij-community,allotria/intellij-community,nicolargo/intellij-community,fitermay/intellij-community,kool79/intellij-community,caot/intellij-community,supersven/intellij-community,apixandru/intellij-community,apixandru/intellij-community,SerCeMan/intellij-community,SerCeMan/intellij-community,salguarnieri/intellij-community,diorcety/intellij-community,gnuhub/intellij-community,adedayo/intellij-community,apixandru/intellij-community,vvv1559/intellij-community,Distrotech/intellij-community,apixandru/intellij-community,SerCeMan/intellij-community,lucafavatella/intellij-community,jagguli/intellij-community,orekyuu/intellij-community,allotria/intellij-community,amith01994/intellij-community,ibinti/intellij-community,asedunov/intellij-community,suncycheng/intellij-community,nicolargo/intellij-community,jagguli/intellij-community,Lekanich/intellij-community,ThiagoGarciaAlves/intellij-community,diorcety/intellij-community,clumsy/intellij-community,Lekanich/intellij-community,amith01994/intellij-community,Lekanich/intellij-community,izonder/intellij-community,jexp/idea2,wreckJ/intellij-community,fnouama/intellij-community,mglukhikh/intellij-community,vladmm/intellij-community,idea4bsd/idea4bsd,akosyakov/intellij-community,wreckJ/intellij-community,TangHao1987/intellij-community,petteyg/intellij-community,ibinti/intellij-community,Lekanich/intellij-community,youdonghai/intellij-community,michaelgallacher/intellij-community,idea4bsd/idea4bsd,dslomov/intellij-community,FHannes/intellij-community,adedayo/intellij-community,ibinti/intellij-community,alphafoobar/intellij-community,da1z/intellij-community,alphafoobar/intellij-community,Lekanich/intellij-community,samthor/intellij-community,tmpgit/intellij-community,fengbaicanhe/intellij-community,hurricup/intellij-community,michaelgallacher/intellij-community,clumsy/intellij-community,muntasirsyed/intellij-community,joewalnes/idea-community,ivan-fedorov/intellij-community,salguarnieri/intellij-community,jexp/idea2,pwoodworth/intellij-community,orekyuu/intellij-community,lucafavatella/intellij-community,consulo/consulo,mglukhikh/intellij-community,asedunov/intellij-community,adedayo/intellij-community,hurricup/intellij-community,kdwink/intellij-community,ahb0327/intellij-community,kool79/intellij-community,lucafavatella/intellij-community,suncycheng/intellij-community,blademainer/intellij-community,vvv1559/intellij-community,fitermay/intellij-community,xfournet/intellij-community,TangHao1987/intellij-community,ahb0327/intellij-community,semonte/intellij-community,muntasirsyed/intellij-community,consulo/consulo,gnuhub/intellij-community,gnuhub/intellij-community,allotria/intellij-community,blademainer/intellij-community,allotria/intellij-community,youdonghai/intellij-community,vladmm/intellij-community,MichaelNedzelsky/intellij-community,Lekanich/intellij-community,kdwink/intellij-community,supersven/intellij-community,vladmm/intellij-community,diorcety/intellij-community,wreckJ/intellij-community,ThiagoGarciaAlves/intellij-community,da1z/intellij-community,holmes/intellij-community,supersven/intellij-community,tmpgit/intellij-community,adedayo/intellij-community,SerCeMan/intellij-community,supersven/intellij-community,fitermay/intellij-community,retomerz/intellij-community,lucafavatella/intellij-community,holmes/intellij-community,jexp/idea2,ol-loginov/intellij-community,Distrotech/intellij-community,ftomassetti/intellij-community,robovm/robovm-studio,holmes/intellij-community,slisson/intellij-community,michaelgallacher/intellij-community,MER-GROUP/intellij-community,youdonghai/intellij-community,michaelgallacher/intellij-community,consulo/consulo,michaelgallacher/intellij-community,wreckJ/intellij-community,ThiagoGarciaAlves/intellij-community,orekyuu/intellij-community,tmpgit/intellij-community,idea4bsd/idea4bsd,retomerz/intellij-community,vvv1559/intellij-community,ibinti/intellij-community,asedunov/intellij-community,amith01994/intellij-community,xfournet/intellij-community,MER-GROUP/intellij-community,retomerz/intellij-community,wreckJ/intellij-community,retomerz/intellij-community,ahb0327/intellij-community,alphafoobar/intellij-community,robovm/robovm-studio,alphafoobar/intellij-community,consulo/consulo,akosyakov/intellij-community,allotria/intellij-community,asedunov/intellij-community,asedunov/intellij-community,jagguli/intellij-community,FHannes/intellij-community,akosyakov/intellij-community,suncycheng/intellij-community,suncycheng/intellij-community,ol-loginov/intellij-community,akosyakov/intellij-community,kool79/intellij-community,TangHao1987/intellij-community,idea4bsd/idea4bsd,xfournet/intellij-community,samthor/intellij-community,hurricup/intellij-community,idea4bsd/idea4bsd,TangHao1987/intellij-community,salguarnieri/intellij-community,clumsy/intellij-community,samthor/intellij-community,ThiagoGarciaAlves/intellij-community,slisson/intellij-community,jexp/idea2,apixandru/intellij-community,da1z/intellij-community,michaelgallacher/intellij-community,hurricup/intellij-community,xfournet/intellij-community,ahb0327/intellij-community,ivan-fedorov/intellij-community,kdwink/intellij-community,signed/intellij-community,da1z/intellij-community,signed/intellij-community,ftomassetti/intellij-community,joewalnes/idea-community,Distrotech/intellij-community,orekyuu/intellij-community,samthor/intellij-community,xfournet/intellij-community,kdwink/intellij-community,MER-GROUP/intellij-community,MichaelNedzelsky/intellij-community,MichaelNedzelsky/intellij-community,SerCeMan/intellij-community,semonte/intellij-community,akosyakov/intellij-community,caot/intellij-community,ol-loginov/intellij-community,hurricup/intellij-community,xfournet/intellij-community,fitermay/intellij-community,ftomassetti/intellij-community,dslomov/intellij-community,fengbaicanhe/intellij-community,ThiagoGarciaAlves/intellij-community,joewalnes/idea-community,ivan-fedorov/intellij-community,jagguli/intellij-community,michaelgallacher/intellij-community,alphafoobar/intellij-community,vladmm/intellij-community,mglukhikh/intellij-community,ibinti/intellij-community,adedayo/intellij-community,petteyg/intellij-community,caot/intellij-community,alphafoobar/intellij-community,FHannes/intellij-community,slisson/intellij-community,ryano144/intellij-community,fengbaicanhe/intellij-community,MER-GROUP/intellij-community,mglukhikh/intellij-community,semonte/intellij-community,samthor/intellij-community,jexp/idea2,semonte/intellij-community,ThiagoGarciaAlves/intellij-community,ivan-fedorov/intellij-community,holmes/intellij-community,diorcety/intellij-community,consulo/consulo,FHannes/intellij-community,ibinti/intellij-community,allotria/intellij-community,da1z/intellij-community,suncycheng/intellij-community,MER-GROUP/intellij-community,tmpgit/intellij-community,ol-loginov/intellij-community,clumsy/intellij-community,fengbaicanhe/intellij-community,retomerz/intellij-community,robovm/robovm-studio,samthor/intellij-community,Distrotech/intellij-community,salguarnieri/intellij-community,ernestp/consulo,ibinti/intellij-community,michaelgallacher/intellij-community,ol-loginov/intellij-community,ol-loginov/intellij-community,blademainer/intellij-community,MichaelNedzelsky/intellij-community,caot/intellij-community,akosyakov/intellij-community,fengbaicanhe/intellij-community,amith01994/intellij-community,robovm/robovm-studio,idea4bsd/idea4bsd,youdonghai/intellij-community,allotria/intellij-community,kool79/intellij-community,asedunov/intellij-community,fnouama/intellij-community,SerCeMan/intellij-community,petteyg/intellij-community,diorcety/intellij-community,amith01994/intellij-community,nicolargo/intellij-community,signed/intellij-community,jagguli/intellij-community,salguarnieri/intellij-community
/* * Copyright 2000-2005 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jetbrains.idea.svn; import com.intellij.openapi.application.PathManager; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.components.PersistentStateComponent; import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.JDOMUtil; import com.intellij.openapi.vfs.LocalFileSystem; import org.jdom.Attribute; import org.jdom.Document; import org.jdom.Element; import org.jdom.JDOMException; import org.tmatesoft.svn.core.SVNException; import org.tmatesoft.svn.core.SVNURL; import org.tmatesoft.svn.core.internal.io.svn.SVNSSHSession; import org.tmatesoft.svn.core.internal.util.SVNBase64; import java.io.File; import java.io.IOException; import java.util.*; @State( name="SvnApplicationSettings", storages = { @Storage( id="SvnApplicationSettings", file="$APP_CONFIG$/other.xml" )} ) public class SvnApplicationSettings implements PersistentStateComponent<SvnApplicationSettings.ConfigurationBean> { private SvnFileSystemListener myVFSHandler; private Map<String, Map<String, Map<String, String>>> myAuthenticationInfo; private int mySvnProjectCount; private LimitedStringsList myLimitedStringsList; public static class ConfigurationBean { public List<String> myCheckoutURLs = new ArrayList<String>(); public List<String> myTypedURLs = new ArrayList<String>(); } private ConfigurationBean myConfigurationBean; private boolean myCredentialsLoaded = false; private boolean myCredentialsModified = false; public static SvnApplicationSettings getInstance() { return ServiceManager.getService(SvnApplicationSettings.class); } public SvnApplicationSettings() { myConfigurationBean = new ConfigurationBean(); } public ConfigurationBean getState() { if (myCredentialsModified) { writeCredentials(); } myConfigurationBean.myTypedURLs.clear(); myConfigurationBean.myTypedURLs.addAll(getTypedList().getList()); return myConfigurationBean; } public void loadState(ConfigurationBean object) { myConfigurationBean = object; getTypedList(); } private LimitedStringsList getTypedList() { if (myLimitedStringsList == null) { checkFillTypedFromCheckout(); myLimitedStringsList = new LimitedStringsList(myConfigurationBean.myTypedURLs); } return myLimitedStringsList; } private void checkFillTypedFromCheckout() { if (myConfigurationBean.myTypedURLs.isEmpty() && (! myConfigurationBean.myCheckoutURLs.isEmpty())) { myConfigurationBean.myTypedURLs.addAll(myConfigurationBean.myCheckoutURLs); } } public void svnActivated() { if (myVFSHandler == null) { myVFSHandler = new SvnFileSystemListener(); LocalFileSystem.getInstance().registerAuxiliaryFileOperationsHandler(myVFSHandler); CommandProcessor.getInstance().addCommandListener(myVFSHandler); } mySvnProjectCount++; } public void svnDeactivated() { mySvnProjectCount--; if (mySvnProjectCount == 0) { LocalFileSystem.getInstance().unregisterAuxiliaryFileOperationsHandler(myVFSHandler); CommandProcessor.getInstance().removeCommandListener(myVFSHandler); myVFSHandler = null; SVNSSHSession.shutdown(); } } private void readCredentials() { myCredentialsLoaded = true; File file = getCredentialsFile(); if (!file.exists() || !file.canRead() || !file.isFile()) { return; } Document document; try { document = JDOMUtil.loadDocument(file); } catch (JDOMException e) { return; } catch (IOException e) { return; } if (document == null || document.getRootElement() == null) { return; } Element authElement = document.getRootElement().getChild("kinds"); if (authElement == null) { return; } myAuthenticationInfo = new HashMap<String, Map<String, Map<String, String>>>(); List groupsList = authElement.getChildren(); for (Iterator groups = groupsList.iterator(); groups.hasNext();) { Element groupElement = (Element) groups.next(); String kind = groupElement.getName(); if ("realm".equals(kind)) { // old version. continue; } Map<String, Map<String, String>> groupMap = new HashMap<String, Map<String, String>>(); myAuthenticationInfo.put(kind, groupMap); List realmsList = groupElement.getChildren("realm"); for (Iterator realms = realmsList.iterator(); realms.hasNext();) { Element realmElement = (Element) realms.next(); String realmName = realmElement.getAttributeValue("name"); StringBuffer sb = new StringBuffer(realmName); byte[] buffer = new byte[sb.length()]; int length = SVNBase64.base64ToByteArray(sb, buffer); realmName = new String(buffer, 0, length); Map<String, String> infoMap = new HashMap<String, String>(); List attrsList = realmElement.getAttributes(); for (Iterator attrs = attrsList.iterator(); attrs.hasNext();) { Attribute attr = (Attribute) attrs.next(); if ("name".equals(attr.getName())) { continue; } String key = attr.getName(); String value = attr.getValue(); infoMap.put(key, value); } groupMap.put(realmName, infoMap); } } } private void writeCredentials() { myCredentialsModified = false; if (myAuthenticationInfo == null) { return; } Document document = new Document(); Element authElement = new Element("kinds"); for (String kind : myAuthenticationInfo.keySet()) { Element groupElement = new Element(kind); Map<String, Map<String, String>> groupsMap = myAuthenticationInfo.get(kind); for (String realm : groupsMap.keySet()) { Element realmElement = new Element("realm"); realmElement.setAttribute("name", SVNBase64.byteArrayToBase64(realm.getBytes())); Map<String, String> info = groupsMap.get(realm); for (String key : info.keySet()) { String value = info.get(key); realmElement.setAttribute(key, value); } groupElement.addContent(realmElement); } authElement.addContent(groupElement); } document.setRootElement(new Element("svn4idea")); document.getRootElement().addContent(authElement); File file = getCredentialsFile(); file.getParentFile().mkdirs(); try { JDOMUtil.writeDocument(document, file, System.getProperty("line.separator")); } catch (IOException e) { // } } public Map<String, String> getAuthenticationInfo(String realm, String kind) { synchronized (this) { if (!myCredentialsLoaded) { readCredentials(); } if (myAuthenticationInfo != null) { Map<String, Map<String, String>> group = myAuthenticationInfo.get(kind); if (group != null) { Map<String, String> info = group.get(realm); if (info != null) { return decodeData(info); } } } } return null; } public void saveAuthenticationInfo(String realm, String kind, Map<String, String> info) { synchronized(this) { if (info == null) { return; } myCredentialsModified = true; realm = realm == null ? "default" : realm; if (myAuthenticationInfo == null) { myAuthenticationInfo = new HashMap<String, Map<String, Map<String, String>>>(); } Map<String, Map<String, String>> group = myAuthenticationInfo.get(kind); if (group == null) { group = new HashMap<String, Map<String, String>>(); myAuthenticationInfo.put(kind, group); } group.put(realm, encodeData(info)); } } public void clearAuthenticationInfo() { synchronized(this) { if (!myCredentialsLoaded) { readCredentials(); } if (myAuthenticationInfo == null) { return; } myAuthenticationInfo.clear(); } } private static Map<String, String> encodeData(Map<String, String> source) { Map<String, String> dst = new HashMap<String, String>(); for (final String key : source.keySet()) { String value = source.get(key); if (key != null && value != null) { dst.put(key, SVNBase64.byteArrayToBase64(value.getBytes())); } } return dst; } private static Map<String, String> decodeData(Map<String, String> source) { Map<String, String> dst = new HashMap<String, String>(); for (String key : source.keySet()) { String value = source.get(key); if (key != null && value != null) { StringBuffer sb = new StringBuffer(value); byte[] buffer = new byte[sb.length()]; int length = SVNBase64.base64ToByteArray(sb, buffer); dst.put(key, new String(buffer, 0, length)); } } return dst; } private static File getCommonPath() { File file = new File(PathManager.getSystemPath()); file = new File(file, "plugins"); file = new File(file, "svn4idea"); file.mkdirs(); return file; } public static File getCredentialsFile() { return new File(getCommonPath(), "credentials.xml"); } private static final String LOADED_REVISIONS_DIR = "loadedRevisions"; public static File getLoadedRevisionsDir(final Project project) { File file = getCommonPath(); file = new File(file, LOADED_REVISIONS_DIR); file = new File(file, project.getLocationHash()); file.mkdirs(); return file; } public Collection<String> getCheckoutURLs() { return myConfigurationBean.myCheckoutURLs; } public void addCheckoutURL(String url) { if (myConfigurationBean.myCheckoutURLs.contains(url)) { return; } myConfigurationBean.myCheckoutURLs.add(0, url); } public void removeCheckoutURL(String url) { if (myConfigurationBean.myCheckoutURLs != null) { // 'url' is not necessary an exact match for some of the urls in collection - it has been parsed and then converted back to string for(String oldUrl: myConfigurationBean.myCheckoutURLs) { try { if (url.equals(oldUrl) || SVNURL.parseURIEncoded(url).equals(SVNURL.parseURIEncoded(oldUrl))) { myConfigurationBean.myCheckoutURLs.remove(oldUrl); break; } } catch (SVNException e) { // ignore } } } } public List<String> getTypedUrlsListCopy() { return new ArrayList<String>(getTypedList().getList()); } public void addTypedUrl(final String url) { getTypedList().add(url); } }
plugins/svn4idea/src/org/jetbrains/idea/svn/SvnApplicationSettings.java
/* * Copyright 2000-2005 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jetbrains.idea.svn; import com.intellij.openapi.application.PathManager; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.components.PersistentStateComponent; import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.JDOMUtil; import com.intellij.openapi.vfs.LocalFileSystem; import org.jdom.Attribute; import org.jdom.Document; import org.jdom.Element; import org.jdom.JDOMException; import org.tmatesoft.svn.core.SVNException; import org.tmatesoft.svn.core.SVNURL; import org.tmatesoft.svn.core.internal.io.svn.SVNSSHSession; import org.tmatesoft.svn.core.internal.util.SVNBase64; import java.io.File; import java.io.IOException; import java.util.*; @State( name="SvnApplicationSettings", storages = { @Storage( id="SvnApplicationSettings", file="$APP_CONFIG$/other.xml" )} ) public class SvnApplicationSettings implements PersistentStateComponent<SvnApplicationSettings.ConfigurationBean> { private SvnFileSystemListener myVFSHandler; private Map<String, Map<String, Map<String, String>>> myAuthenticationInfo; private int mySvnProjectCount; private LimitedStringsList myLimitedStringsList; public static class ConfigurationBean { public List<String> myCheckoutURLs = new ArrayList<String>(); public List<String> myTypedURLs = new ArrayList<String>(); } private ConfigurationBean myConfigurationBean; private boolean myCredentialsLoaded = false; private boolean myCredentialsModified = false; public static SvnApplicationSettings getInstance() { return ServiceManager.getService(SvnApplicationSettings.class); } public SvnApplicationSettings() { myConfigurationBean = new ConfigurationBean(); } public ConfigurationBean getState() { if (myCredentialsModified) { writeCredentials(); } myConfigurationBean.myTypedURLs.clear(); myConfigurationBean.myTypedURLs.addAll(myLimitedStringsList.getList()); return myConfigurationBean; } public void loadState(ConfigurationBean object) { myConfigurationBean = object; if (myConfigurationBean.myTypedURLs.isEmpty() && (! myConfigurationBean.myCheckoutURLs.isEmpty())) { myConfigurationBean.myTypedURLs.addAll(myConfigurationBean.myCheckoutURLs); } myLimitedStringsList = new LimitedStringsList(myConfigurationBean.myTypedURLs); } public void svnActivated() { if (myVFSHandler == null) { myVFSHandler = new SvnFileSystemListener(); LocalFileSystem.getInstance().registerAuxiliaryFileOperationsHandler(myVFSHandler); CommandProcessor.getInstance().addCommandListener(myVFSHandler); } mySvnProjectCount++; } public void svnDeactivated() { mySvnProjectCount--; if (mySvnProjectCount == 0) { LocalFileSystem.getInstance().unregisterAuxiliaryFileOperationsHandler(myVFSHandler); CommandProcessor.getInstance().removeCommandListener(myVFSHandler); myVFSHandler = null; SVNSSHSession.shutdown(); } } private void readCredentials() { myCredentialsLoaded = true; File file = getCredentialsFile(); if (!file.exists() || !file.canRead() || !file.isFile()) { return; } Document document; try { document = JDOMUtil.loadDocument(file); } catch (JDOMException e) { return; } catch (IOException e) { return; } if (document == null || document.getRootElement() == null) { return; } Element authElement = document.getRootElement().getChild("kinds"); if (authElement == null) { return; } myAuthenticationInfo = new HashMap<String, Map<String, Map<String, String>>>(); List groupsList = authElement.getChildren(); for (Iterator groups = groupsList.iterator(); groups.hasNext();) { Element groupElement = (Element) groups.next(); String kind = groupElement.getName(); if ("realm".equals(kind)) { // old version. continue; } Map<String, Map<String, String>> groupMap = new HashMap<String, Map<String, String>>(); myAuthenticationInfo.put(kind, groupMap); List realmsList = groupElement.getChildren("realm"); for (Iterator realms = realmsList.iterator(); realms.hasNext();) { Element realmElement = (Element) realms.next(); String realmName = realmElement.getAttributeValue("name"); StringBuffer sb = new StringBuffer(realmName); byte[] buffer = new byte[sb.length()]; int length = SVNBase64.base64ToByteArray(sb, buffer); realmName = new String(buffer, 0, length); Map<String, String> infoMap = new HashMap<String, String>(); List attrsList = realmElement.getAttributes(); for (Iterator attrs = attrsList.iterator(); attrs.hasNext();) { Attribute attr = (Attribute) attrs.next(); if ("name".equals(attr.getName())) { continue; } String key = attr.getName(); String value = attr.getValue(); infoMap.put(key, value); } groupMap.put(realmName, infoMap); } } } private void writeCredentials() { myCredentialsModified = false; if (myAuthenticationInfo == null) { return; } Document document = new Document(); Element authElement = new Element("kinds"); for (String kind : myAuthenticationInfo.keySet()) { Element groupElement = new Element(kind); Map<String, Map<String, String>> groupsMap = myAuthenticationInfo.get(kind); for (String realm : groupsMap.keySet()) { Element realmElement = new Element("realm"); realmElement.setAttribute("name", SVNBase64.byteArrayToBase64(realm.getBytes())); Map<String, String> info = groupsMap.get(realm); for (String key : info.keySet()) { String value = info.get(key); realmElement.setAttribute(key, value); } groupElement.addContent(realmElement); } authElement.addContent(groupElement); } document.setRootElement(new Element("svn4idea")); document.getRootElement().addContent(authElement); File file = getCredentialsFile(); file.getParentFile().mkdirs(); try { JDOMUtil.writeDocument(document, file, System.getProperty("line.separator")); } catch (IOException e) { // } } public Map<String, String> getAuthenticationInfo(String realm, String kind) { synchronized (this) { if (!myCredentialsLoaded) { readCredentials(); } if (myAuthenticationInfo != null) { Map<String, Map<String, String>> group = myAuthenticationInfo.get(kind); if (group != null) { Map<String, String> info = group.get(realm); if (info != null) { return decodeData(info); } } } } return null; } public void saveAuthenticationInfo(String realm, String kind, Map<String, String> info) { synchronized(this) { if (info == null) { return; } myCredentialsModified = true; realm = realm == null ? "default" : realm; if (myAuthenticationInfo == null) { myAuthenticationInfo = new HashMap<String, Map<String, Map<String, String>>>(); } Map<String, Map<String, String>> group = myAuthenticationInfo.get(kind); if (group == null) { group = new HashMap<String, Map<String, String>>(); myAuthenticationInfo.put(kind, group); } group.put(realm, encodeData(info)); } } public void clearAuthenticationInfo() { synchronized(this) { if (!myCredentialsLoaded) { readCredentials(); } if (myAuthenticationInfo == null) { return; } myAuthenticationInfo.clear(); } } private static Map<String, String> encodeData(Map<String, String> source) { Map<String, String> dst = new HashMap<String, String>(); for (final String key : source.keySet()) { String value = source.get(key); if (key != null && value != null) { dst.put(key, SVNBase64.byteArrayToBase64(value.getBytes())); } } return dst; } private static Map<String, String> decodeData(Map<String, String> source) { Map<String, String> dst = new HashMap<String, String>(); for (String key : source.keySet()) { String value = source.get(key); if (key != null && value != null) { StringBuffer sb = new StringBuffer(value); byte[] buffer = new byte[sb.length()]; int length = SVNBase64.base64ToByteArray(sb, buffer); dst.put(key, new String(buffer, 0, length)); } } return dst; } private static File getCommonPath() { File file = new File(PathManager.getSystemPath()); file = new File(file, "plugins"); file = new File(file, "svn4idea"); file.mkdirs(); return file; } public static File getCredentialsFile() { return new File(getCommonPath(), "credentials.xml"); } private static final String LOADED_REVISIONS_DIR = "loadedRevisions"; public static File getLoadedRevisionsDir(final Project project) { File file = getCommonPath(); file = new File(file, LOADED_REVISIONS_DIR); file = new File(file, project.getLocationHash()); file.mkdirs(); return file; } public Collection<String> getCheckoutURLs() { return myConfigurationBean.myCheckoutURLs; } public void addCheckoutURL(String url) { if (myConfigurationBean.myCheckoutURLs.contains(url)) { return; } myConfigurationBean.myCheckoutURLs.add(0, url); } public void removeCheckoutURL(String url) { if (myConfigurationBean.myCheckoutURLs != null) { // 'url' is not necessary an exact match for some of the urls in collection - it has been parsed and then converted back to string for(String oldUrl: myConfigurationBean.myCheckoutURLs) { try { if (url.equals(oldUrl) || SVNURL.parseURIEncoded(url).equals(SVNURL.parseURIEncoded(oldUrl))) { myConfigurationBean.myCheckoutURLs.remove(oldUrl); break; } } catch (SVNException e) { // ignore } } } } public List<String> getTypedUrlsListCopy() { return new ArrayList<String>(myLimitedStringsList.getList()); } public void addTypedUrl(final String url) { myLimitedStringsList.add(url); } }
SVN: application settings NPE
plugins/svn4idea/src/org/jetbrains/idea/svn/SvnApplicationSettings.java
SVN: application settings NPE
<ide><path>lugins/svn4idea/src/org/jetbrains/idea/svn/SvnApplicationSettings.java <ide> writeCredentials(); <ide> } <ide> myConfigurationBean.myTypedURLs.clear(); <del> myConfigurationBean.myTypedURLs.addAll(myLimitedStringsList.getList()); <add> myConfigurationBean.myTypedURLs.addAll(getTypedList().getList()); <ide> return myConfigurationBean; <ide> } <ide> <ide> public void loadState(ConfigurationBean object) { <ide> myConfigurationBean = object; <add> getTypedList(); <add> } <add> <add> private LimitedStringsList getTypedList() { <add> if (myLimitedStringsList == null) { <add> checkFillTypedFromCheckout(); <add> myLimitedStringsList = new LimitedStringsList(myConfigurationBean.myTypedURLs); <add> } <add> return myLimitedStringsList; <add> } <add> <add> private void checkFillTypedFromCheckout() { <ide> if (myConfigurationBean.myTypedURLs.isEmpty() && (! myConfigurationBean.myCheckoutURLs.isEmpty())) { <ide> myConfigurationBean.myTypedURLs.addAll(myConfigurationBean.myCheckoutURLs); <ide> } <del> myLimitedStringsList = new LimitedStringsList(myConfigurationBean.myTypedURLs); <ide> } <ide> <ide> public void svnActivated() { <ide> } <ide> <ide> public List<String> getTypedUrlsListCopy() { <del> return new ArrayList<String>(myLimitedStringsList.getList()); <add> return new ArrayList<String>(getTypedList().getList()); <ide> } <ide> <ide> public void addTypedUrl(final String url) { <del> myLimitedStringsList.add(url); <add> getTypedList().add(url); <ide> } <ide> }
Java
apache-2.0
7ec18dd06685cfcfa91af57d5772199cd2766a7a
0
cyenyxe/eva-pipeline,EBIvariation/eva-pipeline,jmmut/eva-pipeline,jmmut/eva-pipeline,jmmut/eva-pipeline,EBIvariation/eva-pipeline,cyenyxe/eva-pipeline,cyenyxe/eva-pipeline
/* * Copyright 2015-2017 EMBL - European Bioinformatics Institute * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package uk.ac.ebi.eva.pipeline.jobs; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.batch.core.Job; import org.springframework.batch.core.Step; import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; import org.springframework.batch.core.configuration.annotation.JobBuilderFactory; import org.springframework.batch.core.job.builder.JobBuilder; import org.springframework.batch.core.job.builder.SimpleJobBuilder; import org.springframework.batch.core.launch.support.RunIdIncrementer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Scope; import uk.ac.ebi.eva.pipeline.jobs.steps.DropSingleStudyVariantsStep; import static uk.ac.ebi.eva.pipeline.configuration.BeanNames.DROP_SINGLE_STUDY_VARIANTS_STEP; import static uk.ac.ebi.eva.pipeline.configuration.BeanNames.DROP_STUDY_JOB; /** * Job that removes a study from the database. Given a study to remove: * <p> * remove single study variants --> pull study entries in the rest of variants --> remove file entry in files collection */ @Configuration @EnableBatchProcessing @Import({DropSingleStudyVariantsStep.class}) public class DropStudyJob { private static final Logger logger = LoggerFactory.getLogger(DropStudyJob.class); @Autowired @Qualifier(DROP_SINGLE_STUDY_VARIANTS_STEP) private Step dropSingleStudyVariantsStep; @Bean(DROP_STUDY_JOB) @Scope("prototype") public Job dropStudyJob(JobBuilderFactory jobBuilderFactory) { logger.debug("Building '" + DROP_STUDY_JOB + "'"); JobBuilder jobBuilder = jobBuilderFactory .get(DROP_STUDY_JOB) .incrementer(new RunIdIncrementer()); SimpleJobBuilder builder = jobBuilder .start(dropSingleStudyVariantsStep); return builder.build(); } }
src/main/java/uk/ac/ebi/eva/pipeline/jobs/DropStudyJob.java
/* * Copyright 2015-2017 EMBL - European Bioinformatics Institute * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package uk.ac.ebi.eva.pipeline.jobs; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.batch.core.Job; import org.springframework.batch.core.Step; import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; import org.springframework.batch.core.configuration.annotation.JobBuilderFactory; import org.springframework.batch.core.job.builder.JobBuilder; import org.springframework.batch.core.job.builder.SimpleJobBuilder; import org.springframework.batch.core.launch.support.RunIdIncrementer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Scope; import uk.ac.ebi.eva.pipeline.jobs.steps.DropSingleStudyVariantsStep; import uk.ac.ebi.eva.pipeline.parameters.validation.job.AggregatedVcfJobParametersValidator; import static uk.ac.ebi.eva.pipeline.configuration.BeanNames.DROP_SINGLE_STUDY_VARIANTS_STEP; import static uk.ac.ebi.eva.pipeline.configuration.BeanNames.DROP_STUDY_JOB; /** * Job that removes a study from the database. Given a study to remove: * <p> * remove single study variants --> pull study entries in the rest of variants --> remove file entry in files collection */ @Configuration @EnableBatchProcessing @Import({DropSingleStudyVariantsStep.class}) public class DropStudyJob { private static final Logger logger = LoggerFactory.getLogger(DropStudyJob.class); @Autowired @Qualifier(DROP_SINGLE_STUDY_VARIANTS_STEP) private Step dropSingleStudyVariantsStep; @Bean(DROP_STUDY_JOB) @Scope("prototype") public Job dropStudyJob(JobBuilderFactory jobBuilderFactory) { logger.debug("Building '" + DROP_STUDY_JOB + "'"); JobBuilder jobBuilder = jobBuilderFactory .get(DROP_STUDY_JOB) .incrementer(new RunIdIncrementer()) .validator(new AggregatedVcfJobParametersValidator()); SimpleJobBuilder builder = jobBuilder .start(dropSingleStudyVariantsStep); return builder.build(); } }
removed wrong validator in DropStudyJob
src/main/java/uk/ac/ebi/eva/pipeline/jobs/DropStudyJob.java
removed wrong validator in DropStudyJob
<ide><path>rc/main/java/uk/ac/ebi/eva/pipeline/jobs/DropStudyJob.java <ide> import org.springframework.context.annotation.Scope; <ide> <ide> import uk.ac.ebi.eva.pipeline.jobs.steps.DropSingleStudyVariantsStep; <del>import uk.ac.ebi.eva.pipeline.parameters.validation.job.AggregatedVcfJobParametersValidator; <ide> <ide> import static uk.ac.ebi.eva.pipeline.configuration.BeanNames.DROP_SINGLE_STUDY_VARIANTS_STEP; <ide> import static uk.ac.ebi.eva.pipeline.configuration.BeanNames.DROP_STUDY_JOB; <ide> <ide> JobBuilder jobBuilder = jobBuilderFactory <ide> .get(DROP_STUDY_JOB) <del> .incrementer(new RunIdIncrementer()) <del> .validator(new AggregatedVcfJobParametersValidator()); <add> .incrementer(new RunIdIncrementer()); <add> <ide> SimpleJobBuilder builder = jobBuilder <ide> .start(dropSingleStudyVariantsStep); <ide>
JavaScript
apache-2.0
fb6038a3b93bb7a1326198e8950bbff3a448514f
0
serverboards/serverboards,serverboards/serverboards,serverboards/serverboards,serverboards/serverboards,serverboards/serverboards
import React from 'react' function Item({s}){ return ( <a key={s.id} className={`item ${s.active ? "active" : ""}`} onClick={s.onClick} title={s.description} > {s.label} {s.icon ? ( <i className={`ui icon ${s.icon}`}/> ) : null} </a> ) } class TabBar extends React.Component{ constructor(props){ super(props) this.state={ visible_items: this.props.tabs.length, show_menu: false } } componentDidMount(){ $(window).on( "resize.tabbar", () => { this.setState({visible_items: this.props.tabs.length}) setTimeout( () => this.reflow(this.props.tabs.length), 300 ) } ) this.reflow() } componentWillUnmount(){ $(window).off('.tabbar') } reflow(){ const tabbar = this.refs.tabbar this.refs.parent.style.overflow='hidden' let myw = 0 const maxwidth = tabbar.clientWidth let visible_items = 0 for (const ch of tabbar.children){ myw += ch.clientWidth if (myw > maxwidth){ if (visible_items>0){ this.setState({visible_items}) } this.refs.parent.style.overflow="visible" return } visible_items += 1 } } render(){ const {tabs} = this.props const {visible_items, show_menu} = this.state return ( <div ref="parent" className="ui top secondary pointing menu"> <div ref="tabbar" className="ui top secondary pointing menu" style={{paddingBottom: 0, overflow: "hidden", maxWidth: "100%"}}> {tabs.slice(0, visible_items).map( (s) => ( <Item key={s.name} s={s}/> ) ) } </div> { (visible_items != tabs.length) && ( <div className={`ui dropdown icon item ${ show_menu ? "active visible" : ""}`} onClick={() => this.setState({ show_menu: !show_menu }) }> <i className="ui vertical ellipsis icon"/> { show_menu &&( <div className="ui menu transition visible" style={{left: -100, width: 150}}> {tabs.slice(visible_items).map( (s) => ( <Item key={s.name} s={s}/> ) ) } </div> )} </div> ) } </div> ) } } export default TabBar
frontend/app/js/components/tabbar.js
import React from 'react' function Item({s}){ return ( <a key={s.id} className={`item ${s.active ? "active" : ""}`} onClick={s.onClick} title={s.description} > {s.label} {s.icon ? ( <i className={`ui icon ${s.icon}`}/> ) : null} </a> ) } class TabBar extends React.Component{ constructor(props){ super(props) this.state={ visible_items: this.props.tabs.length, show_menu: false } } componentDidMount(){ $(window).on( "resize.tabbar", () => { this.setState({visible_items: this.props.tabs.length}) setTimeout( () => this.reflow(this.props.tabs.length), 300 ) } ) this.reflow() } componentWillUnmount(){ $(window).off('.tabbar') } reflow(){ console.log("reflow") const tabbar = this.refs.tabbar if (tabbar.clientWidth < tabbar.scrollWidth){ const visible_items = this.state.visible_items-1 if (visible_items>0){ console.log("New visible items: %o", visible_items) this.setState({visible_items}) setTimeout(() => this.reflow(), 300) } } } render(){ const {tabs} = this.props const {visible_items, show_menu} = this.state return ( <div className="ui top secondary pointing menu"> <div ref="tabbar" className="ui top secondary pointing menu" style={{paddingBottom: 0, overflow: "hidden", maxWidth: "100%"}}> {tabs.slice(0, visible_items).map( (s) => ( <Item key={s.name} s={s}/> ) ) } </div> { (visible_items != tabs.length) && ( <div className={`ui dropdown icon item ${ show_menu ? "active visible" : ""}`} onClick={() => this.setState({ show_menu: !show_menu }) }> <i className="ui vertical ellipsis icon"/> { show_menu &&( <div className="ui menu transition visible" style={{left: -100}}> {tabs.slice(visible_items).map( (s) => ( <Item key={s.name} s={s}/> ) ) } </div> )} </div> ) } </div> ) } } export default TabBar
Improved reflow
frontend/app/js/components/tabbar.js
Improved reflow
<ide><path>rontend/app/js/components/tabbar.js <ide> $(window).off('.tabbar') <ide> } <ide> reflow(){ <del> console.log("reflow") <ide> const tabbar = this.refs.tabbar <del> if (tabbar.clientWidth < tabbar.scrollWidth){ <del> const visible_items = this.state.visible_items-1 <del> if (visible_items>0){ <del> console.log("New visible items: %o", visible_items) <del> this.setState({visible_items}) <del> setTimeout(() => this.reflow(), 300) <add> this.refs.parent.style.overflow='hidden' <add> let myw = 0 <add> const maxwidth = tabbar.clientWidth <add> let visible_items = 0 <add> for (const ch of tabbar.children){ <add> myw += ch.clientWidth <add> if (myw > maxwidth){ <add> if (visible_items>0){ <add> this.setState({visible_items}) <add> } <add> this.refs.parent.style.overflow="visible" <add> return <ide> } <add> visible_items += 1 <ide> } <ide> } <ide> render(){ <ide> const {tabs} = this.props <ide> const {visible_items, show_menu} = this.state <ide> return ( <del> <div className="ui top secondary pointing menu"> <add> <div ref="parent" className="ui top secondary pointing menu"> <ide> <div ref="tabbar" className="ui top secondary pointing menu" style={{paddingBottom: 0, overflow: "hidden", maxWidth: "100%"}}> <ide> {tabs.slice(0, visible_items).map( (s) => ( <ide> <Item key={s.name} s={s}/> <ide> <div className={`ui dropdown icon item ${ show_menu ? "active visible" : ""}`} onClick={() => this.setState({ show_menu: !show_menu }) }> <ide> <i className="ui vertical ellipsis icon"/> <ide> { show_menu &&( <del> <div className="ui menu transition visible" style={{left: -100}}> <add> <div className="ui menu transition visible" style={{left: -100, width: 150}}> <ide> {tabs.slice(visible_items).map( (s) => ( <ide> <Item key={s.name} s={s}/> <ide> ) ) }
JavaScript
agpl-3.0
c31af4540ada5dc8c90a9d1b67ece08e6bf26f07
0
Rello/audioplayer,Rello/audioplayer
OC.L10N.register( "audioplayer", { "Welcome to" : "欢迎", "Audio Player" : "Audio Player", "Add new tracks to library" : "搜索音频", "Scan for new audio files" : "搜索新的音频", "New or updated audio files available" : "新的或更新的音频文件可用", "Help" : "帮助", "Sort playlist" : "播放清单排序", "Rename playlist" : "重新命名播放清单", "Delete playlist" : "刪除播放清单", "Add new tracks to playlist by drag and drop" : "通过拖曳给播放清单添加新的音频", "No playlist selected!" : "请选择播放清单", "Sort modus active" : "排序", "Playlist successfully deleted!" : "成功刪除播放清单", "Start scanning…" : "开始搜索…", "Scanning finished! New Audios found!" : "搜索完成,找到新的音频!", "Yes" : "是", "No" : "否", "Error" : "错误", "Are you sure?" : "请确认", "Disc" : "唱片", "Track" : "曲目", "File" : "档案名", "Title" : "曲名", "Subtitle" : "副标题", "Artist" : "艺人", "Album Artist" : "专辑艺人", "Year" : "年份", "Album" : "专辑", "Albums" : "专辑", "Composer" : "作曲者", "Metadata" : "元数据", "Edit metadata" : "编辑元数据", "ID3 Editor" : "ID3编辑器", "No ID3 editor installed" : "未安装ID3编辑器", "Playlists" : "播放清单", "No playlist entry" : "没有播放清单", "Lyrics" : "歌词", "No lyrics found" : "没有找到歌词", "Reading data" : "读取数据", "No data" : "没有数据", "Remove" : "删除", "Options" : "选项", "MIME type" : "MIME类型", "MIME type not supported by browser" : "浏览器不支持此音频格式", "Missing permission to edit metadata of track!" : "没有修改曲目元数据的权限!", "Existing Albums" : "现有的专辑", "New Album" : " 新专辑", "Genre" : "曲风", "Add as Album Cover" : "设定为专辑封面", "of" : "之", "Total" : "总数", "Select from cloud" : "由云端选择", "Edit" : "编辑", "Delete" : "刪除", "Upload" : "上传", "Drop picture" : "弃用照片", "Select picture" : "选择照片", "Picture generating, please wait…" : "图像生成, 请等待…", "Drag picture here!" : "拖动图片到这里!", "Settings" : "设定", "Select a single folder with audio files" : "选取一个含有音频的文件夹", "Invalid path!" : "无效的路径!", "saved" : "已保存", "Reset library" : "重建资料库", "Start resetting library…" : "开始重建资料库…", "Resetting finished!" : "重建完成!", "All library entries will be deleted!" : "所有资料库条目将被删除!", "Close" : "关闭", "Play" : "播放", "Save" : "存储", "Existing Artists" : "已存在的艺人", "New Artist" : " 新艺人", "Existing Genres" : "现有的曲风", "New Genre" : " 新曲风", "Selected" : "选择", "Selected Album" : "选择的专辑", "Selected Artist" : "选择的藝人", "Selected Album Artist" : "选择的专辑艺人", "Selected Composer" : "选择的作曲者", "Selected Folder" : "选择的文件夹", "Selected Genre" : "选择的曲风", "Selected Playlist" : "选择的播放清单", "Selected Year" : "选择的年份", "Length" : "长度" }, "");
l10n/zh_CN.js
OC.L10N.register( "audioplayer", { "Welcome to" : "欢迎", "Audio Player" : "Audio Player", "Add new tracks to library" : "搜索音频", "Scan for new audio files" : "搜索新的音频", "New or updated audio files available" : "New or updated audio files available", "Help" : "帮助", "Sort playlist" : "播放清单排序", "Rename playlist" : "重新命名播放清单", "Delete playlist" : "刪除播放清单", "Add new tracks to playlist by drag and drop" : "Add new tracks to playlist by drag and drop", "No playlist selected!" : "请选择播放清单", "Sort modus active" : "排序", "Playlist successfully deleted!" : "成功刪除播放清单", "Start scanning…" : "开始搜索…", "Scanning finished! New Audios found!" : "搜索完成,找到新的音频!", "Yes" : "是", "No" : "否", "Error" : "错误", "Are you sure?" : "请确认", "Disc" : "唱片", "Track" : "曲目", "File" : "档案名", "Title" : "曲名", "Subtitle" : "副标题", "Artist" : "演出者", "Album Artist" : "Album Artist", "Year" : "年份", "Album" : "专辑", "Albums" : "专辑", "Composer" : "作曲者", "Metadata" : "Metadata", "Edit metadata" : "编辑元数据", "ID3 Editor" : "ID3 Editor", "No ID3 editor installed" : "No ID3 editor installed", "Playlists" : "Playlists", "No playlist entry" : "No playlist entry", "Lyrics" : "Lyrics", "No lyrics found" : "No lyrics found", "Reading data" : "Reading data", "No data" : "No data", "Remove" : "删除", "Options" : "选项", "MIME type" : "MIME类型", "MIME type not supported by browser" : "浏览器不支持此音频格式", "Missing permission to edit metadata of track!" : "Missing permission to edit metadata of track!", "Existing Albums" : "现有的专辑", "New Album" : " 新专辑", "Genre" : "曲风", "Add as Album Cover" : "设定为专辑封面", "of" : "之", "Total" : "总数", "Select from cloud" : "由云端选择", "Edit" : "编辑", "Delete" : "刪除", "Upload" : "上传", "Drop picture" : "弃用照片", "Select picture" : "选择照片", "Picture generating, please wait…" : "图像生成, 请等待…", "Drag picture here!" : "拖动图片在这里!", "Settings" : "Settings", "Select a single folder with audio files" : "Select a single folder with audio files", "Invalid path!" : "Invalid path!", "saved" : "saved", "Reset library" : "Reset library", "Start resetting library…" : "Start resetting library…", "Resetting finished!" : "重设完成!", "All library entries will be deleted!" : "All library entries will be deleted!", "Close" : "关闭", "Play" : "播放", "Save" : "存储", "Existing Artists" : "已存在的艺人", "New Artist" : " 新艺人", "Existing Genres" : "现有的曲风", "New Genre" : " 新曲风", "Selected" : "选择", "Selected Album" : "选择的专辑", "Selected Artist" : "选择的藝人", "Selected Album Artist" : "Selected Album Artist", "Selected Composer" : "选择的作曲者", "Selected Folder" : "选择的文件夹", "Selected Genre" : "选择的曲风", "Selected Playlist" : "选择的播放清单", "Selected Year" : "选择的年份", "Length" : "长度" }, "");
Update zh_CN.js
l10n/zh_CN.js
Update zh_CN.js
<ide><path>10n/zh_CN.js <ide> "Audio Player" : "Audio Player", <ide> "Add new tracks to library" : "搜索音频", <ide> "Scan for new audio files" : "搜索新的音频", <del> "New or updated audio files available" : "New or updated audio files available", <add> "New or updated audio files available" : "新的或更新的音频文件可用", <ide> "Help" : "帮助", <ide> "Sort playlist" : "播放清单排序", <ide> "Rename playlist" : "重新命名播放清单", <ide> "Delete playlist" : "刪除播放清单", <del> "Add new tracks to playlist by drag and drop" : "Add new tracks to playlist by drag and drop", <add> "Add new tracks to playlist by drag and drop" : "通过拖曳给播放清单添加新的音频", <ide> "No playlist selected!" : "请选择播放清单", <ide> "Sort modus active" : "排序", <ide> "Playlist successfully deleted!" : "成功刪除播放清单", <ide> "File" : "档案名", <ide> "Title" : "曲名", <ide> "Subtitle" : "副标题", <del> "Artist" : "演出者", <del> "Album Artist" : "Album Artist", <add> "Artist" : "艺人", <add> "Album Artist" : "专辑艺人", <ide> "Year" : "年份", <ide> "Album" : "专辑", <ide> "Albums" : "专辑", <ide> "Composer" : "作曲者", <del> "Metadata" : "Metadata", <add> "Metadata" : "元数据", <ide> "Edit metadata" : "编辑元数据", <del> "ID3 Editor" : "ID3 Editor", <del> "No ID3 editor installed" : "No ID3 editor installed", <del> "Playlists" : "Playlists", <del> "No playlist entry" : "No playlist entry", <del> "Lyrics" : "Lyrics", <del> "No lyrics found" : "No lyrics found", <del> "Reading data" : "Reading data", <del> "No data" : "No data", <add> "ID3 Editor" : "ID3编辑器", <add> "No ID3 editor installed" : "未安装ID3编辑器", <add> "Playlists" : "播放清单", <add> "No playlist entry" : "没有播放清单", <add> "Lyrics" : "歌词", <add> "No lyrics found" : "没有找到歌词", <add> "Reading data" : "读取数据", <add> "No data" : "没有数据", <ide> "Remove" : "删除", <ide> "Options" : "选项", <ide> "MIME type" : "MIME类型", <ide> "MIME type not supported by browser" : "浏览器不支持此音频格式", <del> "Missing permission to edit metadata of track!" : "Missing permission to edit metadata of track!", <add> "Missing permission to edit metadata of track!" : "没有修改曲目元数据的权限!", <ide> "Existing Albums" : "现有的专辑", <ide> "New Album" : " 新专辑", <ide> "Genre" : "曲风", <ide> "Drop picture" : "弃用照片", <ide> "Select picture" : "选择照片", <ide> "Picture generating, please wait…" : "图像生成, 请等待…", <del> "Drag picture here!" : "拖动图片在这里!", <del> "Settings" : "Settings", <del> "Select a single folder with audio files" : "Select a single folder with audio files", <del> "Invalid path!" : "Invalid path!", <del> "saved" : "saved", <del> "Reset library" : "Reset library", <del> "Start resetting library…" : "Start resetting library…", <del> "Resetting finished!" : "重设完成!", <del> "All library entries will be deleted!" : "All library entries will be deleted!", <add> "Drag picture here!" : "拖动图片到这里!", <add> "Settings" : "设定", <add> "Select a single folder with audio files" : "选取一个含有音频的文件夹", <add> "Invalid path!" : "无效的路径!", <add> "saved" : "已保存", <add> "Reset library" : "重建资料库", <add> "Start resetting library…" : "开始重建资料库…", <add> "Resetting finished!" : "重建完成!", <add> "All library entries will be deleted!" : "所有资料库条目将被删除!", <ide> "Close" : "关闭", <ide> "Play" : "播放", <ide> "Save" : "存储", <ide> "Selected" : "选择", <ide> "Selected Album" : "选择的专辑", <ide> "Selected Artist" : "选择的藝人", <del> "Selected Album Artist" : "Selected Album Artist", <add> "Selected Album Artist" : "选择的专辑艺人", <ide> "Selected Composer" : "选择的作曲者", <ide> "Selected Folder" : "选择的文件夹", <ide> "Selected Genre" : "选择的曲风",
JavaScript
agpl-3.0
45f5dbb57190390a00ae191c255e55fe7b7b2ec8
0
CircuitCoder/ConsoleiT-Frontend,CircuitCoder/ConsoleiT-Frontend,CircuitCoder/ConsoleiT-Frontend,CircuitCoder/ConsoleiT-Frontend
'use strict'; var readFileSync = require('fs').readFileSync; var gulp = require('gulp'); var concat = require('gulp-concat'); var connect = require('gulp-connect'); var cssmin = require('gulp-cssmin'); var del = require('del'); var gulpif = require('gulp-if'); var htmlmin = require('gulp-htmlmin'); var inlineNg2Template = require('gulp-inline-ng2-template'); var rename = require('gulp-rename'); var rev = require('gulp-rev'); var revReplace = require('gulp-rev-replace'); var sass = require('gulp-sass'); var shell = require('gulp-shell'); var sourcemaps = require('gulp-sourcemaps'); var typescript = require('gulp-typescript'); var uglify = require('gulp-uglify'); var util = require('gulp-util'); var production = false; var webserver = false; var htmlminOpt = { collapseWhitespace: true, conservativeCollapse: true, removeComments: true, removeCommentsFromCDATA: true, caseSensitive: true, minifyJS: true, minifyCSS: true, minifyURLs: true } var tsOpt= { target: "es5", module: "system", moduleResolution: "node", emitDecoratorMetadata: true, experimentalDecorators: true, noImplicitAny: true, removeComments: true, outFile: 'bundle.js', rootDir: 'ts', typescript: require('typescript') } var depList = [ 'lib/fix.js', 'lib/md5.js', 'lib/material.min.js', 'node_modules/angular2/es6/dev/src/testing/shims_for_IE.js', 'node_modules/marked/marked.min.js', 'node_modules/es6-shim/es6-shim.js', 'node_modules/systemjs/dist/system-polyfills.js', 'node_modules/angular2/bundles/angular2-polyfills.min.js', 'node_modules/systemjs/dist/system.js', 'node_modules/rxjs/bundles/Rx.js', 'node_modules/angular2/bundles/angular2.dev.js', // Minified version is broken 'node_modules/angular2/bundles/router.dev.js', 'node_modules/angular2/bundles/http.dev.js' ]; var fontList = [ 'node_modules/material-design-icons/iconfont/MaterialIcons-Regular.eot', 'node_modules/material-design-icons/iconfont/MaterialIcons-Regular.woff', 'node_modules/material-design-icons/iconfont/MaterialIcons-Regular.woff2', 'node_modules/material-design-icons/iconfont/MaterialIcons-Regular.ttf', ]; var tsProject = typescript.createProject(tsOpt); function buildjs(bundler) { return gulp.src(['./typings/browser.d.ts','./ts/**/*.ts', '!./ts/config.example.ts']) .on('error', util.log) .pipe(inlineNg2Template({ removeLineBreaks: true, base: '/html' })) // Currently doesn't support source maps .pipe(sourcemaps.init()) .pipe(typescript(tsProject)) //.pipe(gulpif(production, uglify({mangle: false}))) .pipe(gulpif(!production, sourcemaps.write('./'))) .pipe(rev()) .pipe(gulp.dest('./build/js')) .pipe(rev.manifest({ path: './build/rev-manifest.json', base: './build', merge: true })) .pipe(gulp.dest('./build')); }; function buildcss() { return gulp.src('./sass/**/*.scss') .on('error', util.log) .pipe(sourcemaps.init()) .pipe(sass().on('error', sass.logError)) .pipe(gulp.src('./lib/*.css', {passthrough: true})) .pipe(concat('main.css')) //.pipe(gulpif(production, cssmin())) .pipe(gulpif(!production, sourcemaps.write('./'))) .pipe(rev()) .pipe(gulp.dest('./build/css')) .pipe(rev.manifest({ path: './build/rev-manifest.json', base: './build', merge: true })) .pipe(gulp.dest('./build')); }; function builddep() { return gulp.src(depList) .pipe(concat({path: './bundle-dep.js', cwd: ''})) .pipe(gulpif(production, uglify({mangle: false}))) .pipe(rev()) .pipe(gulp.dest('./build/js')) .pipe(rev.manifest({ path: './build/rev-manifest.json', base: './build', merge: true })) .pipe(gulp.dest('./build')); } function buildfont() { return gulp.src(fontList) .pipe(rev()) .pipe(gulp.dest('./build/fonts')) .pipe(rev.manifest({ path: './build/rev-manifest.json', base: './build', merge: true })) .pipe(gulp.dest('./build')); } function buildassets() { return gulp.src('./assets/**/*.*') .pipe(rev()) .pipe(gulp.dest('./build/assets')) .pipe(rev.manifest({ path: './build/rev-manifest.json', base: './build', merge: true })) .pipe(gulp.dest('./build')); } function buildrev() { function replaceMap(filename) { if(filename.indexOf('.map') > -1) { return filename.replace(/.*\//g, ''); } else return filename; } return gulp.src(['./build/**/*.*', '!./build/rev-manifest.json']) .pipe(revReplace({ manifest: gulp.src('./build/rev-manifest.json'), modifiedUnreved: replaceMap, modifiedReved: replaceMap })) .pipe(gulp.dest('./dist')) .pipe(gulpif(webserver, connect.reload())); } gulp.task('prebuild:production', function(done) { production = true; done(); }); gulp.task('clean', function() { return del(['dist', 'build']); }); gulp.task('clean:js', function() { return del(['dist/js/**/*.*', '!dist/js/bundle-dep-*.*', 'build/js/**/*.*', '!build/js/bundle-dep-*.*']); }); gulp.task('clean:css', function() { return del(['dist/css', 'build/css']); }); gulp.task('clean:dep', function() { return del(['dist/js/bundle-dep-*.*', 'build/js/bundle-dep-*.*']); }); gulp.task('clean:font', function() { return del(['dist/fonts/**/*.*', 'build/fonts/**/*.*']); }); gulp.task('clean:assets', function() { return del(['dist/assets/**/*.*', 'build/assets/**/*.*']); }); gulp.task('clean:index', function() { return del(['dist/index.html']); }); gulp.task('build:js', gulp.series('clean:js', buildjs)); gulp.task('build:css', gulp.series('clean:css', buildcss)); gulp.task('build:dep', gulp.series('clean:dep', builddep)); gulp.task('build:font', gulp.series('clean:font', buildfont)); gulp.task('build:assets', gulp.series('clean:assets', buildassets)); gulp.task('build:index', gulp.series('clean:index', function() { return gulp.src('./html/index.html') .pipe(gulp.dest('./build')); })); gulp.task('build:rev', gulp.series(buildrev)); gulp.task('build', gulp.series(gulp.series('build:font', 'build:assets', 'build:dep', 'build:js', 'build:css', 'build:index'), 'build:rev')); gulp.task('build:production', gulp.series('prebuild:production', 'build')); gulp.task('watch', gulp.series('build', function(done) { gulp.watch(['./ts/**/*.ts', './html/view/**/*.html', './html/tmpl/**/*.html'], gulp.series('build:js', 'build:rev')); gulp.watch('./sass/**/*.scss', gulp.series('build:css', 'build:rev')); gulp.watch('./html/index.html', gulp.series('build:index', 'build:rev')); done(); })); gulp.task('webserver', function(done) { webserver = true; connect.server({ root: 'dist', port: 3001, livereload: true, fallback: 'dist/index.html', debug: true }); done(); }); gulp.task('default', gulp.series('watch', 'webserver'));
gulpfile.js
'use strict'; var readFileSync = require('fs').readFileSync; var gulp = require('gulp'); var concat = require('gulp-concat'); var connect = require('gulp-connect'); var cssmin = require('gulp-cssmin'); var del = require('del'); var gulpif = require('gulp-if'); var htmlmin = require('gulp-htmlmin'); var inlineNg2Template = require('gulp-inline-ng2-template'); var rename = require('gulp-rename'); var rev = require('gulp-rev'); var revReplace = require('gulp-rev-replace'); var sass = require('gulp-sass'); var shell = require('gulp-shell'); var sourcemaps = require('gulp-sourcemaps'); var typescript = require('gulp-typescript'); var uglify = require('gulp-uglify'); var util = require('gulp-util'); var production = false; var webserver = false; var htmlminOpt = { collapseWhitespace: true, conservativeCollapse: true, removeComments: true, removeCommentsFromCDATA: true, caseSensitive: true, minifyJS: true, minifyCSS: true, minifyURLs: true } var tsOpt= { target: "es5", module: "system", moduleResolution: "node", emitDecoratorMetadata: true, experimentalDecorators: true, noImplicitAny: true, removeComments: true, outFile: 'bundle.js', rootDir: 'ts', typescript: require('typescript') } var depList = [ 'lib/fix.js', 'lib/md5.js', 'lib/material.min.js', 'node_modules/marked/marked.min.js', 'node_modules/es6-shim/es6-shim.js', 'node_modules/systemjs/dist/system-polyfills.js', 'node_modules/angular2/bundles/angular2-polyfills.min.js', 'node_modules/systemjs/dist/system.js', 'node_modules/rxjs/bundles/Rx.js', 'node_modules/angular2/bundles/angular2.dev.js', // Minified version is broken 'node_modules/angular2/bundles/router.dev.js', 'node_modules/angular2/bundles/http.dev.js' ]; var fontList = [ 'node_modules/material-design-icons/iconfont/MaterialIcons-Regular.eot', 'node_modules/material-design-icons/iconfont/MaterialIcons-Regular.woff', 'node_modules/material-design-icons/iconfont/MaterialIcons-Regular.woff2', 'node_modules/material-design-icons/iconfont/MaterialIcons-Regular.ttf', ]; var tsProject = typescript.createProject(tsOpt); function buildjs(bundler) { return gulp.src(['./typings/browser.d.ts','./ts/**/*.ts', '!./ts/config.example.ts']) .on('error', util.log) .pipe(inlineNg2Template({ removeLineBreaks: true, base: '/html' })) // Currently doesn't support source maps .pipe(sourcemaps.init()) .pipe(typescript(tsProject)) //.pipe(gulpif(production, uglify({mangle: false}))) .pipe(gulpif(!production, sourcemaps.write('./'))) .pipe(rev()) .pipe(gulp.dest('./build/js')) .pipe(rev.manifest({ path: './build/rev-manifest.json', base: './build', merge: true })) .pipe(gulp.dest('./build')); }; function buildcss() { return gulp.src('./sass/**/*.scss') .on('error', util.log) .pipe(sourcemaps.init()) .pipe(sass().on('error', sass.logError)) .pipe(gulp.src('./lib/*.css', {passthrough: true})) .pipe(concat('main.css')) //.pipe(gulpif(production, cssmin())) .pipe(gulpif(!production, sourcemaps.write('./'))) .pipe(rev()) .pipe(gulp.dest('./build/css')) .pipe(rev.manifest({ path: './build/rev-manifest.json', base: './build', merge: true })) .pipe(gulp.dest('./build')); }; function builddep() { return gulp.src(depList) .pipe(concat({path: './bundle-dep.js', cwd: ''})) .pipe(gulpif(production, uglify({mangle: false}))) .pipe(rev()) .pipe(gulp.dest('./build/js')) .pipe(rev.manifest({ path: './build/rev-manifest.json', base: './build', merge: true })) .pipe(gulp.dest('./build')); } function buildfont() { return gulp.src(fontList) .pipe(rev()) .pipe(gulp.dest('./build/fonts')) .pipe(rev.manifest({ path: './build/rev-manifest.json', base: './build', merge: true })) .pipe(gulp.dest('./build')); } function buildassets() { return gulp.src('./assets/**/*.*') .pipe(rev()) .pipe(gulp.dest('./build/assets')) .pipe(rev.manifest({ path: './build/rev-manifest.json', base: './build', merge: true })) .pipe(gulp.dest('./build')); } function buildrev() { function replaceMap(filename) { if(filename.indexOf('.map') > -1) { return filename.replace(/.*\//g, ''); } else return filename; } return gulp.src(['./build/**/*.*', '!./build/rev-manifest.json']) .pipe(revReplace({ manifest: gulp.src('./build/rev-manifest.json'), modifiedUnreved: replaceMap, modifiedReved: replaceMap })) .pipe(gulp.dest('./dist')) .pipe(gulpif(webserver, connect.reload())); } gulp.task('prebuild:production', function(done) { production = true; done(); }); gulp.task('clean', function() { return del(['dist', 'build']); }); gulp.task('clean:js', function() { return del(['dist/js/**/*.*', '!dist/js/bundle-dep-*.*', 'build/js/**/*.*', '!build/js/bundle-dep-*.*']); }); gulp.task('clean:css', function() { return del(['dist/css', 'build/css']); }); gulp.task('clean:dep', function() { return del(['dist/js/bundle-dep-*.*', 'build/js/bundle-dep-*.*']); }); gulp.task('clean:font', function() { return del(['dist/fonts/**/*.*', 'build/fonts/**/*.*']); }); gulp.task('clean:assets', function() { return del(['dist/assets/**/*.*', 'build/assets/**/*.*']); }); gulp.task('clean:index', function() { return del(['dist/index.html']); }); gulp.task('build:js', gulp.series('clean:js', buildjs)); gulp.task('build:css', gulp.series('clean:css', buildcss)); gulp.task('build:dep', gulp.series('clean:dep', builddep)); gulp.task('build:font', gulp.series('clean:font', buildfont)); gulp.task('build:assets', gulp.series('clean:assets', buildassets)); gulp.task('build:index', gulp.series('clean:index', function() { return gulp.src('./html/index.html') .pipe(gulp.dest('./build')); })); gulp.task('build:rev', gulp.series(buildrev)); gulp.task('build', gulp.series(gulp.series('build:font', 'build:assets', 'build:dep', 'build:js', 'build:css', 'build:index'), 'build:rev')); gulp.task('build:production', gulp.series('prebuild:production', 'build')); gulp.task('watch', gulp.series('build', function(done) { gulp.watch(['./ts/**/*.ts', './html/view/**/*.html', './html/tmpl/**/*.html'], gulp.series('build:js', 'build:rev')); gulp.watch('./sass/**/*.scss', gulp.series('build:css', 'build:rev')); gulp.watch('./html/index.html', gulp.series('build:index', 'build:rev')); done(); })); gulp.task('webserver', function(done) { webserver = true; connect.server({ root: 'dist', port: 3001, livereload: true, fallback: 'dist/index.html', debug: true }); done(); }); gulp.task('default', gulp.series('watch', 'webserver'));
Added shims for ie
gulpfile.js
Added shims for ie
<ide><path>ulpfile.js <ide> 'lib/fix.js', <ide> 'lib/md5.js', <ide> 'lib/material.min.js', <add> 'node_modules/angular2/es6/dev/src/testing/shims_for_IE.js', <ide> 'node_modules/marked/marked.min.js', <ide> 'node_modules/es6-shim/es6-shim.js', <ide> 'node_modules/systemjs/dist/system-polyfills.js',
Java
epl-1.0
4b0628bc93dad575b003e5cdaeb308b5778805da
0
ControlSystemStudio/cs-studio,ControlSystemStudio/cs-studio,ControlSystemStudio/cs-studio,ControlSystemStudio/cs-studio,ESSICS/cs-studio,css-iter/cs-studio,ESSICS/cs-studio,ESSICS/cs-studio,ControlSystemStudio/cs-studio,css-iter/cs-studio,ESSICS/cs-studio,ESSICS/cs-studio,css-iter/cs-studio,css-iter/cs-studio,ESSICS/cs-studio,ControlSystemStudio/cs-studio,css-iter/cs-studio,css-iter/cs-studio,ESSICS/cs-studio,css-iter/cs-studio
/******************************************************************************* * Copyright (c) 2013 Oak Ridge National Laboratory. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html ******************************************************************************/ package org.csstudio.simplepv.utilitypv; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.Arrays; import java.util.Calendar; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.concurrent.Executor; import java.util.logging.Level; import org.csstudio.data.values.IDoubleValue; import org.csstudio.data.values.IEnumeratedMetaData; import org.csstudio.data.values.IEnumeratedValue; import org.csstudio.data.values.ILongValue; import org.csstudio.data.values.INumericMetaData; import org.csstudio.data.values.ISeverity; import org.csstudio.data.values.IStringValue; import org.csstudio.data.values.ITimestamp; import org.csstudio.data.values.IValue; import org.csstudio.simplepv.ExceptionHandler; import org.csstudio.simplepv.IPV; import org.csstudio.simplepv.IPVListener; import org.csstudio.utility.pv.PV; import org.csstudio.utility.pv.PVFactory; import org.csstudio.utility.pv.PVListener; import org.eclipse.osgi.util.NLS; import org.epics.util.array.ArrayDouble; import org.epics.util.array.ArrayInt; import org.epics.util.array.ArrayLong; import org.epics.util.time.Timestamp; import org.epics.vtype.Alarm; import org.epics.vtype.AlarmSeverity; import org.epics.vtype.Display; import org.epics.vtype.Time; import org.epics.vtype.VType; import org.epics.vtype.ValueFactory; /**An implementation of {@link IPV} on top of UtlityPV. * @author Xihui Chen * */ public class UtilityPV implements IPV { private String name; private boolean readOnly; private Executor notificationThread; private ExceptionHandler exceptionHandler; private PV pv; private Map<IPVListener, PVListener> listenerMap; private IValue lastIValue; private VType lastVTypeValue; final private static Map<Integer, NumberFormat> fmt_cache = new HashMap<Integer, NumberFormat>(); public UtilityPV(String name, boolean readOnly, Executor notificationThread, ExceptionHandler exceptionHandler) throws Exception { this.name = convertPMPVToUtilityPVName(name); this.readOnly = readOnly; this.notificationThread = notificationThread; this.exceptionHandler = exceptionHandler; pv = PVFactory.createPV(this.name); listenerMap = new LinkedHashMap<IPVListener, PVListener>(4); } @Override public void addListener(final IPVListener listener) { PVListener pvListener = new PVListener() { private Boolean isWriteAllowed; private boolean connected; @Override public void pvValueUpdate(final PV pv) { notificationThread.execute( new Runnable() { @Override public void run() { if(!connected){ connected = true; listener.connectionChanged(UtilityPV.this); } if(isWriteAllowed == null || (!readOnly && pv.isWriteAllowed() != isWriteAllowed)){ listener.writePermissionChanged(UtilityPV.this); isWriteAllowed = pv.isWriteAllowed(); } listener.valueChanged(UtilityPV.this); } }); } @Override public void pvDisconnected(PV pv) { notificationThread.execute(new Runnable() { @Override public void run() { connected =false; listener.connectionChanged(UtilityPV.this); } }); } }; listenerMap.put(listener, pvListener); pv.addListener(pvListener); } @Override public List<VType> getAllBufferedValues() { return Arrays.asList(getValue()); } @Override public String getName() { return name; } @Override public synchronized VType getValue() { IValue iValue = pv.getValue(); if(iValue!=null){ if(iValue == lastIValue) return lastVTypeValue; lastVTypeValue = iValueToVType(iValue); lastIValue = iValue; return lastVTypeValue; } return null; } private VType iValueToVType(IValue iValue) { Alarm alarm = ValueFactory.newAlarm(convertSeverity(iValue.getSeverity()), iValue.getStatus()); Time time = convertTimeStamp(iValue.getTime()); Display display =null; if(iValue.getMetaData() instanceof INumericMetaData) display = convertNumericMetaToDisplay((INumericMetaData) iValue.getMetaData()); if(iValue instanceof IDoubleValue){ double[] values = ((IDoubleValue)iValue).getValues(); if(values.length >1) return ValueFactory.newVDoubleArray(new ArrayDouble(values), alarm, time, display); return ValueFactory.newVDouble( ((IDoubleValue)iValue).getValue(), alarm, time, display); } if(iValue instanceof ILongValue){ final long[] values = ((ILongValue)iValue).getValues(); if(values.length > 1) return ValueFactory.newVLongArray(new ArrayLong(values), alarm, time, display); return ValueFactory.newVDouble( (double) ((ILongValue)iValue).getValue(), alarm, time, display); } if(iValue instanceof IEnumeratedValue){ int[] values = ((IEnumeratedValue)iValue).getValues(); List<String> lables = Arrays.asList(((IEnumeratedMetaData)iValue.getMetaData()).getStates()); if(values.length>1) return ValueFactory.newVEnumArray(new ArrayInt(values), lables, alarm, time); return ValueFactory.newVEnum(((IEnumeratedValue)iValue).getValue(), lables, alarm, time); } if(iValue instanceof IStringValue){ String[] values = ((IStringValue)iValue).getValues(); if(values.length>1) return ValueFactory.newVStringArray(Arrays.asList(values), alarm, time); return ValueFactory.newVString(((IStringValue)iValue).getValue(), alarm, time); } return null; } private static AlarmSeverity convertSeverity(ISeverity severity){ if(severity.isOK()) return AlarmSeverity.NONE; if(severity.isMajor()) return AlarmSeverity.MAJOR; if(severity.isMinor()) return AlarmSeverity.MINOR; if(severity.isInvalid()) return AlarmSeverity.INVALID; return AlarmSeverity.UNDEFINED; } private static Time convertTimeStamp(ITimestamp time){ return ValueFactory.newTime(Timestamp.of(time.seconds(), (int) time.nanoseconds())); } private static Display convertNumericMetaToDisplay(INumericMetaData meta){ int precision = meta.getPrecision(); NumberFormat fmt = fmt_cache.get(-precision); if (fmt == null) { fmt = new DecimalFormat("0"); //$NON-NLS-1$ fmt.setMinimumFractionDigits(precision); fmt.setMaximumFractionDigits(precision); fmt_cache.put(-precision, fmt); } return ValueFactory.newDisplay( meta.getDisplayLow(), meta.getAlarmLow(), meta.getWarnLow(), meta.getUnits(), fmt, meta.getWarnHigh(), meta.getAlarmHigh(), meta.getDisplayHigh(), meta.getDisplayLow(),meta.getDisplayHigh()); } @Override public boolean isBufferingValues() { return false; } @Override public boolean isConnected() { return pv.isConnected(); } @Override public boolean isPaused() { return !pv.isRunning(); } @Override public boolean isStarted() { return pv.isRunning(); } @Override public boolean isWriteAllowed() { if(readOnly) return false; return pv.isWriteAllowed(); } @Override public void removeListener(IPVListener listener) { pv.removeListener(listenerMap.get(listener)); listenerMap.remove(listener); } @Override public void setPaused(boolean paused) { if(paused && pv.isRunning()) pv.stop(); if(!paused && !pv.isRunning()) try { pv.start(); } catch (Exception e) { fireExceptionChanged(e); } } private void fireExceptionChanged(Exception e){ if(exceptionHandler!=null) exceptionHandler.handleException(e); for(IPVListener listener : listenerMap.keySet()){ listener.exceptionOccurred(this, e); } } @Override public void setValue(Object value) throws Exception { if(!readOnly) pv.setValue(value); else throw new Exception(NLS.bind("The PV {0} was created for read only.", getName())); } @Override public boolean setValue(Object value, int timeout) throws Exception { if(!pv.isRunning()) pv.start(); long startTime = System.currentTimeMillis(); while ((Calendar.getInstance().getTimeInMillis() - startTime) < timeout && !pv.isConnected()) { Thread.sleep(100); } if (!pv.isConnected()) { throw new Exception( NLS.bind("Connection Timeout! Failed to connect to the PV {0}.", name)); } if (!pv.isWriteAllowed()) throw new Exception("The PV is not allowed to write"); pv.setValue(value); return true; } @Override public void start() throws Exception { if(pv.isRunning()) throw new IllegalStateException( NLS.bind("PV {0} has already been started.", getName())); pv.start(); } @Override public void stop() { if(!pv.isRunning()){ Activator.getLogger().log(Level.WARNING, NLS.bind("PV {0} has already been stopped or was not started yet.", getName())); return; } pv.stop(); } /**Convert PVManager PV name to Utility PV name if the pv name is supported by Utility pv. * @param pvName * @return the converted name. */ public static String convertPMPVToUtilityPVName(String pvName){ //convert =123 to 123 //conver ="fred" to "fred' if(pvName.startsWith("=")){//$NON-NLS-1$ return pvName.substring(1); } //convert sim://const(1.23, 34, 34) to const://array(1.23, 34, 34) if(pvName.startsWith("sim://const")){ //$NON-NLS-1$ return pvName.replace("sim://const", "const://array"); //$NON-NLS-1$ //$NON-NLS-2$ } return pvName; } }
applications/plugins/org.csstudio.simplepv.utilitypv/src/org/csstudio/simplepv/utilitypv/UtilityPV.java
/******************************************************************************* * Copyright (c) 2013 Oak Ridge National Laboratory. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html ******************************************************************************/ package org.csstudio.simplepv.utilitypv; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.Arrays; import java.util.Calendar; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.concurrent.Executor; import java.util.logging.Level; import org.csstudio.data.values.IDoubleValue; import org.csstudio.data.values.IEnumeratedMetaData; import org.csstudio.data.values.IEnumeratedValue; import org.csstudio.data.values.ILongValue; import org.csstudio.data.values.INumericMetaData; import org.csstudio.data.values.ISeverity; import org.csstudio.data.values.IStringValue; import org.csstudio.data.values.ITimestamp; import org.csstudio.data.values.IValue; import org.csstudio.simplepv.ExceptionHandler; import org.csstudio.simplepv.IPV; import org.csstudio.simplepv.IPVListener; import org.csstudio.utility.pv.PV; import org.csstudio.utility.pv.PVFactory; import org.csstudio.utility.pv.PVListener; import org.eclipse.osgi.util.NLS; import org.epics.util.array.ArrayInt; import org.epics.util.array.ListDouble; import org.epics.util.time.Timestamp; import org.epics.vtype.Alarm; import org.epics.vtype.AlarmSeverity; import org.epics.vtype.Display; import org.epics.vtype.Time; import org.epics.vtype.VType; import org.epics.vtype.ValueFactory; /**An implementation of {@link IPV} on top of UtlityPV. * @author Xihui Chen * */ public class UtilityPV implements IPV { private String name; private boolean readOnly; private Executor notificationThread; private ExceptionHandler exceptionHandler; private PV pv; private Map<IPVListener, PVListener> listenerMap; private IValue lastIValue; private VType lastVTypeValue; final private static Map<Integer, NumberFormat> fmt_cache = new HashMap<Integer, NumberFormat>(); public UtilityPV(String name, boolean readOnly, Executor notificationThread, ExceptionHandler exceptionHandler) throws Exception { this.name = convertPMPVToUtilityPVName(name); this.readOnly = readOnly; this.notificationThread = notificationThread; this.exceptionHandler = exceptionHandler; pv = PVFactory.createPV(this.name); listenerMap = new LinkedHashMap<IPVListener, PVListener>(4); } @Override public void addListener(final IPVListener listener) { PVListener pvListener = new PVListener() { private Boolean isWriteAllowed; private boolean connected; @Override public void pvValueUpdate(final PV pv) { notificationThread.execute( new Runnable() { @Override public void run() { if(!connected){ connected = true; listener.connectionChanged(UtilityPV.this); } if(isWriteAllowed == null || (!readOnly && pv.isWriteAllowed() != isWriteAllowed)){ listener.writePermissionChanged(UtilityPV.this); isWriteAllowed = pv.isWriteAllowed(); } listener.valueChanged(UtilityPV.this); } }); } @Override public void pvDisconnected(PV pv) { notificationThread.execute(new Runnable() { @Override public void run() { connected =false; listener.connectionChanged(UtilityPV.this); } }); } }; listenerMap.put(listener, pvListener); pv.addListener(pvListener); } @Override public List<VType> getAllBufferedValues() { return Arrays.asList(getValue()); } @Override public String getName() { return name; } @Override public synchronized VType getValue() { IValue iValue = pv.getValue(); if(iValue!=null){ if(iValue == lastIValue) return lastVTypeValue; lastVTypeValue = iValueToVType(iValue); lastIValue = iValue; return lastVTypeValue; } return null; } private VType iValueToVType(IValue iValue) { Alarm alarm = ValueFactory.newAlarm(convertSeverity(iValue.getSeverity()), iValue.getStatus()); Time time = convertTimeStamp(iValue.getTime()); Display display =null; if(iValue.getMetaData() instanceof INumericMetaData) display = convertNumericMetaToDisplay((INumericMetaData) iValue.getMetaData()); if(iValue instanceof IDoubleValue){ double[] values = ((IDoubleValue)iValue).getValues(); if(values.length >1) return ValueFactory.newVDoubleArray(values, alarm, time, display); return ValueFactory.newVDouble( ((IDoubleValue)iValue).getValue(), alarm, time, display); } if(iValue instanceof ILongValue){ final long[] values = ((ILongValue)iValue).getValues(); if(values.length > 1) return ValueFactory.newVDoubleArray(new ListDouble(){ @Override public double getDouble(int index) { return values[index]; } @Override public int size() { return values.length; } }, alarm, time, display); return ValueFactory.newVDouble( (double) ((ILongValue)iValue).getValue(), alarm, time, display); } if(iValue instanceof IEnumeratedValue){ int[] values = ((IEnumeratedValue)iValue).getValues(); List<String> lables = Arrays.asList(((IEnumeratedMetaData)iValue.getMetaData()).getStates()); if(values.length>1) return ValueFactory.newVEnumArray(new ArrayInt(values), lables, alarm, time); return ValueFactory.newVEnum(((IEnumeratedValue)iValue).getValue(), lables, alarm, time); } if(iValue instanceof IStringValue){ String[] values = ((IStringValue)iValue).getValues(); if(values.length>1) return ValueFactory.newVStringArray(Arrays.asList(values), alarm, time); return ValueFactory.newVString(((IStringValue)iValue).getValue(), alarm, time); } return null; } private static AlarmSeverity convertSeverity(ISeverity severity){ if(severity.isOK()) return AlarmSeverity.NONE; if(severity.isMajor()) return AlarmSeverity.MAJOR; if(severity.isMinor()) return AlarmSeverity.MINOR; if(severity.isInvalid()) return AlarmSeverity.INVALID; return AlarmSeverity.UNDEFINED; } private static Time convertTimeStamp(ITimestamp time){ return ValueFactory.newTime(Timestamp.of(time.seconds(), (int) time.nanoseconds())); } private static Display convertNumericMetaToDisplay(INumericMetaData meta){ int precision = meta.getPrecision(); NumberFormat fmt = fmt_cache.get(-precision); if (fmt == null) { fmt = new DecimalFormat("0"); //$NON-NLS-1$ fmt.setMinimumFractionDigits(precision); fmt.setMaximumFractionDigits(precision); fmt_cache.put(-precision, fmt); } return ValueFactory.newDisplay( meta.getDisplayLow(), meta.getAlarmLow(), meta.getWarnLow(), meta.getUnits(), fmt, meta.getWarnHigh(), meta.getAlarmHigh(), meta.getDisplayHigh(), meta.getDisplayLow(),meta.getDisplayHigh()); } @Override public boolean isBufferingValues() { return false; } @Override public boolean isConnected() { return pv.isConnected(); } @Override public boolean isPaused() { return !pv.isRunning(); } @Override public boolean isStarted() { return pv.isRunning(); } @Override public boolean isWriteAllowed() { if(readOnly) return false; return pv.isWriteAllowed(); } @Override public void removeListener(IPVListener listener) { pv.removeListener(listenerMap.get(listener)); listenerMap.remove(listener); } @Override public void setPaused(boolean paused) { if(paused && pv.isRunning()) pv.stop(); if(!paused && !pv.isRunning()) try { pv.start(); } catch (Exception e) { fireExceptionChanged(e); } } private void fireExceptionChanged(Exception e){ if(exceptionHandler!=null) exceptionHandler.handleException(e); for(IPVListener listener : listenerMap.keySet()){ listener.exceptionOccurred(this, e); } } @Override public void setValue(Object value) throws Exception { if(!readOnly) pv.setValue(value); else throw new Exception(NLS.bind("The PV {0} was created for read only.", getName())); } @Override public boolean setValue(Object value, int timeout) throws Exception { if(!pv.isRunning()) pv.start(); long startTime = System.currentTimeMillis(); while ((Calendar.getInstance().getTimeInMillis() - startTime) < timeout && !pv.isConnected()) { Thread.sleep(100); } if (!pv.isConnected()) { throw new Exception( NLS.bind("Connection Timeout! Failed to connect to the PV {0}.", name)); } if (!pv.isWriteAllowed()) throw new Exception("The PV is not allowed to write"); pv.setValue(value); return true; } @Override public void start() throws Exception { if(pv.isRunning()) throw new IllegalStateException( NLS.bind("PV {0} has already been started.", getName())); pv.start(); } @Override public void stop() { if(!pv.isRunning()){ Activator.getLogger().log(Level.WARNING, NLS.bind("PV {0} has already been stopped or was not started yet.", getName())); return; } pv.stop(); } /**Convert PVManager PV name to Utility PV name if the pv name is supported by Utility pv. * @param pvName * @return the converted name. */ public static String convertPMPVToUtilityPVName(String pvName){ //convert =123 to 123 //conver ="fred" to "fred' if(pvName.startsWith("=")){//$NON-NLS-1$ return pvName.substring(1); } //convert sim://const(1.23, 34, 34) to const://array(1.23, 34, 34) if(pvName.startsWith("sim://const")){ //$NON-NLS-1$ return pvName.replace("sim://const", "const://array"); //$NON-NLS-1$ //$NON-NLS-2$ } return pvName; } }
o.c.simplepv.utilitypv: Adapt to VType API change
applications/plugins/org.csstudio.simplepv.utilitypv/src/org/csstudio/simplepv/utilitypv/UtilityPV.java
o.c.simplepv.utilitypv: Adapt to VType API change
<ide><path>pplications/plugins/org.csstudio.simplepv.utilitypv/src/org/csstudio/simplepv/utilitypv/UtilityPV.java <ide> import org.csstudio.utility.pv.PVFactory; <ide> import org.csstudio.utility.pv.PVListener; <ide> import org.eclipse.osgi.util.NLS; <add>import org.epics.util.array.ArrayDouble; <ide> import org.epics.util.array.ArrayInt; <del>import org.epics.util.array.ListDouble; <add>import org.epics.util.array.ArrayLong; <ide> import org.epics.util.time.Timestamp; <ide> import org.epics.vtype.Alarm; <ide> import org.epics.vtype.AlarmSeverity; <ide> if(iValue instanceof IDoubleValue){ <ide> double[] values = ((IDoubleValue)iValue).getValues(); <ide> if(values.length >1) <del> return ValueFactory.newVDoubleArray(values, alarm, time, display); <add> return ValueFactory.newVDoubleArray(new ArrayDouble(values), alarm, time, display); <ide> return ValueFactory.newVDouble( <ide> ((IDoubleValue)iValue).getValue(), alarm, time, display); <ide> } <ide> if(iValue instanceof ILongValue){ <ide> final long[] values = ((ILongValue)iValue).getValues(); <ide> if(values.length > 1) <del> return ValueFactory.newVDoubleArray(new ListDouble(){ <del> <del> @Override <del> public double getDouble(int index) { <del> return values[index]; <del> } <del> <del> @Override <del> public int size() { <del> return values.length; <del> } <del> <del> }, alarm, time, display); <add> return ValueFactory.newVLongArray(new ArrayLong(values), alarm, time, display); <ide> return ValueFactory.newVDouble( <ide> (double) ((ILongValue)iValue).getValue(), alarm, time, display); <ide> }
JavaScript
mit
8d919f8352aee15258b23d3bf2c7934933d573fc
0
AdamBrodzinski/RedScript,AdamBrodzinski/RedScript
/** * RedScript compiler * Copyright(c) 2013 Adam Brodzinski <[email protected]> * MIT Licensed */ var transform = require('./transform'); /** Export compile function * Takes a multi line string and splits each line into array lines. * Each line is processed and transformed if it matches the criteria. * Final array of strings are joined and returned. * @param {string} file * @return {string} * @api public */ module.exports = function(file) { var lines = file.split('\n') , debug = false , declaredVars = []; // reset state object for each file process.emit('state:reset'); // Iterate through each line and transform text lines = lines.map(function(line, index) { // normalize # comments to // line = transform.comments(line); // if line begins with a comment, return if (/^\/\//.test(line.trimLeft())) return line; // insert var keyword where needed (currently buggy) line = transform.insertVars(line, declaredVars); // setup 'class' constructors and inherit if necessary line = transform.classes(line); // transform super call from a class method line = transform.callSuper(line); // transform a while loop line = transform.whileLoop(line); // until loop with comment line = transform.untilLoop(line); // for loop with range e.g. `0..20` line = transform.forLoopRange(line); // Bracketless for in statement line = transform.forIn(line); line = transform.forInArr(line); // For key,val in object line = transform.forKeyVal(line); // Function shorthand, func, or func foo line = transform.func(line); // Private block line = transform.privateBlock(line); // Transform require calls to CommonJS if (options.moduleType === 'commonjs') { line = transform.cjsRequire(line); } else if (options.moduleType === 'requirejs') { // TODO implement requirejs transform } // ------------------ refactor below into transform.js --------------- // Matches an @foo or @. or @ var atSymbol = /@(?=[\w$])|@\.|@/g /** * Matches `when` OR `when` and `then`. * @type {RegExp} See function for more info */ , switchWhenThen = /(when)\s(.+)(then)(.+)|(when)\s(.+)/ /** * Matches string interpolation inside double quotes * $1 captures left of `#{`, inc double quote * $3 captures interpolation inside of `#{ }` * $5 captures right of `}`, inc double quote * @type {RegExp} */ , strInt = /(".*)(#\{)([^\{\}]+)(\})(.*")/ /** * Matches an anonymous function 'block' * $0 examp: `on(foo, do |x,y|` * $1 `on(foo, ` * $2 `x,y` * @type {RegExp} */ , anonBlock = /(\(.*)\bdo\b(?:\s\|([\w_$$,\s]*)\|)?/ /** * Matches a RedScript object literal declaration * $0 `object foo inherits bar` * $1 `foo` * $2 `bar` */ , objLit = /object ([\$\w]+)(?: inherits ([\$\w]+))?/ /** * Matches a `def` inside of an object literal * $0 `def foo(p1) * $1 `foo` * $2 `(p1)` */ , objLitDef = /\bdef\b ([\$\w]+)(\([\$\w, ]*\))?/ /** * Matches `def foo.bar` methods * $0 matches `def foo.bar(p1)` * $1 matches `foo.bar` * $2 matches `(p1)` */ , dotDef = /\bdef\b ([\$\w]+\.[\$\w]+)(\([\$\w, ]*\))?/ /** * Matches `def` methods attached to prototype * $0 `def foo >> bar(p1) * $1 `foo` * $2 `bar` * $3 `(p1)` */ , protoDef = /\bdef\b ([\$\w]+) >> ([\$\w]+)(\([\$\w, ]*\))?/; /** * Alias `do` with `{` * fakes negative lookbehind for { or word char, this * prevents aliasing a properly formated do loop * @return {string} returns `}` if lookbehind is false */ /* *line = line.replace(/(\w)?do(?! \{|\{|\w)/g, function($0, $1) { * return $1 ? $0 : '{'; *}); */ /** * Alias `end-` with `end);` or `});` */ line = line.replace(/\bend\b-/g, '});'); /** * Alias `end` with `}` * fakes a negative lookbehind for a word char * @return {string} returns `}` if lookbehind is false */ line = line.replace(/(\w)?end(?!\w)/g, function($0, $1) { return $1 ? $0 : '}'; }); /** * Find any instance of @ and replace it with the * appropriate this. */ line = line.replace(atSymbol, function(match) { // if line contains @foo, @_foo or @$foo if (/@(?=[\w$])/.test(line)) return 'this.'; // else if matches @.foo, @._foo or @.$foo else if (match === '@.') return "this."; else return "this"; }); /** * Alias puts with console.log * if it's bracketless, insert bracket and close at EOL */ line = line.replace(/puts\(/, "console.log("); // if bracketless puts, replace puts & append ); if (/puts /.test(line)) { line = line.replace(/puts /, "console.log(") + ");"; } /** * Alias printf with process.stdout.write * if it's bracketless, insert bracket and close EOL */ line = line.replace(/printf\(/, "process.stdout.write("); // if bracketless puts, replace puts & append ); if (/printf /.test(line)) { line = line.replace(/printf /, "process.stdout.write(") + ");"; } /** * Inserts brackets into switch statement * @param {string} $0 Entire match * @param {string} $1 Matches switch * @param {string} $2 Matches expression * @return {string} Processed switch line */ line = line.replace(/(switch) (.+)/, function($0, $1, $2) { return $1 + " (" + $2 + ") {"; }); /** * Replaces when with case. If then is found a one line * statement is assumed. This currently inserts a semicolon to prevent * errors with appended break. * @param {string} $0 Entire match * @param {string} $1 Matches `when` * @param {string} $2 Label * @param {string} $3 Matches `then` * @param {string} $4 clause (after then) * OR * @param {string} $5 Matches `when` * @param {string} $6 Label * @return {string} Processed when line */ line = line.replace(switchWhenThen, function($0, $1 ,$2 ,$3 ,$4 ,$5 ,$6) { // has `when` and `then` one liner if ($1 && $3) { return "case " + $2 + ":" + $4 + ' ; break;'; // line just has `when` } else if ($5) { return "case " + $6 + ":"; } }); /** * Replaces default with default: in a switch statement */ line = line.replace(/\bdefault\b(?!\:)/, function($0, $1) { // if entire line is just default if (line.trim() === 'default') return 'default:'; // else it's prob something else like `def default` else return $0; }); /** * Replaces an `elsif` with `} else if () {` * @param {string} $0 Entire match * @param {string} $1 Matches `condition` */ line = line.replace(/elsif (?!\s*\()(.+)/, function($0, $1) { // if `else if` is inside a string, bail out if (insideString("elsif", line)) return $0; return '} else if (' + $1 + ') {'; }); /** * Replaces an `else if` with `} else if () {` * @param {string} $0 Entire match * @param {string} $1 Matches `condition` */ line = line.replace(/else if (?!\s*\()(.+)/, function($0, $1) { // if `else if` is inside a string, bail out if (insideString("else if", line)) return $0; return '} else if (' + $1 + ') {'; }); /** * Replaces an `else` with `} else {` * @param {string} $0 Entire match */ line = line.replace(/else(?!(?:\s*\{)| if)/, function($0) { // if `else` is inside a string, bail out if (insideString("else", line)) return $0; return '} else {'; }); /** * Replaces an `if condition` with `if (condition) {` * @param {string} $0 Entire match * @param {string} $1 Matches `condition` */ line = line.replace(/if (?!\s*\()(.+)/, function($0, $1) { // if `if` is inside a string, bail out if (insideString("if", line)) return $0; return 'if (' + $1 + ') {'; }); /** * Replaces text inside string interpolation brackets `#{ }` * @return {string} transformed string */ line = line.replace(strInt, function($0, $1 ,$2 ,$3 ,$4 ,$5) { var left = $1 // left of `#{`, inc double quote , right = $5 // right of `}`, inc double quote , middle = $3; // inside of `#{ }` // if middle contains scary chars like +*-% etc, wrap in parens if (/[^\w\s$$]/.test(middle)) { middle = '(' + middle + ')'; } // if interp is to the far left/right, don't add extra quotes if (left === '"') return middle + ' + "' + right; if (right === '"') return left + '" + ' + middle; return left + '" + ' + middle + ' + "' + right; }); /** * Replaces an anonymous function block * Matches an anonymous function 'block' * $0 examp: `on(foo, do |x,y|` * $1 `on(foo, ` * $2 `x,y` * @return {string} transformed funciton */ line = line.replace(anonBlock, function($0, $1, $2) { var $1tr = $1.trimRight(); var insertComma = /\(.*[^,]$/.test($1tr); // if line has params, insert them if ($2) { // if comma wasn't inserted between block and params if ( insertComma ) { return $1 + ', ' + 'function(' + $2 + ') {'; } return $1 + 'function(' + $2 + ') {'; // else no params } else { // if comma wasn't inserted between block and params if ( insertComma ) { return $1 + ', ' + 'function() {'; } return $1 + 'function() {'; } }); line = transform.objLiteral(line); /** * Replaces `def foo.bar` methods with vanilla methods * $0 matches `def foo.bar(p1)` * $1 matches `foo.bar` * $2 matches `(p1)` */ line = line.replace(dotDef, function($0, $1, $2) { if (insideString("def", line)) return $0; // if def declaration has parens if ($2) return $1 + ' = function' + $2 + ' {'; else return $1 + ' = function() {'; }); /** * Replaces `def foo >> bar` methods with vanilla methods * $0 matches `def foo >> bar(p1)` * $1 matches `foo` * $2 matches `bar` * $3 matches `(p1) */ line = line.replace(protoDef, function($0, $1, $2, $3) { if (insideString("def", line)) return $0; // if def declaration has parens if ($3) return $1 + '.prototype.' + $2 + ' = function' + $3 + ' {'; else return $1 + '.prototype.' + $2 + ' = function() {'; }); /** * Replaces `def` methods with vanilla methods inside * of an object literal. * $0 matches `def foo(p1)` * $1 matches `foo` * $2 matches `(p1)` */ line = line.replace(objLitDef, function($0, $1, $2) { if (insideString("def", line)) return $0; // if def declaration has parens if ($2) return $1 + ': ' + 'function' + $2 + ' {'; else return $1 + ': ' + 'function() {'; }); /** * Conditional assignment operator * $0 matches `foo =|| bar` * $1 matches `foo` * $2 matches `bar` * @return {String} transformed line */ var condAssignment = /([\w\$]+)\s*\|\|=\s*(.+)/; line = line.replace(condAssignment, function($0, $1, $2) { //if (insideString("||=", line)) return $0; return $1 + ' = ' + $1 + ' || ' + $2; }); // Transform `parent*` to `__proto__` line = transform.parentProperty(line); if (debug) console.log(index + " " + line); return line; }); // add classical inheritence methods to the top of the file // if we used a class & insertion isn't disabled with flag if (options.classInsertion === true && state.hasClass === true) { var classLine = '(function(){var e=false,t=/xyz/.test(function(){xyz})?/\\b_super\\b/:/.*/;this.Class=function(){};Class.extend=function(n){function o(){if(!e&&this.init)this.init.apply(this,arguments)}var r=this.prototype;e=true;var i=new this;e=false;for(var s in n){i[s]=typeof n[s]=="function"&&typeof r[s]=="function"&&t.test(n[s])?function(e,t){return function(){var n=this._super;this._super=r[e];var i=t.apply(this,arguments);this._super=n;return i}}(s,n[s]):n[s]}o.prototype=i;o.prototype.constructor=o;o.extend=arguments.callee;return o}})()'; lines.unshift(classLine); } return lines.join('\n'); }; /** * #lastChar - Finds the last character in a string. * @return {string} - char */ String.prototype.lastChar = function(){ return this[this.length - 1]; }; /** * Checks to see if keyword is used inside a string * @param {string} match keyword to match * @param {string} ln line to match against * @return {bool} true if match is found */ function insideString(match, ln) { var regex = "['\"][\\w\\s]*[^\\w]" + match + "[^\\w][\\w\\s]*['\"]"; var insideStr = new RegExp(regex, "g"); return insideStr.test(ln); }
lib/compile.js
/** * RedScript compiler * Copyright(c) 2013 Adam Brodzinski <[email protected]> * MIT Licensed */ var transform = require('./transform'); /** Export compile function * Takes a multi line string and splits each line into array lines. * Each line is processed and transformed if it matches the criteria. * Final array of strings are joined and returned. * @param {string} file * @return {string} * @api public */ module.exports = function(file) { var lines = file.split('\n') , debug = false , declaredVars = []; // reset state object for each file process.emit('state:reset'); // Iterate through each line and transform text lines = lines.map(function(line, index) { // normalize # comments to // line = transform.comments(line); // if line begins with a comment, return if (/^\/\//.test(line.trimLeft())) return line; // insert var keyword where needed (currently buggy) line = transform.insertVars(line, declaredVars); // setup 'class' constructors and inherit if necessary line = transform.classes(line); // transform super call from a class method line = transform.callSuper(line); // transform a while loop line = transform.whileLoop(line); // until loop with comment line = transform.untilLoop(line); // for loop with range e.g. `0..20` line = transform.forLoopRange(line); // Bracketless for in statement line = transform.forIn(line); line = transform.forInArr(line); // For key,val in object line = transform.forKeyVal(line); // Function shorthand, func, or func foo line = transform.func(line); // Private block line = transform.privateBlock(line); // Transform require calls to CommonJS if (options.moduleType === 'commonjs') { line = transform.cjsRequire(line); } else if (options.moduleType === 'requirejs') { // TODO implement requirejs transform } // ------------------ refactor below into transform.js --------------- // Matches an @foo or @. or @ var atSymbol = /@(?=[\w$])|@\.|@/g /** * Matches `when` OR `when` and `then`. * @type {RegExp} See function for more info */ , switchWhenThen = /(when)\s(.+)(then)(.+)|(when)\s(.+)/ /** * Matches string interpolation inside double quotes * $1 captures left of `#{`, inc double quote * $3 captures interpolation inside of `#{ }` * $5 captures right of `}`, inc double quote * @type {RegExp} */ , strInt = /(".*)(#\{)([^\{\}]+)(\})(.*")/ /** * Matches an anonymous function 'block' * $0 examp: `on(foo, do |x,y|` * $1 `on(foo, ` * $2 `x,y` * @type {RegExp} */ , anonBlock = /(\(.*)\bdo\b(?:\s\|([\w_$$,\s]*)\|)?/ /** * Matches a RedScript object literal declaration * $0 `object foo inherits bar` * $1 `foo` * $2 `bar` */ , objLit = /object ([\$\w]+)(?: inherits ([\$\w]+))?/ /** * Matches a `def` inside of an object literal * $0 `def foo(p1) * $1 `foo` * $2 `(p1)` */ , objLitDef = /\bdef\b ([\$\w]+)(\([\$\w, ]*\))?/ /** * Matches `def foo.bar` methods * $0 matches `def foo.bar(p1)` * $1 matches `foo.bar` * $2 matches `(p1)` */ , dotDef = /\bdef\b ([\$\w]+\.[\$\w]+)(\([\$\w, ]*\))?/ /** * Matches `def` methods attached to prototype * $0 `def foo >> bar(p1) * $1 `foo` * $2 `bar` * $3 `(p1)` */ , protoDef = /\bdef\b ([\$\w]+) >> ([\$\w]+)(\([\$\w, ]*\))?/; /** * Alias `do` with `{` * fakes negative lookbehind for { or word char, this * prevents aliasing a properly formated do loop * @return {string} returns `}` if lookbehind is false */ /* *line = line.replace(/(\w)?do(?! \{|\{|\w)/g, function($0, $1) { * return $1 ? $0 : '{'; *}); */ /** * Alias `end-` with `end);` or `});` */ line = line.replace(/\bend\b-/g, '});'); /** * Alias `end` with `}` * fakes a negative lookbehind for a word char * @return {string} returns `}` if lookbehind is false */ line = line.replace(/(\w)?end(?!\w)/g, function($0, $1) { return $1 ? $0 : '}'; }); /** * Find any instance of @ and replace it with the * appropriate this. */ line = line.replace(atSymbol, function(match) { // if line contains @foo, @_foo or @$foo if (/@(?=[\w$])/.test(line)) return 'this.'; // else if matches @.foo, @._foo or @.$foo else if (match === '@.') return "this."; else return "this"; }); /** * Alias puts with console.log * if it's bracketless, insert bracket and close at EOL */ line = line.replace(/puts\(/, "console.log("); // if bracketless puts, replace puts & append ); if (/puts /.test(line)) { line = line.replace(/puts /, "console.log(") + ");"; } /** * Alias printf with process.stdout.write * if it's bracketless, insert bracket and close EOL */ line = line.replace(/printf\(/, "process.stdout.write("); // if bracketless puts, replace puts & append ); if (/printf /.test(line)) { line = line.replace(/printf /, "process.stdout.write(") + ");"; } /** * Inserts brackets into switch statement * @param {string} $0 Entire match * @param {string} $1 Matches switch * @param {string} $2 Matches expression * @return {string} Processed switch line */ line = line.replace(/(switch) (.+)/, function($0, $1, $2) { return $1 + " (" + $2 + ") {"; }); /** * Replaces when with case. If then is found a one line * statement is assumed. This currently inserts a semicolon to prevent * errors with appended break. * @param {string} $0 Entire match * @param {string} $1 Matches `when` * @param {string} $2 Label * @param {string} $3 Matches `then` * @param {string} $4 clause (after then) * OR * @param {string} $5 Matches `when` * @param {string} $6 Label * @return {string} Processed when line */ line = line.replace(switchWhenThen, function($0, $1 ,$2 ,$3 ,$4 ,$5 ,$6) { // has `when` and `then` one liner if ($1 && $3) { return "case " + $2 + ":" + $4 + ' ; break;'; // line just has `when` } else if ($5) { return "case " + $6 + ":"; } }); /** * Replaces default with default: in a switch statement */ line = line.replace(/\bdefault\b(?!\:)/, function($0, $1) { // if entire line is just default if (line.trim() === 'default') return 'default:'; // else it's prob something else like `def default` else return $0; }); /** * Replaces an `else if` with `} else if () {` * @param {string} $0 Entire match * @param {string} $1 Matches `condition` */ line = line.replace(/else if (?!\s*\()(.+)/, function($0, $1) { // if `else if` is inside a string, bail out if (insideString("else if", line)) return $0; return '} else if (' + $1 + ') {'; }); /** * Replaces an `else` with `} else {` * @param {string} $0 Entire match */ line = line.replace(/else(?!(?:\s*\{)| if)/, function($0) { // if `else` is inside a string, bail out if (insideString("else", line)) return $0; return '} else {'; }); /** * Replaces an `if condition` with `if (condition) {` * @param {string} $0 Entire match * @param {string} $1 Matches `condition` */ line = line.replace(/if (?!\s*\()(.+)/, function($0, $1) { // if `if` is inside a string, bail out if (insideString("if", line)) return $0; return 'if (' + $1 + ') {'; }); /** * Replaces text inside string interpolation brackets `#{ }` * @return {string} transformed string */ line = line.replace(strInt, function($0, $1 ,$2 ,$3 ,$4 ,$5) { var left = $1 // left of `#{`, inc double quote , right = $5 // right of `}`, inc double quote , middle = $3; // inside of `#{ }` // if middle contains scary chars like +*-% etc, wrap in parens if (/[^\w\s$$]/.test(middle)) { middle = '(' + middle + ')'; } // if interp is to the far left/right, don't add extra quotes if (left === '"') return middle + ' + "' + right; if (right === '"') return left + '" + ' + middle; return left + '" + ' + middle + ' + "' + right; }); /** * Replaces an anonymous function block * Matches an anonymous function 'block' * $0 examp: `on(foo, do |x,y|` * $1 `on(foo, ` * $2 `x,y` * @return {string} transformed funciton */ line = line.replace(anonBlock, function($0, $1, $2) { var $1tr = $1.trimRight(); var insertComma = /\(.*[^,]$/.test($1tr); // if line has params, insert them if ($2) { // if comma wasn't inserted between block and params if ( insertComma ) { return $1 + ', ' + 'function(' + $2 + ') {'; } return $1 + 'function(' + $2 + ') {'; // else no params } else { // if comma wasn't inserted between block and params if ( insertComma ) { return $1 + ', ' + 'function() {'; } return $1 + 'function() {'; } }); line = transform.objLiteral(line); /** * Replaces `def foo.bar` methods with vanilla methods * $0 matches `def foo.bar(p1)` * $1 matches `foo.bar` * $2 matches `(p1)` */ line = line.replace(dotDef, function($0, $1, $2) { if (insideString("def", line)) return $0; // if def declaration has parens if ($2) return $1 + ' = function' + $2 + ' {'; else return $1 + ' = function() {'; }); /** * Replaces `def foo >> bar` methods with vanilla methods * $0 matches `def foo >> bar(p1)` * $1 matches `foo` * $2 matches `bar` * $3 matches `(p1) */ line = line.replace(protoDef, function($0, $1, $2, $3) { if (insideString("def", line)) return $0; // if def declaration has parens if ($3) return $1 + '.prototype.' + $2 + ' = function' + $3 + ' {'; else return $1 + '.prototype.' + $2 + ' = function() {'; }); /** * Replaces `def` methods with vanilla methods inside * of an object literal. * $0 matches `def foo(p1)` * $1 matches `foo` * $2 matches `(p1)` */ line = line.replace(objLitDef, function($0, $1, $2) { if (insideString("def", line)) return $0; // if def declaration has parens if ($2) return $1 + ': ' + 'function' + $2 + ' {'; else return $1 + ': ' + 'function() {'; }); /** * Conditional assignment operator * $0 matches `foo =|| bar` * $1 matches `foo` * $2 matches `bar` * @return {String} transformed line */ var condAssignment = /([\w\$]+)\s*\|\|=\s*(.+)/; line = line.replace(condAssignment, function($0, $1, $2) { //if (insideString("||=", line)) return $0; return $1 + ' = ' + $1 + ' || ' + $2; }); // Transform `parent*` to `__proto__` line = transform.parentProperty(line); if (debug) console.log(index + " " + line); return line; }); // add classical inheritence methods to the top of the file // if we used a class & insertion isn't disabled with flag if (options.classInsertion === true && state.hasClass === true) { var classLine = '(function(){var e=false,t=/xyz/.test(function(){xyz})?/\\b_super\\b/:/.*/;this.Class=function(){};Class.extend=function(n){function o(){if(!e&&this.init)this.init.apply(this,arguments)}var r=this.prototype;e=true;var i=new this;e=false;for(var s in n){i[s]=typeof n[s]=="function"&&typeof r[s]=="function"&&t.test(n[s])?function(e,t){return function(){var n=this._super;this._super=r[e];var i=t.apply(this,arguments);this._super=n;return i}}(s,n[s]):n[s]}o.prototype=i;o.prototype.constructor=o;o.extend=arguments.callee;return o}})()'; lines.unshift(classLine); } return lines.join('\n'); }; /** * #lastChar - Finds the last character in a string. * @return {string} - char */ String.prototype.lastChar = function(){ return this[this.length - 1]; }; /** * Checks to see if keyword is used inside a string * @param {string} match keyword to match * @param {string} ln line to match against * @return {bool} true if match is found */ function insideString(match, ln) { var regex = "['\"][\\w\\s]*[^\\w]" + match + "[^\\w][\\w\\s]*['\"]"; var insideStr = new RegExp(regex, "g"); return insideStr.test(ln); }
Adds support for elsif statements
lib/compile.js
Adds support for elsif statements
<ide><path>ib/compile.js <ide> if (line.trim() === 'default') return 'default:'; <ide> // else it's prob something else like `def default` <ide> else return $0; <add> }); <add> <add> <add> /** <add> * Replaces an `elsif` with `} else if () {` <add> * @param {string} $0 Entire match <add> * @param {string} $1 Matches `condition` <add> */ <add> line = line.replace(/elsif (?!\s*\()(.+)/, function($0, $1) { <add> // if `else if` is inside a string, bail out <add> if (insideString("elsif", line)) return $0; <add> return '} else if (' + $1 + ') {'; <ide> }); <ide> <ide>
JavaScript
mit
7524017d76c79da78d05b8b4fac5c2609d4ac555
0
Rishabh570/flickrphotofeed,Rishabh570/flickrphotofeed
var processing = false; // JavaScript source code $(document).ready(function () { $('form').submit(function (evt) { evt.preventDefault(); var searchTerm = $('#input').val(); // AJAX Starts var flickrAPI = "https://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?"; var animal = searchTerm; var flickrOptions = { tags: animal, format: "json", }; function displayPhotos(data) { var photoHTML = '<ul>'; $.each(data.items, function(i,photo) { photoHTML += '<li class="grid">'; photoHTML += '<a href="' + photo.link + '" class="image">'; photoHTML += '<img src="' + photo.media.m + '"></a></li>'; }); photoHTML += '</ul>'; $('#photos').html(photoHTML); } $.getJSON(flickrAPI, flickrOptions, displayPhotos); }) //end submit // Fire AJAX every time page reaches 70% of height ########################################## $(document).scroll(function(e){ var searchTerm = $('#input').val(); var flickrAPI = "https://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?"; var animal = searchTerm; var flickrOptions = { tags: animal, format: "json", }; if (processing) { return false; } if ( $(document).scrollTop() >= ($(document).height() - $(window).height())*0.7) { console.log('reached'); processing = true; // AJAX Starts function displayPhotos(data) { var photoHTML = '<ul>'; $.each(data.items, function(i,photo) { photoHTML += '<li class="grid">'; photoHTML += '<a href="' + photo.link + '" class="image">'; photoHTML += '<img src="' + photo.media.m + '"></a></li>'; }); photoHTML += '</ul>'; $('#photos').html(photoHTML); } $.getJSON(flickrAPI, flickrOptions, displayPhotos); processing = false; } }); //############################################################################################ }); // end ready
js/scripts.js
var processing = false; // JavaScript source code $(document).ready(function () { $('form').submit(function (evt) { evt.preventDefault(); var searchTerm = $('#input').val(); // AJAX Starts var flickrAPI = "https://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?"; var animal = searchTerm; var flickrOptions = { tags: animal, format: "json", }; function displayPhotos(data) { var photoHTML = '<ul>'; $.each(data.items, function(i,photo) { photoHTML += '<li class="grid">'; photoHTML += '<a href="' + photo.link + '" class="image">'; photoHTML += '<img src="' + photo.media.m + '"></a></li>'; }); photoHTML += '</ul>'; $('#photos').html(photoHTML); } $.getJSON(flickrAPI, flickrOptions, displayPhotos); }) //end submit // Fire AJAX every time page reaches 70% of height ########################################## $(document).scroll(function(e){ var searchTerm = $('#input').val(); var flickrAPI = "https://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?"; var animal = searchTerm; var flickrOptions = { tags: animal, format: "json", }; if (processing) { return false; } if ( $(document).scrollTop() >= ($(document).height() - $(window).height())*0.7) { console.log('reached'); processing = true; // AJAX Starts function displayPhotos(data) { var photoHTML = '<ul>'; $.each(data.items, function(i,photo) { photoHTML += '<li class="grid">'; photoHTML += '<a href="' + photo.link + '" class="image">'; photoHTML += '<img src="' + photo.media.m + '"></a></li>'; }); photoHTML += '</ul>'; $('#photos').html(photoHTML); } $.getJSON(flickrAPI, flickrOptions, displayPhotos); processing = false; } }); //############################################################################################ }); // end ready
Update scripts.js to include AJAX refresh.
js/scripts.js
Update scripts.js to include AJAX refresh.
<ide><path>s/scripts.js <ide> <ide> }) //end submit <ide> <del> <ide> // Fire AJAX every time page reaches 70% of height ########################################## <ide> $(document).scroll(function(e){ <ide> var searchTerm = $('#input').val(); <ide> if (processing) { <ide> return false; <ide> } <add> <ide> if ( $(document).scrollTop() >= ($(document).height() - $(window).height())*0.7) { <ide> console.log('reached'); <ide> processing = true; <ide> processing = false; <ide> } <ide> }); <del> <ide> //############################################################################################ <ide> }); // end ready
Java
mit
8b51b2d7f24d8f03de0d0c9e8bf1bf9802eb786d
0
archansel/TimeSense
package com.gwk.timesense.rule; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import static org.junit.Assert.*; /*** * Unit test for TSRule class. * * @author Anselmus KA Kurniawan * @version 0.1 */ public class TSRuleUnitTest { private Date now; private Calendar calendar; private static SimpleDateFormat formatter = new SimpleDateFormat("dd MMM yyyy HH:mm:ss"); private static void assertEqualDates(Date date1, Date date2) { String d1 = formatter.format(date1); String d2 = formatter.format(date2); assertTrue("Dates should be equal", d1.equals(d2)); } private static void assertNotEqualDates(Date date1, Date date2) { String d1 = formatter.format(date1); String d2 = formatter.format(date2); assertFalse("Dates should not be equal", d1.equals(d2)); } @Before public void setUp() throws Exception { this.now = new Date(); this.calendar = Calendar.getInstance(); this.calendar.setTime(this.now); this.calendar.set(Calendar.HOUR_OF_DAY, 0); this.calendar.set(Calendar.MINUTE, 0); this.calendar.set(Calendar.SECOND, 0); } @After public void tearDown() throws Exception { this.now = null; this.calendar = null; assertNull(this.now); assertNull(this.calendar); } @Test public void constructor() throws Exception { String name = "RULE_NAME"; Date start = new Date(); this.calendar.setTime(start); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date end = this.calendar.getTime(); TSRule rule = new TSRule(name, start, end); assertEquals("Name should be equal", name, rule.getName()); assertEqualDates(start, rule.getStartTime()); assertEqualDates(end, rule.getEndTime()); } @Test public void morning() throws Exception { this.calendar.set(Calendar.HOUR_OF_DAY, 4); Date start = this.calendar.getTime(); this.calendar.set(Calendar.HOUR_OF_DAY, 11); Date end = this.calendar.getTime(); TSRule rule = TSRule.morning(); assertEquals("Name should be equal", TSRule.TS_RULE_NAME_MORNING, rule.getName()); assertEqualDates(start, rule.getStartTime()); assertEqualDates(end, rule.getEndTime()); } @Test public void afternoon() throws Exception { this.calendar.set(Calendar.HOUR_OF_DAY, 11); Date start = this.calendar.getTime(); this.calendar.set(Calendar.HOUR_OF_DAY, 17); Date end = this.calendar.getTime(); TSRule rule = TSRule.afternoon(); assertEquals("Name should be equal", TSRule.TS_RULE_NAME_AFTERNOON, rule.getName()); assertEqualDates(start, rule.getStartTime()); assertEqualDates(end, rule.getEndTime()); } @Test public void evening() throws Exception { this.calendar.set(Calendar.HOUR_OF_DAY, 17); Date start = this.calendar.getTime(); this.calendar.set(Calendar.HOUR_OF_DAY, 21); Date end = this.calendar.getTime(); TSRule rule = TSRule.evening(); assertEquals("Name should be equal", TSRule.TS_RULE_NAME_EVENING, rule.getName()); assertEqualDates(start, rule.getStartTime()); assertEqualDates(end, rule.getEndTime()); } @Test public void night() throws Exception { this.calendar.set(Calendar.HOUR_OF_DAY, 21); Date start = this.calendar.getTime(); this.calendar.set(Calendar.HOUR_OF_DAY, 4); Date end = this.calendar.getTime(); TSRule rule = TSRule.night(); assertEquals("Name should be equal", TSRule.TS_RULE_NAME_NIGHT, rule.getName()); assertEqualDates(start, rule.getStartTime()); assertEqualDates(end, rule.getEndTime()); } @Test public void getName() throws Exception { String name = "RULE_NAME"; Date start = new Date(); this.calendar.setTime(start); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date end = this.calendar.getTime(); TSRule rule = new TSRule(name, start, end); assertEquals("Name should be equal", name, rule.getName()); } @Test public void setName() throws Exception { String name = "RULE_NAME"; Date start = new Date(); this.calendar.setTime(start); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date end = this.calendar.getTime(); TSRule rule = new TSRule(name, start, end); String newName = "NAME"; rule.setName(newName); assertEquals("Name should be equal", newName, rule.getName()); } @Test public void getStartTime() throws Exception { String name = "RULE_NAME"; Date start = new Date(); this.calendar.setTime(start); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date end = this.calendar.getTime(); TSRule rule = new TSRule(name, start, end); assertEqualDates(start, rule.getStartTime()); } @Test public void setStartTime() throws Exception { String name = "RULE_NAME"; Date start = new Date(); this.calendar.setTime(start); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date end = this.calendar.getTime(); TSRule rule = new TSRule(name, start, end); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date newDate = this.calendar.getTime(); rule.setStartTime(newDate); assertEqualDates(newDate, rule.getStartTime()); } @Test public void getEndTime() throws Exception { String name = "RULE_NAME"; Date start = new Date(); this.calendar.setTime(start); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date end = this.calendar.getTime(); TSRule rule = new TSRule(name, start, end); assertEqualDates(end, rule.getEndTime()); } @Test public void setEndTime() throws Exception { String name = "RULE_NAME"; Date start = new Date(); this.calendar.setTime(start); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date end = this.calendar.getTime(); TSRule rule = new TSRule(name, start, end); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date newDate = this.calendar.getTime(); rule.setEndTime(newDate); assertEqualDates(newDate, rule.getEndTime()); } @Test public void equals() throws Exception { TSRule morning = TSRule.morning(); TSRule night = TSRule.night(); assertTrue("Rules should be equal", morning.equals(morning)); assertFalse("Rules should not be equal", morning.equals(night)); } }
TimeSenseExample/timesense/src/test/java/com/gwk/timesense/rule/TSRuleUnitTest.java
package com.gwk.timesense.rule; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import static org.junit.Assert.*; /*** * Unit test for TSRule class. * * @author Anselmus KA Kurniawan * @version 0.1 */ public class TSRuleUnitTest { private Date now; private Calendar calendar; private static SimpleDateFormat formatter = new SimpleDateFormat("dd MMM yyyy HH:mm:ss"); private static boolean assertEqualDates(Date date1, Date date2) { String d1 = formatter.format(date1); String d2 = formatter.format(date2); return d1.equals(d2); } private static boolean assertNotEqualDates(Date date1, Date date2) { String d1 = formatter.format(date1); String d2 = formatter.format(date2); return !d1.equals(d2); } @Before public void setUp() throws Exception { this.now = new Date(); this.calendar = Calendar.getInstance(); this.calendar.setTime(this.now); this.calendar.set(Calendar.HOUR_OF_DAY, 0); this.calendar.set(Calendar.MINUTE, 0); this.calendar.set(Calendar.SECOND, 0); } @After public void tearDown() throws Exception { this.now = null; this.calendar = null; assertNull(this.now); assertNull(this.calendar); } @Test public void constructor() throws Exception { String name = "RULE_NAME"; Date start = new Date(); this.calendar.setTime(start); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date end = this.calendar.getTime(); TSRule rule = new TSRule(name, start, end); assertEquals(name, rule.getName()); assertEqualDates(start, rule.getStartTime()); assertEqualDates(end, rule.getEndTime()); } @Test public void morning() throws Exception { this.calendar.set(Calendar.HOUR_OF_DAY, 4); Date start = this.calendar.getTime(); this.calendar.set(Calendar.HOUR_OF_DAY, 11); Date end = this.calendar.getTime(); TSRule rule = TSRule.morning(); assertEquals(TSRule.TS_RULE_NAME_MORNING, rule.getName()); assertEqualDates(start, rule.getStartTime()); assertEqualDates(end, rule.getEndTime()); } @Test public void afternoon() throws Exception { this.calendar.set(Calendar.HOUR_OF_DAY, 11); Date start = this.calendar.getTime(); this.calendar.set(Calendar.HOUR_OF_DAY, 17); Date end = this.calendar.getTime(); TSRule rule = TSRule.afternoon(); assertEquals(TSRule.TS_RULE_NAME_AFTERNOON, rule.getName()); assertEqualDates(start, rule.getStartTime()); assertEqualDates(end, rule.getEndTime()); } @Test public void evening() throws Exception { this.calendar.set(Calendar.HOUR_OF_DAY, 17); Date start = this.calendar.getTime(); this.calendar.set(Calendar.HOUR_OF_DAY, 21); Date end = this.calendar.getTime(); TSRule rule = TSRule.evening(); assertEquals(TSRule.TS_RULE_NAME_EVENING, rule.getName()); assertEqualDates(start, rule.getStartTime()); assertEqualDates(end, rule.getEndTime()); } @Test public void night() throws Exception { this.calendar.set(Calendar.HOUR_OF_DAY, 21); Date start = this.calendar.getTime(); this.calendar.set(Calendar.HOUR_OF_DAY, 4); Date end = this.calendar.getTime(); TSRule rule = TSRule.night(); assertEquals(TSRule.TS_RULE_NAME_NIGHT, rule.getName()); assertEqualDates(start, rule.getStartTime()); assertEqualDates(end, rule.getEndTime()); } @Test public void getName() throws Exception { String name = "RULE_NAME"; Date start = new Date(); this.calendar.setTime(start); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date end = this.calendar.getTime(); TSRule rule = new TSRule(name, start, end); assertEquals(name, rule.getName()); } @Test public void setName() throws Exception { String name = "RULE_NAME"; Date start = new Date(); this.calendar.setTime(start); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date end = this.calendar.getTime(); TSRule rule = new TSRule(name, start, end); String newName = "NAME"; rule.setName(newName); assertEquals(newName, rule.getName()); } @Test public void getStartTime() throws Exception { String name = "RULE_NAME"; Date start = new Date(); this.calendar.setTime(start); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date end = this.calendar.getTime(); TSRule rule = new TSRule(name, start, end); assertEqualDates(start, rule.getStartTime()); } @Test public void setStartTime() throws Exception { String name = "RULE_NAME"; Date start = new Date(); this.calendar.setTime(start); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date end = this.calendar.getTime(); TSRule rule = new TSRule(name, start, end); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date newDate = this.calendar.getTime(); rule.setStartTime(newDate); assertEqualDates(newDate, rule.getStartTime()); } @Test public void getEndTime() throws Exception { String name = "RULE_NAME"; Date start = new Date(); this.calendar.setTime(start); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date end = this.calendar.getTime(); TSRule rule = new TSRule(name, start, end); assertEqualDates(end, rule.getEndTime()); } @Test public void setEndTime() throws Exception { String name = "RULE_NAME"; Date start = new Date(); this.calendar.setTime(start); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date end = this.calendar.getTime(); TSRule rule = new TSRule(name, start, end); this.calendar.add(Calendar.HOUR_OF_DAY, 1); Date newDate = this.calendar.getTime(); rule.setEndTime(newDate); assertEqualDates(newDate, rule.getEndTime()); } @Test public void equals() throws Exception { TSRule morning = TSRule.morning(); TSRule night = TSRule.night(); assertTrue(morning.equals(morning)); assertFalse(morning.equals(night)); } }
Update TSRule unit test, add test message
TimeSenseExample/timesense/src/test/java/com/gwk/timesense/rule/TSRuleUnitTest.java
Update TSRule unit test, add test message
<ide><path>imeSenseExample/timesense/src/test/java/com/gwk/timesense/rule/TSRuleUnitTest.java <ide> private Calendar calendar; <ide> <ide> private static SimpleDateFormat formatter = new SimpleDateFormat("dd MMM yyyy HH:mm:ss"); <del> private static boolean assertEqualDates(Date date1, Date date2) { <add> private static void assertEqualDates(Date date1, Date date2) { <ide> String d1 = formatter.format(date1); <ide> String d2 = formatter.format(date2); <del> return d1.equals(d2); <del> } <del> private static boolean assertNotEqualDates(Date date1, Date date2) { <add> assertTrue("Dates should be equal", d1.equals(d2)); <add> } <add> private static void assertNotEqualDates(Date date1, Date date2) { <ide> String d1 = formatter.format(date1); <ide> String d2 = formatter.format(date2); <del> return !d1.equals(d2); <add> assertFalse("Dates should not be equal", d1.equals(d2)); <ide> } <ide> <ide> @Before <ide> <ide> TSRule rule = new TSRule(name, start, end); <ide> <del> assertEquals(name, rule.getName()); <add> assertEquals("Name should be equal", name, rule.getName()); <ide> assertEqualDates(start, rule.getStartTime()); <ide> assertEqualDates(end, rule.getEndTime()); <ide> } <ide> <ide> TSRule rule = TSRule.morning(); <ide> <del> assertEquals(TSRule.TS_RULE_NAME_MORNING, rule.getName()); <add> assertEquals("Name should be equal", TSRule.TS_RULE_NAME_MORNING, rule.getName()); <ide> assertEqualDates(start, rule.getStartTime()); <ide> assertEqualDates(end, rule.getEndTime()); <ide> } <ide> <ide> TSRule rule = TSRule.afternoon(); <ide> <del> assertEquals(TSRule.TS_RULE_NAME_AFTERNOON, rule.getName()); <add> assertEquals("Name should be equal", TSRule.TS_RULE_NAME_AFTERNOON, rule.getName()); <ide> assertEqualDates(start, rule.getStartTime()); <ide> assertEqualDates(end, rule.getEndTime()); <ide> } <ide> <ide> TSRule rule = TSRule.evening(); <ide> <del> assertEquals(TSRule.TS_RULE_NAME_EVENING, rule.getName()); <add> assertEquals("Name should be equal", TSRule.TS_RULE_NAME_EVENING, rule.getName()); <ide> assertEqualDates(start, rule.getStartTime()); <ide> assertEqualDates(end, rule.getEndTime()); <ide> } <ide> <ide> TSRule rule = TSRule.night(); <ide> <del> assertEquals(TSRule.TS_RULE_NAME_NIGHT, rule.getName()); <add> assertEquals("Name should be equal", TSRule.TS_RULE_NAME_NIGHT, rule.getName()); <ide> assertEqualDates(start, rule.getStartTime()); <ide> assertEqualDates(end, rule.getEndTime()); <ide> } <ide> <ide> TSRule rule = new TSRule(name, start, end); <ide> <del> assertEquals(name, rule.getName()); <add> assertEquals("Name should be equal", name, rule.getName()); <ide> } <ide> <ide> @Test <ide> String newName = "NAME"; <ide> rule.setName(newName); <ide> <del> assertEquals(newName, rule.getName()); <add> assertEquals("Name should be equal", newName, rule.getName()); <ide> } <ide> <ide> @Test <ide> TSRule morning = TSRule.morning(); <ide> TSRule night = TSRule.night(); <ide> <del> assertTrue(morning.equals(morning)); <del> assertFalse(morning.equals(night)); <add> assertTrue("Rules should be equal", morning.equals(morning)); <add> assertFalse("Rules should not be equal", morning.equals(night)); <ide> } <ide> <ide> }
Java
mpl-2.0
604a003c184698aa5cea685d14719affa33f19b4
0
vinayvenu/openmrs-core,Negatu/openmrs-core,kckc/openmrs-core,chethandeshpande/openmrs-core,WANeves/openmrs-core,lbl52001/openmrs-core,alexwind26/openmrs-core,naraink/openmrs-core,michaelhofer/openmrs-core,maany/openmrs-core,nilusi/Legacy-UI,andyvand/OpenMRS,Bhamni/openmrs-core,prisamuel/openmrs-core,jamesfeshner/openmrs-module,sadhanvejella/openmrs,ldf92/openmrs-core,chethandeshpande/openmrs-core,kigsmtua/openmrs-core,sravanthi17/openmrs-core,macorrales/openmrs-core,asifur77/openmrs,jcantu1988/openmrs-core,jembi/openmrs-core,Negatu/openmrs-core,siddharthkhabia/openmrs-core,milankarunarathne/openmrs-core,Winbobob/openmrs-core,lbl52001/openmrs-core,AbhijitParate/openmrs-core,maekstr/openmrs-core,kabariyamilind/openMRSDEV,rbtracker/openmrs-core,shiangree/openmrs-core,lilo2k/openmrs-core,koskedk/openmrs-core,geoff-wasilwa/openmrs-core,Openmrs-joel/openmrs-core,maekstr/openmrs-core,kigsmtua/openmrs-core,milankarunarathne/openmrs-core,WANeves/openmrs-core,shiangree/openmrs-core,sintjuri/openmrs-core,kristopherschmidt/openmrs-core,kigsmtua/openmrs-core,siddharthkhabia/openmrs-core,dlahn/openmrs-core,sravanthi17/openmrs-core,macorrales/openmrs-core,maany/openmrs-core,kabariyamilind/openMRSDEV,donaldgavis/openmrs-core,MitchellBot/openmrs-core,MuhammadSafwan/Stop-Button-Ability,kigsmtua/openmrs-core,Winbobob/openmrs-core,hoquangtruong/TestMylyn,prisamuel/openmrs-core,jcantu1988/openmrs-core,Bhamni/openmrs-core,prisamuel/openmrs-core,trsorsimoII/openmrs-core,kckc/openmrs-core,aj-jaswanth/openmrs-core,jvena1/openmrs-core,nilusi/Legacy-UI,iLoop2/openmrs-core,pselle/openmrs-core,Negatu/openmrs-core,dlahn/openmrs-core,asifur77/openmrs,lilo2k/openmrs-core,chethandeshpande/openmrs-core,MuhammadSafwan/Stop-Button-Ability,MitchellBot/openmrs-core,jamesfeshner/openmrs-module,Winbobob/openmrs-core,michaelhofer/openmrs-core,aj-jaswanth/openmrs-core,maekstr/openmrs-core,kckc/openmrs-core,jvena1/openmrs-core,Winbobob/openmrs-core,iLoop2/openmrs-core,lilo2k/openmrs-core,nilusi/Legacy-UI,MuhammadSafwan/Stop-Button-Ability,iLoop2/openmrs-core,Bhamni/openmrs-core,iLoop2/openmrs-core,koskedk/openmrs-core,preethi29/openmrs-core,WANeves/openmrs-core,joansmith/openmrs-core,sravanthi17/openmrs-core,siddharthkhabia/openmrs-core,spereverziev/openmrs-core,alexei-grigoriev/openmrs-core,koskedk/openmrs-core,hoquangtruong/TestMylyn,hoquangtruong/TestMylyn,shiangree/openmrs-core,milankarunarathne/openmrs-core,donaldgavis/openmrs-core,sadhanvejella/openmrs,AbhijitParate/openmrs-core,jamesfeshner/openmrs-module,vinayvenu/openmrs-core,MuhammadSafwan/Stop-Button-Ability,jvena1/openmrs-core,kckc/openmrs-core,asifur77/openmrs,aboutdata/openmrs-core,sintjuri/openmrs-core,kabariyamilind/openMRSDEV,ern2/openmrs-core,WANeves/openmrs-core,Winbobob/openmrs-core,foolchan2556/openmrs-core,asifur77/openmrs,Winbobob/openmrs-core,Ch3ck/openmrs-core,jembi/openmrs-core,spereverziev/openmrs-core,andyvand/OpenMRS,Negatu/openmrs-core,maany/openmrs-core,andyvand/OpenMRS,Bhamni/openmrs-core,koskedk/openmrs-core,alexei-grigoriev/openmrs-core,michaelhofer/openmrs-core,donaldgavis/openmrs-core,rbtracker/openmrs-core,ldf92/openmrs-core,naraink/openmrs-core,nilusi/Legacy-UI,jamesfeshner/openmrs-module,jembi/openmrs-core,trsorsimoII/openmrs-core,jembi/openmrs-core,pselle/openmrs-core,milankarunarathne/openmrs-core,aboutdata/openmrs-core,lilo2k/openmrs-core,trsorsimoII/openmrs-core,shiangree/openmrs-core,andyvand/OpenMRS,Ch3ck/openmrs-core,kristopherschmidt/openmrs-core,alexei-grigoriev/openmrs-core,hoquangtruong/TestMylyn,lilo2k/openmrs-core,spereverziev/openmrs-core,ern2/openmrs-core,jvena1/openmrs-core,dlahn/openmrs-core,AbhijitParate/openmrs-core,dcmul/openmrs-core,rbtracker/openmrs-core,michaelhofer/openmrs-core,vinayvenu/openmrs-core,sintjuri/openmrs-core,andyvand/OpenMRS,alexei-grigoriev/openmrs-core,koskedk/openmrs-core,geoff-wasilwa/openmrs-core,MitchellBot/openmrs-core,AbhijitParate/openmrs-core,siddharthkhabia/openmrs-core,shiangree/openmrs-core,vinayvenu/openmrs-core,donaldgavis/openmrs-core,aj-jaswanth/openmrs-core,aj-jaswanth/openmrs-core,nilusi/Legacy-UI,prisamuel/openmrs-core,joansmith/openmrs-core,maekstr/openmrs-core,jcantu1988/openmrs-core,rbtracker/openmrs-core,maekstr/openmrs-core,dcmul/openmrs-core,andyvand/OpenMRS,ldf92/openmrs-core,Openmrs-joel/openmrs-core,vinayvenu/openmrs-core,MitchellBot/openmrs-core,maany/openmrs-core,ldf92/openmrs-core,milankarunarathne/openmrs-core,kabariyamilind/openMRSDEV,ern2/openmrs-core,sintjuri/openmrs-core,trsorsimoII/openmrs-core,ern2/openmrs-core,lbl52001/openmrs-core,Openmrs-joel/openmrs-core,chethandeshpande/openmrs-core,sadhanvejella/openmrs,preethi29/openmrs-core,jamesfeshner/openmrs-module,naraink/openmrs-core,jcantu1988/openmrs-core,jembi/openmrs-core,maany/openmrs-core,ssmusoke/openmrs-core,Openmrs-joel/openmrs-core,dcmul/openmrs-core,sintjuri/openmrs-core,WANeves/openmrs-core,foolchan2556/openmrs-core,prisamuel/openmrs-core,MitchellBot/openmrs-core,foolchan2556/openmrs-core,dlahn/openmrs-core,Ch3ck/openmrs-core,aboutdata/openmrs-core,aboutdata/openmrs-core,hoquangtruong/TestMylyn,Openmrs-joel/openmrs-core,geoff-wasilwa/openmrs-core,siddharthkhabia/openmrs-core,trsorsimoII/openmrs-core,alexwind26/openmrs-core,kckc/openmrs-core,MuhammadSafwan/Stop-Button-Ability,rbtracker/openmrs-core,ldf92/openmrs-core,ssmusoke/openmrs-core,asifur77/openmrs,nilusi/Legacy-UI,kristopherschmidt/openmrs-core,joansmith/openmrs-core,jembi/openmrs-core,WANeves/openmrs-core,kabariyamilind/openMRSDEV,sadhanvejella/openmrs,dcmul/openmrs-core,dcmul/openmrs-core,iLoop2/openmrs-core,foolchan2556/openmrs-core,preethi29/openmrs-core,pselle/openmrs-core,maekstr/openmrs-core,alexei-grigoriev/openmrs-core,sravanthi17/openmrs-core,naraink/openmrs-core,koskedk/openmrs-core,kckc/openmrs-core,lbl52001/openmrs-core,Negatu/openmrs-core,lilo2k/openmrs-core,kigsmtua/openmrs-core,dlahn/openmrs-core,kristopherschmidt/openmrs-core,joansmith/openmrs-core,aj-jaswanth/openmrs-core,alexei-grigoriev/openmrs-core,hoquangtruong/TestMylyn,pselle/openmrs-core,aboutdata/openmrs-core,sravanthi17/openmrs-core,prisamuel/openmrs-core,macorrales/openmrs-core,Negatu/openmrs-core,pselle/openmrs-core,naraink/openmrs-core,shiangree/openmrs-core,milankarunarathne/openmrs-core,chethandeshpande/openmrs-core,donaldgavis/openmrs-core,spereverziev/openmrs-core,joansmith/openmrs-core,ssmusoke/openmrs-core,aboutdata/openmrs-core,iLoop2/openmrs-core,naraink/openmrs-core,alexwind26/openmrs-core,kristopherschmidt/openmrs-core,kigsmtua/openmrs-core,AbhijitParate/openmrs-core,sintjuri/openmrs-core,geoff-wasilwa/openmrs-core,preethi29/openmrs-core,alexwind26/openmrs-core,sadhanvejella/openmrs,jvena1/openmrs-core,ssmusoke/openmrs-core,alexwind26/openmrs-core,pselle/openmrs-core,ern2/openmrs-core,spereverziev/openmrs-core,jcantu1988/openmrs-core,geoff-wasilwa/openmrs-core,Ch3ck/openmrs-core,macorrales/openmrs-core,AbhijitParate/openmrs-core,dcmul/openmrs-core,spereverziev/openmrs-core,MuhammadSafwan/Stop-Button-Ability,macorrales/openmrs-core,foolchan2556/openmrs-core,lbl52001/openmrs-core,sadhanvejella/openmrs,preethi29/openmrs-core,lbl52001/openmrs-core,michaelhofer/openmrs-core,siddharthkhabia/openmrs-core,Ch3ck/openmrs-core,foolchan2556/openmrs-core,Bhamni/openmrs-core,ssmusoke/openmrs-core
/** * The contents of this file are subject to the OpenMRS Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://license.openmrs.org * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * Copyright (C) OpenMRS, LLC. All Rights Reserved. */ package org.openmrs.web.controller.visit; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang.StringUtils; import org.directwebremoting.util.Logger; import org.openmrs.Encounter; import org.openmrs.Form; import org.openmrs.Patient; import org.openmrs.Provider; import org.openmrs.Visit; import org.openmrs.api.context.Context; import org.openmrs.util.OpenmrsUtil; import org.openmrs.web.controller.PortletControllerUtil; import org.openmrs.web.controller.bean.DatatableRequest; import org.openmrs.web.controller.bean.DatatableResponse; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; /** * Lists visits. */ @Controller public class VisitListController { protected final Logger log = Logger.getLogger(getClass()); public static final String VISITS_PATH = "/admin/visits/datatable"; public static final String PATIENT = "patient"; /** * It handles calls from DataTables. * * @param patient * @param request * @return {@link DatatableResponse} */ @RequestMapping(VISITS_PATH) public @ResponseBody DatatableResponse getVisits(@ModelAttribute Patient patient, HttpServletRequest request) { DatatableRequest datatable = DatatableRequest.parseRequest(request); DatatableResponse response = new DatatableResponse(datatable); Integer totalVisitsCount = Context.getEncounterService().getEncountersByVisitsAndPatientCount(patient, false, null); response.setiTotalRecords(totalVisitsCount); Map<String, Object> model = new HashMap<String, Object>(); model.put("person", patient); PortletControllerUtil.addFormToEditAndViewUrlMaps(model); @SuppressWarnings("unchecked") Map<Form, String> formToViewUrlMap = (Map<Form, String>) model.get("formToViewUrlMap"); @SuppressWarnings("unchecked") Map<Form, String> formToEditUrlMap = (Map<Form, String>) model.get("formToEditUrlMap"); if (!StringUtils.isBlank(datatable.getsSearch())) { Integer filteredVisitsCount = Context.getEncounterService().getEncountersByVisitsAndPatientCount(patient, false, datatable.getsSearch()); response.setiTotalDisplayRecords(filteredVisitsCount); } else { response.setiTotalDisplayRecords(totalVisitsCount); } List<Encounter> encounters = Context.getEncounterService().getEncountersByVisitsAndPatient(patient, false, datatable.getsSearch(), datatable.getiDisplayStart(), datatable.getiDisplayLength()); response.setsColumns("visitId", "visitActive", "visitType", "visitLocation", "visitFrom", "visitTo", "visitIndication", "firstInVisit", "lastInVisit", "encounterId", "encounterDate", "encounterType", "encounterProviders", "encounterLocation", "encounterEnterer", "formViewURL"); for (Encounter encounter : encounters) { Map<String, String> row = new HashMap<String, String>(); if (encounter.getVisit() != null) { Visit visit = encounter.getVisit(); row.put("visitId", visit.getId().toString()); row.put("visitActive", Boolean.toString(isActive(visit.getStartDatetime(), visit.getStopDatetime()))); row.put("visitType", visit.getVisitType().getName()); row.put("visitLocation", (visit.getLocation() != null) ? visit.getLocation().getName() : ""); row.put("visitFrom", Context.getDateFormat().format(visit.getStartDatetime())); if (visit.getStopDatetime() != null) { row.put("visitTo", Context.getDateFormat().format(visit.getStopDatetime())); } if (visit.getIndication() != null && visit.getIndication().getName() != null) { row.put("visitIndication", visit.getIndication().getName().getName()); } Object[] visitEncounters = visit.getEncounters().toArray(); if (visitEncounters.length > 0) { if (encounter.equals(visitEncounters[0])) { row.put("firstInVisit", Boolean.TRUE.toString()); } if (encounter.equals(visitEncounters[visitEncounters.length - 1])) { row.put("lastInVisit", Boolean.TRUE.toString()); } } else { row.put("firstInVisit", Boolean.TRUE.toString()); row.put("lastInVisit", Boolean.TRUE.toString()); } } if (encounter.getId() != null) { //If it is not mocked encounter row.put("encounterId", encounter.getId().toString()); row.put("encounterDate", Context.getDateFormat().format(encounter.getEncounterDatetime())); row.put("encounterType", encounter.getEncounterType().getName()); row.put("encounterProviders", getProviders(encounter)); row.put("encounterLocation", (encounter.getLocation() != null) ? encounter.getLocation().getName() : ""); row.put("encounterEnterer", (encounter.getCreator() != null) ? encounter.getCreator().getPersonName() .toString() : ""); row.put("formViewURL", getViewFormURL(request, formToViewUrlMap, formToEditUrlMap, encounter)); } response.addRow(row); } return response; } private String getViewFormURL(HttpServletRequest request, Map<Form, String> formToViewUrlMap, Map<Form, String> formToEditUrlMap, Encounter encounter) { String viewFormURL = formToViewUrlMap.get(encounter.getForm()); if (viewFormURL == null) { viewFormURL = formToEditUrlMap.get(encounter.getForm()); } if (viewFormURL != null) { viewFormURL = request.getContextPath() + "/" + viewFormURL + "?encounterId=" + encounter.getId(); } else { viewFormURL = request.getContextPath() + "/admin/encounters/encounter.form?encounterId=" + encounter.getId(); } return viewFormURL; } private String getProviders(Encounter encounter) { StringBuilder providersBuilder = new StringBuilder(); for (Set<Provider> providers : encounter.getProvidersByRoles().values()) { for (Provider provider : providers) { if (provider.getPerson() != null) { providersBuilder.append(provider.getPerson().getPersonName().getFullName()); } else { providersBuilder.append(provider.getIdentifier()); } providersBuilder.append(", "); } } if (providersBuilder.length() > 1) { return providersBuilder.substring(0, providersBuilder.length() - 2); } else { return ""; } } @ModelAttribute public Patient getPatient(@RequestParam(PATIENT) Integer patientId) { return Context.getPatientService().getPatient(patientId); } private boolean isActive(Date start, Date end) { Date now = new Date(); if (OpenmrsUtil.compare(now, start) >= 0) { if (OpenmrsUtil.compareWithNullAsLatest(now, end) < 0) { return true; } } return false; } }
web/src/main/java/org/openmrs/web/controller/visit/VisitListController.java
/** * The contents of this file are subject to the OpenMRS Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://license.openmrs.org * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * Copyright (C) OpenMRS, LLC. All Rights Reserved. */ package org.openmrs.web.controller.visit; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang.StringUtils; import org.directwebremoting.util.Logger; import org.openmrs.Encounter; import org.openmrs.Form; import org.openmrs.Patient; import org.openmrs.Provider; import org.openmrs.Visit; import org.openmrs.api.context.Context; import org.openmrs.util.OpenmrsUtil; import org.openmrs.web.controller.PortletControllerUtil; import org.openmrs.web.controller.bean.DatatableRequest; import org.openmrs.web.controller.bean.DatatableResponse; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; /** * Lists visits. */ @Controller public class VisitListController { protected final Logger log = Logger.getLogger(getClass()); public static final String VISITS_PATH = "/admin/visits/datatable"; public static final String PATIENT = "patient"; /** * It handles calls from DataTables. * * @param patient * @param request * @return {@link DatatableResponse} */ @RequestMapping(VISITS_PATH) public @ResponseBody DatatableResponse getVisits(@ModelAttribute Patient patient, HttpServletRequest request) { DatatableRequest datatable = DatatableRequest.parseRequest(request); DatatableResponse response = new DatatableResponse(datatable); Integer totalVisitsCount = Context.getEncounterService().getEncountersByVisitsAndPatientCount(patient, false, null); response.setiTotalRecords(totalVisitsCount); Map<String, Object> model = new HashMap<String, Object>(); model.put("person", patient); PortletControllerUtil.addFormToEditAndViewUrlMaps(model); @SuppressWarnings("unchecked") Map<Form, String> formToViewUrlMap = (Map<Form, String>) model.get("formToViewUrlMap"); if (!StringUtils.isBlank(datatable.getsSearch())) { Integer filteredVisitsCount = Context.getEncounterService().getEncountersByVisitsAndPatientCount(patient, false, datatable.getsSearch()); response.setiTotalDisplayRecords(filteredVisitsCount); } else { response.setiTotalDisplayRecords(totalVisitsCount); } List<Encounter> encounters = Context.getEncounterService().getEncountersByVisitsAndPatient(patient, false, datatable.getsSearch(), datatable.getiDisplayStart(), datatable.getiDisplayLength()); response.setsColumns("visitId", "visitActive", "visitType", "visitLocation", "visitFrom", "visitTo", "visitIndication", "firstInVisit", "lastInVisit", "encounterId", "encounterDate", "encounterType", "encounterProviders", "encounterLocation", "encounterEnterer", "formViewURL"); for (Encounter encounter : encounters) { Map<String, String> row = new HashMap<String, String>(); if (encounter.getVisit() != null) { Visit visit = encounter.getVisit(); row.put("visitId", visit.getId().toString()); row.put("visitActive", Boolean.toString(isActive(visit.getStartDatetime(), visit.getStopDatetime()))); row.put("visitType", visit.getVisitType().getName()); row.put("visitLocation", (visit.getLocation() != null) ? visit.getLocation().getName() : ""); row.put("visitFrom", Context.getDateFormat().format(visit.getStartDatetime())); if (visit.getStopDatetime() != null) { row.put("visitTo", Context.getDateFormat().format(visit.getStopDatetime())); } if (visit.getIndication() != null && visit.getIndication().getName() != null) { row.put("visitIndication", visit.getIndication().getName().getName()); } Object[] visitEncounters = visit.getEncounters().toArray(); if (visitEncounters.length > 0) { if (encounter.equals(visitEncounters[0])) { row.put("firstInVisit", Boolean.TRUE.toString()); } if (encounter.equals(visitEncounters[visitEncounters.length - 1])) { row.put("lastInVisit", Boolean.TRUE.toString()); } } else { row.put("firstInVisit", Boolean.TRUE.toString()); row.put("lastInVisit", Boolean.TRUE.toString()); } } if (encounter.getId() != null) { //If it is not mocked encounter row.put("encounterId", encounter.getId().toString()); row.put("encounterDate", Context.getDateFormat().format(encounter.getEncounterDatetime())); row.put("encounterType", encounter.getEncounterType().getName()); row.put("encounterProviders", getProviders(encounter)); row.put("encounterLocation", (encounter.getLocation() != null) ? encounter.getLocation().getName() : ""); row.put("encounterEnterer", (encounter.getCreator() != null) ? encounter.getCreator().getPersonName() .toString() : ""); row.put("formViewURL", getViewFormURL(request, formToViewUrlMap, encounter)); } response.addRow(row); } return response; } private String getViewFormURL(HttpServletRequest request, Map<Form, String> formToViewUrlMap, Encounter encounter) { String viewFormURL = formToViewUrlMap.get(encounter.getForm()); if (viewFormURL != null) { viewFormURL = request.getContextPath() + "/" + viewFormURL + "?encounterId=" + encounter.getId(); } else { viewFormURL = request.getContextPath() + "/admin/encounters/encounterDisplay.list?encounterId=" + encounter.getId(); } return viewFormURL; } private String getProviders(Encounter encounter) { StringBuilder providersBuilder = new StringBuilder(); for (Set<Provider> providers : encounter.getProvidersByRoles().values()) { for (Provider provider : providers) { if (provider.getPerson() != null) { providersBuilder.append(provider.getPerson().getPersonName().getFullName()); } else { providersBuilder.append(provider.getIdentifier()); } providersBuilder.append(", "); } } if (providersBuilder.length() > 1) { return providersBuilder.substring(0, providersBuilder.length() - 2); } else { return ""; } } @ModelAttribute public Patient getPatient(@RequestParam(PATIENT) Integer patientId) { return Context.getPatientService().getPatient(patientId); } private boolean isActive(Date start, Date end) { Date now = new Date(); if (OpenmrsUtil.compare(now, start) >= 0) { if (OpenmrsUtil.compareWithNullAsLatest(now, end) < 0) { return true; } } return false; } }
IN PROGRESS - issue TRUNK-422: Edit / View of previous forms should merge into a single interface paradigm https://tickets.openmrs.org/browse/TRUNK-422 git-svn-id: ce3478dfdc990238714fcdf4fc6855b7489218cf@24814 5bac5841-c719-aa4e-b3fe-cce5062f897a
web/src/main/java/org/openmrs/web/controller/visit/VisitListController.java
IN PROGRESS - issue TRUNK-422: Edit / View of previous forms should merge into a single interface paradigm https://tickets.openmrs.org/browse/TRUNK-422
<ide><path>eb/src/main/java/org/openmrs/web/controller/visit/VisitListController.java <ide> @SuppressWarnings("unchecked") <ide> Map<Form, String> formToViewUrlMap = (Map<Form, String>) model.get("formToViewUrlMap"); <ide> <add> @SuppressWarnings("unchecked") <add> Map<Form, String> formToEditUrlMap = (Map<Form, String>) model.get("formToEditUrlMap"); <add> <ide> if (!StringUtils.isBlank(datatable.getsSearch())) { <ide> Integer filteredVisitsCount = Context.getEncounterService().getEncountersByVisitsAndPatientCount(patient, false, <ide> datatable.getsSearch()); <ide> row.put("encounterLocation", (encounter.getLocation() != null) ? encounter.getLocation().getName() : ""); <ide> row.put("encounterEnterer", (encounter.getCreator() != null) ? encounter.getCreator().getPersonName() <ide> .toString() : ""); <del> row.put("formViewURL", getViewFormURL(request, formToViewUrlMap, encounter)); <add> row.put("formViewURL", getViewFormURL(request, formToViewUrlMap, formToEditUrlMap, encounter)); <ide> } <ide> <ide> response.addRow(row); <ide> return response; <ide> } <ide> <del> private String getViewFormURL(HttpServletRequest request, Map<Form, String> formToViewUrlMap, Encounter encounter) { <add> private String getViewFormURL(HttpServletRequest request, Map<Form, String> formToViewUrlMap, <add> Map<Form, String> formToEditUrlMap, Encounter encounter) { <ide> String viewFormURL = formToViewUrlMap.get(encounter.getForm()); <add> if (viewFormURL == null) { <add> viewFormURL = formToEditUrlMap.get(encounter.getForm()); <add> } <ide> if (viewFormURL != null) { <ide> viewFormURL = request.getContextPath() + "/" + viewFormURL + "?encounterId=" + encounter.getId(); <ide> } else { <del> viewFormURL = request.getContextPath() + "/admin/encounters/encounterDisplay.list?encounterId=" <add> viewFormURL = request.getContextPath() + "/admin/encounters/encounter.form?encounterId=" <ide> + encounter.getId(); <ide> } <ide> return viewFormURL;
JavaScript
mit
1a1f9afda62792d7acc8e00674a1a486496c462e
0
reelyactive/barnowl
/** * Copyright reelyActive 2014-2015 * We believe in an open Internet of Things */ var util = require('util'); var events = require('events'); var reelPacket = require('../../decoders/protocols/reelpacket'); var identifier = require('../../common/util/identifier'); /** * ReelManager Class * Manages the composition of reels. * @constructor */ function ReelManager() { var self = this; this.listenerInstances = []; this.origins = {}; events.EventEmitter.call(this); } util.inherits(ReelManager, events.EventEmitter); /** * Update the tables based on ReelceiverStatistics packet. * @param {ReelManager} instance The given ReelManager instance. * @param {Packet} packet The ReelceiverStatistics packet. */ function handleReelceiverStatistics(instance, packet) { // TODO: store data about the reelceivers } /** * Update the tables based on ReelAnnounce packet. * @param {ReelManager} instance The given ReelManager instance. * @param {Packet} packet The ReelAnnounce packet. */ function handleReelAnnounce(instance, packet) { var originKey = packet.origin; var isNewOriginKey = (Object.keys(instance.origins).indexOf(originKey) < 0); var deviceCounts; var reelOffsets; var deviceCount = packet.deviceCount; var deviceIdentifier = packet.identifier; if(isNewOriginKey) { initialiseOrigin(instance, originKey); } deviceCounts = instance.origins[originKey].deviceCounts; reelOffsets = instance.origins[originKey].reelOffsets; // Furthest device from the hub so far if(deviceCount >= deviceCounts.length) { for(var cCount = deviceCounts.length; cCount < deviceCount; cCount++) { var unknownDevice = new identifier(); deviceCounts[cCount] = unknownDevice; // Fill any reel gaps reelOffsets.splice(0, 0, unknownDevice); // with 'unknown' devices } deviceCounts[deviceCount] = deviceIdentifier; reelOffsets.splice(0, 0, deviceIdentifier); } else { var expectedDeviceIdentifier = deviceCounts[deviceCount]; // The device fills in one of the gaps in the reel if(expectedDeviceIdentifier.type === identifier.UNDEFINED) { var reelOffset = reelOffsets.length - deviceCount - 1; deviceCounts[deviceCount] = deviceIdentifier; reelOffsets[reelOffset] = deviceIdentifier; } // Device identifier conflict, physical change to reel detected! else if(expectedDeviceIdentifier.value !== deviceIdentifier.value) { initialiseOrigin(instance, originKey); // Reset! } } } /** * Initialise/reset the given origin key. * @param {ReelManager} instance The given ReelManager instance. * @param {String} originKey The origin key. */ function initialiseOrigin(instance, originKey) { instance.origins[originKey] = { reelOffsets: [], deviceCounts: [] }; } /** * Bind the reel manager to a listener service and handle received * reelManagementPackets. * @param {ListenerService} emitter ListenerService. */ ReelManager.prototype.bind = function(emitter) { var self = this; this.listenerInstances.push(emitter); emitter.on('reelManagementPacket', function(packet) { switch(packet.type) { case reelPacket.REELCEIVER_STATISTICS: handleReelceiverStatistics(self, packet); break; case reelPacket.REEL_ANNOUNCE: handleReelAnnounce(self, packet); break; } }); }; /** * Look up and append the reelceiver ID for each decoding in the given array. * @param {array} decodings Array of decodings with offsets and origins. * @param {callback} callback Function to call on completion. */ ReelManager.prototype.setDecoderIdentifiers = function(decodings, callback) { var self = this; var err; decodings.forEach(function (decoding) { if(self.origins[decoding.origin]) { var decoderIdentifier = self.origins[decoding.origin].reelOffsets[decoding.reelOffset]; if(decoderIdentifier != null) { decoding.identifier = decoderIdentifier.toType(identifier.EUI64); } else { decoding.identifier = new identifier(); } } else { decoding.identifier = new identifier(); } }); callback(err); }; module.exports = ReelManager;
lib/core/reelmanager/reelmanager.js
/** * Copyright reelyActive 2014 * We believe in an open Internet of Things */ var util = require('util'); var events = require('events'); var reelPacket = require('../../decoders/protocols/reelpacket'); var identifier = require('../../common/util/identifier'); /** * ReelManager Class * Manages the composition of reels. * @constructor */ function ReelManager() { var self = this; this.listenerInstances = []; this.origins = {}; events.EventEmitter.call(this); } util.inherits(ReelManager, events.EventEmitter); /** * Update the tables based on ReelceiverStatistics packet. * @param {ReelManager} instance The given ReelManager instance. * @param {Packet} packet The ReelceiverStatistics packet. */ function handleReelceiverStatistics(instance, packet) { var originKey = packet.origin; var isNewOriginKey = (instance.origins[originKey] == null); var reelOffset = packet.reelOffset; var deviceIdentifier = packet.identifier; if(isNewOriginKey) { instance.origins[originKey] = []; } instance.origins[originKey][reelOffset] = deviceIdentifier; // TODO: store more data about the reelceivers } /** * Bind the reel manager to a listener service and handle received * reelManagementPackets. * @param {ListenerService} emitter ListenerService. */ ReelManager.prototype.bind = function(emitter) { var self = this; this.listenerInstances.push(emitter); emitter.on('reelManagementPacket', function(packet) { var isReelceiverStatistics = (packet.type === reelPacket.REELCEIVER_STATISTICS); if(isReelceiverStatistics) { handleReelceiverStatistics(self, packet); } }); }; /** * Look up and append the reelceiver ID for each decoding in the given array. * @param {array} decodings Array of decodings with offsets and origins. * @param {callback} callback Function to call on completion. */ ReelManager.prototype.setDecoderIdentifiers = function(decodings, callback) { var self = this; var err; decodings.forEach(function (decoding) { if(self.origins[decoding.origin]) { var decoderIdentifier = self.origins[decoding.origin][decoding.reelOffset]; if(decoderIdentifier != null) { decoding.identifier = decoderIdentifier.toType(identifier.EUI64); } else { decoding.identifier = new identifier(); } } else { decoding.identifier = new identifier(); } }); callback(err); }; module.exports = ReelManager;
Determine reelceiver IDs from announce rather than statistics packets (faster)
lib/core/reelmanager/reelmanager.js
Determine reelceiver IDs from announce rather than statistics packets (faster)
<ide><path>ib/core/reelmanager/reelmanager.js <ide> /** <del> * Copyright reelyActive 2014 <add> * Copyright reelyActive 2014-2015 <ide> * We believe in an open Internet of Things <ide> */ <ide> <ide> * @param {Packet} packet The ReelceiverStatistics packet. <ide> */ <ide> function handleReelceiverStatistics(instance, packet) { <add> // TODO: store data about the reelceivers <add>} <add> <add> <add>/** <add> * Update the tables based on ReelAnnounce packet. <add> * @param {ReelManager} instance The given ReelManager instance. <add> * @param {Packet} packet The ReelAnnounce packet. <add> */ <add>function handleReelAnnounce(instance, packet) { <ide> var originKey = packet.origin; <del> var isNewOriginKey = (instance.origins[originKey] == null); <del> var reelOffset = packet.reelOffset; <add> var isNewOriginKey = (Object.keys(instance.origins).indexOf(originKey) < 0); <add> var deviceCounts; <add> var reelOffsets; <add> var deviceCount = packet.deviceCount; <ide> var deviceIdentifier = packet.identifier; <ide> <ide> if(isNewOriginKey) { <del> instance.origins[originKey] = []; <add> initialiseOrigin(instance, originKey); <ide> } <del> instance.origins[originKey][reelOffset] = deviceIdentifier; <del> <del> // TODO: store more data about the reelceivers <add> deviceCounts = instance.origins[originKey].deviceCounts; <add> reelOffsets = instance.origins[originKey].reelOffsets; <add> <add> // Furthest device from the hub so far <add> if(deviceCount >= deviceCounts.length) { <add> for(var cCount = deviceCounts.length; cCount < deviceCount; cCount++) { <add> var unknownDevice = new identifier(); <add> deviceCounts[cCount] = unknownDevice; // Fill any reel gaps <add> reelOffsets.splice(0, 0, unknownDevice); // with 'unknown' devices <add> } <add> deviceCounts[deviceCount] = deviceIdentifier; <add> reelOffsets.splice(0, 0, deviceIdentifier); <add> } <add> <add> else { <add> var expectedDeviceIdentifier = deviceCounts[deviceCount]; <add> <add> // The device fills in one of the gaps in the reel <add> if(expectedDeviceIdentifier.type === identifier.UNDEFINED) { <add> var reelOffset = reelOffsets.length - deviceCount - 1; <add> deviceCounts[deviceCount] = deviceIdentifier; <add> reelOffsets[reelOffset] = deviceIdentifier; <add> } <add> <add> // Device identifier conflict, physical change to reel detected! <add> else if(expectedDeviceIdentifier.value !== deviceIdentifier.value) { <add> initialiseOrigin(instance, originKey); // Reset! <add> } <add> } <add>} <add> <add> <add>/** <add> * Initialise/reset the given origin key. <add> * @param {ReelManager} instance The given ReelManager instance. <add> * @param {String} originKey The origin key. <add> */ <add>function initialiseOrigin(instance, originKey) { <add> instance.origins[originKey] = { reelOffsets: [], <add> deviceCounts: [] }; <ide> } <ide> <ide> <ide> <ide> this.listenerInstances.push(emitter); <ide> emitter.on('reelManagementPacket', function(packet) { <del> var isReelceiverStatistics = <del> (packet.type === reelPacket.REELCEIVER_STATISTICS); <del> if(isReelceiverStatistics) { <del> handleReelceiverStatistics(self, packet); <add> switch(packet.type) { <add> case reelPacket.REELCEIVER_STATISTICS: <add> handleReelceiverStatistics(self, packet); <add> break; <add> case reelPacket.REEL_ANNOUNCE: <add> handleReelAnnounce(self, packet); <add> break; <ide> } <ide> }); <ide> }; <ide> <ide> decodings.forEach(function (decoding) { <ide> if(self.origins[decoding.origin]) { <del> var decoderIdentifier = self.origins[decoding.origin][decoding.reelOffset]; <add> var decoderIdentifier = self.origins[decoding.origin].reelOffsets[decoding.reelOffset]; <ide> if(decoderIdentifier != null) { <ide> decoding.identifier = decoderIdentifier.toType(identifier.EUI64); <ide> }
Java
apache-2.0
b4786a5ac5942fe8e0222d2289b279a32d45cdb0
0
consulo/consulo-java,consulo/consulo-java,consulo/consulo-java,consulo/consulo-java
java-impl/src/com/intellij/platform/templates/SystemFileProcessor.java
/* * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.platform.templates; import com.intellij.ide.util.projectWizard.ProjectTemplateFileProcessor; import com.intellij.openapi.components.PathMacroManager; import com.intellij.openapi.components.PersistentStateComponent; import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.components.impl.ComponentManagerImpl; import com.intellij.openapi.components.impl.stores.ComponentStoreImpl; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.JDOMExternalizable; import com.intellij.openapi.util.JDOMUtil; import com.intellij.openapi.util.WriteExternalException; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.ui.UIUtil; import com.intellij.util.xmlb.XmlSerializer; import org.jdom.Element; import org.jetbrains.annotations.Nullable; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * @author Dmitry Avdeev * Date: 2/15/13 */ public class SystemFileProcessor extends ProjectTemplateFileProcessor { private static final String[] COMPONENT_NAMES = new String[] { FileEditorManagerImpl.FILE_EDITOR_MANAGER, "org.jetbrains.idea.maven.project.MavenWorkspaceSettingsComponent" }; @Nullable @Override protected String encodeFileText(String content, VirtualFile file, Project project) throws IOException { final String fileName = file.getName(); if (file.getParent().getName().equals(Project.DIRECTORY_STORE_FOLDER) && fileName.equals("workspace.xml")) { List<Object> componentList = new ArrayList<Object>(); for (String componentName : COMPONENT_NAMES) { Object component = project.getComponent(componentName); if (component == null) { try { component = ServiceManager.getService(project, Class.forName(componentName)); } catch (ClassNotFoundException ignore) { } } ContainerUtil.addIfNotNull(componentList, component); } if (!componentList.isEmpty()) { final Element root = new Element("project"); for (final Object component : componentList) { final Element element = new Element("component"); element.setAttribute("name", ComponentManagerImpl.getComponentName(component)); root.addContent(element); UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override public void run() { if (component instanceof JDOMExternalizable) { try { ((JDOMExternalizable)component).writeExternal(element); } catch (WriteExternalException ignore) { LOG.error(ignore); } } else { Object state = ((PersistentStateComponent)component).getState(); Element element1 = XmlSerializer.serialize(state); element.addContent(element1.cloneContent()); element.setAttribute("name", ComponentStoreImpl.getComponentName((PersistentStateComponent)component)); } } }); } PathMacroManager.getInstance(project).collapsePaths(root); return JDOMUtil.writeElement(root); } } return null; } private static final Logger LOG = Logger.getInstance(SystemFileProcessor.class); }
compilation fixed
java-impl/src/com/intellij/platform/templates/SystemFileProcessor.java
compilation fixed
<ide><path>ava-impl/src/com/intellij/platform/templates/SystemFileProcessor.java <del>/* <del> * Copyright 2000-2013 JetBrains s.r.o. <del> * <del> * Licensed under the Apache License, Version 2.0 (the "License"); <del> * you may not use this file except in compliance with the License. <del> * You may obtain a copy of the License at <del> * <del> * http://www.apache.org/licenses/LICENSE-2.0 <del> * <del> * Unless required by applicable law or agreed to in writing, software <del> * distributed under the License is distributed on an "AS IS" BASIS, <del> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <del> * See the License for the specific language governing permissions and <del> * limitations under the License. <del> */ <del>package com.intellij.platform.templates; <del> <del>import com.intellij.ide.util.projectWizard.ProjectTemplateFileProcessor; <del>import com.intellij.openapi.components.PathMacroManager; <del>import com.intellij.openapi.components.PersistentStateComponent; <del>import com.intellij.openapi.components.ServiceManager; <del>import com.intellij.openapi.components.impl.ComponentManagerImpl; <del>import com.intellij.openapi.components.impl.stores.ComponentStoreImpl; <del>import com.intellij.openapi.diagnostic.Logger; <del>import com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl; <del>import com.intellij.openapi.project.Project; <del>import com.intellij.openapi.util.JDOMExternalizable; <del>import com.intellij.openapi.util.JDOMUtil; <del>import com.intellij.openapi.util.WriteExternalException; <del>import com.intellij.openapi.vfs.VirtualFile; <del>import com.intellij.util.containers.ContainerUtil; <del>import com.intellij.util.ui.UIUtil; <del>import com.intellij.util.xmlb.XmlSerializer; <del>import org.jdom.Element; <del>import org.jetbrains.annotations.Nullable; <del> <del>import java.io.IOException; <del>import java.util.ArrayList; <del>import java.util.List; <del> <del>/** <del> * @author Dmitry Avdeev <del> * Date: 2/15/13 <del> */ <del>public class SystemFileProcessor extends ProjectTemplateFileProcessor { <del> <del> private static final String[] COMPONENT_NAMES = new String[] { <del> FileEditorManagerImpl.FILE_EDITOR_MANAGER, <del> "org.jetbrains.idea.maven.project.MavenWorkspaceSettingsComponent" <del> }; <del> <del> @Nullable <del> @Override <del> protected String encodeFileText(String content, VirtualFile file, Project project) throws IOException { <del> final String fileName = file.getName(); <del> if (file.getParent().getName().equals(Project.DIRECTORY_STORE_FOLDER) && fileName.equals("workspace.xml")) { <del> <del> List<Object> componentList = new ArrayList<Object>(); <del> for (String componentName : COMPONENT_NAMES) { <del> Object component = project.getComponent(componentName); <del> if (component == null) { <del> try { <del> component = ServiceManager.getService(project, Class.forName(componentName)); <del> } <del> catch (ClassNotFoundException ignore) { <del> } <del> } <del> ContainerUtil.addIfNotNull(componentList, component); <del> } <del> if (!componentList.isEmpty()) { <del> final Element root = new Element("project"); <del> for (final Object component : componentList) { <del> final Element element = new Element("component"); <del> element.setAttribute("name", ComponentManagerImpl.getComponentName(component)); <del> root.addContent(element); <del> UIUtil.invokeAndWaitIfNeeded(new Runnable() { <del> @Override <del> public void run() { <del> if (component instanceof JDOMExternalizable) { <del> try { <del> ((JDOMExternalizable)component).writeExternal(element); <del> } <del> catch (WriteExternalException ignore) { <del> LOG.error(ignore); <del> } <del> } <del> else { <del> Object state = ((PersistentStateComponent)component).getState(); <del> Element element1 = XmlSerializer.serialize(state); <del> element.addContent(element1.cloneContent()); <del> element.setAttribute("name", ComponentStoreImpl.getComponentName((PersistentStateComponent)component)); <del> } <del> } <del> }); <del> } <del> PathMacroManager.getInstance(project).collapsePaths(root); <del> return JDOMUtil.writeElement(root); <del> } <del> } <del> return null; <del> } <del> <del> private static final Logger LOG = Logger.getInstance(SystemFileProcessor.class); <del>}
Java
apache-2.0
d52ab5d1bc04be6d92064bfffb4c4cf18a0b3d5a
0
werval/werval,werval/werval,werval/werval,werval/werval
/* * Copyright (c) 2013 the original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.qiweb.api.controllers; import java.io.InputStream; import org.qiweb.api.Mode; import org.qiweb.api.outcomes.Outcome; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static java.util.Locale.US; import static org.qiweb.api.context.CurrentContext.application; import static org.qiweb.api.context.CurrentContext.outcomes; import static org.qiweb.api.context.CurrentContext.request; import static org.qiweb.api.context.CurrentContext.response; import static org.qiweb.api.exceptions.IllegalArguments.ensureNotEmpty; import static org.qiweb.api.http.Headers.Names.CACHE_CONTROL; import static org.qiweb.api.http.Headers.Names.CONTENT_TYPE; import static org.qiweb.api.mime.MimeTypesNames.APPLICATION_OCTET_STREAM; import static org.qiweb.api.util.Charsets.US_ASCII; /** * Classpath Resources Controller. * * Always use chunked transfer encoding. * <p> * MimeType detection done using Application MimeTypes, fallback to <code>application/octet-stream</code>. * <p> * Log 404 at DEBUG level. * <p> * Log 200 at TRACE level. */ public class ClasspathResources { private static final Logger LOG = LoggerFactory.getLogger( ClasspathResources.class ); // No need for heading slash as we ask a ClassLoader instance for Resources // Would have been needed if we asked a Class instance for Resources private static final String META_INF_RESOURCES = "META-INF/resources"; /** * Serve static files from META-INF/resources in classpath. * * @param path Path of the requested resources, relative to META-INF/resources * * @return A Chunked Outcome if found, 404 otherwise */ public Outcome metainf( String path ) { return resource( META_INF_RESOURCES + '/' + path ); } /** * Serve static files from resources in classpath. * * @param basepath Base path of the requested resources, relative to the classpath root * @param path Path of the requested resources, relative to the basePath parameter * * @return A Chunked Outcome if found, 404 otherwise */ public Outcome resource( String basepath, String path ) { return resource( basepath + '/' + path ); } /** * Serve static files from resources in classpath. * * @param path Path of the requested resources, relative to the classpath root * * @return A Chunked Outcome if found, 404 otherwise */ public Outcome resource( String path ) { ensureNotEmpty( "Path", path ); if( path.contains( ".." ) ) { LOG.warn( "Directory traversal attempt: '{}'", path ); return outcomes(). badRequest(). as( "text/plain" ). withBody( "Did you just attempted a directory traversal attack? Keep out." ). build(); } InputStream input = application().classLoader().getResourceAsStream( path ); if( input == null ) { LOG.debug( "Requested resource '{}' not found", path ); return outcomes(). notFound(). as( "text/plain" ). withBody( request().path() + " not found" ). build(); } // Cache-Control if( application().mode() == Mode.DEV ) { response().headers().with( CACHE_CONTROL, "no-cache" ); } else { Long maxAge = application().config().seconds( "qiweb.lib.classpath.cache.maxage" ); if( maxAge.equals( 0L ) ) { response().headers().with( CACHE_CONTROL, "no-cache" ); } else { response().headers().with( CACHE_CONTROL, "max-age=" + maxAge ); } } // Mime Type String mimetype = application().mimeTypes().ofPathWithCharset( path ); response().headers().with( CONTENT_TYPE, mimetype ); // Disposition and filename String resourceName = path.substring( path.lastIndexOf( '/' ) + 1 ); String filename = US_ASCII.newEncoder().canEncode( resourceName ) ? "; filename=\"" + resourceName + "\"" : "; filename*=" + application().defaultCharset().name().toLowerCase( US ) + "; filename=\"" + resourceName + "\""; if( APPLICATION_OCTET_STREAM.equals( mimetype ) ) { // Browser will prompt the user, we should provide a filename response().headers().with( "Content-Disposition", "attachment" + filename ); } else { // Tell the browser to attempt to display the file and provide a filename in case it cannot response().headers().with( "Content-Disposition", "inline" + filename ); } LOG.trace( "Will serve '{}' with mimetype '{}'", path, mimetype ); return outcomes().ok().withBody( input ).build(); } }
org.qiweb/org.qiweb.api/src/main/java/org/qiweb/api/controllers/ClasspathResources.java
/* * Copyright (c) 2013 the original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.qiweb.api.controllers; import java.io.InputStream; import org.qiweb.api.Mode; import org.qiweb.api.outcomes.Outcome; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static java.util.Locale.US; import static org.qiweb.api.context.CurrentContext.application; import static org.qiweb.api.context.CurrentContext.outcomes; import static org.qiweb.api.context.CurrentContext.request; import static org.qiweb.api.context.CurrentContext.response; import static org.qiweb.api.exceptions.IllegalArguments.ensureNotEmpty; import static org.qiweb.api.http.Headers.Names.CACHE_CONTROL; import static org.qiweb.api.http.Headers.Names.CONTENT_TYPE; import static org.qiweb.api.mime.MimeTypesNames.APPLICATION_OCTET_STREAM; import static org.qiweb.api.util.Charsets.US_ASCII; /** * Classpath Resources Controller. * * Always use chunked transfer encoding. * <p> * MimeType detection done using Application MimeTypes, fallback to <code>application/octet-stream</code>. * <p> * Log 404 at DEBUG level. * <p> * Log 200 at TRACE level. */ public class ClasspathResources { private static final Logger LOG = LoggerFactory.getLogger( ClasspathResources.class ); // No need for heading slash as we ask a ClassLoader instance for Resources // Would have been needed if we asked a Class instance for Resources private static final String META_INF_RESOURCES = "META-INF/resources/"; /** * Serve static files from META-INF/resources in classpath. * * @param path Path of the requested resources, relative to META-INF/resources * * @return A Chunked Outcome if found, 404 otherwise */ public Outcome metainf( String path ) { return resource( META_INF_RESOURCES + path ); } /** * Serve static files from resources in classpath. * * @param basepath Base path of the requested resources, relative to the classpath root * @param path Path of the requested resources, relative to the basePath parameter * * @return A Chunked Outcome if found, 404 otherwise */ public Outcome resource( String basepath, String path ) { return resource( basepath + path ); } /** * Serve static files from resources in classpath. * * @param path Path of the requested resources, relative to the classpath root * * @return A Chunked Outcome if found, 404 otherwise */ public Outcome resource( String path ) { ensureNotEmpty( "Path", path ); if( path.contains( ".." ) ) { LOG.warn( "Directory traversal attempt: '{}'", path ); return outcomes(). badRequest(). as( "text/plain" ). withBody( "Did you just attempted a directory traversal attack? Keep out." ). build(); } InputStream input = application().classLoader().getResourceAsStream( path ); if( input == null ) { LOG.debug( "Requested resource '{}' not found", path ); return outcomes(). notFound(). as( "text/plain" ). withBody( request().path() + " not found" ). build(); } // Cache-Control if( application().mode() == Mode.DEV ) { response().headers().with( CACHE_CONTROL, "no-cache" ); } else { Long maxAge = application().config().seconds( "qiweb.lib.classpath.cache.maxage" ); if( maxAge.equals( 0L ) ) { response().headers().with( CACHE_CONTROL, "no-cache" ); } else { response().headers().with( CACHE_CONTROL, "max-age=" + maxAge ); } } // Mime Type String mimetype = application().mimeTypes().ofPathWithCharset( path ); response().headers().with( CONTENT_TYPE, mimetype ); // Disposition and filename String resourceName = path.substring( path.lastIndexOf( '/' ) + 1 ); String filename = US_ASCII.newEncoder().canEncode( resourceName ) ? "; filename=\"" + resourceName + "\"" : "; filename*=" + application().defaultCharset().name().toLowerCase( US ) + "; filename=\"" + resourceName + "\""; if( APPLICATION_OCTET_STREAM.equals( mimetype ) ) { // Browser will prompt the user, we should provide a filename response().headers().with( "Content-Disposition", "attachment" + filename ); } else { // Tell the browser to attempt to display the file and provide a filename in case it cannot response().headers().with( "Content-Disposition", "inline" + filename ); } LOG.trace( "Will serve '{}' with mimetype '{}'", path, mimetype ); return outcomes().ok().withBody( input ).build(); } }
ClasspathResources: fix trailing slash handling
org.qiweb/org.qiweb.api/src/main/java/org/qiweb/api/controllers/ClasspathResources.java
ClasspathResources: fix trailing slash handling
<ide><path>rg.qiweb/org.qiweb.api/src/main/java/org/qiweb/api/controllers/ClasspathResources.java <ide> private static final Logger LOG = LoggerFactory.getLogger( ClasspathResources.class ); <ide> // No need for heading slash as we ask a ClassLoader instance for Resources <ide> // Would have been needed if we asked a Class instance for Resources <del> private static final String META_INF_RESOURCES = "META-INF/resources/"; <add> private static final String META_INF_RESOURCES = "META-INF/resources"; <ide> <ide> /** <ide> * Serve static files from META-INF/resources in classpath. <ide> */ <ide> public Outcome metainf( String path ) <ide> { <del> return resource( META_INF_RESOURCES + path ); <add> return resource( META_INF_RESOURCES + '/' + path ); <ide> } <ide> <ide> /** <ide> */ <ide> public Outcome resource( String basepath, String path ) <ide> { <del> return resource( basepath + path ); <add> return resource( basepath + '/' + path ); <ide> } <ide> <ide> /**
Java
apache-2.0
0a4bb26b0c8af592bb58f938d9a19467834dd55e
0
apache/clerezza,apache/clerezza
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.clerezza.rdf.storage.externalizer; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Iterator; import org.apache.clerezza.rdf.core.MGraph; import org.apache.clerezza.rdf.core.NonLiteral; import org.apache.clerezza.rdf.core.Resource; import org.apache.clerezza.rdf.core.Triple; import org.apache.clerezza.rdf.core.TypedLiteral; import org.apache.clerezza.rdf.core.UriRef; import org.apache.clerezza.rdf.core.impl.AbstractMGraph; import org.apache.clerezza.rdf.core.impl.TripleImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * * @author reto */ /* * This could be optimized by not using the notification mechanism provided by * AbstractMGraph but intercept the notification of the basegraph */ class ExternalizingMGraph extends AbstractMGraph { private final MGraph baseGraph; private final File dataDir; static final UriRef base64Uri = new UriRef("http://www.w3.org/2001/XMLSchema#base64Binary"); // not using a known uri-scheme (such as urn:hash) to avoid collision with Uris in the graph private static final String UriHashPrefix = "urn:x-litrep:"; private static final Charset UTF8 = Charset.forName("utf-8"); private static final byte[] DELIMITER = "^^".getBytes(UTF8); Logger logger = LoggerFactory.getLogger(ExternalizingMGraph.class); public ExternalizingMGraph(MGraph baseGraph, File dataDir) { this.baseGraph = baseGraph; this.dataDir = dataDir; logger.debug("Created externalizing mgraph with dir: {}", dataDir); } @Override protected Iterator<Triple> performFilter(NonLiteral subject, UriRef predicate, Resource object) { if (object != null) { if (needsReplacing(object)) { return replaceReferences(baseGraph.filter(subject, predicate, replace((TypedLiteral) object))); } else { return baseGraph.filter(subject, predicate, object); } } else { return replaceReferences(baseGraph.filter(subject, predicate, object)); } } @Override public int size() { return baseGraph.size(); } @Override public boolean performAdd(Triple triple) { return baseGraph.add(replaceWithReference(triple)); } @Override public boolean performRemove(Triple triple) { return baseGraph.remove(replaceWithReference(triple)); } private Triple replaceWithReference(Triple triple) { Resource object = triple.getObject(); if (needsReplacing(object)) { return new TripleImpl(triple.getSubject(), triple.getPredicate(), replace((TypedLiteral) object)); } else { return triple; } } /** * this method defines which resources are to be replaced, the rest of the * code only assumes the resource to be replaced to be a typed literal. * * @param object * @return */ private boolean needsReplacing(Resource object) { if (object instanceof TypedLiteral) { if (object instanceof ReplacementLiteral) { return true; } if (((TypedLiteral) object).getDataType().equals(base64Uri)) { return true; } } return false; } UriRef replace(TypedLiteral literal) { if (literal instanceof ReplacementLiteral) { ReplacementLiteral replacementLiteral = (ReplacementLiteral) literal; return new UriRef(UriHashPrefix + replacementLiteral.base16Hash); } FileOutputStream out = null; try { final byte[] serializedLiteral = serializeLiteral(literal); final byte[] hash = getHash(literal, serializedLiteral); String base16Hash = toBase16(hash); File storingFile = getStoringFile(base16Hash); out = new FileOutputStream(storingFile); out.write(serializedLiteral); return new UriRef(UriHashPrefix + base16Hash); } catch (IOException ex) { throw new RuntimeException(ex); } catch (NoSuchAlgorithmException ex) { throw new RuntimeException(ex); } finally { try { out.close(); } catch (IOException ex) { throw new RuntimeException(ex); } } } /** * the first bytes are the datatype-uri followed by trailing "^^", the rest * the lexical form. everything encoded as utf-8 * @return */ private byte[] serializeLiteral(TypedLiteral literal) { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); byte[] uriBytes = literal.getDataType().getUnicodeString().getBytes(UTF8); out.write(uriBytes); out.write(DELIMITER); out.write(literal.getLexicalForm().getBytes(UTF8)); return out.toByteArray(); } catch (IOException ex) { throw new RuntimeException(ex); } } TypedLiteral getLiteralForUri(String uriString) { String base16Hash = uriString.substring(UriHashPrefix.length()); return getLiteralForHash(base16Hash); } private TypedLiteral getLiteralForHash(String base16Hash) { return new ReplacementLiteral(base16Hash); } String toBase16(byte[] bytes) { StringBuilder sb = new StringBuilder(); for (byte b : bytes) { if ((b < 16) && (b > 0)) { sb.append('0'); } String integerHex = Integer.toHexString(b); if (b < 0) { sb.append(integerHex.substring(6)); } else { sb.append(integerHex); } } return sb.toString(); } private File getStoringFile(String base16Hash) { File dir1 = new File(dataDir, base16Hash.substring(0, 2)); File dir2 = new File(dir1, base16Hash.substring(2, 5)); File dir3 = new File(dir2, base16Hash.substring(5, 8)); dir3.mkdirs(); return new File(dir3, base16Hash.substring(8)); } private Iterator<Triple> replaceReferences(final Iterator<Triple> base) { return new Iterator<Triple>() { @Override public boolean hasNext() { return base.hasNext(); } @Override public Triple next() { return replaceReference(base.next()); } @Override public void remove() { base.remove(); } private Triple replaceReference(Triple triple) { Resource object = triple.getObject(); if (object instanceof UriRef) { String uriString = ((UriRef) object).getUnicodeString(); if (uriString.startsWith(UriHashPrefix)) { return new TripleImpl(triple.getSubject(), triple.getPredicate(), getLiteralForUri(uriString)); } } return triple; } }; } private byte[] getHash(TypedLiteral literal, byte[] serializedLiteral) throws NoSuchAlgorithmException { MessageDigest digest = java.security.MessageDigest.getInstance("MD5"); digest.update(serializedLiteral); byte[] hash = new byte[digest.getDigestLength()+4]; int javaHash = literal.hashCode(); hash[0] = (byte) (javaHash >>> 24); hash[1] = (byte) (javaHash >>> 16); hash[2] = (byte) (javaHash >>> 8); hash[3] = (byte) javaHash; byte[] md5Digest = digest.digest(); System.arraycopy(md5Digest, 0, hash, 4, md5Digest.length); return hash; } int parseHexInt(String hexInt) { int[] hashBytes = new int[4]; hashBytes[0] = Integer.parseInt(hexInt.substring(0,2), 16); hashBytes[1] = Integer.parseInt(hexInt.substring(2,4), 16); hashBytes[2] = Integer.parseInt(hexInt.substring(4,6), 16); hashBytes[3] = Integer.parseInt(hexInt.substring(6,8), 16); return getIntFromBytes(hashBytes); } private int getIntFromBytes(int[] bytes) { int result = 0; int shift = (bytes.length*8); for (int b : bytes) { shift -= 8; result |= (0xFF & b) << shift; } return result; } private class ReplacementLiteral implements TypedLiteral { private String lexicalForm; private UriRef dataType; final private String base16Hash; private boolean initialized = false; final private int hash; private ReplacementLiteral(String base16Hash) { this.base16Hash = base16Hash; hash = parseHexInt(base16Hash.substring(0, 8)); } private synchronized void initialize() { if (initialized) { return; } File file = getStoringFile(base16Hash); try { InputStream in = new FileInputStream(file); try { ByteArrayOutputStream typeWriter = new ByteArrayOutputStream(); int posInDelimiter = 0; for (int ch = in.read(); ch != -1; ch = in.read()) { if (ch == DELIMITER[posInDelimiter]) { posInDelimiter++; if (DELIMITER.length == posInDelimiter) { break; } } else { if (posInDelimiter > 0) { typeWriter.write(DELIMITER, 0, posInDelimiter); posInDelimiter = 0; } typeWriter.write(ch); } } dataType = new UriRef(new String(typeWriter.toByteArray(), UTF8)); typeWriter = null; ByteArrayOutputStream dataWriter = new ByteArrayOutputStream((int) file.length()); for (int ch = in.read(); ch != -1; ch = in.read()) { dataWriter.write(ch); } lexicalForm = new String(dataWriter.toByteArray(), UTF8); } finally { in.close(); } } catch (IOException ex) { throw new RuntimeException(ex); } initialized = true; } @Override public UriRef getDataType() { if (!initialized) initialize(); return dataType; } @Override public String getLexicalForm() { if (!initialized) initialize(); return lexicalForm; } @Override public boolean equals(Object obj) { if (obj instanceof ReplacementLiteral) { ReplacementLiteral other = (ReplacementLiteral)obj; return base16Hash.equals(other.base16Hash); } TypedLiteral other = (TypedLiteral)obj; return getLexicalForm().equals(other.getLexicalForm()) && getDataType().equals(other.getDataType()); } @Override public int hashCode() { return hash; } } }
parent/rdf.storage.externalizer/src/main/java/org/apache/clerezza/rdf/storage/externalizer/ExternalizingMGraph.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.clerezza.rdf.storage.externalizer; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Iterator; import org.apache.clerezza.rdf.core.MGraph; import org.apache.clerezza.rdf.core.NonLiteral; import org.apache.clerezza.rdf.core.Resource; import org.apache.clerezza.rdf.core.Triple; import org.apache.clerezza.rdf.core.TypedLiteral; import org.apache.clerezza.rdf.core.UriRef; import org.apache.clerezza.rdf.core.impl.AbstractMGraph; import org.apache.clerezza.rdf.core.impl.TripleImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * * @author reto */ /* * This could be optimized by not using the notification mechanism provided by * AbstractMGraph but intercept the notification of the basegraph */ class ExternalizingMGraph extends AbstractMGraph { private final MGraph baseGraph; private final File dataDir; static final UriRef base64Uri = new UriRef("http://www.w3.org/2001/XMLSchema#base64Binary"); // not using a known uri-scheme (such as urn:hash) to avoid collision with Uris in the graph private static final String UriHashPrefix = "urn:x-litrep:"; private static final Charset UTF8 = Charset.forName("utf-8"); private static final byte[] DELIMITER = "^^".getBytes(UTF8); Logger logger = LoggerFactory.getLogger(ExternalizingMGraph.class); public ExternalizingMGraph(MGraph baseGraph, File dataDir) { this.baseGraph = baseGraph; this.dataDir = dataDir; logger.debug("Created externalizing mgraph with dir: {}", dataDir); } @Override protected Iterator<Triple> performFilter(NonLiteral subject, UriRef predicate, Resource object) { if (object != null) { if (needsReplacing(object)) { return replaceReferences(baseGraph.filter(subject, predicate, replace((TypedLiteral) object))); } else { return baseGraph.filter(subject, predicate, object); } } else { return replaceReferences(baseGraph.filter(subject, predicate, object)); } } @Override public int size() { return baseGraph.size(); } @Override public boolean performAdd(Triple triple) { return baseGraph.add(replaceWithReference(triple)); } @Override public boolean performRemove(Triple triple) { return baseGraph.remove(replaceWithReference(triple)); } private Triple replaceWithReference(Triple triple) { Resource object = triple.getObject(); if (needsReplacing(object)) { return new TripleImpl(triple.getSubject(), triple.getPredicate(), replace((TypedLiteral) object)); } else { return triple; } } /** * this method defines which resources are to be replaced, the rest of the * code only assumes the resource to be replaced to be a typed literal. * * @param object * @return */ private boolean needsReplacing(Resource object) { if (object instanceof TypedLiteral) { if (object instanceof ReplacementLiteral) { return true; } if (((TypedLiteral) object).getDataType().equals(base64Uri)) { return true; } } return false; } UriRef replace(TypedLiteral literal) { if (literal instanceof ReplacementLiteral) { ReplacementLiteral replacementLiteral = (ReplacementLiteral) literal; return new UriRef(UriHashPrefix + replacementLiteral.base16Hash); } FileOutputStream out = null; try { final byte[] serializedLiteral = serializeLiteral(literal); final byte[] hash = getHash(literal, serializedLiteral); String base16Hash = toBase16(hash); File storingFile = getStoringFile(base16Hash); out = new FileOutputStream(storingFile); out.write(serializedLiteral); return new UriRef(UriHashPrefix + base16Hash); } catch (IOException ex) { throw new RuntimeException(ex); } catch (NoSuchAlgorithmException ex) { throw new RuntimeException(ex); } finally { try { out.close(); } catch (IOException ex) { throw new RuntimeException(ex); } } } /** * the first bytes are the datatype-uri followed by trailing "^^", the rest * the lexical form. everything encoded as utf-8 * @return */ private byte[] serializeLiteral(TypedLiteral literal) { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); byte[] uriBytes = literal.getDataType().getUnicodeString().getBytes(UTF8); out.write(uriBytes); out.write(DELIMITER); out.write(literal.getLexicalForm().getBytes(UTF8)); return out.toByteArray(); } catch (IOException ex) { throw new RuntimeException(ex); } } TypedLiteral getLiteralForUri(String uriString) { String base16Hash = uriString.substring(UriHashPrefix.length()); return getLiteralForHash(base16Hash); } private TypedLiteral getLiteralForHash(String base16Hash) { return new ReplacementLiteral(base16Hash); } String toBase16(byte[] bytes) { StringBuilder sb = new StringBuilder(); for (byte b : bytes) { if ((b < 16) && (b > 0)) { sb.append('0'); } String integerHex = Integer.toHexString(b); if (b < 0) { sb.append(integerHex.substring(6)); } else { sb.append(integerHex); } } return sb.toString(); } private File getStoringFile(String base16Hash) { File dir1 = new File(dataDir, base16Hash.substring(0, 4)); File dir2 = new File(dir1, base16Hash.substring(4, 8)); dir2.mkdirs(); return new File(dir2, base16Hash.substring(8)); } private Iterator<Triple> replaceReferences(final Iterator<Triple> base) { return new Iterator<Triple>() { @Override public boolean hasNext() { return base.hasNext(); } @Override public Triple next() { return replaceReference(base.next()); } @Override public void remove() { base.remove(); } private Triple replaceReference(Triple triple) { Resource object = triple.getObject(); if (object instanceof UriRef) { String uriString = ((UriRef) object).getUnicodeString(); if (uriString.startsWith(UriHashPrefix)) { return new TripleImpl(triple.getSubject(), triple.getPredicate(), getLiteralForUri(uriString)); } } return triple; } }; } private byte[] getHash(TypedLiteral literal, byte[] serializedLiteral) throws NoSuchAlgorithmException { MessageDigest digest = java.security.MessageDigest.getInstance("MD5"); digest.update(serializedLiteral); byte[] hash = new byte[digest.getDigestLength()+4]; int javaHash = literal.hashCode(); hash[0] = (byte) (javaHash >>> 24); hash[1] = (byte) (javaHash >>> 16); hash[2] = (byte) (javaHash >>> 8); hash[3] = (byte) javaHash; byte[] md5Digest = digest.digest(); System.arraycopy(md5Digest, 0, hash, 4, md5Digest.length); return hash; } int parseHexInt(String hexInt) { int[] hashBytes = new int[4]; hashBytes[0] = Integer.parseInt(hexInt.substring(0,2), 16); hashBytes[1] = Integer.parseInt(hexInt.substring(2,4), 16); hashBytes[2] = Integer.parseInt(hexInt.substring(4,6), 16); hashBytes[3] = Integer.parseInt(hexInt.substring(6,8), 16); return getIntFromBytes(hashBytes); } private int getIntFromBytes(int[] bytes) { int result = 0; int shift = (bytes.length*8); for (int b : bytes) { shift -= 8; result |= (0xFF & b) << shift; } return result; } private class ReplacementLiteral implements TypedLiteral { private String lexicalForm; private UriRef dataType; final private String base16Hash; private boolean initialized = false; final private int hash; private ReplacementLiteral(String base16Hash) { this.base16Hash = base16Hash; hash = parseHexInt(base16Hash.substring(0, 8)); } private synchronized void initialize() { if (initialized) { return; } File file = getStoringFile(base16Hash); try { InputStream in = new FileInputStream(file); try { ByteArrayOutputStream typeWriter = new ByteArrayOutputStream(); int posInDelimiter = 0; for (int ch = in.read(); ch != -1; ch = in.read()) { if (ch == DELIMITER[posInDelimiter]) { posInDelimiter++; if (DELIMITER.length == posInDelimiter) { break; } } else { if (posInDelimiter > 0) { typeWriter.write(DELIMITER, 0, posInDelimiter); posInDelimiter = 0; } typeWriter.write(ch); } } dataType = new UriRef(new String(typeWriter.toByteArray(), UTF8)); typeWriter = null; ByteArrayOutputStream dataWriter = new ByteArrayOutputStream((int) file.length()); for (int ch = in.read(); ch != -1; ch = in.read()) { dataWriter.write(ch); } lexicalForm = new String(dataWriter.toByteArray(), UTF8); } finally { in.close(); } } catch (IOException ex) { throw new RuntimeException(ex); } initialized = true; } @Override public UriRef getDataType() { if (!initialized) initialize(); return dataType; } @Override public String getLexicalForm() { if (!initialized) initialize(); return lexicalForm; } @Override public boolean equals(Object obj) { if (obj instanceof ReplacementLiteral) { ReplacementLiteral other = (ReplacementLiteral)obj; return base16Hash.equals(other.base16Hash); } TypedLiteral other = (TypedLiteral)obj; return getLexicalForm().equals(other.getLexicalForm()) && getDataType().equals(other.getDataType()); } @Override public int hashCode() { return hash; } } }
CLEREZZA-454: rdf.storage.externalizer max allowed subdirectories reduced git-svn-id: 38b6077511a9281ad6e07629729fbb76b9a63fb8@1078710 13f79535-47bb-0310-9956-ffa450edef68
parent/rdf.storage.externalizer/src/main/java/org/apache/clerezza/rdf/storage/externalizer/ExternalizingMGraph.java
CLEREZZA-454: rdf.storage.externalizer max allowed subdirectories reduced
<ide><path>arent/rdf.storage.externalizer/src/main/java/org/apache/clerezza/rdf/storage/externalizer/ExternalizingMGraph.java <ide> } <ide> <ide> private File getStoringFile(String base16Hash) { <del> File dir1 = new File(dataDir, base16Hash.substring(0, 4)); <del> File dir2 = new File(dir1, base16Hash.substring(4, 8)); <del> dir2.mkdirs(); <del> return new File(dir2, base16Hash.substring(8)); <add> <add> File dir1 = new File(dataDir, base16Hash.substring(0, 2)); <add> File dir2 = new File(dir1, base16Hash.substring(2, 5)); <add> File dir3 = new File(dir2, base16Hash.substring(5, 8)); <add> dir3.mkdirs(); <add> return new File(dir3, base16Hash.substring(8)); <ide> } <ide> <ide> private Iterator<Triple> replaceReferences(final Iterator<Triple> base) {
JavaScript
mit
d2fea2310ab0e4873eddfb24da4c424d376383f6
0
hold-the-door-game/Prototypes,hold-the-door-game/Prototypes
import React from 'react'; import bind from 'react-autobind'; class Walker extends React.Component { constructor(props) { super(props); bind(this); this.walker = {}; this.loadAnimations(); this.initializeSprite(); } componentDidMount() { const app = this.props.app; app.stage.addChild(this.walker); } loadAnimations() { this.walkingFrames = []; this.idleFrames = []; for (let i = 0; i < 6; i++) { this.walkingFrames.push(window.PIXI.Texture.fromFrame(`scott_pilgrim_walking_01 ${i}.ase`)); } for (let i = 0; i < 8; i++) { this.idleFrames.push(window.PIXI.Texture.fromFrame(`scott_pilgrim_idle ${i}.ase`)); } } initializeSprite() { const app = this.props.app; this.walker = new window.PIXI.extras.AnimatedSprite(this.walkingFrames); this.walker.x = this.props.position.x; this.walker.y = this.props.position.y; this.walker.anchor.set(0.5, 1); this.walker.animationSpeed = 0.1; this.walker.scale.x = 3; this.walker.scale.y = 3; const randomFrame = Math.floor(Math.random() * 6); this.walker.gotoAndPlay(randomFrame); app.stage.addChild(this.walker); } setPosition(x, y) { this.walker.x = x; this.walker.y = y; } updateAnimation(isWalking) { if (!isWalking && this.walker.textures === this.walkingFrames) { this.walker.textures = this.idleFrames; this.walker.play(); } } render() { const x = this.props.position.x; const y = this.props.position.y; const isWalking = this.props.isWalking; this.setPosition(x, y); this.updateAnimation(isWalking); return null; } } export default Walker;
src/Game/Prototype01/walker.js
import React from 'react'; import bind from 'react-autobind'; class Walker extends React.Component { constructor(props) { super(props); bind(this); this.walker = {}; this.loadAnimations(); this.initializeSprite(); } componentDidMount() { const app = this.props.app; app.stage.addChild(this.walker); } loadAnimations() { this.walkingFrames = []; this.idleFrames = []; for (let i = 0; i < 6; i++) { this.walkingFrames.push(window.PIXI.Texture.fromFrame(`scott_pilgrim_walking_01 ${i}.ase`)); } for (let i = 0; i < 8; i++) { this.idleFrames.push(window.PIXI.Texture.fromFrame(`scott_pilgrim_idle ${i}.ase`)); } } initializeSprite() { const app = this.props.app; this.walker = new window.PIXI.extras.AnimatedSprite(this.walkingFrames); this.walker.x = this.props.position.x; this.walker.y = this.props.position.y; this.walker.anchor.set(0.5, 1); this.walker.animationSpeed = 0.1; this.walker.scale.x = 3; this.walker.scale.y = 3; this.walker.play(); app.stage.addChild(this.walker); } setPosition(x, y) { this.walker.x = x; this.walker.y = y; } updateAnimation(isWalking) { if (!isWalking && this.walker.textures === this.walkingFrames) { this.walker.textures = this.idleFrames; this.walker.play(); } } render() { const x = this.props.position.x; const y = this.props.position.y; const isWalking = this.props.isWalking; this.setPosition(x, y); this.updateAnimation(isWalking); return null; } } export default Walker;
Starts animation at random frame to make it feel more natural
src/Game/Prototype01/walker.js
Starts animation at random frame to make it feel more natural
<ide><path>rc/Game/Prototype01/walker.js <ide> this.walker.animationSpeed = 0.1; <ide> this.walker.scale.x = 3; <ide> this.walker.scale.y = 3; <del> this.walker.play(); <add> <add> const randomFrame = Math.floor(Math.random() * 6); <add> this.walker.gotoAndPlay(randomFrame); <ide> app.stage.addChild(this.walker); <ide> } <ide>
Java
apache-2.0
ac80e99b00b2a758a0ef604bc68d149b96b58d04
0
beckchr/musicmount
/* * Copyright 2013-2014 Odysseus Software GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.musicmount.fx; import java.io.File; import java.util.logging.Level; import java.util.prefs.Preferences; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.collections.FXCollections; import javafx.concurrent.Service; import javafx.concurrent.Task; import javafx.concurrent.WorkerStateEvent; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.geometry.HPos; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.control.Button; import javafx.scene.control.CheckBox; import javafx.scene.control.ChoiceBox; import javafx.scene.control.Label; import javafx.scene.control.ProgressIndicator; import javafx.scene.control.TextField; import javafx.scene.control.Tooltip; import javafx.scene.layout.BorderPane; import javafx.scene.layout.ColumnConstraintsBuilder; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; import javafx.scene.text.Text; import javafx.stage.DirectoryChooser; import org.musicmount.builder.MusicMountBuilder; import org.musicmount.util.LoggingUtil; public class FXBuildController { static { LoggingUtil.configure(MusicMountBuilder.class.getPackage().getName(), Level.FINE); } private static final String STATUS_NO_RELATIVE_MUSIC_PATH = "Cannot calculate relative music path, custom path path required"; private static final Preferences PREFERENCES = Preferences.userNodeForPackage(FXBuildController.class); private static final String PREFERENCE_KEY_GROUPING = "builder.grouping"; private static final String PREFERENCE_KEY_NO_TRACK_INDEX = "builder.noTrackIndex"; private static final String PREFERENCE_KEY_NO_VARIOUS_ARTISTS = "builder.noVariousArtists"; private static final String PREFERENCE_KEY_RETINA = "builder.retina"; private static final String PREFERENCE_KEY_UNKNOWN_GENRE = "builder.unknownGenre"; private Pane pane; private TextField musicFolderTextField; private Button musicFolderChooseButton; private TextField mountFolderTextField; private Button mountFolderChooseButton; private TextField musicPathTextField; private ChoiceBox<String> musicPathChoiceBox; private CheckBox retinaCheckBox; private CheckBox groupingCheckBox; private CheckBox fullCheckBox; private CheckBox noTrackIndexCheckBox; private CheckBox noVariousArtistsCheckBox; private CheckBox unknownGenreCheckBox; private ProgressIndicator progressIndicator; private Button runButton; private Text statusText; private final FXCommandModel model; private final MusicMountBuilder builder = new MusicMountBuilder(); private final Service<Object> service = new Service<Object>() { @Override protected Task<Object> createTask() { return new Task<Object>() { @Override protected Object call() throws Exception { builder.build(model.getMusicFolder(), model.getMountFolder(), model.getMusicPath()); return null; } }; } }; public FXBuildController(final FXCommandModel model) { this.model = model; this.pane = createView(); loadPreferences(); pane.visibleProperty().addListener(new ChangeListener<Boolean>() { @Override public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) { if (newValue) { updateAll(); } } }); builder.setProgressHandler(new FXProgressHandler(statusText, progressIndicator, builder.getProgressHandler())); musicFolderTextField.textProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { model.setMusicFolder(model.toFolder(newValue)); if (model.getCustomMusicPath() == null) { updateMusicPath(); } updateRunButton(); } }); musicFolderChooseButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { DirectoryChooser directoryChooser = new DirectoryChooser(); directoryChooser.setTitle("Music Folder"); File directory = directoryChooser.showDialog(null); if (directory != null) { musicFolderTextField.setText(directory.getAbsolutePath()); } } }); mountFolderTextField.textProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { model.setMountFolder(model.toFolder(newValue)); if (model.getCustomMusicPath() == null) { updateMusicPath(); } updateRunButton(); } }); mountFolderChooseButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { DirectoryChooser directoryChooser = new DirectoryChooser(); directoryChooser.setTitle("Mount Folder"); File directory = directoryChooser.showDialog(null); if (directory != null) { mountFolderTextField.setText(directory.getAbsolutePath()); } } }); musicPathTextField.textProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { if (model.getCustomMusicPath() != null) { model.setCustomMusicPath(newValue); } updateRunButton(); } }); musicPathChoiceBox.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() { @Override public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) { if(newValue.intValue() == 0) { // auto model.setCustomMusicPath(null); } else if (model.getCustomMusicPath() == null) { // custom model.setCustomMusicPath(FXCommandModel.DEFAULT_CUSTOM_MUSIC_PATH); } updateMusicPath(); updateRunButton(); } }); retinaCheckBox.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { builder.setRetina(retinaCheckBox.isSelected()); } }); groupingCheckBox.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { builder.setGrouping(groupingCheckBox.isSelected()); } }); fullCheckBox.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { builder.setFull(fullCheckBox.isSelected()); } }); noTrackIndexCheckBox.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { builder.setNoTrackIndex(noTrackIndexCheckBox.isSelected()); } }); noVariousArtistsCheckBox.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { builder.setNoVariousArtists(noVariousArtistsCheckBox.isSelected()); } }); unknownGenreCheckBox.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { builder.setUnknownGenre(unknownGenreCheckBox.isSelected()); } }); service.setOnRunning(new EventHandler<WorkerStateEvent>() { public void handle(WorkerStateEvent event) { statusText.setText(null); disableControls(true); } }); service.setOnSucceeded(new EventHandler<WorkerStateEvent>() { public void handle(WorkerStateEvent event) { statusText.setText("Site generation succeeded"); disableControls(false); savePreferences(); } }); service.setOnFailed(new EventHandler<WorkerStateEvent>() { public void handle(WorkerStateEvent event) { statusText.setText("Site generation failed"); if (service.getException() != null) { service.getException().printStackTrace(); } disableControls(false); } }); runButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { service.reset(); service.start(); } }); updateAll(); } private void loadPreferences() { builder.setGrouping(PREFERENCES.getBoolean(PREFERENCE_KEY_GROUPING, false)); builder.setNoTrackIndex(PREFERENCES.getBoolean(PREFERENCE_KEY_NO_TRACK_INDEX, false)); builder.setNoVariousArtists(PREFERENCES.getBoolean(PREFERENCE_KEY_NO_VARIOUS_ARTISTS, false)); builder.setRetina(PREFERENCES.getBoolean(PREFERENCE_KEY_RETINA, false)); builder.setUnknownGenre(PREFERENCES.getBoolean(PREFERENCE_KEY_UNKNOWN_GENRE, false)); } private void savePreferences() { PREFERENCES.putBoolean(PREFERENCE_KEY_GROUPING, builder.isGrouping()); PREFERENCES.putBoolean(PREFERENCE_KEY_NO_TRACK_INDEX, builder.isNoTrackIndex()); PREFERENCES.putBoolean(PREFERENCE_KEY_NO_VARIOUS_ARTISTS, builder.isNoVariousArtists()); PREFERENCES.putBoolean(PREFERENCE_KEY_RETINA, builder.isRetina()); PREFERENCES.putBoolean(PREFERENCE_KEY_UNKNOWN_GENRE, builder.isUnknownGenre()); } void disableControls(boolean disable) { musicFolderTextField.setDisable(disable); musicFolderChooseButton.setDisable(disable); mountFolderTextField.setDisable(disable); mountFolderChooseButton.setDisable(disable); musicFolderTextField.setDisable(disable); musicPathChoiceBox.setDisable(disable); musicPathTextField.setDisable(disable); retinaCheckBox.setDisable(disable); groupingCheckBox.setDisable(disable); fullCheckBox.setDisable(disable); noTrackIndexCheckBox.setDisable(disable); noVariousArtistsCheckBox.setDisable(disable); unknownGenreCheckBox.setDisable(disable); runButton.setDisable(disable || !model.isValid()); } Pane createView() { GridPane grid = new GridPane(); grid.setAlignment(Pos.CENTER); grid.setHgap(5); grid.setVgap(10); // grid.setGridLinesVisible(true); grid.getColumnConstraints().add(0, ColumnConstraintsBuilder.create().hgrow(Priority.NEVER).build()); grid.getColumnConstraints().add(1, ColumnConstraintsBuilder.create().hgrow(Priority.ALWAYS).build()); grid.getColumnConstraints().add(2, ColumnConstraintsBuilder.create().hgrow(Priority.ALWAYS).build()); grid.getColumnConstraints().add(3, ColumnConstraintsBuilder.create().hgrow(Priority.NEVER).build()); /* * music folder */ Label musicFolderLabel = new Label("Music Folder"); musicFolderTextField = new TextField(); musicFolderTextField.setPromptText("Input directory, containing your music collection"); musicFolderChooseButton = new Button("..."); grid.add(musicFolderLabel, 0, 1); GridPane.setHalignment(musicFolderLabel, HPos.RIGHT); grid.add(musicFolderTextField, 1, 1, 2, 1); grid.add(musicFolderChooseButton, 3, 1); /* * mount folder */ Label mountFolderLabel = new Label("Mount Folder"); mountFolderTextField = new TextField(); mountFolderTextField.setPromptText("Output directory, containing your generated site"); mountFolderChooseButton = new Button("..."); grid.add(mountFolderLabel, 0, 2); GridPane.setHalignment(mountFolderLabel, HPos.RIGHT); grid.add(mountFolderTextField, 1, 2, 2, 1); grid.add(mountFolderChooseButton, 3, 2); /* * music path */ Label musicPathLabel = new Label("Music Path"); musicPathTextField = new TextField(); musicPathTextField.setPromptText("Web path to music, absolute or relative to site URL"); musicPathChoiceBox = new ChoiceBox<String>(FXCollections.observableArrayList("Auto", "Custom")); grid.add(musicPathLabel, 0, 3); GridPane.setHalignment(musicPathLabel, HPos.RIGHT); HBox.setHgrow(musicPathTextField, Priority.ALWAYS); HBox musicPathHBox = new HBox(10); musicPathHBox.getChildren().addAll(musicPathChoiceBox, musicPathTextField); grid.add(musicPathHBox, 1, 3, 2, 1); /* * options */ Label optionsLabel = new Label("Options"); grid.add(optionsLabel, 0, 4); GridPane.setHalignment(optionsLabel, HPos.RIGHT); retinaCheckBox = new CheckBox("Retina Images"); retinaCheckBox.setTooltip(new Tooltip("Double image resolution, better for tables")); grid.add(retinaCheckBox, 1, 4); groupingCheckBox = new CheckBox("Track Grouping"); groupingCheckBox.setTooltip(new Tooltip("Use grouping tag to group album tracks")); grid.add(groupingCheckBox, 1, 5); fullCheckBox = new CheckBox("Full Parse/Build"); fullCheckBox.setTooltip(new Tooltip("Force full parse/build, don't use asset store")); grid.add(fullCheckBox, 1, 6); noTrackIndexCheckBox = new CheckBox("No Track Index"); noTrackIndexCheckBox.setTooltip(new Tooltip("Do not generate a track index")); grid.add(noTrackIndexCheckBox, 2, 4); noVariousArtistsCheckBox = new CheckBox("No 'Various Artists' Item"); noVariousArtistsCheckBox.setTooltip(new Tooltip("Exclude 'Various Artists' from album artist index")); grid.add(noVariousArtistsCheckBox, 2, 5); unknownGenreCheckBox = new CheckBox("Add 'Unknown' Genre"); unknownGenreCheckBox.setTooltip(new Tooltip("Report missing genre as 'Unknown'")); grid.add(unknownGenreCheckBox, 2, 6); /* * progress */ progressIndicator = new ProgressIndicator(); progressIndicator.setPrefWidth(30); progressIndicator.setVisible(false); VBox progressBox = new VBox(); progressBox.setFillWidth(false); progressBox.setAlignment(Pos.BOTTOM_CENTER); progressBox.getChildren().add(progressIndicator); grid.add(progressBox, 0, 5, 1, 3); /* * run button */ runButton = new Button("Build Site"); runButton.setId("build-button"); runButton.getStyleClass().add("run-button"); HBox runButtonHBox = new HBox(10); runButtonHBox.setAlignment(Pos.BOTTOM_RIGHT); runButtonHBox.getChildren().add(runButton); grid.add(runButtonHBox, 2, 7, 2, 1); GridPane.setVgrow(runButtonHBox, Priority.ALWAYS); BorderPane borderPane = new BorderPane(); borderPane.setCenter(grid); BorderPane.setMargin(grid, new Insets(10)); Text titleText = new Text("Generate MusicMount Site"); titleText.setId("build-title"); titleText.getStyleClass().add("tool-title"); borderPane.setTop(titleText); BorderPane.setMargin(titleText, new Insets(15, 10, 0, 10)); statusText = new Text(); statusText.setId("build-status"); statusText.getStyleClass().add("status-text"); borderPane.setBottom(statusText); BorderPane.setMargin(statusText, new Insets(5, 10, 10, 10)); return borderPane; } void updateAll() { updateMusicFolder(); updateMountFolder(); updateMusicPath(); updateOptions(); updateRunButton(); } void updateMusicFolder() { musicFolderTextField.setText(model.getMusicFolder() != null ? model.getMusicFolder().toString() : null); } void updateMountFolder() { mountFolderTextField.setText(model.getMountFolder() != null ? model.getMountFolder().toString() : null); } void updateMusicPath() { musicPathChoiceBox.getSelectionModel().select(model.getCustomMusicPath() == null ? 0 : 1); musicPathTextField.setEditable(model.getCustomMusicPath() != null); musicPathTextField.setText(model.getMusicPath()); if (model.getCustomMusicPath() == null && model.getMusicFolder() != null && model.getMountFolder() != null && !model.getMusicFolder().equals(model.getMountFolder()) && model.getMusicPath() == null) { // no relative path statusText.setText(STATUS_NO_RELATIVE_MUSIC_PATH); } else if (STATUS_NO_RELATIVE_MUSIC_PATH.equals(statusText.getText())) { statusText.setText(null); } } void updateOptions() { fullCheckBox.setSelected(builder.isFull()); groupingCheckBox.setSelected(builder.isGrouping()); noTrackIndexCheckBox.setSelected(builder.isNoTrackIndex()); noVariousArtistsCheckBox.setSelected(builder.isNoVariousArtists()); retinaCheckBox.setSelected(builder.isRetina()); unknownGenreCheckBox.setSelected(builder.isUnknownGenre()); } void updateRunButton() { runButton.setDisable(service.isRunning() || !model.isValid()); } public Pane getPane() { return pane; } public Service<Object> getService() { return service; } }
ui/src/main/java/org/musicmount/fx/FXBuildController.java
/* * Copyright 2013-2014 Odysseus Software GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.musicmount.fx; import java.io.File; import java.util.logging.Level; import java.util.prefs.Preferences; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.collections.FXCollections; import javafx.concurrent.Service; import javafx.concurrent.Task; import javafx.concurrent.WorkerStateEvent; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.geometry.HPos; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.control.Button; import javafx.scene.control.CheckBox; import javafx.scene.control.ChoiceBox; import javafx.scene.control.Label; import javafx.scene.control.ProgressIndicator; import javafx.scene.control.TextField; import javafx.scene.control.Tooltip; import javafx.scene.layout.BorderPane; import javafx.scene.layout.ColumnConstraintsBuilder; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; import javafx.scene.text.Text; import javafx.stage.DirectoryChooser; import org.musicmount.builder.MusicMountBuilder; import org.musicmount.util.LoggingUtil; public class FXBuildController { static { LoggingUtil.configure(MusicMountBuilder.class.getPackage().getName(), Level.FINE); } private static final String STATUS_NO_RELATIVE_MUSIC_PATH = "Cannot calculate relative music path, custom path path required"; private static final Preferences PREFERENCES = Preferences.userNodeForPackage(FXBuildController.class); private static final String PREFERENCE_KEY_FULL = "builder.full"; private static final String PREFERENCE_KEY_GROUPING = "builder.grouping"; private static final String PREFERENCE_KEY_NO_TRACK_INDEX = "builder.noTrackIndex"; private static final String PREFERENCE_KEY_NO_VARIOUS_ARTISTS = "builder.noVariousArtists"; private static final String PREFERENCE_KEY_RETINA = "builder.retina"; private static final String PREFERENCE_KEY_UNKNOWN_GENRE = "builder.unknownGenre"; private Pane pane; private TextField musicFolderTextField; private Button musicFolderChooseButton; private TextField mountFolderTextField; private Button mountFolderChooseButton; private TextField musicPathTextField; private ChoiceBox<String> musicPathChoiceBox; private CheckBox retinaCheckBox; private CheckBox groupingCheckBox; private CheckBox fullCheckBox; private CheckBox noTrackIndexCheckBox; private CheckBox noVariousArtistsCheckBox; private CheckBox unknownGenreCheckBox; private ProgressIndicator progressIndicator; private Button runButton; private Text statusText; private final FXCommandModel model; private final MusicMountBuilder builder = new MusicMountBuilder(); private final Service<Object> service = new Service<Object>() { @Override protected Task<Object> createTask() { return new Task<Object>() { @Override protected Object call() throws Exception { builder.build(model.getMusicFolder(), model.getMountFolder(), model.getMusicPath()); return null; } }; } }; public FXBuildController(final FXCommandModel model) { this.model = model; this.pane = createView(); loadPreferences(); pane.visibleProperty().addListener(new ChangeListener<Boolean>() { @Override public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) { if (newValue) { updateAll(); } } }); builder.setProgressHandler(new FXProgressHandler(statusText, progressIndicator, builder.getProgressHandler())); musicFolderTextField.textProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { model.setMusicFolder(model.toFolder(newValue)); if (model.getCustomMusicPath() == null) { updateMusicPath(); } updateRunButton(); } }); musicFolderChooseButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { DirectoryChooser directoryChooser = new DirectoryChooser(); directoryChooser.setTitle("Music Folder"); File directory = directoryChooser.showDialog(null); if (directory != null) { musicFolderTextField.setText(directory.getAbsolutePath()); } } }); mountFolderTextField.textProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { model.setMountFolder(model.toFolder(newValue)); if (model.getCustomMusicPath() == null) { updateMusicPath(); } updateRunButton(); } }); mountFolderChooseButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { DirectoryChooser directoryChooser = new DirectoryChooser(); directoryChooser.setTitle("Mount Folder"); File directory = directoryChooser.showDialog(null); if (directory != null) { mountFolderTextField.setText(directory.getAbsolutePath()); } } }); musicPathTextField.textProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { if (model.getCustomMusicPath() != null) { model.setCustomMusicPath(newValue); } updateRunButton(); } }); musicPathChoiceBox.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() { @Override public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) { if(newValue.intValue() == 0) { // auto model.setCustomMusicPath(null); } else if (model.getCustomMusicPath() == null) { // custom model.setCustomMusicPath(FXCommandModel.DEFAULT_CUSTOM_MUSIC_PATH); } updateMusicPath(); updateRunButton(); } }); retinaCheckBox.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { builder.setRetina(retinaCheckBox.isSelected()); } }); groupingCheckBox.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { builder.setGrouping(groupingCheckBox.isSelected()); } }); fullCheckBox.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { builder.setFull(fullCheckBox.isSelected()); } }); noTrackIndexCheckBox.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { builder.setNoTrackIndex(noTrackIndexCheckBox.isSelected()); } }); noVariousArtistsCheckBox.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { builder.setNoVariousArtists(noVariousArtistsCheckBox.isSelected()); } }); unknownGenreCheckBox.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { builder.setUnknownGenre(unknownGenreCheckBox.isSelected()); } }); service.setOnRunning(new EventHandler<WorkerStateEvent>() { public void handle(WorkerStateEvent event) { statusText.setText(null); disableControls(true); } }); service.setOnSucceeded(new EventHandler<WorkerStateEvent>() { public void handle(WorkerStateEvent event) { statusText.setText("Site generation succeeded"); disableControls(false); savePreferences(); } }); service.setOnFailed(new EventHandler<WorkerStateEvent>() { public void handle(WorkerStateEvent event) { statusText.setText("Site generation failed"); if (service.getException() != null) { service.getException().printStackTrace(); } disableControls(false); } }); runButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { service.reset(); service.start(); } }); updateAll(); } private void loadPreferences() { builder.setFull(PREFERENCES.getBoolean(PREFERENCE_KEY_FULL, false)); builder.setGrouping(PREFERENCES.getBoolean(PREFERENCE_KEY_GROUPING, false)); builder.setNoTrackIndex(PREFERENCES.getBoolean(PREFERENCE_KEY_NO_TRACK_INDEX, false)); builder.setNoVariousArtists(PREFERENCES.getBoolean(PREFERENCE_KEY_NO_VARIOUS_ARTISTS, false)); builder.setRetina(PREFERENCES.getBoolean(PREFERENCE_KEY_RETINA, false)); builder.setUnknownGenre(PREFERENCES.getBoolean(PREFERENCE_KEY_UNKNOWN_GENRE, false)); } private void savePreferences() { PREFERENCES.putBoolean(PREFERENCE_KEY_FULL, builder.isFull()); PREFERENCES.putBoolean(PREFERENCE_KEY_GROUPING, builder.isGrouping()); PREFERENCES.putBoolean(PREFERENCE_KEY_NO_TRACK_INDEX, builder.isNoTrackIndex()); PREFERENCES.putBoolean(PREFERENCE_KEY_NO_VARIOUS_ARTISTS, builder.isNoVariousArtists()); PREFERENCES.putBoolean(PREFERENCE_KEY_RETINA, builder.isRetina()); PREFERENCES.putBoolean(PREFERENCE_KEY_UNKNOWN_GENRE, builder.isUnknownGenre()); } void disableControls(boolean disable) { musicFolderTextField.setDisable(disable); musicFolderChooseButton.setDisable(disable); mountFolderTextField.setDisable(disable); mountFolderChooseButton.setDisable(disable); musicFolderTextField.setDisable(disable); musicPathChoiceBox.setDisable(disable); musicPathTextField.setDisable(disable); retinaCheckBox.setDisable(disable); groupingCheckBox.setDisable(disable); fullCheckBox.setDisable(disable); noTrackIndexCheckBox.setDisable(disable); noVariousArtistsCheckBox.setDisable(disable); unknownGenreCheckBox.setDisable(disable); runButton.setDisable(disable || !model.isValid()); } Pane createView() { GridPane grid = new GridPane(); grid.setAlignment(Pos.CENTER); grid.setHgap(5); grid.setVgap(10); // grid.setGridLinesVisible(true); grid.getColumnConstraints().add(0, ColumnConstraintsBuilder.create().hgrow(Priority.NEVER).build()); grid.getColumnConstraints().add(1, ColumnConstraintsBuilder.create().hgrow(Priority.ALWAYS).build()); grid.getColumnConstraints().add(2, ColumnConstraintsBuilder.create().hgrow(Priority.ALWAYS).build()); grid.getColumnConstraints().add(3, ColumnConstraintsBuilder.create().hgrow(Priority.NEVER).build()); /* * music folder */ Label musicFolderLabel = new Label("Music Folder"); musicFolderTextField = new TextField(); musicFolderTextField.setPromptText("Input directory, containing your music collection"); musicFolderChooseButton = new Button("..."); grid.add(musicFolderLabel, 0, 1); GridPane.setHalignment(musicFolderLabel, HPos.RIGHT); grid.add(musicFolderTextField, 1, 1, 2, 1); grid.add(musicFolderChooseButton, 3, 1); /* * mount folder */ Label mountFolderLabel = new Label("Mount Folder"); mountFolderTextField = new TextField(); mountFolderTextField.setPromptText("Output directory, containing your generated site"); mountFolderChooseButton = new Button("..."); grid.add(mountFolderLabel, 0, 2); GridPane.setHalignment(mountFolderLabel, HPos.RIGHT); grid.add(mountFolderTextField, 1, 2, 2, 1); grid.add(mountFolderChooseButton, 3, 2); /* * music path */ Label musicPathLabel = new Label("Music Path"); musicPathTextField = new TextField(); musicPathTextField.setPromptText("Web path to music, absolute or relative to site URL"); musicPathChoiceBox = new ChoiceBox<String>(FXCollections.observableArrayList("Auto", "Custom")); grid.add(musicPathLabel, 0, 3); GridPane.setHalignment(musicPathLabel, HPos.RIGHT); HBox.setHgrow(musicPathTextField, Priority.ALWAYS); HBox musicPathHBox = new HBox(10); musicPathHBox.getChildren().addAll(musicPathChoiceBox, musicPathTextField); grid.add(musicPathHBox, 1, 3, 2, 1); /* * options */ Label optionsLabel = new Label("Options"); grid.add(optionsLabel, 0, 4); GridPane.setHalignment(optionsLabel, HPos.RIGHT); retinaCheckBox = new CheckBox("Retina Images"); retinaCheckBox.setTooltip(new Tooltip("Double image resolution, better for tables")); grid.add(retinaCheckBox, 1, 4); groupingCheckBox = new CheckBox("Track Grouping"); groupingCheckBox.setTooltip(new Tooltip("Use grouping tag to group album tracks")); grid.add(groupingCheckBox, 1, 5); fullCheckBox = new CheckBox("Full Parse/Build"); fullCheckBox.setTooltip(new Tooltip("Force full parse/build, don't use asset store")); grid.add(fullCheckBox, 1, 6); noTrackIndexCheckBox = new CheckBox("No Track Index"); noTrackIndexCheckBox.setTooltip(new Tooltip("Do not generate a track index")); grid.add(noTrackIndexCheckBox, 2, 4); noVariousArtistsCheckBox = new CheckBox("No 'Various Artists' Item"); noVariousArtistsCheckBox.setTooltip(new Tooltip("Exclude 'Various Artists' from album artist index")); grid.add(noVariousArtistsCheckBox, 2, 5); unknownGenreCheckBox = new CheckBox("Add 'Unknown' Genre"); unknownGenreCheckBox.setTooltip(new Tooltip("Report missing genre as 'Unknown'")); grid.add(unknownGenreCheckBox, 2, 6); /* * progress */ progressIndicator = new ProgressIndicator(); progressIndicator.setPrefWidth(30); progressIndicator.setVisible(false); VBox progressBox = new VBox(); progressBox.setFillWidth(false); progressBox.setAlignment(Pos.BOTTOM_CENTER); progressBox.getChildren().add(progressIndicator); grid.add(progressBox, 0, 5, 1, 3); /* * run button */ runButton = new Button("Build Site"); runButton.setId("build-button"); runButton.getStyleClass().add("run-button"); HBox runButtonHBox = new HBox(10); runButtonHBox.setAlignment(Pos.BOTTOM_RIGHT); runButtonHBox.getChildren().add(runButton); grid.add(runButtonHBox, 2, 7, 2, 1); GridPane.setVgrow(runButtonHBox, Priority.ALWAYS); BorderPane borderPane = new BorderPane(); borderPane.setCenter(grid); BorderPane.setMargin(grid, new Insets(10)); Text titleText = new Text("Generate MusicMount Site"); titleText.setId("build-title"); titleText.getStyleClass().add("tool-title"); borderPane.setTop(titleText); BorderPane.setMargin(titleText, new Insets(15, 10, 0, 10)); statusText = new Text(); statusText.setId("build-status"); statusText.getStyleClass().add("status-text"); borderPane.setBottom(statusText); BorderPane.setMargin(statusText, new Insets(5, 10, 10, 10)); return borderPane; } void updateAll() { updateMusicFolder(); updateMountFolder(); updateMusicPath(); updateOptions(); updateRunButton(); } void updateMusicFolder() { musicFolderTextField.setText(model.getMusicFolder() != null ? model.getMusicFolder().toString() : null); } void updateMountFolder() { mountFolderTextField.setText(model.getMountFolder() != null ? model.getMountFolder().toString() : null); } void updateMusicPath() { musicPathChoiceBox.getSelectionModel().select(model.getCustomMusicPath() == null ? 0 : 1); musicPathTextField.setEditable(model.getCustomMusicPath() != null); musicPathTextField.setText(model.getMusicPath()); if (model.getCustomMusicPath() == null && model.getMusicFolder() != null && model.getMountFolder() != null && !model.getMusicFolder().equals(model.getMountFolder()) && model.getMusicPath() == null) { // no relative path statusText.setText(STATUS_NO_RELATIVE_MUSIC_PATH); } else if (STATUS_NO_RELATIVE_MUSIC_PATH.equals(statusText.getText())) { statusText.setText(null); } } void updateOptions() { fullCheckBox.setSelected(builder.isFull()); groupingCheckBox.setSelected(builder.isGrouping()); noTrackIndexCheckBox.setSelected(builder.isNoTrackIndex()); noVariousArtistsCheckBox.setSelected(builder.isNoVariousArtists()); retinaCheckBox.setSelected(builder.isRetina()); unknownGenreCheckBox.setSelected(builder.isUnknownGenre()); } void updateRunButton() { runButton.setDisable(service.isRunning() || !model.isValid()); } public Pane getPane() { return pane; } public Service<Object> getService() { return service; } }
don't make "Full" option a preference
ui/src/main/java/org/musicmount/fx/FXBuildController.java
don't make "Full" option a preference
<ide><path>i/src/main/java/org/musicmount/fx/FXBuildController.java <ide> private static final String STATUS_NO_RELATIVE_MUSIC_PATH = "Cannot calculate relative music path, custom path path required"; <ide> <ide> private static final Preferences PREFERENCES = Preferences.userNodeForPackage(FXBuildController.class); <del> private static final String PREFERENCE_KEY_FULL = "builder.full"; <ide> private static final String PREFERENCE_KEY_GROUPING = "builder.grouping"; <ide> private static final String PREFERENCE_KEY_NO_TRACK_INDEX = "builder.noTrackIndex"; <ide> private static final String PREFERENCE_KEY_NO_VARIOUS_ARTISTS = "builder.noVariousArtists"; <ide> } <ide> <ide> private void loadPreferences() { <del> builder.setFull(PREFERENCES.getBoolean(PREFERENCE_KEY_FULL, false)); <ide> builder.setGrouping(PREFERENCES.getBoolean(PREFERENCE_KEY_GROUPING, false)); <ide> builder.setNoTrackIndex(PREFERENCES.getBoolean(PREFERENCE_KEY_NO_TRACK_INDEX, false)); <ide> builder.setNoVariousArtists(PREFERENCES.getBoolean(PREFERENCE_KEY_NO_VARIOUS_ARTISTS, false)); <ide> } <ide> <ide> private void savePreferences() { <del> PREFERENCES.putBoolean(PREFERENCE_KEY_FULL, builder.isFull()); <ide> PREFERENCES.putBoolean(PREFERENCE_KEY_GROUPING, builder.isGrouping()); <ide> PREFERENCES.putBoolean(PREFERENCE_KEY_NO_TRACK_INDEX, builder.isNoTrackIndex()); <ide> PREFERENCES.putBoolean(PREFERENCE_KEY_NO_VARIOUS_ARTISTS, builder.isNoVariousArtists());
Java
mit
ec025c8dfbfc30e0e7adbf829f6d02a1407a9da2
0
jbosboom/streamjit,jbosboom/streamjit
package edu.mit.streamjit.impl.distributed.node; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; import edu.mit.streamjit.impl.blob.Blob; import edu.mit.streamjit.impl.blob.Buffer; import edu.mit.streamjit.impl.blob.ConcurrentArrayBuffer; import edu.mit.streamjit.impl.blob.Blob.Token; import edu.mit.streamjit.impl.blob.DrainData; import edu.mit.streamjit.impl.common.BlobThread; import edu.mit.streamjit.impl.distributed.common.BoundaryChannel; import edu.mit.streamjit.impl.distributed.common.BoundaryChannel.BoundaryInputChannel; import edu.mit.streamjit.impl.distributed.common.BoundaryChannel.BoundaryOutputChannel; import edu.mit.streamjit.impl.distributed.common.CTRLRDrainElement.CTRLRDrainProcessor; import edu.mit.streamjit.impl.distributed.common.CTRLRDrainElement.DoDrain; import edu.mit.streamjit.impl.distributed.common.CTRLRDrainElement.DrainDataRequest; import edu.mit.streamjit.impl.distributed.common.Command.CommandProcessor; import edu.mit.streamjit.impl.distributed.common.AppStatus; import edu.mit.streamjit.impl.distributed.common.SNDrainElement; import edu.mit.streamjit.impl.distributed.common.SNMessageElement; import edu.mit.streamjit.impl.distributed.common.TCPConnection.TCPConnectionInfo; import edu.mit.streamjit.impl.distributed.common.TCPConnection.TCPConnectionProvider; import edu.mit.streamjit.impl.distributed.common.Utils; /** * {@link BlobsManagerImpl} responsible to run all {@link Blob}s those are * assigned to the {@link StreamNode}. * * @author Sumanan [email protected] * @since May 27, 2013 */ public class BlobsManagerImpl implements BlobsManager { private Set<BlobExecuter> blobExecuters; private final StreamNode streamNode; private final TCPConnectionProvider conProvider; private Map<Token, TCPConnectionInfo> conInfoMap; private final CTRLRDrainProcessor drainProcessor; private final CommandProcessor cmdProcessor; private final ImmutableMap<Token, Buffer> bufferMap; public BlobsManagerImpl(ImmutableSet<Blob> blobSet, Map<Token, TCPConnectionInfo> conInfoMap, StreamNode streamNode, TCPConnectionProvider conProvider) { this.conInfoMap = conInfoMap; this.streamNode = streamNode; this.conProvider = conProvider; this.cmdProcessor = new CommandProcessorImpl(); this.drainProcessor = new CTRLRDrainProcessorImpl(); bufferMap = createBufferMap(blobSet); for (Blob b : blobSet) { b.installBuffers(bufferMap); } Set<Token> locaTokens = getLocalTokens(blobSet); blobExecuters = new HashSet<>(); for (Blob b : blobSet) { ImmutableMap<Token, BoundaryInputChannel> inputChannels = createInputChannels( Sets.difference(b.getInputs(), locaTokens), bufferMap); ImmutableMap<Token, BoundaryOutputChannel> outputChannels = createOutputChannels( Sets.difference(b.getOutputs(), locaTokens), bufferMap); blobExecuters .add(new BlobExecuter(b, inputChannels, outputChannels)); } } @Override public void start() { for (BlobExecuter be : blobExecuters) be.start(); } @Override public void stop() { for (BlobExecuter be : blobExecuters) be.stop(); } // TODO: Buffer sizes, including head and tail buffers, must be optimized. // consider adding some tuning factor private ImmutableMap<Token, Buffer> createBufferMap(Set<Blob> blobSet) { ImmutableMap.Builder<Token, Buffer> bufferMapBuilder = ImmutableMap .<Token, Buffer> builder(); Map<Token, Integer> minInputBufCapaciy = new HashMap<>(); Map<Token, Integer> minOutputBufCapaciy = new HashMap<>(); for (Blob b : blobSet) { Set<Blob.Token> inputs = b.getInputs(); for (Token t : inputs) { minInputBufCapaciy.put(t, b.getMinimumBufferCapacity(t)); } Set<Blob.Token> outputs = b.getOutputs(); for (Token t : outputs) { minOutputBufCapaciy.put(t, b.getMinimumBufferCapacity(t)); } } Set<Token> localTokens = Sets.intersection(minInputBufCapaciy.keySet(), minOutputBufCapaciy.keySet()); Set<Token> globalInputTokens = Sets.difference( minInputBufCapaciy.keySet(), localTokens); Set<Token> globalOutputTokens = Sets.difference( minOutputBufCapaciy.keySet(), localTokens); for (Token t : localTokens) { int bufSize; bufSize = lcm(minInputBufCapaciy.get(t), minOutputBufCapaciy.get(t)); // TODO: Just to increase the performance. Change it later bufSize = Math.max(1000, bufSize); Buffer buf = new ConcurrentArrayBuffer(bufSize); bufferMapBuilder.put(t, buf); } for (Token t : Sets.union(globalInputTokens, globalOutputTokens)) { bufferMapBuilder.put(t, new ConcurrentArrayBuffer(1000)); } return bufferMapBuilder.build(); } private int gcd(int a, int b) { while (true) { if (a == 0) return b; b %= a; if (b == 0) return a; a %= b; } } private int lcm(int a, int b) { int val = gcd(a, b); return val != 0 ? ((a * b) / val) : 0; } private Set<Token> getLocalTokens(Set<Blob> blobSet) { Set<Token> inputTokens = new HashSet<>(); Set<Token> outputTokens = new HashSet<>(); for (Blob b : blobSet) { Set<Token> inputs = b.getInputs(); for (Token t : inputs) { inputTokens.add(t); } Set<Token> outputs = b.getOutputs(); for (Token t : outputs) { outputTokens.add(t); } } return Sets.intersection(inputTokens, outputTokens); } private ImmutableMap<Token, BoundaryInputChannel> createInputChannels( Set<Token> inputTokens, ImmutableMap<Token, Buffer> bufferMap) { ImmutableMap.Builder<Token, BoundaryInputChannel> inputChannelMap = new ImmutableMap.Builder<>(); for (Token t : inputTokens) { TCPConnectionInfo conInfo = conInfoMap.get(t); inputChannelMap.put(t, new TCPInputChannel(bufferMap.get(t), conProvider, conInfo, t.toString(), 0)); } return inputChannelMap.build(); } private ImmutableMap<Token, BoundaryOutputChannel> createOutputChannels( Set<Token> outputTokens, ImmutableMap<Token, Buffer> bufferMap) { ImmutableMap.Builder<Token, BoundaryOutputChannel> outputChannelMap = new ImmutableMap.Builder<>(); for (Token t : outputTokens) { TCPConnectionInfo conInfo = conInfoMap.get(t); outputChannelMap.put(t, new TCPOutputChannel(bufferMap.get(t), conProvider, conInfo, t.toString(), 0)); } return outputChannelMap.build(); } private class BlobExecuter { private volatile int drainState; private final Token blobID; private final Blob blob; private Set<BlobThread> blobThreads; private final ImmutableMap<Token, BoundaryInputChannel> inputChannels; private final ImmutableMap<Token, BoundaryOutputChannel> outputChannels; Set<Thread> inputChannelThreads; Set<Thread> outputChannelThreads; private boolean reqDrainData; private BlobExecuter(Blob blob, ImmutableMap<Token, BoundaryInputChannel> inputChannels, ImmutableMap<Token, BoundaryOutputChannel> outputChannels) { this.blob = blob; this.blobThreads = new HashSet<>(); assert blob.getInputs().containsAll(inputChannels.keySet()); assert blob.getOutputs().containsAll(outputChannels.keySet()); this.inputChannels = inputChannels; this.outputChannels = outputChannels; inputChannelThreads = new HashSet<>(inputChannels.values().size()); outputChannelThreads = new HashSet<>(outputChannels.values().size()); for (int i = 0; i < blob.getCoreCount(); i++) { blobThreads.add(new BlobThread(blob.getCoreCode(i))); } drainState = 0; this.blobID = Utils.getBlobID(blob); } private void start() { for (BoundaryInputChannel bc : inputChannels.values()) { Thread t = new Thread(bc.getRunnable(), bc.name()); t.start(); inputChannelThreads.add(t); } for (BoundaryOutputChannel bc : outputChannels.values()) { Thread t = new Thread(bc.getRunnable(), bc.name()); t.start(); outputChannelThreads.add(t); } for (Thread t : blobThreads) t.start(); } private void stop() { for (BoundaryInputChannel bc : inputChannels.values()) { bc.stop(true); } for (BoundaryOutputChannel bc : outputChannels.values()) { bc.stop(true); } for (Thread t : blobThreads) try { t.join(); } catch (InterruptedException e) { e.printStackTrace(); } } private void doDrain(boolean reqDrainData) { this.reqDrainData = reqDrainData; drainState = 1; for (BoundaryInputChannel bc : inputChannels.values()) { bc.stop(!this.reqDrainData); } for (Thread t : inputChannelThreads) { try { t.join(); } catch (InterruptedException e) { e.printStackTrace(); } } DrainCallback dcb = new DrainCallback(this); drainState = 2; this.blob.drain(dcb); } private void drained() { drainState = 3; for (BlobThread bt : blobThreads) { bt.requestStop(); } for (BoundaryOutputChannel bc : outputChannels.values()) { bc.stop(!this.reqDrainData); } for (Thread t : outputChannelThreads) { try { t.join(); } catch (InterruptedException e) { e.printStackTrace(); } } drainState = 4; SNMessageElement drained = new SNDrainElement.Drained(blobID); try { streamNode.controllerConnection.writeObject(drained); } catch (IOException e) { e.printStackTrace(); } // System.out.println("Blob " + blobID + "is drained"); if (this.reqDrainData) { // System.out.println("**********************************"); DrainData dd = blob.getDrainData(); drainState = 5; for (Token t : dd.getData().keySet()) { System.out.println("From Blob: " + t.toString() + " - " + dd.getData().get(t).size()); } ImmutableMap.Builder<Token, ImmutableList<Object>> inputDataBuilder = new ImmutableMap.Builder<>(); ImmutableMap.Builder<Token, ImmutableList<Object>> outputDataBuilder = new ImmutableMap.Builder<>(); for (Token t : blob.getInputs()) { if (inputChannels.containsKey(t)) { BoundaryChannel chanl = inputChannels.get(t); ImmutableList<Object> draindata = chanl .getUnprocessedData(); System.out.println(String.format( "No of unprocessed data of %s is %d", chanl.name(), draindata.size())); inputDataBuilder.put(t, draindata); } // TODO: Unnecessary data copy. Optimise this. else { Buffer buf = bufferMap.get(t); Object[] bufArray = new Object[buf.size()]; buf.readAll(bufArray); assert buf.size() == 0 : String.format( "buffer size is %d. But 0 is expected", buf.size()); inputDataBuilder.put(t, ImmutableList.copyOf(bufArray)); } } for (Token t : blob.getOutputs()) { if (outputChannels.containsKey(t)) { BoundaryChannel chanl = outputChannels.get(t); ImmutableList<Object> draindata = chanl .getUnprocessedData(); System.out.println(String.format( "No of unprocessed data of %s is %d", chanl.name(), draindata.size())); outputDataBuilder.put(t, draindata); } } SNMessageElement me = new SNDrainElement.DrainedData(blobID, dd, inputDataBuilder.build(), outputDataBuilder.build()); try { streamNode.controllerConnection.writeObject(me); // System.out.println(blobID + " DrainData has been sent"); drainState = 6; } catch (IOException e) { e.printStackTrace(); } // System.out.println("**********************************"); } // printDrainedStatus(); } public Token getBlobID() { return Utils.getBlobID(blob); } } private static class DrainCallback implements Runnable { private final BlobExecuter blobExec; DrainCallback(BlobExecuter be) { this.blobExec = be; } @Override public void run() { blobExec.drained(); } } @Override public void drain(Token blobID, boolean reqDrainData) { for (BlobExecuter be : blobExecuters) { if (be.getBlobID().equals(blobID)) { be.doDrain(reqDrainData); return; } } throw new IllegalArgumentException(String.format( "No blob with blobID %s", blobID)); } /** * Just to added for debugging purpose. */ private synchronized void printDrainedStatus() { System.out.println("****************************************"); for (BlobExecuter be : blobExecuters) { switch (be.drainState) { case 0 : System.out.println(String.format("%s - No Drain Called", be.blobID)); break; case 1 : System.out.println(String.format("%s - Drain Called", be.blobID)); break; case 2 : System.out.println(String.format( "%s - Drain Passed to Interpreter", be.blobID)); break; case 3 : System.out.println(String.format( "%s - Returned from Interpreter", be.blobID)); break; case 4 : System.out.println(String.format( "%s - Draining Completed. All threads stopped.", be.blobID)); break; case 5 : System.out.println(String.format( "%s - Processing Drain data", be.blobID)); break; case 6 : System.out.println(String.format("%s - Draindata sent", be.blobID)); break; } } System.out.println("****************************************"); } @Override public void reqDrainedData(Set<Token> blobSet) { // ImmutableMap.Builder<Token, DrainData> builder = new // ImmutableMap.Builder<>(); // for (BlobExecuter be : blobExecuters) { // if (be.isDrained) { // builder.put(be.blobID, be.blob.getDrainData()); // } // } // // try { // streamNode.controllerConnection // .writeObject(new SNDrainElement.DrainedData(builder.build())); // } catch (IOException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } } public CTRLRDrainProcessor getDrainProcessor() { return drainProcessor; } public CommandProcessor getCommandProcessor() { return cmdProcessor; } /** * Implementation of {@link DrainProcessor} at {@link StreamNode} side. All * appropriate response logic to successfully perform the draining is * implemented here. * * @author Sumanan [email protected] * @since Jul 30, 2013 */ private class CTRLRDrainProcessorImpl implements CTRLRDrainProcessor { @Override public void process(DrainDataRequest drnDataReq) { reqDrainedData(drnDataReq.blobsSet); } @Override public void process(DoDrain drain) { drain(drain.blobID, drain.reqDrainData); } } /** * {@link CommandProcessor} at {@link StreamNode} side. * * @author Sumanan [email protected] * @since May 27, 2013 */ private class CommandProcessorImpl implements CommandProcessor { @Override public void processSTART() { start(); long heapMaxSize = Runtime.getRuntime().maxMemory(); long heapSize = Runtime.getRuntime().totalMemory(); long heapFreeSize = Runtime.getRuntime().freeMemory(); System.out .println("##############################################"); System.out.println("heapMaxSize = " + heapMaxSize / 1e6); System.out.println("heapSize = " + heapSize / 1e6); System.out.println("heapFreeSize = " + heapFreeSize / 1e6); System.out.println("StraemJit app is running..."); System.out .println("##############################################"); } @Override public void processSTOP() { stop(); System.out.println("StraemJit app stopped..."); try { streamNode.controllerConnection.writeObject(AppStatus.STOPPED); } catch (IOException e) { e.printStackTrace(); } } @Override public void processEXIT() { System.out.println("StreamNode is Exiting..."); streamNode.exit(); } } }
src/edu/mit/streamjit/impl/distributed/node/BlobsManagerImpl.java
package edu.mit.streamjit.impl.distributed.node; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; import edu.mit.streamjit.impl.blob.Blob; import edu.mit.streamjit.impl.blob.Buffer; import edu.mit.streamjit.impl.blob.ConcurrentArrayBuffer; import edu.mit.streamjit.impl.blob.Blob.Token; import edu.mit.streamjit.impl.blob.DrainData; import edu.mit.streamjit.impl.common.BlobThread; import edu.mit.streamjit.impl.distributed.common.BoundaryChannel; import edu.mit.streamjit.impl.distributed.common.BoundaryChannel.BoundaryInputChannel; import edu.mit.streamjit.impl.distributed.common.BoundaryChannel.BoundaryOutputChannel; import edu.mit.streamjit.impl.distributed.common.CTRLRDrainElement.CTRLRDrainProcessor; import edu.mit.streamjit.impl.distributed.common.CTRLRDrainElement.DoDrain; import edu.mit.streamjit.impl.distributed.common.CTRLRDrainElement.DrainDataRequest; import edu.mit.streamjit.impl.distributed.common.Command.CommandProcessor; import edu.mit.streamjit.impl.distributed.common.AppStatus; import edu.mit.streamjit.impl.distributed.common.SNDrainElement; import edu.mit.streamjit.impl.distributed.common.SNMessageElement; import edu.mit.streamjit.impl.distributed.common.TCPConnection.TCPConnectionInfo; import edu.mit.streamjit.impl.distributed.common.TCPConnection.TCPConnectionProvider; import edu.mit.streamjit.impl.distributed.common.Utils; /** * {@link BlobsManagerImpl} responsible to run all {@link Blob}s those are * assigned to the {@link StreamNode}. * * @author Sumanan [email protected] * @since May 27, 2013 */ public class BlobsManagerImpl implements BlobsManager { private Set<BlobExecuter> blobExecuters; private final StreamNode streamNode; private final TCPConnectionProvider conProvider; private Map<Token, TCPConnectionInfo> conInfoMap; private final CTRLRDrainProcessor drainProcessor; private final CommandProcessor cmdProcessor; private final ImmutableMap<Token, Buffer> bufferMap; public BlobsManagerImpl(ImmutableSet<Blob> blobSet, Map<Token, TCPConnectionInfo> conInfoMap, StreamNode streamNode, TCPConnectionProvider conProvider) { this.conInfoMap = conInfoMap; this.streamNode = streamNode; this.conProvider = conProvider; this.cmdProcessor = new CommandProcessorImpl(streamNode); this.drainProcessor = new CTRLRDrainProcessorImpl(streamNode); bufferMap = createBufferMap(blobSet); for (Blob b : blobSet) { b.installBuffers(bufferMap); } Set<Token> locaTokens = getLocalTokens(blobSet); blobExecuters = new HashSet<>(); for (Blob b : blobSet) { ImmutableMap<Token, BoundaryInputChannel> inputChannels = createInputChannels( Sets.difference(b.getInputs(), locaTokens), bufferMap); ImmutableMap<Token, BoundaryOutputChannel> outputChannels = createOutputChannels( Sets.difference(b.getOutputs(), locaTokens), bufferMap); blobExecuters .add(new BlobExecuter(b, inputChannels, outputChannels)); } } @Override public void start() { for (BlobExecuter be : blobExecuters) be.start(); } @Override public void stop() { for (BlobExecuter be : blobExecuters) be.stop(); } // TODO: Buffer sizes, including head and tail buffers, must be optimized. // consider adding some tuning factor private ImmutableMap<Token, Buffer> createBufferMap(Set<Blob> blobSet) { ImmutableMap.Builder<Token, Buffer> bufferMapBuilder = ImmutableMap .<Token, Buffer> builder(); Map<Token, Integer> minInputBufCapaciy = new HashMap<>(); Map<Token, Integer> minOutputBufCapaciy = new HashMap<>(); for (Blob b : blobSet) { Set<Blob.Token> inputs = b.getInputs(); for (Token t : inputs) { minInputBufCapaciy.put(t, b.getMinimumBufferCapacity(t)); } Set<Blob.Token> outputs = b.getOutputs(); for (Token t : outputs) { minOutputBufCapaciy.put(t, b.getMinimumBufferCapacity(t)); } } Set<Token> localTokens = Sets.intersection(minInputBufCapaciy.keySet(), minOutputBufCapaciy.keySet()); Set<Token> globalInputTokens = Sets.difference( minInputBufCapaciy.keySet(), localTokens); Set<Token> globalOutputTokens = Sets.difference( minOutputBufCapaciy.keySet(), localTokens); for (Token t : localTokens) { int bufSize; bufSize = lcm(minInputBufCapaciy.get(t), minOutputBufCapaciy.get(t)); // TODO: Just to increase the performance. Change it later bufSize = Math.max(1000, bufSize); Buffer buf = new ConcurrentArrayBuffer(bufSize); bufferMapBuilder.put(t, buf); } for (Token t : Sets.union(globalInputTokens, globalOutputTokens)) { bufferMapBuilder.put(t, new ConcurrentArrayBuffer(1000)); } return bufferMapBuilder.build(); } private int gcd(int a, int b) { while (true) { if (a == 0) return b; b %= a; if (b == 0) return a; a %= b; } } private int lcm(int a, int b) { int val = gcd(a, b); return val != 0 ? ((a * b) / val) : 0; } private Set<Token> getLocalTokens(Set<Blob> blobSet) { Set<Token> inputTokens = new HashSet<>(); Set<Token> outputTokens = new HashSet<>(); for (Blob b : blobSet) { Set<Token> inputs = b.getInputs(); for (Token t : inputs) { inputTokens.add(t); } Set<Token> outputs = b.getOutputs(); for (Token t : outputs) { outputTokens.add(t); } } return Sets.intersection(inputTokens, outputTokens); } private ImmutableMap<Token, BoundaryInputChannel> createInputChannels( Set<Token> inputTokens, ImmutableMap<Token, Buffer> bufferMap) { ImmutableMap.Builder<Token, BoundaryInputChannel> inputChannelMap = new ImmutableMap.Builder<>(); for (Token t : inputTokens) { TCPConnectionInfo conInfo = conInfoMap.get(t); inputChannelMap.put(t, new TCPInputChannel(bufferMap.get(t), conProvider, conInfo, t.toString(), 0)); } return inputChannelMap.build(); } private ImmutableMap<Token, BoundaryOutputChannel> createOutputChannels( Set<Token> outputTokens, ImmutableMap<Token, Buffer> bufferMap) { ImmutableMap.Builder<Token, BoundaryOutputChannel> outputChannelMap = new ImmutableMap.Builder<>(); for (Token t : outputTokens) { TCPConnectionInfo conInfo = conInfoMap.get(t); outputChannelMap.put(t, new TCPOutputChannel(bufferMap.get(t), conProvider, conInfo, t.toString(), 0)); } return outputChannelMap.build(); } private class BlobExecuter { private volatile int drainState; private final Token blobID; private final Blob blob; private Set<BlobThread> blobThreads; private final ImmutableMap<Token, BoundaryInputChannel> inputChannels; private final ImmutableMap<Token, BoundaryOutputChannel> outputChannels; Set<Thread> inputChannelThreads; Set<Thread> outputChannelThreads; private boolean reqDrainData; private BlobExecuter(Blob blob, ImmutableMap<Token, BoundaryInputChannel> inputChannels, ImmutableMap<Token, BoundaryOutputChannel> outputChannels) { this.blob = blob; this.blobThreads = new HashSet<>(); assert blob.getInputs().containsAll(inputChannels.keySet()); assert blob.getOutputs().containsAll(outputChannels.keySet()); this.inputChannels = inputChannels; this.outputChannels = outputChannels; inputChannelThreads = new HashSet<>(inputChannels.values().size()); outputChannelThreads = new HashSet<>(outputChannels.values().size()); for (int i = 0; i < blob.getCoreCount(); i++) { blobThreads.add(new BlobThread(blob.getCoreCode(i))); } drainState = 0; this.blobID = Utils.getBlobID(blob); } private void start() { for (BoundaryInputChannel bc : inputChannels.values()) { Thread t = new Thread(bc.getRunnable(), bc.name()); t.start(); inputChannelThreads.add(t); } for (BoundaryOutputChannel bc : outputChannels.values()) { Thread t = new Thread(bc.getRunnable(), bc.name()); t.start(); outputChannelThreads.add(t); } for (Thread t : blobThreads) t.start(); } private void stop() { for (BoundaryInputChannel bc : inputChannels.values()) { bc.stop(true); } for (BoundaryOutputChannel bc : outputChannels.values()) { bc.stop(true); } for (Thread t : blobThreads) try { t.join(); } catch (InterruptedException e) { e.printStackTrace(); } } private void doDrain(boolean reqDrainData) { this.reqDrainData = reqDrainData; drainState = 1; for (BoundaryInputChannel bc : inputChannels.values()) { bc.stop(!this.reqDrainData); } for (Thread t : inputChannelThreads) { try { t.join(); } catch (InterruptedException e) { e.printStackTrace(); } } DrainCallback dcb = new DrainCallback(this); drainState = 2; this.blob.drain(dcb); } private void drained() { drainState = 3; for (BlobThread bt : blobThreads) { bt.requestStop(); } for (BoundaryOutputChannel bc : outputChannels.values()) { bc.stop(!this.reqDrainData); } for (Thread t : outputChannelThreads) { try { t.join(); } catch (InterruptedException e) { e.printStackTrace(); } } drainState = 4; SNMessageElement drained = new SNDrainElement.Drained(blobID); try { streamNode.controllerConnection.writeObject(drained); } catch (IOException e) { e.printStackTrace(); } // System.out.println("Blob " + blobID + "is drained"); if (this.reqDrainData) { // System.out.println("**********************************"); DrainData dd = blob.getDrainData(); drainState = 5; for (Token t : dd.getData().keySet()) { System.out.println("From Blob: " + t.toString() + " - " + dd.getData().get(t).size()); } ImmutableMap.Builder<Token, ImmutableList<Object>> inputDataBuilder = new ImmutableMap.Builder<>(); ImmutableMap.Builder<Token, ImmutableList<Object>> outputDataBuilder = new ImmutableMap.Builder<>(); for (Token t : blob.getInputs()) { if (inputChannels.containsKey(t)) { BoundaryChannel chanl = inputChannels.get(t); ImmutableList<Object> draindata = chanl .getUnprocessedData(); System.out.println(String.format( "No of unprocessed data of %s is %d", chanl.name(), draindata.size())); inputDataBuilder.put(t, draindata); } // TODO: Unnecessary data copy. Optimise this. else { Buffer buf = bufferMap.get(t); Object[] bufArray = new Object[buf.size()]; buf.readAll(bufArray); assert buf.size() == 0 : String.format( "buffer size is %d. But 0 is expected", buf.size()); inputDataBuilder.put(t, ImmutableList.copyOf(bufArray)); } } for (Token t : blob.getOutputs()) { if (outputChannels.containsKey(t)) { BoundaryChannel chanl = outputChannels.get(t); ImmutableList<Object> draindata = chanl .getUnprocessedData(); System.out.println(String.format( "No of unprocessed data of %s is %d", chanl.name(), draindata.size())); outputDataBuilder.put(t, draindata); } } SNMessageElement me = new SNDrainElement.DrainedData(blobID, dd, inputDataBuilder.build(), outputDataBuilder.build()); try { streamNode.controllerConnection.writeObject(me); // System.out.println(blobID + " DrainData has been sent"); drainState = 6; } catch (IOException e) { e.printStackTrace(); } // System.out.println("**********************************"); } // printDrainedStatus(); } public Token getBlobID() { return Utils.getBlobID(blob); } } private static class DrainCallback implements Runnable { private final BlobExecuter blobExec; DrainCallback(BlobExecuter be) { this.blobExec = be; } @Override public void run() { blobExec.drained(); } } @Override public void drain(Token blobID, boolean reqDrainData) { for (BlobExecuter be : blobExecuters) { if (be.getBlobID().equals(blobID)) { be.doDrain(reqDrainData); return; } } throw new IllegalArgumentException(String.format( "No blob with blobID %s", blobID)); } /** * Just to added for debugging purpose. */ private synchronized void printDrainedStatus() { System.out.println("****************************************"); for (BlobExecuter be : blobExecuters) { switch (be.drainState) { case 0 : System.out.println(String.format("%s - No Drain Called", be.blobID)); break; case 1 : System.out.println(String.format("%s - Drain Called", be.blobID)); break; case 2 : System.out.println(String.format( "%s - Drain Passed to Interpreter", be.blobID)); break; case 3 : System.out.println(String.format( "%s - Returned from Interpreter", be.blobID)); break; case 4 : System.out.println(String.format( "%s - Draining Completed. All threads stopped.", be.blobID)); break; case 5 : System.out.println(String.format( "%s - Processing Drain data", be.blobID)); break; case 6 : System.out.println(String.format("%s - Draindata sent", be.blobID)); break; } } System.out.println("****************************************"); } @Override public void reqDrainedData(Set<Token> blobSet) { // ImmutableMap.Builder<Token, DrainData> builder = new // ImmutableMap.Builder<>(); // for (BlobExecuter be : blobExecuters) { // if (be.isDrained) { // builder.put(be.blobID, be.blob.getDrainData()); // } // } // // try { // streamNode.controllerConnection // .writeObject(new SNDrainElement.DrainedData(builder.build())); // } catch (IOException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } } public CTRLRDrainProcessor getDrainProcessor() { return drainProcessor; } public CommandProcessor getCommandProcessor() { return cmdProcessor; } /** * Implementation of {@link DrainProcessor} at {@link StreamNode} side. All * appropriate response logic to successfully perform the draining is * implemented here. * * @author Sumanan [email protected] * @since Jul 30, 2013 */ public class CTRLRDrainProcessorImpl implements CTRLRDrainProcessor { StreamNode streamNode; public CTRLRDrainProcessorImpl(StreamNode streamNode) { this.streamNode = streamNode; } @Override public void process(DrainDataRequest drnDataReq) { streamNode.getBlobsManager().reqDrainedData(drnDataReq.blobsSet); } @Override public void process(DoDrain drain) { streamNode.getBlobsManager() .drain(drain.blobID, drain.reqDrainData); } } /** * {@link CommandProcessor} at {@link StreamNode} side. * * @author Sumanan [email protected] * @since May 27, 2013 */ public class CommandProcessorImpl implements CommandProcessor { StreamNode streamNode; public CommandProcessorImpl(StreamNode streamNode) { this.streamNode = streamNode; } @Override public void processSTART() { BlobsManager bm = streamNode.getBlobsManager(); if (bm != null) { bm.start(); long heapMaxSize = Runtime.getRuntime().maxMemory(); long heapSize = Runtime.getRuntime().totalMemory(); long heapFreeSize = Runtime.getRuntime().freeMemory(); System.out .println("##############################################"); System.out.println("heapMaxSize = " + heapMaxSize / 1e6); System.out.println("heapSize = " + heapSize / 1e6); System.out.println("heapFreeSize = " + heapFreeSize / 1e6); System.out.println("StraemJit app is running..."); System.out .println("##############################################"); } else { // TODO: Need to handle this case. Need to send the error // message to // the controller. System.out .println("Couldn't start the blobs...BlobsManager is null."); } } @Override public void processSTOP() { BlobsManager bm = streamNode.getBlobsManager(); if (bm != null) { bm.stop(); System.out.println("StraemJit app stopped..."); try { streamNode.controllerConnection .writeObject(AppStatus.STOPPED); } catch (IOException e) { e.printStackTrace(); } } else { // TODO: Need to handle this case. Need to send the error // message to // the controller. System.out .println("Couldn't stop the blobs...BlobsManager is null."); } } @Override public void processEXIT() { System.out.println("StreamNode is Exiting..."); streamNode.exit(); } } }
Changes due to previous restructure Inner classes are changed to access outer class's instance variables and methods.
src/edu/mit/streamjit/impl/distributed/node/BlobsManagerImpl.java
Changes due to previous restructure
<ide><path>rc/edu/mit/streamjit/impl/distributed/node/BlobsManagerImpl.java <ide> this.streamNode = streamNode; <ide> this.conProvider = conProvider; <ide> <del> this.cmdProcessor = new CommandProcessorImpl(streamNode); <del> this.drainProcessor = new CTRLRDrainProcessorImpl(streamNode); <add> this.cmdProcessor = new CommandProcessorImpl(); <add> this.drainProcessor = new CTRLRDrainProcessorImpl(); <ide> <ide> bufferMap = createBufferMap(blobSet); <ide> <ide> * @author Sumanan [email protected] <ide> * @since Jul 30, 2013 <ide> */ <del> public class CTRLRDrainProcessorImpl implements CTRLRDrainProcessor { <del> <del> StreamNode streamNode; <del> <del> public CTRLRDrainProcessorImpl(StreamNode streamNode) { <del> this.streamNode = streamNode; <del> } <add> private class CTRLRDrainProcessorImpl implements CTRLRDrainProcessor { <ide> <ide> @Override <ide> public void process(DrainDataRequest drnDataReq) { <del> streamNode.getBlobsManager().reqDrainedData(drnDataReq.blobsSet); <add> reqDrainedData(drnDataReq.blobsSet); <ide> } <ide> <ide> @Override <ide> public void process(DoDrain drain) { <del> streamNode.getBlobsManager() <del> .drain(drain.blobID, drain.reqDrainData); <add> drain(drain.blobID, drain.reqDrainData); <ide> } <ide> } <ide> <ide> * @author Sumanan [email protected] <ide> * @since May 27, 2013 <ide> */ <del> public class CommandProcessorImpl implements CommandProcessor { <del> StreamNode streamNode; <del> <del> public CommandProcessorImpl(StreamNode streamNode) { <del> this.streamNode = streamNode; <del> } <add> private class CommandProcessorImpl implements CommandProcessor { <ide> <ide> @Override <ide> public void processSTART() { <del> BlobsManager bm = streamNode.getBlobsManager(); <del> if (bm != null) { <del> bm.start(); <del> long heapMaxSize = Runtime.getRuntime().maxMemory(); <del> long heapSize = Runtime.getRuntime().totalMemory(); <del> long heapFreeSize = Runtime.getRuntime().freeMemory(); <del> <del> System.out <del> .println("##############################################"); <del> <del> System.out.println("heapMaxSize = " + heapMaxSize / 1e6); <del> System.out.println("heapSize = " + heapSize / 1e6); <del> System.out.println("heapFreeSize = " + heapFreeSize / 1e6); <del> System.out.println("StraemJit app is running..."); <del> System.out <del> .println("##############################################"); <del> <del> } else { <del> // TODO: Need to handle this case. Need to send the error <del> // message to <del> // the controller. <del> System.out <del> .println("Couldn't start the blobs...BlobsManager is null."); <del> } <add> start(); <add> long heapMaxSize = Runtime.getRuntime().maxMemory(); <add> long heapSize = Runtime.getRuntime().totalMemory(); <add> long heapFreeSize = Runtime.getRuntime().freeMemory(); <add> <add> System.out <add> .println("##############################################"); <add> <add> System.out.println("heapMaxSize = " + heapMaxSize / 1e6); <add> System.out.println("heapSize = " + heapSize / 1e6); <add> System.out.println("heapFreeSize = " + heapFreeSize / 1e6); <add> System.out.println("StraemJit app is running..."); <add> System.out <add> .println("##############################################"); <add> <ide> } <ide> <ide> @Override <ide> public void processSTOP() { <del> BlobsManager bm = streamNode.getBlobsManager(); <del> if (bm != null) { <del> bm.stop(); <del> System.out.println("StraemJit app stopped..."); <del> try { <del> streamNode.controllerConnection <del> .writeObject(AppStatus.STOPPED); <del> } catch (IOException e) { <del> e.printStackTrace(); <del> } <del> } else { <del> // TODO: Need to handle this case. Need to send the error <del> // message to <del> // the controller. <del> System.out <del> .println("Couldn't stop the blobs...BlobsManager is null."); <add> stop(); <add> System.out.println("StraemJit app stopped..."); <add> try { <add> streamNode.controllerConnection.writeObject(AppStatus.STOPPED); <add> } catch (IOException e) { <add> e.printStackTrace(); <ide> } <ide> } <ide> <ide> streamNode.exit(); <ide> } <ide> } <del> <ide> }
Java
apache-2.0
e96f5fc10270d977a3efedba1eb1aeb1c5ef1680
0
allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.diff.util; import com.intellij.application.options.CodeStyle; import com.intellij.codeInsight.daemon.OutsidersPsiFileSupport; import com.intellij.diff.*; import com.intellij.diff.comparison.ByWord; import com.intellij.diff.comparison.ComparisonMergeUtil; import com.intellij.diff.comparison.ComparisonPolicy; import com.intellij.diff.comparison.ComparisonUtil; import com.intellij.diff.contents.DiffContent; import com.intellij.diff.contents.DocumentContent; import com.intellij.diff.contents.EmptyContent; import com.intellij.diff.fragments.DiffFragment; import com.intellij.diff.fragments.LineFragment; import com.intellij.diff.fragments.MergeLineFragment; import com.intellij.diff.fragments.MergeWordFragment; import com.intellij.diff.impl.DiffSettingsHolder.DiffSettings; import com.intellij.diff.impl.DiffToolSubstitutor; import com.intellij.diff.requests.ContentDiffRequest; import com.intellij.diff.requests.DiffRequest; import com.intellij.diff.tools.util.DiffNotifications; import com.intellij.diff.tools.util.FoldingModelSupport; import com.intellij.diff.tools.util.base.TextDiffSettingsHolder.TextDiffSettings; import com.intellij.diff.tools.util.base.TextDiffViewerUtil; import com.intellij.diff.tools.util.text.*; import com.intellij.icons.AllIcons; import com.intellij.lang.Language; import com.intellij.openapi.Disposable; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.application.impl.LaterInvocator; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.command.UndoConfirmationPolicy; import com.intellij.openapi.command.undo.DocumentReference; import com.intellij.openapi.command.undo.DocumentReferenceManager; import com.intellij.openapi.command.undo.UndoManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.diff.impl.GenericDataProvider; import com.intellij.openapi.editor.*; import com.intellij.openapi.editor.colors.EditorColors; import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.colors.EditorColorsScheme; import com.intellij.openapi.editor.event.DocumentEvent; import com.intellij.openapi.editor.ex.EditorEx; import com.intellij.openapi.editor.ex.EditorMarkupModel; import com.intellij.openapi.editor.ex.util.EditorUtil; import com.intellij.openapi.editor.ex.util.EmptyEditorHighlighter; import com.intellij.openapi.editor.highlighter.EditorHighlighter; import com.intellij.openapi.editor.highlighter.EditorHighlighterFactory; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.fileEditor.impl.text.TextEditorImpl; import com.intellij.openapi.fileTypes.FileType; import com.intellij.openapi.fileTypes.PlainTextFileType; import com.intellij.openapi.fileTypes.SyntaxHighlighter; import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectManager; import com.intellij.openapi.ui.DialogWrapperDialog; import com.intellij.openapi.ui.MessageType; import com.intellij.openapi.ui.WindowWrapper; import com.intellij.openapi.ui.popup.Balloon; import com.intellij.openapi.ui.popup.JBPopupFactory; import com.intellij.openapi.util.*; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.ReadonlyStatusHandler; import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.newvfs.RefreshQueue; import com.intellij.openapi.wm.IdeFocusManager; import com.intellij.openapi.wm.IdeFrame; import com.intellij.openapi.wm.WindowManager; import com.intellij.openapi.wm.ex.IdeFrameEx; import com.intellij.openapi.wm.impl.IdeFrameImpl; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; import com.intellij.psi.codeStyle.CommonCodeStyleSettings; import com.intellij.testFramework.LightVirtualFile; import com.intellij.ui.ColorUtil; import com.intellij.ui.HyperlinkAdapter; import com.intellij.ui.JBColor; import com.intellij.ui.ScreenUtil; import com.intellij.ui.awt.RelativePoint; import com.intellij.ui.components.JBLabel; import com.intellij.ui.scale.JBUIScale; import com.intellij.util.ArrayUtil; import com.intellij.util.DocumentUtil; import com.intellij.util.ImageLoader; import com.intellij.util.LineSeparator; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.Convertor; import com.intellij.util.ui.JBInsets; import com.intellij.util.ui.JBUI; import com.intellij.util.ui.UIUtil; import gnu.trove.Equality; import gnu.trove.TIntFunction; import org.jetbrains.annotations.*; import javax.swing.*; import javax.swing.border.Border; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import java.awt.*; import java.nio.charset.Charset; import java.util.List; import java.util.*; public class DiffUtil { private static final Logger LOG = Logger.getInstance(DiffUtil.class); public static final Key<Boolean> TEMP_FILE_KEY = Key.create("Diff.TempFile"); @NotNull public static final String DIFF_CONFIG = "diff.xml"; public static final int TITLE_GAP = JBUIScale.scale(2); public static final List<Image> DIFF_FRAME_ICONS = loadDiffFrameImages(); @NotNull private static List<Image> loadDiffFrameImages() { return Arrays.asList(ImageLoader.loadFromResource("/diff_frame32.png"), ImageLoader.loadFromResource("/diff_frame64.png"), ImageLoader.loadFromResource("/diff_frame128.png")); } // // Editor // public static boolean isDiffEditor(@NotNull Editor editor) { return editor.getEditorKind() == EditorKind.DIFF; } @Nullable public static EditorHighlighter initEditorHighlighter(@Nullable Project project, @NotNull DocumentContent content, @NotNull CharSequence text) { EditorHighlighter highlighter = createEditorHighlighter(project, content); if (highlighter == null) return null; highlighter.setText(text); return highlighter; } @NotNull public static EditorHighlighter initEmptyEditorHighlighter(@NotNull CharSequence text) { EditorHighlighter highlighter = createEmptyEditorHighlighter(); highlighter.setText(text); return highlighter; } @Nullable private static EditorHighlighter createEditorHighlighter(@Nullable Project project, @NotNull DocumentContent content) { FileType type = content.getContentType(); VirtualFile file = content.getHighlightFile(); Language language = content.getUserData(DiffUserDataKeys.LANGUAGE); EditorHighlighterFactory highlighterFactory = EditorHighlighterFactory.getInstance(); if (language != null) { SyntaxHighlighter syntaxHighlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(language, project, file); return highlighterFactory.createEditorHighlighter(syntaxHighlighter, EditorColorsManager.getInstance().getGlobalScheme()); } if (file != null && file.isValid()) { if ((type == null || type == PlainTextFileType.INSTANCE) || file.getFileType() == type || file instanceof LightVirtualFile) { return highlighterFactory.createEditorHighlighter(project, file); } } if (type != null) { return highlighterFactory.createEditorHighlighter(project, type); } return null; } @NotNull private static EditorHighlighter createEmptyEditorHighlighter() { return new EmptyEditorHighlighter(EditorColorsManager.getInstance().getGlobalScheme().getAttributes(HighlighterColors.TEXT)); } public static void setEditorHighlighter(@Nullable Project project, @NotNull EditorEx editor, @NotNull DocumentContent content) { EditorHighlighter highlighter = createEditorHighlighter(project, content); if (highlighter != null) editor.setHighlighter(highlighter); } public static void setEditorCodeStyle(@Nullable Project project, @NotNull EditorEx editor, @Nullable DocumentContent content) { if (project != null && content != null && editor.getVirtualFile() == null) { PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(content.getDocument()); CommonCodeStyleSettings.IndentOptions indentOptions = psiFile != null ? CodeStyle.getSettings(psiFile).getIndentOptionsByFile(psiFile) : CodeStyle.getSettings(project).getIndentOptions(content.getContentType()); editor.getSettings().setTabSize(indentOptions.TAB_SIZE); editor.getSettings().setUseTabCharacter(indentOptions.USE_TAB_CHARACTER); } Language language = content != null ? content.getUserData(DiffUserDataKeys.LANGUAGE) : null; if (language == null) language = TextEditorImpl.getDocumentLanguage(editor); editor.getSettings().setLanguage(language); editor.getSettings().setCaretRowShown(false); editor.reinitSettings(); } public static void setFoldingModelSupport(@NotNull EditorEx editor) { editor.getSettings().setFoldingOutlineShown(true); editor.getSettings().setAutoCodeFoldingEnabled(false); editor.getColorsScheme().setAttributes(EditorColors.FOLDED_TEXT_ATTRIBUTES, null); } @NotNull public static EditorEx createEditor(@NotNull Document document, @Nullable Project project, boolean isViewer) { return createEditor(document, project, isViewer, false); } @NotNull public static EditorEx createEditor(@NotNull Document document, @Nullable Project project, boolean isViewer, boolean enableFolding) { EditorFactory factory = EditorFactory.getInstance(); EditorKind kind = EditorKind.DIFF; EditorEx editor = (EditorEx)(isViewer ? factory.createViewer(document, project, kind) : factory.createEditor(document, project, kind)); editor.getSettings().setShowIntentionBulb(false); ((EditorMarkupModel)editor.getMarkupModel()).setErrorStripeVisible(true); editor.getGutterComponentEx().setShowDefaultGutterPopup(false); if (enableFolding) { setFoldingModelSupport(editor); } else { editor.getSettings().setFoldingOutlineShown(false); editor.getFoldingModel().setFoldingEnabled(false); } UIUtil.removeScrollBorder(editor.getComponent()); return editor; } public static void configureEditor(@NotNull EditorEx editor, @NotNull DocumentContent content, @Nullable Project project) { VirtualFile virtualFile = FileDocumentManager.getInstance().getFile(content.getDocument()); if (virtualFile != null && Registry.is("diff.enable.psi.highlighting")) { editor.setFile(virtualFile); } setEditorHighlighter(project, editor, content); setEditorCodeStyle(project, editor, content); } public static boolean isMirrored(@NotNull Editor editor) { if (editor instanceof EditorEx) { return ((EditorEx)editor).getVerticalScrollbarOrientation() == EditorEx.VERTICAL_SCROLLBAR_LEFT; } return false; } @Contract("null, _ -> false; _, null -> false") public static boolean canNavigateToFile(@Nullable Project project, @Nullable VirtualFile file) { if (project == null || project.isDefault()) return false; if (file == null || !file.isValid()) return false; if (OutsidersPsiFileSupport.isOutsiderFile(file)) return false; if (file.getUserData(TEMP_FILE_KEY) == Boolean.TRUE) return false; return true; } public static void installLineConvertor(@NotNull EditorEx editor, @NotNull FoldingModelSupport foldingSupport) { assert foldingSupport.getCount() == 1; TIntFunction foldingLineConvertor = foldingSupport.getLineConvertor(0); editor.getGutterComponentEx().setLineNumberConvertor(foldingLineConvertor); } public static void installLineConvertor(@NotNull EditorEx editor, @NotNull DocumentContent content) { TIntFunction contentLineConvertor = getContentLineConvertor(content); editor.getGutterComponentEx().setLineNumberConvertor(contentLineConvertor); } public static void installLineConvertor(@NotNull EditorEx editor, @NotNull DocumentContent content, @NotNull FoldingModelSupport foldingSupport, int editorIndex) { TIntFunction contentLineConvertor = getContentLineConvertor(content); TIntFunction foldingLineConvertor = foldingSupport.getLineConvertor(editorIndex); editor.getGutterComponentEx().setLineNumberConvertor(mergeLineConverters(contentLineConvertor, foldingLineConvertor)); } @Nullable public static TIntFunction getContentLineConvertor(@NotNull DocumentContent content) { return content.getUserData(DiffUserDataKeysEx.LINE_NUMBER_CONVERTOR); } @Nullable public static TIntFunction mergeLineConverters(@Nullable TIntFunction convertor1, @Nullable TIntFunction convertor2) { if (convertor1 == null && convertor2 == null) return null; if (convertor1 == null) return convertor2; if (convertor2 == null) return convertor1; return value -> { int value2 = convertor2.execute(value); return value2 >= 0 ? convertor1.execute(value2) : value2; }; } // // Scrolling // public static void disableBlitting(@NotNull EditorEx editor) { if (Registry.is("diff.divider.repainting.disable.blitting")) { editor.getScrollPane().getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); } } public static void moveCaret(@Nullable final Editor editor, int line) { if (editor == null) return; editor.getCaretModel().removeSecondaryCarets(); editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(line, 0)); } public static void scrollEditor(@Nullable final Editor editor, int line, boolean animated) { scrollEditor(editor, line, 0, animated); } public static void scrollEditor(@Nullable final Editor editor, int line, int column, boolean animated) { if (editor == null) return; editor.getCaretModel().removeSecondaryCarets(); editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(line, column)); scrollToCaret(editor, animated); } public static void scrollToPoint(@Nullable Editor editor, @NotNull Point point, boolean animated) { if (editor == null) return; if (!animated) editor.getScrollingModel().disableAnimation(); editor.getScrollingModel().scrollHorizontally(point.x); editor.getScrollingModel().scrollVertically(point.y); if (!animated) editor.getScrollingModel().enableAnimation(); } public static void scrollToCaret(@Nullable Editor editor, boolean animated) { if (editor == null) return; if (!animated) editor.getScrollingModel().disableAnimation(); editor.getScrollingModel().scrollToCaret(ScrollType.CENTER); if (!animated) editor.getScrollingModel().enableAnimation(); } @NotNull public static Point getScrollingPosition(@Nullable Editor editor) { if (editor == null) return new Point(0, 0); ScrollingModel model = editor.getScrollingModel(); return new Point(model.getHorizontalScrollOffset(), model.getVerticalScrollOffset()); } @NotNull public static LogicalPosition getCaretPosition(@Nullable Editor editor) { return editor != null ? editor.getCaretModel().getLogicalPosition() : new LogicalPosition(0, 0); } public static void moveCaretToLineRangeIfNeeded(@NotNull Editor editor, int startLine, int endLine) { int caretLine = editor.getCaretModel().getLogicalPosition().line; if (!isSelectedByLine(caretLine, startLine, endLine)) { editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(startLine, 0)); } } // // Icons // @NotNull public static Icon getArrowIcon(@NotNull Side sourceSide) { return sourceSide.select(AllIcons.Diff.ArrowRight, AllIcons.Diff.Arrow); } @NotNull public static Icon getArrowDownIcon(@NotNull Side sourceSide) { return sourceSide.select(AllIcons.Diff.ArrowRightDown, AllIcons.Diff.ArrowLeftDown); } // // UI // public static void registerAction(@NotNull AnAction action, @NotNull JComponent component) { action.registerCustomShortcutSet(action.getShortcutSet(), component); } @NotNull public static JPanel createMessagePanel(@NotNull String message) { String text = StringUtil.replace(message, "\n", "<br>"); JLabel label = new JBLabel(text) { @Override public Dimension getMinimumSize() { Dimension size = super.getMinimumSize(); size.width = Math.min(size.width, 200); size.height = Math.min(size.height, 100); return size; } }.setCopyable(true); return createMessagePanel(label); } @NotNull public static JPanel createMessagePanel(@NotNull JComponent label) { CenteredPanel panel = new CenteredPanel(label, JBUI.Borders.empty(5)); EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme(); TextAttributes commentAttributes = scheme.getAttributes(DefaultLanguageHighlighterColors.LINE_COMMENT); if (commentAttributes.getForegroundColor() != null && commentAttributes.getBackgroundColor() == null) { label.setForeground(commentAttributes.getForegroundColor()); } else { label.setForeground(scheme.getDefaultForeground()); } label.setBackground(scheme.getDefaultBackground()); panel.setBackground(scheme.getDefaultBackground()); return panel; } public static void addActionBlock(@NotNull DefaultActionGroup group, AnAction... actions) { addActionBlock(group, Arrays.asList(actions)); } public static void addActionBlock(@NotNull DefaultActionGroup group, @Nullable List<? extends AnAction> actions) { if (actions == null || actions.isEmpty()) return; group.addSeparator(); AnAction[] children = group.getChildren(null); for (AnAction action : actions) { if (action instanceof Separator || !ArrayUtil.contains(action, children)) { group.add(action); } } } @NotNull public static String getSettingsConfigurablePath() { if (SystemInfo.isMac) { return "Preferences | Tools | Diff & Merge"; } return "Settings | Tools | Diff & Merge"; } @NotNull public static String createTooltipText(@NotNull String text, @Nullable String appendix) { StringBuilder result = new StringBuilder(); result.append("<html><body>"); result.append(text); if (appendix != null) { result.append("<br><div style='margin-top: 5px'><font size='2'>"); result.append(appendix); result.append("</font></div>"); } result.append("</body></html>"); return result.toString(); } @NotNull public static String createNotificationText(@NotNull String text, @Nullable String appendix) { StringBuilder result = new StringBuilder(); result.append("<html><body>"); result.append(text); if (appendix != null) { result.append("<br><span style='color:#").append(ColorUtil.toHex(JBColor.gray)).append("'><small>"); result.append(appendix); result.append("</small></span>"); } result.append("</body></html>"); return result.toString(); } public static void showSuccessPopup(@NotNull String message, @NotNull RelativePoint point, @NotNull Disposable disposable, @Nullable Runnable hyperlinkHandler) { HyperlinkListener listener = null; if (hyperlinkHandler != null) { listener = new HyperlinkAdapter() { @Override protected void hyperlinkActivated(HyperlinkEvent e) { hyperlinkHandler.run(); } }; } Color bgColor = MessageType.INFO.getPopupBackground(); Balloon balloon = JBPopupFactory.getInstance() .createHtmlTextBalloonBuilder(message, null, bgColor, listener) .setAnimationCycle(200) .createBalloon(); balloon.show(point, Balloon.Position.below); Disposer.register(disposable, balloon); } // // Titles // @NotNull public static List<JComponent> createSimpleTitles(@NotNull ContentDiffRequest request) { List<DiffContent> contents = request.getContents(); List<String> titles = request.getContentTitles(); if (!ContainerUtil.exists(titles, Condition.NOT_NULL)) { return Collections.nCopies(titles.size(), null); } List<JComponent> components = new ArrayList<>(titles.size()); for (int i = 0; i < contents.size(); i++) { JComponent title = createTitle(StringUtil.notNullize(titles.get(i))); title = createTitleWithNotifications(title, contents.get(i)); components.add(title); } return components; } @NotNull public static List<JComponent> createTextTitles(@NotNull ContentDiffRequest request, @NotNull List<? extends Editor> editors) { List<DiffContent> contents = request.getContents(); List<String> titles = request.getContentTitles(); boolean equalCharsets = TextDiffViewerUtil.areEqualCharsets(contents); boolean equalSeparators = TextDiffViewerUtil.areEqualLineSeparators(contents); List<JComponent> result = new ArrayList<>(contents.size()); if (equalCharsets && equalSeparators && !ContainerUtil.exists(titles, Condition.NOT_NULL)) { return Collections.nCopies(titles.size(), null); } for (int i = 0; i < contents.size(); i++) { JComponent title = createTitle(StringUtil.notNullize(titles.get(i)), contents.get(i), equalCharsets, equalSeparators, editors.get(i)); title = createTitleWithNotifications(title, contents.get(i)); result.add(title); } return result; } @Nullable private static JComponent createTitleWithNotifications(@Nullable JComponent title, @NotNull DiffContent content) { List<JComponent> notifications = new ArrayList<>(getCustomNotifications(content)); if (content instanceof DocumentContent) { Document document = ((DocumentContent)content).getDocument(); if (FileDocumentManager.getInstance().isPartialPreviewOfALargeFile(document)) { notifications.add(DiffNotifications.createNotification("File is too large. Only preview is loaded.")); } } if (notifications.isEmpty()) return title; JPanel panel = new JPanel(new BorderLayout(0, TITLE_GAP)); if (title != null) panel.add(title, BorderLayout.NORTH); panel.add(createStackedComponents(notifications, TITLE_GAP), BorderLayout.SOUTH); return panel; } @Nullable private static JComponent createTitle(@NotNull String title, @NotNull DiffContent content, boolean equalCharsets, boolean equalSeparators, @Nullable Editor editor) { if (content instanceof EmptyContent) return null; DocumentContent documentContent = (DocumentContent)content; Charset charset = equalCharsets ? null : documentContent.getCharset(); Boolean bom = equalCharsets ? null : documentContent.hasBom(); LineSeparator separator = equalSeparators ? null : documentContent.getLineSeparator(); boolean isReadOnly = editor == null || editor.isViewer() || !canMakeWritable(editor.getDocument()); return createTitle(title, separator, charset, bom, isReadOnly); } @NotNull public static JComponent createTitle(@NotNull String title) { return createTitle(title, null, null, null, false); } @NotNull public static JComponent createTitle(@NotNull String title, @Nullable LineSeparator separator, @Nullable Charset charset, @Nullable Boolean bom, boolean readOnly) { JPanel panel = new JPanel(new BorderLayout()); panel.setBorder(JBUI.Borders.empty(0, 4)); JBLabel titleLabel = new JBLabel(title).setCopyable(true); if (readOnly) titleLabel.setIcon(AllIcons.Ide.Readonly); panel.add(titleLabel, BorderLayout.CENTER); if (charset != null && separator != null) { JPanel panel2 = new JPanel(); panel2.setLayout(new BoxLayout(panel2, BoxLayout.X_AXIS)); panel2.add(createCharsetPanel(charset, bom)); panel2.add(Box.createRigidArea(JBUI.size(4, 0))); panel2.add(createSeparatorPanel(separator)); panel.add(panel2, BorderLayout.EAST); } else if (charset != null) { panel.add(createCharsetPanel(charset, bom), BorderLayout.EAST); } else if (separator != null) { panel.add(createSeparatorPanel(separator), BorderLayout.EAST); } return panel; } @NotNull private static JComponent createCharsetPanel(@NotNull Charset charset, @Nullable Boolean bom) { String text = charset.displayName(); if (bom != null && bom) { text += " BOM"; } JLabel label = new JLabel(text); // TODO: specific colors for other charsets if (charset.equals(Charset.forName("UTF-8"))) { label.setForeground(JBColor.BLUE); } else if (charset.equals(Charset.forName("ISO-8859-1"))) { label.setForeground(JBColor.RED); } else { label.setForeground(JBColor.BLACK); } return label; } @NotNull private static JComponent createSeparatorPanel(@NotNull LineSeparator separator) { JLabel label = new JLabel(separator.name()); Color color; if (separator == LineSeparator.CRLF) { color = JBColor.RED; } else if (separator == LineSeparator.LF) { color = JBColor.BLUE; } else if (separator == LineSeparator.CR) { color = JBColor.MAGENTA; } else { color = JBColor.BLACK; } label.setForeground(color); return label; } @NotNull public static List<JComponent> createSyncHeightComponents(@NotNull final List<JComponent> components) { if (!ContainerUtil.exists(components, Condition.NOT_NULL)) return components; List<JComponent> result = new ArrayList<>(); for (int i = 0; i < components.size(); i++) { result.add(new SyncHeightComponent(components, i)); } return result; } @NotNull public static JComponent createStackedComponents(@NotNull List<? extends JComponent> components, int gap) { JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); for (int i = 0; i < components.size(); i++) { if (i != 0) panel.add(Box.createVerticalStrut(JBUIScale.scale(gap))); panel.add(components.get(i)); } return panel; } // // Focus // public static boolean isFocusedComponent(@Nullable Component component) { return isFocusedComponent(null, component); } public static boolean isFocusedComponent(@Nullable Project project, @Nullable Component component) { if (component == null) return false; Component ideFocusOwner = IdeFocusManager.getInstance(project).getFocusOwner(); if (ideFocusOwner != null && SwingUtilities.isDescendingFrom(ideFocusOwner, component)) return true; Component jdkFocusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); if (jdkFocusOwner != null && SwingUtilities.isDescendingFrom(jdkFocusOwner, component)) return true; return false; } public static void requestFocus(@Nullable Project project, @Nullable Component component) { if (component == null) return; IdeFocusManager.getInstance(project).requestFocus(component, true); } public static boolean isFocusedComponentInWindow(@Nullable Component component) { if (component == null) return false; Window window = UIUtil.getWindow(component); if (window == null) return false; Component windowFocusOwner = window.getMostRecentFocusOwner(); return windowFocusOwner != null && SwingUtilities.isDescendingFrom(windowFocusOwner, component); } public static void requestFocusInWindow(@Nullable Component component) { if (component != null) component.requestFocusInWindow(); } public static void runPreservingFocus(@NotNull FocusableContext context, @NotNull Runnable task) { boolean hadFocus = context.isFocusedInWindow(); // if (hadFocus) KeyboardFocusManager.getCurrentKeyboardFocusManager().clearFocusOwner(); task.run(); if (hadFocus) context.requestFocusInWindow(); } // // Compare // @NotNull public static TwosideTextDiffProvider createTextDiffProvider(@Nullable Project project, @NotNull ContentDiffRequest request, @NotNull TextDiffSettings settings, @NotNull Runnable rediff, @NotNull Disposable disposable) { DiffUserDataKeysEx.DiffComputer diffComputer = request.getUserData(DiffUserDataKeysEx.CUSTOM_DIFF_COMPUTER); if (diffComputer != null) return new SimpleTextDiffProvider(settings, rediff, disposable, diffComputer); TwosideTextDiffProvider smartProvider = SmartTextDiffProvider.create(project, request, settings, rediff, disposable); if (smartProvider != null) return smartProvider; return new SimpleTextDiffProvider(settings, rediff, disposable); } @NotNull public static TwosideTextDiffProvider.NoIgnore createNoIgnoreTextDiffProvider(@Nullable Project project, @NotNull ContentDiffRequest request, @NotNull TextDiffSettings settings, @NotNull Runnable rediff, @NotNull Disposable disposable) { DiffUserDataKeysEx.DiffComputer diffComputer = request.getUserData(DiffUserDataKeysEx.CUSTOM_DIFF_COMPUTER); if (diffComputer != null) return new SimpleTextDiffProvider.NoIgnore(settings, rediff, disposable, diffComputer); TwosideTextDiffProvider.NoIgnore smartProvider = SmartTextDiffProvider.createNoIgnore(project, request, settings, rediff, disposable); if (smartProvider != null) return smartProvider; return new SimpleTextDiffProvider.NoIgnore(settings, rediff, disposable); } @Nullable public static MergeInnerDifferences compareThreesideInner(@NotNull List<? extends CharSequence> chunks, @NotNull ComparisonPolicy comparisonPolicy, @NotNull ProgressIndicator indicator) { if (chunks.get(0) == null && chunks.get(1) == null && chunks.get(2) == null) return null; // --- if (comparisonPolicy == ComparisonPolicy.IGNORE_WHITESPACES) { if (isChunksEquals(chunks.get(0), chunks.get(1), comparisonPolicy) && isChunksEquals(chunks.get(0), chunks.get(2), comparisonPolicy)) { // whitespace-only changes, ex: empty lines added/removed return new MergeInnerDifferences(Collections.emptyList(), Collections.emptyList(), Collections.emptyList()); } } if (chunks.get(0) == null && chunks.get(1) == null || chunks.get(0) == null && chunks.get(2) == null || chunks.get(1) == null && chunks.get(2) == null) { // =--, -=-, --= return null; } if (chunks.get(0) != null && chunks.get(1) != null && chunks.get(2) != null) { // === List<DiffFragment> fragments1 = ByWord.compare(chunks.get(1), chunks.get(0), comparisonPolicy, indicator); List<DiffFragment> fragments2 = ByWord.compare(chunks.get(1), chunks.get(2), comparisonPolicy, indicator); List<TextRange> left = new ArrayList<>(); List<TextRange> base = new ArrayList<>(); List<TextRange> right = new ArrayList<>(); for (DiffFragment wordFragment : fragments1) { base.add(new TextRange(wordFragment.getStartOffset1(), wordFragment.getEndOffset1())); left.add(new TextRange(wordFragment.getStartOffset2(), wordFragment.getEndOffset2())); } for (DiffFragment wordFragment : fragments2) { base.add(new TextRange(wordFragment.getStartOffset1(), wordFragment.getEndOffset1())); right.add(new TextRange(wordFragment.getStartOffset2(), wordFragment.getEndOffset2())); } return new MergeInnerDifferences(left, base, right); } // ==-, =-=, -== final ThreeSide side1 = chunks.get(0) != null ? ThreeSide.LEFT : ThreeSide.BASE; final ThreeSide side2 = chunks.get(2) != null ? ThreeSide.RIGHT : ThreeSide.BASE; CharSequence chunk1 = side1.select(chunks); CharSequence chunk2 = side2.select(chunks); List<DiffFragment> wordConflicts = ByWord.compare(chunk1, chunk2, comparisonPolicy, indicator); List<List<TextRange>> textRanges = ThreeSide.map(side -> { if (side == side1) { return ContainerUtil.map(wordConflicts, fragment -> new TextRange(fragment.getStartOffset1(), fragment.getEndOffset1())); } if (side == side2) { return ContainerUtil.map(wordConflicts, fragment -> new TextRange(fragment.getStartOffset2(), fragment.getEndOffset2())); } return null; }); return new MergeInnerDifferences(textRanges.get(0), textRanges.get(1), textRanges.get(2)); } private static boolean isChunksEquals(@Nullable CharSequence chunk1, @Nullable CharSequence chunk2, @NotNull ComparisonPolicy comparisonPolicy) { if (chunk1 == null) chunk1 = ""; if (chunk2 == null) chunk2 = ""; return ComparisonUtil.isEquals(chunk1, chunk2, comparisonPolicy); } @NotNull public static <T> int[] getSortedIndexes(@NotNull List<? extends T> values, @NotNull Comparator<? super T> comparator) { final List<Integer> indexes = new ArrayList<>(values.size()); for (int i = 0; i < values.size(); i++) { indexes.add(i); } ContainerUtil.sort(indexes, (i1, i2) -> { T val1 = values.get(i1); T val2 = values.get(i2); return comparator.compare(val1, val2); }); return ArrayUtil.toIntArray(indexes); } @NotNull public static int[] invertIndexes(@NotNull int[] indexes) { int[] inverted = new int[indexes.length]; for (int i = 0; i < indexes.length; i++) { inverted[indexes[i]] = i; } return inverted; } // // Document modification // public static boolean isSomeRangeSelected(@NotNull Editor editor, @NotNull Condition<? super BitSet> condition) { List<Caret> carets = editor.getCaretModel().getAllCarets(); if (carets.size() != 1) return true; Caret caret = carets.get(0); if (caret.hasSelection()) return true; return condition.value(getSelectedLines(editor)); } @NotNull public static BitSet getSelectedLines(@NotNull Editor editor) { Document document = editor.getDocument(); int totalLines = getLineCount(document); BitSet lines = new BitSet(totalLines + 1); for (Caret caret : editor.getCaretModel().getAllCarets()) { appendSelectedLines(editor, lines, caret); } return lines; } private static void appendSelectedLines(@NotNull Editor editor, @NotNull BitSet lines, @NotNull Caret caret) { Document document = editor.getDocument(); int totalLines = getLineCount(document); if (caret.hasSelection()) { int line1 = editor.offsetToLogicalPosition(caret.getSelectionStart()).line; int line2 = editor.offsetToLogicalPosition(caret.getSelectionEnd()).line; lines.set(line1, line2 + 1); if (caret.getSelectionEnd() == document.getTextLength()) lines.set(totalLines); } else { int offset = caret.getOffset(); VisualPosition visualPosition = caret.getVisualPosition(); Pair<LogicalPosition, LogicalPosition> pair = EditorUtil.calcSurroundingRange(editor, visualPosition, visualPosition); lines.set(pair.first.line, Math.max(pair.second.line, pair.first.line + 1)); if (offset == document.getTextLength()) lines.set(totalLines); } } public static boolean isSelectedByLine(int line, int line1, int line2) { if (line1 == line2 && line == line1) { return true; } if (line >= line1 && line < line2) { return true; } return false; } public static boolean isSelectedByLine(@NotNull BitSet selected, int line1, int line2) { if (line1 == line2) { return selected.get(line1); } else { int next = selected.nextSetBit(line1); return next != -1 && next < line2; } } private static void deleteLines(@NotNull Document document, int line1, int line2) { TextRange range = getLinesRange(document, line1, line2); int offset1 = range.getStartOffset(); int offset2 = range.getEndOffset(); if (offset1 > 0) { offset1--; } else if (offset2 < document.getTextLength()) { offset2++; } document.deleteString(offset1, offset2); } private static void insertLines(@NotNull Document document, int line, @NotNull CharSequence text) { if (line == getLineCount(document)) { document.insertString(document.getTextLength(), "\n" + text); } else { document.insertString(document.getLineStartOffset(line), text + "\n"); } } private static void replaceLines(@NotNull Document document, int line1, int line2, @NotNull CharSequence text) { TextRange currentTextRange = getLinesRange(document, line1, line2); int offset1 = currentTextRange.getStartOffset(); int offset2 = currentTextRange.getEndOffset(); document.replaceString(offset1, offset2, text); } public static void applyModification(@NotNull Document document, int line1, int line2, @NotNull List<? extends CharSequence> newLines) { if (line1 == line2 && newLines.isEmpty()) return; if (line1 == line2) { insertLines(document, line1, StringUtil.join(newLines, "\n")); } else if (newLines.isEmpty()) { deleteLines(document, line1, line2); } else { replaceLines(document, line1, line2, StringUtil.join(newLines, "\n")); } } public static void applyModification(@NotNull Document document1, int line1, int line2, @NotNull Document document2, int oLine1, int oLine2) { if (line1 == line2 && oLine1 == oLine2) return; if (line1 == line2) { insertLines(document1, line1, getLinesContent(document2, oLine1, oLine2)); } else if (oLine1 == oLine2) { deleteLines(document1, line1, line2); } else { replaceLines(document1, line1, line2, getLinesContent(document2, oLine1, oLine2)); } } public static String applyModification(@NotNull CharSequence text, @NotNull LineOffsets lineOffsets, @NotNull CharSequence otherText, @NotNull LineOffsets otherLineOffsets, @NotNull List<? extends Range> ranges) { return new Object() { private final StringBuilder stringBuilder = new StringBuilder(); private boolean isEmpty = true; @NotNull public String execute() { int lastLine = 0; for (Range range : ranges) { CharSequence newChunkContent = getLinesContent(otherText, otherLineOffsets, range.start2, range.end2); appendOriginal(lastLine, range.start1); append(newChunkContent, range.end2 - range.start2); lastLine = range.end1; } appendOriginal(lastLine, lineOffsets.getLineCount()); return stringBuilder.toString(); } private void appendOriginal(int start, int end) { append(getLinesContent(text, lineOffsets, start, end), end - start); } private void append(CharSequence content, int lineCount) { if (lineCount > 0 && !isEmpty) { stringBuilder.append('\n'); } stringBuilder.append(content); isEmpty &= lineCount == 0; } }.execute(); } @NotNull public static CharSequence getLinesContent(@NotNull Document document, int line1, int line2) { return getLinesRange(document, line1, line2).subSequence(document.getImmutableCharSequence()); } @NotNull public static CharSequence getLinesContent(@NotNull Document document, int line1, int line2, boolean includeNewLine) { return getLinesRange(document, line1, line2, includeNewLine).subSequence(document.getImmutableCharSequence()); } @NotNull public static CharSequence getLinesContent(@NotNull CharSequence sequence, @NotNull LineOffsets lineOffsets, int line1, int line2) { return getLinesContent(sequence, lineOffsets, line1, line2, false); } @NotNull public static CharSequence getLinesContent(@NotNull CharSequence sequence, @NotNull LineOffsets lineOffsets, int line1, int line2, boolean includeNewline) { assert sequence.length() == lineOffsets.getTextLength(); return getLinesRange(lineOffsets, line1, line2, includeNewline).subSequence(sequence); } /** * Return affected range, without non-internal newlines * <p/> * we consider '\n' not as a part of line, but a separator between lines * ex: if last line is not empty, the last symbol will not be '\n' */ public static TextRange getLinesRange(@NotNull Document document, int line1, int line2) { return getLinesRange(document, line1, line2, false); } @NotNull public static TextRange getLinesRange(@NotNull Document document, int line1, int line2, boolean includeNewline) { return getLinesRange(LineOffsetsUtil.create(document), line1, line2, includeNewline); } @NotNull public static TextRange getLinesRange(@NotNull LineOffsets lineOffsets, int line1, int line2, boolean includeNewline) { if (line1 == line2) { int lineStartOffset = line1 < lineOffsets.getLineCount() ? lineOffsets.getLineStart(line1) : lineOffsets.getTextLength(); return new TextRange(lineStartOffset, lineStartOffset); } else { int startOffset = lineOffsets.getLineStart(line1); int endOffset = lineOffsets.getLineEnd(line2 - 1); if (includeNewline && endOffset < lineOffsets.getTextLength()) endOffset++; return new TextRange(startOffset, endOffset); } } public static int getOffset(@NotNull Document document, int line, int column) { if (line < 0) return 0; if (line >= getLineCount(document)) return document.getTextLength(); int start = document.getLineStartOffset(line); int end = document.getLineEndOffset(line); return Math.min(start + column, end); } /** * Document.getLineCount() returns 0 for empty text. * <p> * This breaks an assumption "getLineCount() == StringUtil.countNewLines(text) + 1" * and adds unnecessary corner case into line ranges logic. */ public static int getLineCount(@NotNull Document document) { return Math.max(document.getLineCount(), 1); } @NotNull public static List<String> getLines(@NotNull Document document) { return getLines(document, 0, getLineCount(document)); } @NotNull public static List<String> getLines(@NotNull CharSequence text, @NonNls LineOffsets lineOffsets) { return getLines(text, lineOffsets, 0, lineOffsets.getLineCount()); } @NotNull public static List<String> getLines(@NotNull Document document, int startLine, int endLine) { return getLines(document.getCharsSequence(), LineOffsetsUtil.create(document), startLine, endLine); } @NotNull public static List<String> getLines(@NotNull CharSequence text, @NonNls LineOffsets lineOffsets, int startLine, int endLine) { if (startLine < 0 || startLine > endLine || endLine > lineOffsets.getLineCount()) { throw new IndexOutOfBoundsException(String.format("Wrong line range: [%d, %d); lineCount: '%d'", startLine, endLine, lineOffsets.getLineCount())); } List<String> result = new ArrayList<>(); for (int i = startLine; i < endLine; i++) { int start = lineOffsets.getLineStart(i); int end = lineOffsets.getLineEnd(i); result.add(text.subSequence(start, end).toString()); } return result; } public static int bound(int value, int lowerBound, int upperBound) { assert lowerBound <= upperBound : String.format("%s - [%s, %s]", value, lowerBound, upperBound); return Math.max(Math.min(value, upperBound), lowerBound); } // // Updating ranges on change // @NotNull public static LineRange getAffectedLineRange(@NotNull DocumentEvent e) { int line1 = e.getDocument().getLineNumber(e.getOffset()); int line2 = e.getDocument().getLineNumber(e.getOffset() + e.getOldLength()) + 1; return new LineRange(line1, line2); } public static int countLinesShift(@NotNull DocumentEvent e) { return StringUtil.countNewLines(e.getNewFragment()) - StringUtil.countNewLines(e.getOldFragment()); } @NotNull public static UpdatedLineRange updateRangeOnModification(int start, int end, int changeStart, int changeEnd, int shift) { return updateRangeOnModification(start, end, changeStart, changeEnd, shift, false); } @NotNull public static UpdatedLineRange updateRangeOnModification(int start, int end, int changeStart, int changeEnd, int shift, boolean greedy) { if (end <= changeStart) { // change before return new UpdatedLineRange(start, end, false); } if (start >= changeEnd) { // change after return new UpdatedLineRange(start + shift, end + shift, false); } if (start <= changeStart && end >= changeEnd) { // change inside return new UpdatedLineRange(start, end + shift, false); } // range is damaged. We don't know new boundaries. // But we can try to return approximate new position int newChangeEnd = changeEnd + shift; if (start >= changeStart && end <= changeEnd) { // fully inside change return greedy ? new UpdatedLineRange(changeStart, newChangeEnd, true) : new UpdatedLineRange(newChangeEnd, newChangeEnd, true); } if (start < changeStart) { // bottom boundary damaged return greedy ? new UpdatedLineRange(start, newChangeEnd, true) : new UpdatedLineRange(start, changeStart, true); } else { // top boundary damaged return greedy ? new UpdatedLineRange(changeStart, end + shift, true) : new UpdatedLineRange(newChangeEnd, end + shift, true); } } public static class UpdatedLineRange { public final int startLine; public final int endLine; public final boolean damaged; public UpdatedLineRange(int startLine, int endLine, boolean damaged) { this.startLine = startLine; this.endLine = endLine; this.damaged = damaged; } } // // Types // @NotNull public static TextDiffType getLineDiffType(@NotNull LineFragment fragment) { boolean left = fragment.getStartLine1() != fragment.getEndLine1(); boolean right = fragment.getStartLine2() != fragment.getEndLine2(); return getDiffType(left, right); } @NotNull public static TextDiffType getDiffType(@NotNull DiffFragment fragment) { boolean left = fragment.getEndOffset1() != fragment.getStartOffset1(); boolean right = fragment.getEndOffset2() != fragment.getStartOffset2(); return getDiffType(left, right); } @NotNull public static TextDiffType getDiffType(boolean hasDeleted, boolean hasInserted) { if (hasDeleted && hasInserted) { return TextDiffType.MODIFIED; } else if (hasDeleted) { return TextDiffType.DELETED; } else if (hasInserted) { return TextDiffType.INSERTED; } else { LOG.error("Diff fragment should not be empty"); return TextDiffType.MODIFIED; } } @NotNull public static MergeConflictType getMergeType(@NotNull Condition<? super ThreeSide> emptiness, @NotNull Equality<? super ThreeSide> equality, @Nullable Equality<? super ThreeSide> trueEquality, @NotNull BooleanGetter conflictResolver) { boolean isLeftEmpty = emptiness.value(ThreeSide.LEFT); boolean isBaseEmpty = emptiness.value(ThreeSide.BASE); boolean isRightEmpty = emptiness.value(ThreeSide.RIGHT); assert !isLeftEmpty || !isBaseEmpty || !isRightEmpty; if (isBaseEmpty) { if (isLeftEmpty) { // --= return new MergeConflictType(TextDiffType.INSERTED, false, true); } else if (isRightEmpty) { // =-- return new MergeConflictType(TextDiffType.INSERTED, true, false); } else { // =-= boolean equalModifications = equality.equals(ThreeSide.LEFT, ThreeSide.RIGHT); if (equalModifications) { return new MergeConflictType(TextDiffType.INSERTED, true, true); } else { return new MergeConflictType(TextDiffType.CONFLICT, true, true, false); } } } else { if (isLeftEmpty && isRightEmpty) { // -=- return new MergeConflictType(TextDiffType.DELETED, true, true); } else { // -==, ==-, === boolean unchangedLeft = equality.equals(ThreeSide.BASE, ThreeSide.LEFT); boolean unchangedRight = equality.equals(ThreeSide.BASE, ThreeSide.RIGHT); if (unchangedLeft && unchangedRight) { assert trueEquality != null; boolean trueUnchangedLeft = trueEquality.equals(ThreeSide.BASE, ThreeSide.LEFT); boolean trueUnchangedRight = trueEquality.equals(ThreeSide.BASE, ThreeSide.RIGHT); assert !trueUnchangedLeft || !trueUnchangedRight; return new MergeConflictType(TextDiffType.MODIFIED, !trueUnchangedLeft, !trueUnchangedRight); } if (unchangedLeft) return new MergeConflictType(isRightEmpty ? TextDiffType.DELETED : TextDiffType.MODIFIED, false, true); if (unchangedRight) return new MergeConflictType(isLeftEmpty ? TextDiffType.DELETED : TextDiffType.MODIFIED, true, false); boolean equalModifications = equality.equals(ThreeSide.LEFT, ThreeSide.RIGHT); if (equalModifications) { return new MergeConflictType(TextDiffType.MODIFIED, true, true); } else { boolean canBeResolved = !isLeftEmpty && !isRightEmpty && conflictResolver.get(); return new MergeConflictType(TextDiffType.CONFLICT, true, true, canBeResolved); } } } } @NotNull public static MergeConflictType getLineThreeWayDiffType(@NotNull MergeLineFragment fragment, @NotNull List<? extends CharSequence> sequences, @NotNull List<? extends LineOffsets> lineOffsets, @NotNull ComparisonPolicy policy) { return getMergeType((side) -> isLineMergeIntervalEmpty(fragment, side), (side1, side2) -> compareLineMergeContents(fragment, sequences, lineOffsets, policy, side1, side2), null, () -> canResolveLineConflict(fragment, sequences, lineOffsets)); } @NotNull public static MergeConflictType getLineMergeType(@NotNull MergeLineFragment fragment, @NotNull List<? extends CharSequence> sequences, @NotNull List<? extends LineOffsets> lineOffsets, @NotNull ComparisonPolicy policy) { return getMergeType((side) -> isLineMergeIntervalEmpty(fragment, side), (side1, side2) -> compareLineMergeContents(fragment, sequences, lineOffsets, policy, side1, side2), (side1, side2) -> compareLineMergeContents(fragment, sequences, lineOffsets, ComparisonPolicy.DEFAULT, side1, side2), () -> canResolveLineConflict(fragment, sequences, lineOffsets)); } private static boolean canResolveLineConflict(@NotNull MergeLineFragment fragment, @NotNull List<? extends CharSequence> sequences, @NotNull List<? extends LineOffsets> lineOffsets) { List<? extends CharSequence> contents = ThreeSide.map(side -> getLinesContent(side.select(sequences), side.select(lineOffsets), fragment.getStartLine(side), fragment.getEndLine(side))); return ComparisonMergeUtil.tryResolveConflict(contents.get(0), contents.get(1), contents.get(2)) != null; } private static boolean compareLineMergeContents(@NotNull MergeLineFragment fragment, @NotNull List<? extends CharSequence> sequences, @NotNull List<? extends LineOffsets> lineOffsets, @NotNull ComparisonPolicy policy, @NotNull ThreeSide side1, @NotNull ThreeSide side2) { int start1 = fragment.getStartLine(side1); int end1 = fragment.getEndLine(side1); int start2 = fragment.getStartLine(side2); int end2 = fragment.getEndLine(side2); if (end2 - start2 != end1 - start1) return false; CharSequence sequence1 = side1.select(sequences); CharSequence sequence2 = side2.select(sequences); LineOffsets offsets1 = side1.select(lineOffsets); LineOffsets offsets2 = side2.select(lineOffsets); for (int i = 0; i < end1 - start1; i++) { int line1 = start1 + i; int line2 = start2 + i; CharSequence content1 = getLinesContent(sequence1, offsets1, line1, line1 + 1); CharSequence content2 = getLinesContent(sequence2, offsets2, line2, line2 + 1); if (!ComparisonUtil.isEquals(content1, content2, policy)) return false; } return true; } private static boolean isLineMergeIntervalEmpty(@NotNull MergeLineFragment fragment, @NotNull ThreeSide side) { return fragment.getStartLine(side) == fragment.getEndLine(side); } @NotNull public static MergeConflictType getWordMergeType(@NotNull MergeWordFragment fragment, @NotNull List<? extends CharSequence> texts, @NotNull ComparisonPolicy policy) { return getMergeType((side) -> isWordMergeIntervalEmpty(fragment, side), (side1, side2) -> compareWordMergeContents(fragment, texts, policy, side1, side2), null, BooleanGetter.FALSE); } public static boolean compareWordMergeContents(@NotNull MergeWordFragment fragment, @NotNull List<? extends CharSequence> texts, @NotNull ComparisonPolicy policy, @NotNull ThreeSide side1, @NotNull ThreeSide side2) { int start1 = fragment.getStartOffset(side1); int end1 = fragment.getEndOffset(side1); int start2 = fragment.getStartOffset(side2); int end2 = fragment.getEndOffset(side2); CharSequence document1 = side1.select(texts); CharSequence document2 = side2.select(texts); CharSequence content1 = document1.subSequence(start1, end1); CharSequence content2 = document2.subSequence(start2, end2); return ComparisonUtil.isEquals(content1, content2, policy); } private static boolean isWordMergeIntervalEmpty(@NotNull MergeWordFragment fragment, @NotNull ThreeSide side) { return fragment.getStartOffset(side) == fragment.getEndOffset(side); } // // Writable // @CalledInAwt public static boolean executeWriteCommand(@Nullable Project project, @NotNull Document document, @Nullable String commandName, @Nullable String commandGroupId, @NotNull UndoConfirmationPolicy confirmationPolicy, boolean underBulkUpdate, @NotNull Runnable task) { if (!makeWritable(project, document)) { VirtualFile file = FileDocumentManager.getInstance().getFile(document); LOG.warn("Document is read-only" + (file != null ? ": " + file.getPresentableName() : "")); return false; } ApplicationManager.getApplication().runWriteAction(() -> CommandProcessor.getInstance().executeCommand(project, () -> { if (underBulkUpdate) { DocumentUtil.executeInBulk(document, true, task); } else { task.run(); } }, commandName, commandGroupId, confirmationPolicy, document)); return true; } @CalledInAwt public static boolean executeWriteCommand(@NotNull final Document document, @Nullable final Project project, @Nullable final String commandName, @NotNull final Runnable task) { return executeWriteCommand(project, document, commandName, null, UndoConfirmationPolicy.DEFAULT, false, task); } public static boolean isEditable(@NotNull Editor editor) { return !editor.isViewer() && canMakeWritable(editor.getDocument()); } public static boolean canMakeWritable(@NotNull Document document) { if (document.isWritable()) { return true; } VirtualFile file = FileDocumentManager.getInstance().getFile(document); if (file != null && file.isValid() && file.isInLocalFileSystem()) { if (file.getUserData(TEMP_FILE_KEY) == Boolean.TRUE) return false; // decompiled file can be writable, but Document with decompiled content is still read-only return !file.isWritable(); } return false; } @CalledInAwt public static boolean makeWritable(@Nullable Project project, @NotNull Document document) { VirtualFile file = FileDocumentManager.getInstance().getFile(document); if (file == null) return document.isWritable(); if (!file.isValid()) return false; return makeWritable(project, file) && document.isWritable(); } @CalledInAwt public static boolean makeWritable(@Nullable Project project, @NotNull VirtualFile file) { if (project == null) project = ProjectManager.getInstance().getDefaultProject(); return !ReadonlyStatusHandler.getInstance(project).ensureFilesWritable(Collections.singletonList(file)).hasReadonlyFiles(); } public static void putNonundoableOperation(@Nullable Project project, @NotNull Document document) { UndoManager undoManager = project != null ? UndoManager.getInstance(project) : UndoManager.getGlobalInstance(); if (undoManager != null) { DocumentReference ref = DocumentReferenceManager.getInstance().create(document); undoManager.nonundoableActionPerformed(ref, false); } } /** * Difference with {@link VfsUtil#markDirtyAndRefresh} is that refresh from VfsUtil will be performed with ModalityState.NON_MODAL. */ public static void markDirtyAndRefresh(boolean async, boolean recursive, boolean reloadChildren, @NotNull VirtualFile... files) { ModalityState modalityState = ApplicationManager.getApplication().getDefaultModalityState(); VfsUtil.markDirty(recursive, reloadChildren, files); RefreshQueue.getInstance().refresh(async, recursive, null, modalityState, files); } // // Windows // @NotNull public static Dimension getDefaultDiffPanelSize() { return new Dimension(400, 200); } @NotNull public static Dimension getDefaultDiffWindowSize() { Rectangle screenBounds = ScreenUtil.getMainScreenBounds(); int width = (int)(screenBounds.width * 0.8); int height = (int)(screenBounds.height * 0.8); return new Dimension(width, height); } @NotNull public static WindowWrapper.Mode getWindowMode(@NotNull DiffDialogHints hints) { WindowWrapper.Mode mode = hints.getMode(); if (mode == null) { boolean isUnderDialog = LaterInvocator.isInModalContext(); mode = isUnderDialog ? WindowWrapper.Mode.MODAL : WindowWrapper.Mode.FRAME; } return mode; } public static void closeWindow(@Nullable Window window, boolean modalOnly, boolean recursive) { if (window == null) return; Component component = window; while (component != null) { if (component instanceof Window) { boolean isClosed = closeWindow((Window)component, modalOnly); if (!isClosed) break; } component = recursive ? component.getParent() : null; } } /** * @return whether window was closed */ private static boolean closeWindow(@NotNull Window window, boolean modalOnly) { if (window instanceof IdeFrameImpl) return false; if (modalOnly && canBeHiddenBehind(window)) return false; if (window instanceof DialogWrapperDialog) { ((DialogWrapperDialog)window).getDialogWrapper().doCancelAction(); return !window.isVisible(); } window.setVisible(false); window.dispose(); return true; } private static boolean canBeHiddenBehind(@NotNull Window window) { if (!(window instanceof Frame)) return false; if (SystemInfo.isMac) { if (window instanceof IdeFrame) { // we can't move focus to full-screen main frame, as it will be hidden behind other frame windows Project project = ((IdeFrame)window).getProject(); IdeFrame projectFrame = WindowManager.getInstance().getIdeFrame(project); if (projectFrame instanceof IdeFrameEx) { return !((IdeFrameEx)projectFrame).isInFullScreen(); } } } return true; } // // UserData // public static <T> UserDataHolderBase createUserDataHolder(@NotNull Key<T> key, @Nullable T value) { UserDataHolderBase holder = new UserDataHolderBase(); holder.putUserData(key, value); return holder; } public static boolean isUserDataFlagSet(@NotNull Key<Boolean> key, UserDataHolder... holders) { for (UserDataHolder holder : holders) { if (holder == null) continue; Boolean data = holder.getUserData(key); if (data != null) return data; } return false; } public static <T> T getUserData(@Nullable UserDataHolder first, @Nullable UserDataHolder second, @NotNull Key<T> key) { if (first != null) { T data = first.getUserData(key); if (data != null) return data; } if (second != null) { T data = second.getUserData(key); if (data != null) return data; } return null; } public static void addNotification(@Nullable JComponent component, @NotNull UserDataHolder holder) { if (component == null) return; List<JComponent> oldComponents = ContainerUtil.notNullize(holder.getUserData(DiffUserDataKeys.NOTIFICATIONS)); holder.putUserData(DiffUserDataKeys.NOTIFICATIONS, ContainerUtil.append(oldComponents, component)); } @NotNull public static List<JComponent> getCustomNotifications(@NotNull UserDataHolder context, @NotNull UserDataHolder request) { List<JComponent> requestComponents = request.getUserData(DiffUserDataKeys.NOTIFICATIONS); List<JComponent> contextComponents = context.getUserData(DiffUserDataKeys.NOTIFICATIONS); return ContainerUtil.concat(ContainerUtil.notNullize(contextComponents), ContainerUtil.notNullize(requestComponents)); } @NotNull public static List<JComponent> getCustomNotifications(@NotNull DiffContent content) { return ContainerUtil.notNullize(content.getUserData(DiffUserDataKeys.NOTIFICATIONS)); } // // DataProvider // @Nullable public static Object getData(@Nullable DataProvider provider, @Nullable DataProvider fallbackProvider, @NotNull @NonNls String dataId) { if (provider != null) { Object data = provider.getData(dataId); if (data != null) return data; } if (fallbackProvider != null) { Object data = fallbackProvider.getData(dataId); if (data != null) return data; } return null; } public static <T> void putDataKey(@NotNull UserDataHolder holder, @NotNull DataKey<T> key, @Nullable T value) { DataProvider dataProvider = holder.getUserData(DiffUserDataKeys.DATA_PROVIDER); if (!(dataProvider instanceof GenericDataProvider)) { dataProvider = new GenericDataProvider(dataProvider); holder.putUserData(DiffUserDataKeys.DATA_PROVIDER, dataProvider); } ((GenericDataProvider)dataProvider).putData(key, value); } @NotNull public static DiffSettings getDiffSettings(@NotNull DiffContext context) { DiffSettings settings = context.getUserData(DiffSettings.KEY); if (settings == null) { settings = DiffSettings.getSettings(context.getUserData(DiffUserDataKeys.PLACE)); context.putUserData(DiffSettings.KEY, settings); } return settings; } @NotNull public static <K, V> TreeMap<K, V> trimDefaultValues(@NotNull TreeMap<K, V> map, @NotNull Convertor<? super K, V> defaultValue) { TreeMap<K, V> result = new TreeMap<>(); for (Map.Entry<K, V> it : map.entrySet()) { K key = it.getKey(); V value = it.getValue(); if (!value.equals(defaultValue.convert(key))) result.put(key, value); } return result; } // // Tools // @NotNull public static <T extends DiffTool> List<T> filterSuppressedTools(@NotNull List<T> tools) { if (tools.size() < 2) return tools; final List<Class<? extends DiffTool>> suppressedTools = new ArrayList<>(); for (T tool : tools) { try { if (tool instanceof SuppressiveDiffTool) suppressedTools.addAll(((SuppressiveDiffTool)tool).getSuppressedTools()); } catch (Throwable e) { LOG.error(e); } } if (suppressedTools.isEmpty()) return tools; List<T> filteredTools = ContainerUtil.filter(tools, tool -> !suppressedTools.contains(tool.getClass())); return filteredTools.isEmpty() ? tools : filteredTools; } @Nullable public static DiffTool findToolSubstitutor(@NotNull DiffTool tool, @NotNull DiffContext context, @NotNull DiffRequest request) { for (DiffToolSubstitutor substitutor : DiffToolSubstitutor.EP_NAME.getExtensions()) { DiffTool replacement = substitutor.getReplacement(tool, context, request); if (replacement == null) continue; boolean canShow = replacement.canShow(context, request); if (!canShow) { LOG.error("DiffTool substitutor returns invalid tool"); continue; } return replacement; } return null; } // // Helpers // private static class SyncHeightComponent extends JPanel { @NotNull private final List<? extends JComponent> myComponents; SyncHeightComponent(@NotNull List<? extends JComponent> components, int index) { super(new BorderLayout()); myComponents = components; JComponent delegate = components.get(index); if (delegate != null) add(delegate, BorderLayout.CENTER); } @Override public Dimension getPreferredSize() { Dimension size = super.getPreferredSize(); size.height = getPreferredHeight(); return size; } private int getPreferredHeight() { int height = 0; for (JComponent component : myComponents) { if (component == null) continue; height = Math.max(height, component.getPreferredSize().height); } return height; } } public static class CenteredPanel extends JPanel { private final JComponent myComponent; public CenteredPanel(@NotNull JComponent component) { myComponent = component; add(component); } public CenteredPanel(@NotNull JComponent component, @NotNull Border border) { this(component); setBorder(border); } @Override public void doLayout() { final Dimension size = getSize(); final Dimension preferredSize = myComponent.getPreferredSize(); Insets insets = getInsets(); JBInsets.removeFrom(size, insets); int width = Math.min(size.width, preferredSize.width); int height = Math.min(size.height, preferredSize.height); int x = Math.max(0, (size.width - preferredSize.width) / 2); int y = Math.max(0, (size.height - preferredSize.height) / 2); myComponent.setBounds(insets.left + x, insets.top + y, width, height); } @Override public Dimension getPreferredSize() { return addInsets(myComponent.getPreferredSize()); } @Override public Dimension getMinimumSize() { return addInsets(myComponent.getMinimumSize()); } @Override public Dimension getMaximumSize() { return addInsets(myComponent.getMaximumSize()); } private Dimension addInsets(Dimension dimension) { JBInsets.addTo(dimension, getInsets()); return dimension; } } }
platform/diff-impl/src/com/intellij/diff/util/DiffUtil.java
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.diff.util; import com.intellij.application.options.CodeStyle; import com.intellij.codeInsight.daemon.OutsidersPsiFileSupport; import com.intellij.diff.*; import com.intellij.diff.comparison.ByWord; import com.intellij.diff.comparison.ComparisonMergeUtil; import com.intellij.diff.comparison.ComparisonPolicy; import com.intellij.diff.comparison.ComparisonUtil; import com.intellij.diff.contents.DiffContent; import com.intellij.diff.contents.DocumentContent; import com.intellij.diff.contents.EmptyContent; import com.intellij.diff.fragments.DiffFragment; import com.intellij.diff.fragments.LineFragment; import com.intellij.diff.fragments.MergeLineFragment; import com.intellij.diff.fragments.MergeWordFragment; import com.intellij.diff.impl.DiffSettingsHolder.DiffSettings; import com.intellij.diff.impl.DiffToolSubstitutor; import com.intellij.diff.requests.ContentDiffRequest; import com.intellij.diff.requests.DiffRequest; import com.intellij.diff.tools.util.DiffNotifications; import com.intellij.diff.tools.util.FoldingModelSupport; import com.intellij.diff.tools.util.base.TextDiffSettingsHolder.TextDiffSettings; import com.intellij.diff.tools.util.base.TextDiffViewerUtil; import com.intellij.diff.tools.util.text.*; import com.intellij.icons.AllIcons; import com.intellij.lang.Language; import com.intellij.openapi.Disposable; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.application.impl.LaterInvocator; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.command.UndoConfirmationPolicy; import com.intellij.openapi.command.undo.DocumentReference; import com.intellij.openapi.command.undo.DocumentReferenceManager; import com.intellij.openapi.command.undo.UndoManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.diff.impl.GenericDataProvider; import com.intellij.openapi.editor.*; import com.intellij.openapi.editor.colors.EditorColors; import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.colors.EditorColorsScheme; import com.intellij.openapi.editor.event.DocumentEvent; import com.intellij.openapi.editor.ex.EditorEx; import com.intellij.openapi.editor.ex.EditorMarkupModel; import com.intellij.openapi.editor.ex.util.EditorUtil; import com.intellij.openapi.editor.ex.util.EmptyEditorHighlighter; import com.intellij.openapi.editor.highlighter.EditorHighlighter; import com.intellij.openapi.editor.highlighter.EditorHighlighterFactory; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.fileTypes.FileType; import com.intellij.openapi.fileTypes.PlainTextFileType; import com.intellij.openapi.fileTypes.SyntaxHighlighter; import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectManager; import com.intellij.openapi.ui.DialogWrapperDialog; import com.intellij.openapi.ui.MessageType; import com.intellij.openapi.ui.WindowWrapper; import com.intellij.openapi.ui.popup.Balloon; import com.intellij.openapi.ui.popup.JBPopupFactory; import com.intellij.openapi.util.*; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.ReadonlyStatusHandler; import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.newvfs.RefreshQueue; import com.intellij.openapi.wm.IdeFocusManager; import com.intellij.openapi.wm.IdeFrame; import com.intellij.openapi.wm.WindowManager; import com.intellij.openapi.wm.ex.IdeFrameEx; import com.intellij.openapi.wm.impl.IdeFrameImpl; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; import com.intellij.psi.codeStyle.CommonCodeStyleSettings; import com.intellij.testFramework.LightVirtualFile; import com.intellij.ui.ColorUtil; import com.intellij.ui.HyperlinkAdapter; import com.intellij.ui.JBColor; import com.intellij.ui.ScreenUtil; import com.intellij.ui.awt.RelativePoint; import com.intellij.ui.components.JBLabel; import com.intellij.ui.scale.JBUIScale; import com.intellij.util.ArrayUtil; import com.intellij.util.DocumentUtil; import com.intellij.util.ImageLoader; import com.intellij.util.LineSeparator; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.Convertor; import com.intellij.util.ui.JBInsets; import com.intellij.util.ui.JBUI; import com.intellij.util.ui.UIUtil; import gnu.trove.Equality; import gnu.trove.TIntFunction; import org.jetbrains.annotations.*; import javax.swing.*; import javax.swing.border.Border; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import java.awt.*; import java.nio.charset.Charset; import java.util.List; import java.util.*; public class DiffUtil { private static final Logger LOG = Logger.getInstance(DiffUtil.class); public static final Key<Boolean> TEMP_FILE_KEY = Key.create("Diff.TempFile"); @NotNull public static final String DIFF_CONFIG = "diff.xml"; public static final int TITLE_GAP = JBUIScale.scale(2); public static final List<Image> DIFF_FRAME_ICONS = loadDiffFrameImages(); @NotNull private static List<Image> loadDiffFrameImages() { return Arrays.asList(ImageLoader.loadFromResource("/diff_frame32.png"), ImageLoader.loadFromResource("/diff_frame64.png"), ImageLoader.loadFromResource("/diff_frame128.png")); } // // Editor // public static boolean isDiffEditor(@NotNull Editor editor) { return editor.getEditorKind() == EditorKind.DIFF; } @Nullable public static EditorHighlighter initEditorHighlighter(@Nullable Project project, @NotNull DocumentContent content, @NotNull CharSequence text) { EditorHighlighter highlighter = createEditorHighlighter(project, content); if (highlighter == null) return null; highlighter.setText(text); return highlighter; } @NotNull public static EditorHighlighter initEmptyEditorHighlighter(@NotNull CharSequence text) { EditorHighlighter highlighter = createEmptyEditorHighlighter(); highlighter.setText(text); return highlighter; } @Nullable private static EditorHighlighter createEditorHighlighter(@Nullable Project project, @NotNull DocumentContent content) { FileType type = content.getContentType(); VirtualFile file = content.getHighlightFile(); Language language = content.getUserData(DiffUserDataKeys.LANGUAGE); EditorHighlighterFactory highlighterFactory = EditorHighlighterFactory.getInstance(); if (language != null) { SyntaxHighlighter syntaxHighlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(language, project, file); return highlighterFactory.createEditorHighlighter(syntaxHighlighter, EditorColorsManager.getInstance().getGlobalScheme()); } if (file != null && file.isValid()) { if ((type == null || type == PlainTextFileType.INSTANCE) || file.getFileType() == type || file instanceof LightVirtualFile) { return highlighterFactory.createEditorHighlighter(project, file); } } if (type != null) { return highlighterFactory.createEditorHighlighter(project, type); } return null; } @NotNull private static EditorHighlighter createEmptyEditorHighlighter() { return new EmptyEditorHighlighter(EditorColorsManager.getInstance().getGlobalScheme().getAttributes(HighlighterColors.TEXT)); } public static void setEditorHighlighter(@Nullable Project project, @NotNull EditorEx editor, @NotNull DocumentContent content) { EditorHighlighter highlighter = createEditorHighlighter(project, content); if (highlighter != null) editor.setHighlighter(highlighter); } public static void setEditorCodeStyle(@Nullable Project project, @NotNull EditorEx editor, @Nullable DocumentContent content) { if (project != null && content != null && editor.getVirtualFile() == null) { PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(content.getDocument()); CommonCodeStyleSettings.IndentOptions indentOptions = psiFile != null ? CodeStyle.getSettings(psiFile).getIndentOptionsByFile(psiFile) : CodeStyle.getSettings(project).getIndentOptions(content.getContentType()); editor.getSettings().setTabSize(indentOptions.TAB_SIZE); editor.getSettings().setUseTabCharacter(indentOptions.USE_TAB_CHARACTER); } editor.getSettings().setCaretRowShown(false); editor.reinitSettings(); } public static void setFoldingModelSupport(@NotNull EditorEx editor) { editor.getSettings().setFoldingOutlineShown(true); editor.getSettings().setAutoCodeFoldingEnabled(false); editor.getColorsScheme().setAttributes(EditorColors.FOLDED_TEXT_ATTRIBUTES, null); } @NotNull public static EditorEx createEditor(@NotNull Document document, @Nullable Project project, boolean isViewer) { return createEditor(document, project, isViewer, false); } @NotNull public static EditorEx createEditor(@NotNull Document document, @Nullable Project project, boolean isViewer, boolean enableFolding) { EditorFactory factory = EditorFactory.getInstance(); EditorKind kind = EditorKind.DIFF; EditorEx editor = (EditorEx)(isViewer ? factory.createViewer(document, project, kind) : factory.createEditor(document, project, kind)); editor.getSettings().setShowIntentionBulb(false); ((EditorMarkupModel)editor.getMarkupModel()).setErrorStripeVisible(true); editor.getGutterComponentEx().setShowDefaultGutterPopup(false); if (enableFolding) { setFoldingModelSupport(editor); } else { editor.getSettings().setFoldingOutlineShown(false); editor.getFoldingModel().setFoldingEnabled(false); } UIUtil.removeScrollBorder(editor.getComponent()); return editor; } public static void configureEditor(@NotNull EditorEx editor, @NotNull DocumentContent content, @Nullable Project project) { VirtualFile virtualFile = FileDocumentManager.getInstance().getFile(content.getDocument()); if (virtualFile != null && Registry.is("diff.enable.psi.highlighting")) { editor.setFile(virtualFile); } setEditorHighlighter(project, editor, content); setEditorCodeStyle(project, editor, content); } public static boolean isMirrored(@NotNull Editor editor) { if (editor instanceof EditorEx) { return ((EditorEx)editor).getVerticalScrollbarOrientation() == EditorEx.VERTICAL_SCROLLBAR_LEFT; } return false; } @Contract("null, _ -> false; _, null -> false") public static boolean canNavigateToFile(@Nullable Project project, @Nullable VirtualFile file) { if (project == null || project.isDefault()) return false; if (file == null || !file.isValid()) return false; if (OutsidersPsiFileSupport.isOutsiderFile(file)) return false; if (file.getUserData(TEMP_FILE_KEY) == Boolean.TRUE) return false; return true; } public static void installLineConvertor(@NotNull EditorEx editor, @NotNull FoldingModelSupport foldingSupport) { assert foldingSupport.getCount() == 1; TIntFunction foldingLineConvertor = foldingSupport.getLineConvertor(0); editor.getGutterComponentEx().setLineNumberConvertor(foldingLineConvertor); } public static void installLineConvertor(@NotNull EditorEx editor, @NotNull DocumentContent content) { TIntFunction contentLineConvertor = getContentLineConvertor(content); editor.getGutterComponentEx().setLineNumberConvertor(contentLineConvertor); } public static void installLineConvertor(@NotNull EditorEx editor, @NotNull DocumentContent content, @NotNull FoldingModelSupport foldingSupport, int editorIndex) { TIntFunction contentLineConvertor = getContentLineConvertor(content); TIntFunction foldingLineConvertor = foldingSupport.getLineConvertor(editorIndex); editor.getGutterComponentEx().setLineNumberConvertor(mergeLineConverters(contentLineConvertor, foldingLineConvertor)); } @Nullable public static TIntFunction getContentLineConvertor(@NotNull DocumentContent content) { return content.getUserData(DiffUserDataKeysEx.LINE_NUMBER_CONVERTOR); } @Nullable public static TIntFunction mergeLineConverters(@Nullable TIntFunction convertor1, @Nullable TIntFunction convertor2) { if (convertor1 == null && convertor2 == null) return null; if (convertor1 == null) return convertor2; if (convertor2 == null) return convertor1; return value -> { int value2 = convertor2.execute(value); return value2 >= 0 ? convertor1.execute(value2) : value2; }; } // // Scrolling // public static void disableBlitting(@NotNull EditorEx editor) { if (Registry.is("diff.divider.repainting.disable.blitting")) { editor.getScrollPane().getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); } } public static void moveCaret(@Nullable final Editor editor, int line) { if (editor == null) return; editor.getCaretModel().removeSecondaryCarets(); editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(line, 0)); } public static void scrollEditor(@Nullable final Editor editor, int line, boolean animated) { scrollEditor(editor, line, 0, animated); } public static void scrollEditor(@Nullable final Editor editor, int line, int column, boolean animated) { if (editor == null) return; editor.getCaretModel().removeSecondaryCarets(); editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(line, column)); scrollToCaret(editor, animated); } public static void scrollToPoint(@Nullable Editor editor, @NotNull Point point, boolean animated) { if (editor == null) return; if (!animated) editor.getScrollingModel().disableAnimation(); editor.getScrollingModel().scrollHorizontally(point.x); editor.getScrollingModel().scrollVertically(point.y); if (!animated) editor.getScrollingModel().enableAnimation(); } public static void scrollToCaret(@Nullable Editor editor, boolean animated) { if (editor == null) return; if (!animated) editor.getScrollingModel().disableAnimation(); editor.getScrollingModel().scrollToCaret(ScrollType.CENTER); if (!animated) editor.getScrollingModel().enableAnimation(); } @NotNull public static Point getScrollingPosition(@Nullable Editor editor) { if (editor == null) return new Point(0, 0); ScrollingModel model = editor.getScrollingModel(); return new Point(model.getHorizontalScrollOffset(), model.getVerticalScrollOffset()); } @NotNull public static LogicalPosition getCaretPosition(@Nullable Editor editor) { return editor != null ? editor.getCaretModel().getLogicalPosition() : new LogicalPosition(0, 0); } public static void moveCaretToLineRangeIfNeeded(@NotNull Editor editor, int startLine, int endLine) { int caretLine = editor.getCaretModel().getLogicalPosition().line; if (!isSelectedByLine(caretLine, startLine, endLine)) { editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(startLine, 0)); } } // // Icons // @NotNull public static Icon getArrowIcon(@NotNull Side sourceSide) { return sourceSide.select(AllIcons.Diff.ArrowRight, AllIcons.Diff.Arrow); } @NotNull public static Icon getArrowDownIcon(@NotNull Side sourceSide) { return sourceSide.select(AllIcons.Diff.ArrowRightDown, AllIcons.Diff.ArrowLeftDown); } // // UI // public static void registerAction(@NotNull AnAction action, @NotNull JComponent component) { action.registerCustomShortcutSet(action.getShortcutSet(), component); } @NotNull public static JPanel createMessagePanel(@NotNull String message) { String text = StringUtil.replace(message, "\n", "<br>"); JLabel label = new JBLabel(text) { @Override public Dimension getMinimumSize() { Dimension size = super.getMinimumSize(); size.width = Math.min(size.width, 200); size.height = Math.min(size.height, 100); return size; } }.setCopyable(true); return createMessagePanel(label); } @NotNull public static JPanel createMessagePanel(@NotNull JComponent label) { CenteredPanel panel = new CenteredPanel(label, JBUI.Borders.empty(5)); EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme(); TextAttributes commentAttributes = scheme.getAttributes(DefaultLanguageHighlighterColors.LINE_COMMENT); if (commentAttributes.getForegroundColor() != null && commentAttributes.getBackgroundColor() == null) { label.setForeground(commentAttributes.getForegroundColor()); } else { label.setForeground(scheme.getDefaultForeground()); } label.setBackground(scheme.getDefaultBackground()); panel.setBackground(scheme.getDefaultBackground()); return panel; } public static void addActionBlock(@NotNull DefaultActionGroup group, AnAction... actions) { addActionBlock(group, Arrays.asList(actions)); } public static void addActionBlock(@NotNull DefaultActionGroup group, @Nullable List<? extends AnAction> actions) { if (actions == null || actions.isEmpty()) return; group.addSeparator(); AnAction[] children = group.getChildren(null); for (AnAction action : actions) { if (action instanceof Separator || !ArrayUtil.contains(action, children)) { group.add(action); } } } @NotNull public static String getSettingsConfigurablePath() { if (SystemInfo.isMac) { return "Preferences | Tools | Diff & Merge"; } return "Settings | Tools | Diff & Merge"; } @NotNull public static String createTooltipText(@NotNull String text, @Nullable String appendix) { StringBuilder result = new StringBuilder(); result.append("<html><body>"); result.append(text); if (appendix != null) { result.append("<br><div style='margin-top: 5px'><font size='2'>"); result.append(appendix); result.append("</font></div>"); } result.append("</body></html>"); return result.toString(); } @NotNull public static String createNotificationText(@NotNull String text, @Nullable String appendix) { StringBuilder result = new StringBuilder(); result.append("<html><body>"); result.append(text); if (appendix != null) { result.append("<br><span style='color:#").append(ColorUtil.toHex(JBColor.gray)).append("'><small>"); result.append(appendix); result.append("</small></span>"); } result.append("</body></html>"); return result.toString(); } public static void showSuccessPopup(@NotNull String message, @NotNull RelativePoint point, @NotNull Disposable disposable, @Nullable Runnable hyperlinkHandler) { HyperlinkListener listener = null; if (hyperlinkHandler != null) { listener = new HyperlinkAdapter() { @Override protected void hyperlinkActivated(HyperlinkEvent e) { hyperlinkHandler.run(); } }; } Color bgColor = MessageType.INFO.getPopupBackground(); Balloon balloon = JBPopupFactory.getInstance() .createHtmlTextBalloonBuilder(message, null, bgColor, listener) .setAnimationCycle(200) .createBalloon(); balloon.show(point, Balloon.Position.below); Disposer.register(disposable, balloon); } // // Titles // @NotNull public static List<JComponent> createSimpleTitles(@NotNull ContentDiffRequest request) { List<DiffContent> contents = request.getContents(); List<String> titles = request.getContentTitles(); if (!ContainerUtil.exists(titles, Condition.NOT_NULL)) { return Collections.nCopies(titles.size(), null); } List<JComponent> components = new ArrayList<>(titles.size()); for (int i = 0; i < contents.size(); i++) { JComponent title = createTitle(StringUtil.notNullize(titles.get(i))); title = createTitleWithNotifications(title, contents.get(i)); components.add(title); } return components; } @NotNull public static List<JComponent> createTextTitles(@NotNull ContentDiffRequest request, @NotNull List<? extends Editor> editors) { List<DiffContent> contents = request.getContents(); List<String> titles = request.getContentTitles(); boolean equalCharsets = TextDiffViewerUtil.areEqualCharsets(contents); boolean equalSeparators = TextDiffViewerUtil.areEqualLineSeparators(contents); List<JComponent> result = new ArrayList<>(contents.size()); if (equalCharsets && equalSeparators && !ContainerUtil.exists(titles, Condition.NOT_NULL)) { return Collections.nCopies(titles.size(), null); } for (int i = 0; i < contents.size(); i++) { JComponent title = createTitle(StringUtil.notNullize(titles.get(i)), contents.get(i), equalCharsets, equalSeparators, editors.get(i)); title = createTitleWithNotifications(title, contents.get(i)); result.add(title); } return result; } @Nullable private static JComponent createTitleWithNotifications(@Nullable JComponent title, @NotNull DiffContent content) { List<JComponent> notifications = new ArrayList<>(getCustomNotifications(content)); if (content instanceof DocumentContent) { Document document = ((DocumentContent)content).getDocument(); if (FileDocumentManager.getInstance().isPartialPreviewOfALargeFile(document)) { notifications.add(DiffNotifications.createNotification("File is too large. Only preview is loaded.")); } } if (notifications.isEmpty()) return title; JPanel panel = new JPanel(new BorderLayout(0, TITLE_GAP)); if (title != null) panel.add(title, BorderLayout.NORTH); panel.add(createStackedComponents(notifications, TITLE_GAP), BorderLayout.SOUTH); return panel; } @Nullable private static JComponent createTitle(@NotNull String title, @NotNull DiffContent content, boolean equalCharsets, boolean equalSeparators, @Nullable Editor editor) { if (content instanceof EmptyContent) return null; DocumentContent documentContent = (DocumentContent)content; Charset charset = equalCharsets ? null : documentContent.getCharset(); Boolean bom = equalCharsets ? null : documentContent.hasBom(); LineSeparator separator = equalSeparators ? null : documentContent.getLineSeparator(); boolean isReadOnly = editor == null || editor.isViewer() || !canMakeWritable(editor.getDocument()); return createTitle(title, separator, charset, bom, isReadOnly); } @NotNull public static JComponent createTitle(@NotNull String title) { return createTitle(title, null, null, null, false); } @NotNull public static JComponent createTitle(@NotNull String title, @Nullable LineSeparator separator, @Nullable Charset charset, @Nullable Boolean bom, boolean readOnly) { JPanel panel = new JPanel(new BorderLayout()); panel.setBorder(JBUI.Borders.empty(0, 4)); JBLabel titleLabel = new JBLabel(title).setCopyable(true); if (readOnly) titleLabel.setIcon(AllIcons.Ide.Readonly); panel.add(titleLabel, BorderLayout.CENTER); if (charset != null && separator != null) { JPanel panel2 = new JPanel(); panel2.setLayout(new BoxLayout(panel2, BoxLayout.X_AXIS)); panel2.add(createCharsetPanel(charset, bom)); panel2.add(Box.createRigidArea(JBUI.size(4, 0))); panel2.add(createSeparatorPanel(separator)); panel.add(panel2, BorderLayout.EAST); } else if (charset != null) { panel.add(createCharsetPanel(charset, bom), BorderLayout.EAST); } else if (separator != null) { panel.add(createSeparatorPanel(separator), BorderLayout.EAST); } return panel; } @NotNull private static JComponent createCharsetPanel(@NotNull Charset charset, @Nullable Boolean bom) { String text = charset.displayName(); if (bom != null && bom) { text += " BOM"; } JLabel label = new JLabel(text); // TODO: specific colors for other charsets if (charset.equals(Charset.forName("UTF-8"))) { label.setForeground(JBColor.BLUE); } else if (charset.equals(Charset.forName("ISO-8859-1"))) { label.setForeground(JBColor.RED); } else { label.setForeground(JBColor.BLACK); } return label; } @NotNull private static JComponent createSeparatorPanel(@NotNull LineSeparator separator) { JLabel label = new JLabel(separator.name()); Color color; if (separator == LineSeparator.CRLF) { color = JBColor.RED; } else if (separator == LineSeparator.LF) { color = JBColor.BLUE; } else if (separator == LineSeparator.CR) { color = JBColor.MAGENTA; } else { color = JBColor.BLACK; } label.setForeground(color); return label; } @NotNull public static List<JComponent> createSyncHeightComponents(@NotNull final List<JComponent> components) { if (!ContainerUtil.exists(components, Condition.NOT_NULL)) return components; List<JComponent> result = new ArrayList<>(); for (int i = 0; i < components.size(); i++) { result.add(new SyncHeightComponent(components, i)); } return result; } @NotNull public static JComponent createStackedComponents(@NotNull List<? extends JComponent> components, int gap) { JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); for (int i = 0; i < components.size(); i++) { if (i != 0) panel.add(Box.createVerticalStrut(JBUIScale.scale(gap))); panel.add(components.get(i)); } return panel; } // // Focus // public static boolean isFocusedComponent(@Nullable Component component) { return isFocusedComponent(null, component); } public static boolean isFocusedComponent(@Nullable Project project, @Nullable Component component) { if (component == null) return false; Component ideFocusOwner = IdeFocusManager.getInstance(project).getFocusOwner(); if (ideFocusOwner != null && SwingUtilities.isDescendingFrom(ideFocusOwner, component)) return true; Component jdkFocusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); if (jdkFocusOwner != null && SwingUtilities.isDescendingFrom(jdkFocusOwner, component)) return true; return false; } public static void requestFocus(@Nullable Project project, @Nullable Component component) { if (component == null) return; IdeFocusManager.getInstance(project).requestFocus(component, true); } public static boolean isFocusedComponentInWindow(@Nullable Component component) { if (component == null) return false; Window window = UIUtil.getWindow(component); if (window == null) return false; Component windowFocusOwner = window.getMostRecentFocusOwner(); return windowFocusOwner != null && SwingUtilities.isDescendingFrom(windowFocusOwner, component); } public static void requestFocusInWindow(@Nullable Component component) { if (component != null) component.requestFocusInWindow(); } public static void runPreservingFocus(@NotNull FocusableContext context, @NotNull Runnable task) { boolean hadFocus = context.isFocusedInWindow(); // if (hadFocus) KeyboardFocusManager.getCurrentKeyboardFocusManager().clearFocusOwner(); task.run(); if (hadFocus) context.requestFocusInWindow(); } // // Compare // @NotNull public static TwosideTextDiffProvider createTextDiffProvider(@Nullable Project project, @NotNull ContentDiffRequest request, @NotNull TextDiffSettings settings, @NotNull Runnable rediff, @NotNull Disposable disposable) { DiffUserDataKeysEx.DiffComputer diffComputer = request.getUserData(DiffUserDataKeysEx.CUSTOM_DIFF_COMPUTER); if (diffComputer != null) return new SimpleTextDiffProvider(settings, rediff, disposable, diffComputer); TwosideTextDiffProvider smartProvider = SmartTextDiffProvider.create(project, request, settings, rediff, disposable); if (smartProvider != null) return smartProvider; return new SimpleTextDiffProvider(settings, rediff, disposable); } @NotNull public static TwosideTextDiffProvider.NoIgnore createNoIgnoreTextDiffProvider(@Nullable Project project, @NotNull ContentDiffRequest request, @NotNull TextDiffSettings settings, @NotNull Runnable rediff, @NotNull Disposable disposable) { DiffUserDataKeysEx.DiffComputer diffComputer = request.getUserData(DiffUserDataKeysEx.CUSTOM_DIFF_COMPUTER); if (diffComputer != null) return new SimpleTextDiffProvider.NoIgnore(settings, rediff, disposable, diffComputer); TwosideTextDiffProvider.NoIgnore smartProvider = SmartTextDiffProvider.createNoIgnore(project, request, settings, rediff, disposable); if (smartProvider != null) return smartProvider; return new SimpleTextDiffProvider.NoIgnore(settings, rediff, disposable); } @Nullable public static MergeInnerDifferences compareThreesideInner(@NotNull List<? extends CharSequence> chunks, @NotNull ComparisonPolicy comparisonPolicy, @NotNull ProgressIndicator indicator) { if (chunks.get(0) == null && chunks.get(1) == null && chunks.get(2) == null) return null; // --- if (comparisonPolicy == ComparisonPolicy.IGNORE_WHITESPACES) { if (isChunksEquals(chunks.get(0), chunks.get(1), comparisonPolicy) && isChunksEquals(chunks.get(0), chunks.get(2), comparisonPolicy)) { // whitespace-only changes, ex: empty lines added/removed return new MergeInnerDifferences(Collections.emptyList(), Collections.emptyList(), Collections.emptyList()); } } if (chunks.get(0) == null && chunks.get(1) == null || chunks.get(0) == null && chunks.get(2) == null || chunks.get(1) == null && chunks.get(2) == null) { // =--, -=-, --= return null; } if (chunks.get(0) != null && chunks.get(1) != null && chunks.get(2) != null) { // === List<DiffFragment> fragments1 = ByWord.compare(chunks.get(1), chunks.get(0), comparisonPolicy, indicator); List<DiffFragment> fragments2 = ByWord.compare(chunks.get(1), chunks.get(2), comparisonPolicy, indicator); List<TextRange> left = new ArrayList<>(); List<TextRange> base = new ArrayList<>(); List<TextRange> right = new ArrayList<>(); for (DiffFragment wordFragment : fragments1) { base.add(new TextRange(wordFragment.getStartOffset1(), wordFragment.getEndOffset1())); left.add(new TextRange(wordFragment.getStartOffset2(), wordFragment.getEndOffset2())); } for (DiffFragment wordFragment : fragments2) { base.add(new TextRange(wordFragment.getStartOffset1(), wordFragment.getEndOffset1())); right.add(new TextRange(wordFragment.getStartOffset2(), wordFragment.getEndOffset2())); } return new MergeInnerDifferences(left, base, right); } // ==-, =-=, -== final ThreeSide side1 = chunks.get(0) != null ? ThreeSide.LEFT : ThreeSide.BASE; final ThreeSide side2 = chunks.get(2) != null ? ThreeSide.RIGHT : ThreeSide.BASE; CharSequence chunk1 = side1.select(chunks); CharSequence chunk2 = side2.select(chunks); List<DiffFragment> wordConflicts = ByWord.compare(chunk1, chunk2, comparisonPolicy, indicator); List<List<TextRange>> textRanges = ThreeSide.map(side -> { if (side == side1) { return ContainerUtil.map(wordConflicts, fragment -> new TextRange(fragment.getStartOffset1(), fragment.getEndOffset1())); } if (side == side2) { return ContainerUtil.map(wordConflicts, fragment -> new TextRange(fragment.getStartOffset2(), fragment.getEndOffset2())); } return null; }); return new MergeInnerDifferences(textRanges.get(0), textRanges.get(1), textRanges.get(2)); } private static boolean isChunksEquals(@Nullable CharSequence chunk1, @Nullable CharSequence chunk2, @NotNull ComparisonPolicy comparisonPolicy) { if (chunk1 == null) chunk1 = ""; if (chunk2 == null) chunk2 = ""; return ComparisonUtil.isEquals(chunk1, chunk2, comparisonPolicy); } @NotNull public static <T> int[] getSortedIndexes(@NotNull List<? extends T> values, @NotNull Comparator<? super T> comparator) { final List<Integer> indexes = new ArrayList<>(values.size()); for (int i = 0; i < values.size(); i++) { indexes.add(i); } ContainerUtil.sort(indexes, (i1, i2) -> { T val1 = values.get(i1); T val2 = values.get(i2); return comparator.compare(val1, val2); }); return ArrayUtil.toIntArray(indexes); } @NotNull public static int[] invertIndexes(@NotNull int[] indexes) { int[] inverted = new int[indexes.length]; for (int i = 0; i < indexes.length; i++) { inverted[indexes[i]] = i; } return inverted; } // // Document modification // public static boolean isSomeRangeSelected(@NotNull Editor editor, @NotNull Condition<? super BitSet> condition) { List<Caret> carets = editor.getCaretModel().getAllCarets(); if (carets.size() != 1) return true; Caret caret = carets.get(0); if (caret.hasSelection()) return true; return condition.value(getSelectedLines(editor)); } @NotNull public static BitSet getSelectedLines(@NotNull Editor editor) { Document document = editor.getDocument(); int totalLines = getLineCount(document); BitSet lines = new BitSet(totalLines + 1); for (Caret caret : editor.getCaretModel().getAllCarets()) { appendSelectedLines(editor, lines, caret); } return lines; } private static void appendSelectedLines(@NotNull Editor editor, @NotNull BitSet lines, @NotNull Caret caret) { Document document = editor.getDocument(); int totalLines = getLineCount(document); if (caret.hasSelection()) { int line1 = editor.offsetToLogicalPosition(caret.getSelectionStart()).line; int line2 = editor.offsetToLogicalPosition(caret.getSelectionEnd()).line; lines.set(line1, line2 + 1); if (caret.getSelectionEnd() == document.getTextLength()) lines.set(totalLines); } else { int offset = caret.getOffset(); VisualPosition visualPosition = caret.getVisualPosition(); Pair<LogicalPosition, LogicalPosition> pair = EditorUtil.calcSurroundingRange(editor, visualPosition, visualPosition); lines.set(pair.first.line, Math.max(pair.second.line, pair.first.line + 1)); if (offset == document.getTextLength()) lines.set(totalLines); } } public static boolean isSelectedByLine(int line, int line1, int line2) { if (line1 == line2 && line == line1) { return true; } if (line >= line1 && line < line2) { return true; } return false; } public static boolean isSelectedByLine(@NotNull BitSet selected, int line1, int line2) { if (line1 == line2) { return selected.get(line1); } else { int next = selected.nextSetBit(line1); return next != -1 && next < line2; } } private static void deleteLines(@NotNull Document document, int line1, int line2) { TextRange range = getLinesRange(document, line1, line2); int offset1 = range.getStartOffset(); int offset2 = range.getEndOffset(); if (offset1 > 0) { offset1--; } else if (offset2 < document.getTextLength()) { offset2++; } document.deleteString(offset1, offset2); } private static void insertLines(@NotNull Document document, int line, @NotNull CharSequence text) { if (line == getLineCount(document)) { document.insertString(document.getTextLength(), "\n" + text); } else { document.insertString(document.getLineStartOffset(line), text + "\n"); } } private static void replaceLines(@NotNull Document document, int line1, int line2, @NotNull CharSequence text) { TextRange currentTextRange = getLinesRange(document, line1, line2); int offset1 = currentTextRange.getStartOffset(); int offset2 = currentTextRange.getEndOffset(); document.replaceString(offset1, offset2, text); } public static void applyModification(@NotNull Document document, int line1, int line2, @NotNull List<? extends CharSequence> newLines) { if (line1 == line2 && newLines.isEmpty()) return; if (line1 == line2) { insertLines(document, line1, StringUtil.join(newLines, "\n")); } else if (newLines.isEmpty()) { deleteLines(document, line1, line2); } else { replaceLines(document, line1, line2, StringUtil.join(newLines, "\n")); } } public static void applyModification(@NotNull Document document1, int line1, int line2, @NotNull Document document2, int oLine1, int oLine2) { if (line1 == line2 && oLine1 == oLine2) return; if (line1 == line2) { insertLines(document1, line1, getLinesContent(document2, oLine1, oLine2)); } else if (oLine1 == oLine2) { deleteLines(document1, line1, line2); } else { replaceLines(document1, line1, line2, getLinesContent(document2, oLine1, oLine2)); } } public static String applyModification(@NotNull CharSequence text, @NotNull LineOffsets lineOffsets, @NotNull CharSequence otherText, @NotNull LineOffsets otherLineOffsets, @NotNull List<? extends Range> ranges) { return new Object() { private final StringBuilder stringBuilder = new StringBuilder(); private boolean isEmpty = true; @NotNull public String execute() { int lastLine = 0; for (Range range : ranges) { CharSequence newChunkContent = getLinesContent(otherText, otherLineOffsets, range.start2, range.end2); appendOriginal(lastLine, range.start1); append(newChunkContent, range.end2 - range.start2); lastLine = range.end1; } appendOriginal(lastLine, lineOffsets.getLineCount()); return stringBuilder.toString(); } private void appendOriginal(int start, int end) { append(getLinesContent(text, lineOffsets, start, end), end - start); } private void append(CharSequence content, int lineCount) { if (lineCount > 0 && !isEmpty) { stringBuilder.append('\n'); } stringBuilder.append(content); isEmpty &= lineCount == 0; } }.execute(); } @NotNull public static CharSequence getLinesContent(@NotNull Document document, int line1, int line2) { return getLinesRange(document, line1, line2).subSequence(document.getImmutableCharSequence()); } @NotNull public static CharSequence getLinesContent(@NotNull Document document, int line1, int line2, boolean includeNewLine) { return getLinesRange(document, line1, line2, includeNewLine).subSequence(document.getImmutableCharSequence()); } @NotNull public static CharSequence getLinesContent(@NotNull CharSequence sequence, @NotNull LineOffsets lineOffsets, int line1, int line2) { return getLinesContent(sequence, lineOffsets, line1, line2, false); } @NotNull public static CharSequence getLinesContent(@NotNull CharSequence sequence, @NotNull LineOffsets lineOffsets, int line1, int line2, boolean includeNewline) { assert sequence.length() == lineOffsets.getTextLength(); return getLinesRange(lineOffsets, line1, line2, includeNewline).subSequence(sequence); } /** * Return affected range, without non-internal newlines * <p/> * we consider '\n' not as a part of line, but a separator between lines * ex: if last line is not empty, the last symbol will not be '\n' */ public static TextRange getLinesRange(@NotNull Document document, int line1, int line2) { return getLinesRange(document, line1, line2, false); } @NotNull public static TextRange getLinesRange(@NotNull Document document, int line1, int line2, boolean includeNewline) { return getLinesRange(LineOffsetsUtil.create(document), line1, line2, includeNewline); } @NotNull public static TextRange getLinesRange(@NotNull LineOffsets lineOffsets, int line1, int line2, boolean includeNewline) { if (line1 == line2) { int lineStartOffset = line1 < lineOffsets.getLineCount() ? lineOffsets.getLineStart(line1) : lineOffsets.getTextLength(); return new TextRange(lineStartOffset, lineStartOffset); } else { int startOffset = lineOffsets.getLineStart(line1); int endOffset = lineOffsets.getLineEnd(line2 - 1); if (includeNewline && endOffset < lineOffsets.getTextLength()) endOffset++; return new TextRange(startOffset, endOffset); } } public static int getOffset(@NotNull Document document, int line, int column) { if (line < 0) return 0; if (line >= getLineCount(document)) return document.getTextLength(); int start = document.getLineStartOffset(line); int end = document.getLineEndOffset(line); return Math.min(start + column, end); } /** * Document.getLineCount() returns 0 for empty text. * <p> * This breaks an assumption "getLineCount() == StringUtil.countNewLines(text) + 1" * and adds unnecessary corner case into line ranges logic. */ public static int getLineCount(@NotNull Document document) { return Math.max(document.getLineCount(), 1); } @NotNull public static List<String> getLines(@NotNull Document document) { return getLines(document, 0, getLineCount(document)); } @NotNull public static List<String> getLines(@NotNull CharSequence text, @NonNls LineOffsets lineOffsets) { return getLines(text, lineOffsets, 0, lineOffsets.getLineCount()); } @NotNull public static List<String> getLines(@NotNull Document document, int startLine, int endLine) { return getLines(document.getCharsSequence(), LineOffsetsUtil.create(document), startLine, endLine); } @NotNull public static List<String> getLines(@NotNull CharSequence text, @NonNls LineOffsets lineOffsets, int startLine, int endLine) { if (startLine < 0 || startLine > endLine || endLine > lineOffsets.getLineCount()) { throw new IndexOutOfBoundsException(String.format("Wrong line range: [%d, %d); lineCount: '%d'", startLine, endLine, lineOffsets.getLineCount())); } List<String> result = new ArrayList<>(); for (int i = startLine; i < endLine; i++) { int start = lineOffsets.getLineStart(i); int end = lineOffsets.getLineEnd(i); result.add(text.subSequence(start, end).toString()); } return result; } public static int bound(int value, int lowerBound, int upperBound) { assert lowerBound <= upperBound : String.format("%s - [%s, %s]", value, lowerBound, upperBound); return Math.max(Math.min(value, upperBound), lowerBound); } // // Updating ranges on change // @NotNull public static LineRange getAffectedLineRange(@NotNull DocumentEvent e) { int line1 = e.getDocument().getLineNumber(e.getOffset()); int line2 = e.getDocument().getLineNumber(e.getOffset() + e.getOldLength()) + 1; return new LineRange(line1, line2); } public static int countLinesShift(@NotNull DocumentEvent e) { return StringUtil.countNewLines(e.getNewFragment()) - StringUtil.countNewLines(e.getOldFragment()); } @NotNull public static UpdatedLineRange updateRangeOnModification(int start, int end, int changeStart, int changeEnd, int shift) { return updateRangeOnModification(start, end, changeStart, changeEnd, shift, false); } @NotNull public static UpdatedLineRange updateRangeOnModification(int start, int end, int changeStart, int changeEnd, int shift, boolean greedy) { if (end <= changeStart) { // change before return new UpdatedLineRange(start, end, false); } if (start >= changeEnd) { // change after return new UpdatedLineRange(start + shift, end + shift, false); } if (start <= changeStart && end >= changeEnd) { // change inside return new UpdatedLineRange(start, end + shift, false); } // range is damaged. We don't know new boundaries. // But we can try to return approximate new position int newChangeEnd = changeEnd + shift; if (start >= changeStart && end <= changeEnd) { // fully inside change return greedy ? new UpdatedLineRange(changeStart, newChangeEnd, true) : new UpdatedLineRange(newChangeEnd, newChangeEnd, true); } if (start < changeStart) { // bottom boundary damaged return greedy ? new UpdatedLineRange(start, newChangeEnd, true) : new UpdatedLineRange(start, changeStart, true); } else { // top boundary damaged return greedy ? new UpdatedLineRange(changeStart, end + shift, true) : new UpdatedLineRange(newChangeEnd, end + shift, true); } } public static class UpdatedLineRange { public final int startLine; public final int endLine; public final boolean damaged; public UpdatedLineRange(int startLine, int endLine, boolean damaged) { this.startLine = startLine; this.endLine = endLine; this.damaged = damaged; } } // // Types // @NotNull public static TextDiffType getLineDiffType(@NotNull LineFragment fragment) { boolean left = fragment.getStartLine1() != fragment.getEndLine1(); boolean right = fragment.getStartLine2() != fragment.getEndLine2(); return getDiffType(left, right); } @NotNull public static TextDiffType getDiffType(@NotNull DiffFragment fragment) { boolean left = fragment.getEndOffset1() != fragment.getStartOffset1(); boolean right = fragment.getEndOffset2() != fragment.getStartOffset2(); return getDiffType(left, right); } @NotNull public static TextDiffType getDiffType(boolean hasDeleted, boolean hasInserted) { if (hasDeleted && hasInserted) { return TextDiffType.MODIFIED; } else if (hasDeleted) { return TextDiffType.DELETED; } else if (hasInserted) { return TextDiffType.INSERTED; } else { LOG.error("Diff fragment should not be empty"); return TextDiffType.MODIFIED; } } @NotNull public static MergeConflictType getMergeType(@NotNull Condition<? super ThreeSide> emptiness, @NotNull Equality<? super ThreeSide> equality, @Nullable Equality<? super ThreeSide> trueEquality, @NotNull BooleanGetter conflictResolver) { boolean isLeftEmpty = emptiness.value(ThreeSide.LEFT); boolean isBaseEmpty = emptiness.value(ThreeSide.BASE); boolean isRightEmpty = emptiness.value(ThreeSide.RIGHT); assert !isLeftEmpty || !isBaseEmpty || !isRightEmpty; if (isBaseEmpty) { if (isLeftEmpty) { // --= return new MergeConflictType(TextDiffType.INSERTED, false, true); } else if (isRightEmpty) { // =-- return new MergeConflictType(TextDiffType.INSERTED, true, false); } else { // =-= boolean equalModifications = equality.equals(ThreeSide.LEFT, ThreeSide.RIGHT); if (equalModifications) { return new MergeConflictType(TextDiffType.INSERTED, true, true); } else { return new MergeConflictType(TextDiffType.CONFLICT, true, true, false); } } } else { if (isLeftEmpty && isRightEmpty) { // -=- return new MergeConflictType(TextDiffType.DELETED, true, true); } else { // -==, ==-, === boolean unchangedLeft = equality.equals(ThreeSide.BASE, ThreeSide.LEFT); boolean unchangedRight = equality.equals(ThreeSide.BASE, ThreeSide.RIGHT); if (unchangedLeft && unchangedRight) { assert trueEquality != null; boolean trueUnchangedLeft = trueEquality.equals(ThreeSide.BASE, ThreeSide.LEFT); boolean trueUnchangedRight = trueEquality.equals(ThreeSide.BASE, ThreeSide.RIGHT); assert !trueUnchangedLeft || !trueUnchangedRight; return new MergeConflictType(TextDiffType.MODIFIED, !trueUnchangedLeft, !trueUnchangedRight); } if (unchangedLeft) return new MergeConflictType(isRightEmpty ? TextDiffType.DELETED : TextDiffType.MODIFIED, false, true); if (unchangedRight) return new MergeConflictType(isLeftEmpty ? TextDiffType.DELETED : TextDiffType.MODIFIED, true, false); boolean equalModifications = equality.equals(ThreeSide.LEFT, ThreeSide.RIGHT); if (equalModifications) { return new MergeConflictType(TextDiffType.MODIFIED, true, true); } else { boolean canBeResolved = !isLeftEmpty && !isRightEmpty && conflictResolver.get(); return new MergeConflictType(TextDiffType.CONFLICT, true, true, canBeResolved); } } } } @NotNull public static MergeConflictType getLineThreeWayDiffType(@NotNull MergeLineFragment fragment, @NotNull List<? extends CharSequence> sequences, @NotNull List<? extends LineOffsets> lineOffsets, @NotNull ComparisonPolicy policy) { return getMergeType((side) -> isLineMergeIntervalEmpty(fragment, side), (side1, side2) -> compareLineMergeContents(fragment, sequences, lineOffsets, policy, side1, side2), null, () -> canResolveLineConflict(fragment, sequences, lineOffsets)); } @NotNull public static MergeConflictType getLineMergeType(@NotNull MergeLineFragment fragment, @NotNull List<? extends CharSequence> sequences, @NotNull List<? extends LineOffsets> lineOffsets, @NotNull ComparisonPolicy policy) { return getMergeType((side) -> isLineMergeIntervalEmpty(fragment, side), (side1, side2) -> compareLineMergeContents(fragment, sequences, lineOffsets, policy, side1, side2), (side1, side2) -> compareLineMergeContents(fragment, sequences, lineOffsets, ComparisonPolicy.DEFAULT, side1, side2), () -> canResolveLineConflict(fragment, sequences, lineOffsets)); } private static boolean canResolveLineConflict(@NotNull MergeLineFragment fragment, @NotNull List<? extends CharSequence> sequences, @NotNull List<? extends LineOffsets> lineOffsets) { List<? extends CharSequence> contents = ThreeSide.map(side -> getLinesContent(side.select(sequences), side.select(lineOffsets), fragment.getStartLine(side), fragment.getEndLine(side))); return ComparisonMergeUtil.tryResolveConflict(contents.get(0), contents.get(1), contents.get(2)) != null; } private static boolean compareLineMergeContents(@NotNull MergeLineFragment fragment, @NotNull List<? extends CharSequence> sequences, @NotNull List<? extends LineOffsets> lineOffsets, @NotNull ComparisonPolicy policy, @NotNull ThreeSide side1, @NotNull ThreeSide side2) { int start1 = fragment.getStartLine(side1); int end1 = fragment.getEndLine(side1); int start2 = fragment.getStartLine(side2); int end2 = fragment.getEndLine(side2); if (end2 - start2 != end1 - start1) return false; CharSequence sequence1 = side1.select(sequences); CharSequence sequence2 = side2.select(sequences); LineOffsets offsets1 = side1.select(lineOffsets); LineOffsets offsets2 = side2.select(lineOffsets); for (int i = 0; i < end1 - start1; i++) { int line1 = start1 + i; int line2 = start2 + i; CharSequence content1 = getLinesContent(sequence1, offsets1, line1, line1 + 1); CharSequence content2 = getLinesContent(sequence2, offsets2, line2, line2 + 1); if (!ComparisonUtil.isEquals(content1, content2, policy)) return false; } return true; } private static boolean isLineMergeIntervalEmpty(@NotNull MergeLineFragment fragment, @NotNull ThreeSide side) { return fragment.getStartLine(side) == fragment.getEndLine(side); } @NotNull public static MergeConflictType getWordMergeType(@NotNull MergeWordFragment fragment, @NotNull List<? extends CharSequence> texts, @NotNull ComparisonPolicy policy) { return getMergeType((side) -> isWordMergeIntervalEmpty(fragment, side), (side1, side2) -> compareWordMergeContents(fragment, texts, policy, side1, side2), null, BooleanGetter.FALSE); } public static boolean compareWordMergeContents(@NotNull MergeWordFragment fragment, @NotNull List<? extends CharSequence> texts, @NotNull ComparisonPolicy policy, @NotNull ThreeSide side1, @NotNull ThreeSide side2) { int start1 = fragment.getStartOffset(side1); int end1 = fragment.getEndOffset(side1); int start2 = fragment.getStartOffset(side2); int end2 = fragment.getEndOffset(side2); CharSequence document1 = side1.select(texts); CharSequence document2 = side2.select(texts); CharSequence content1 = document1.subSequence(start1, end1); CharSequence content2 = document2.subSequence(start2, end2); return ComparisonUtil.isEquals(content1, content2, policy); } private static boolean isWordMergeIntervalEmpty(@NotNull MergeWordFragment fragment, @NotNull ThreeSide side) { return fragment.getStartOffset(side) == fragment.getEndOffset(side); } // // Writable // @CalledInAwt public static boolean executeWriteCommand(@Nullable Project project, @NotNull Document document, @Nullable String commandName, @Nullable String commandGroupId, @NotNull UndoConfirmationPolicy confirmationPolicy, boolean underBulkUpdate, @NotNull Runnable task) { if (!makeWritable(project, document)) { VirtualFile file = FileDocumentManager.getInstance().getFile(document); LOG.warn("Document is read-only" + (file != null ? ": " + file.getPresentableName() : "")); return false; } ApplicationManager.getApplication().runWriteAction(() -> CommandProcessor.getInstance().executeCommand(project, () -> { if (underBulkUpdate) { DocumentUtil.executeInBulk(document, true, task); } else { task.run(); } }, commandName, commandGroupId, confirmationPolicy, document)); return true; } @CalledInAwt public static boolean executeWriteCommand(@NotNull final Document document, @Nullable final Project project, @Nullable final String commandName, @NotNull final Runnable task) { return executeWriteCommand(project, document, commandName, null, UndoConfirmationPolicy.DEFAULT, false, task); } public static boolean isEditable(@NotNull Editor editor) { return !editor.isViewer() && canMakeWritable(editor.getDocument()); } public static boolean canMakeWritable(@NotNull Document document) { if (document.isWritable()) { return true; } VirtualFile file = FileDocumentManager.getInstance().getFile(document); if (file != null && file.isValid() && file.isInLocalFileSystem()) { if (file.getUserData(TEMP_FILE_KEY) == Boolean.TRUE) return false; // decompiled file can be writable, but Document with decompiled content is still read-only return !file.isWritable(); } return false; } @CalledInAwt public static boolean makeWritable(@Nullable Project project, @NotNull Document document) { VirtualFile file = FileDocumentManager.getInstance().getFile(document); if (file == null) return document.isWritable(); if (!file.isValid()) return false; return makeWritable(project, file) && document.isWritable(); } @CalledInAwt public static boolean makeWritable(@Nullable Project project, @NotNull VirtualFile file) { if (project == null) project = ProjectManager.getInstance().getDefaultProject(); return !ReadonlyStatusHandler.getInstance(project).ensureFilesWritable(Collections.singletonList(file)).hasReadonlyFiles(); } public static void putNonundoableOperation(@Nullable Project project, @NotNull Document document) { UndoManager undoManager = project != null ? UndoManager.getInstance(project) : UndoManager.getGlobalInstance(); if (undoManager != null) { DocumentReference ref = DocumentReferenceManager.getInstance().create(document); undoManager.nonundoableActionPerformed(ref, false); } } /** * Difference with {@link VfsUtil#markDirtyAndRefresh} is that refresh from VfsUtil will be performed with ModalityState.NON_MODAL. */ public static void markDirtyAndRefresh(boolean async, boolean recursive, boolean reloadChildren, @NotNull VirtualFile... files) { ModalityState modalityState = ApplicationManager.getApplication().getDefaultModalityState(); VfsUtil.markDirty(recursive, reloadChildren, files); RefreshQueue.getInstance().refresh(async, recursive, null, modalityState, files); } // // Windows // @NotNull public static Dimension getDefaultDiffPanelSize() { return new Dimension(400, 200); } @NotNull public static Dimension getDefaultDiffWindowSize() { Rectangle screenBounds = ScreenUtil.getMainScreenBounds(); int width = (int)(screenBounds.width * 0.8); int height = (int)(screenBounds.height * 0.8); return new Dimension(width, height); } @NotNull public static WindowWrapper.Mode getWindowMode(@NotNull DiffDialogHints hints) { WindowWrapper.Mode mode = hints.getMode(); if (mode == null) { boolean isUnderDialog = LaterInvocator.isInModalContext(); mode = isUnderDialog ? WindowWrapper.Mode.MODAL : WindowWrapper.Mode.FRAME; } return mode; } public static void closeWindow(@Nullable Window window, boolean modalOnly, boolean recursive) { if (window == null) return; Component component = window; while (component != null) { if (component instanceof Window) { boolean isClosed = closeWindow((Window)component, modalOnly); if (!isClosed) break; } component = recursive ? component.getParent() : null; } } /** * @return whether window was closed */ private static boolean closeWindow(@NotNull Window window, boolean modalOnly) { if (window instanceof IdeFrameImpl) return false; if (modalOnly && canBeHiddenBehind(window)) return false; if (window instanceof DialogWrapperDialog) { ((DialogWrapperDialog)window).getDialogWrapper().doCancelAction(); return !window.isVisible(); } window.setVisible(false); window.dispose(); return true; } private static boolean canBeHiddenBehind(@NotNull Window window) { if (!(window instanceof Frame)) return false; if (SystemInfo.isMac) { if (window instanceof IdeFrame) { // we can't move focus to full-screen main frame, as it will be hidden behind other frame windows Project project = ((IdeFrame)window).getProject(); IdeFrame projectFrame = WindowManager.getInstance().getIdeFrame(project); if (projectFrame instanceof IdeFrameEx) { return !((IdeFrameEx)projectFrame).isInFullScreen(); } } } return true; } // // UserData // public static <T> UserDataHolderBase createUserDataHolder(@NotNull Key<T> key, @Nullable T value) { UserDataHolderBase holder = new UserDataHolderBase(); holder.putUserData(key, value); return holder; } public static boolean isUserDataFlagSet(@NotNull Key<Boolean> key, UserDataHolder... holders) { for (UserDataHolder holder : holders) { if (holder == null) continue; Boolean data = holder.getUserData(key); if (data != null) return data; } return false; } public static <T> T getUserData(@Nullable UserDataHolder first, @Nullable UserDataHolder second, @NotNull Key<T> key) { if (first != null) { T data = first.getUserData(key); if (data != null) return data; } if (second != null) { T data = second.getUserData(key); if (data != null) return data; } return null; } public static void addNotification(@Nullable JComponent component, @NotNull UserDataHolder holder) { if (component == null) return; List<JComponent> oldComponents = ContainerUtil.notNullize(holder.getUserData(DiffUserDataKeys.NOTIFICATIONS)); holder.putUserData(DiffUserDataKeys.NOTIFICATIONS, ContainerUtil.append(oldComponents, component)); } @NotNull public static List<JComponent> getCustomNotifications(@NotNull UserDataHolder context, @NotNull UserDataHolder request) { List<JComponent> requestComponents = request.getUserData(DiffUserDataKeys.NOTIFICATIONS); List<JComponent> contextComponents = context.getUserData(DiffUserDataKeys.NOTIFICATIONS); return ContainerUtil.concat(ContainerUtil.notNullize(contextComponents), ContainerUtil.notNullize(requestComponents)); } @NotNull public static List<JComponent> getCustomNotifications(@NotNull DiffContent content) { return ContainerUtil.notNullize(content.getUserData(DiffUserDataKeys.NOTIFICATIONS)); } // // DataProvider // @Nullable public static Object getData(@Nullable DataProvider provider, @Nullable DataProvider fallbackProvider, @NotNull @NonNls String dataId) { if (provider != null) { Object data = provider.getData(dataId); if (data != null) return data; } if (fallbackProvider != null) { Object data = fallbackProvider.getData(dataId); if (data != null) return data; } return null; } public static <T> void putDataKey(@NotNull UserDataHolder holder, @NotNull DataKey<T> key, @Nullable T value) { DataProvider dataProvider = holder.getUserData(DiffUserDataKeys.DATA_PROVIDER); if (!(dataProvider instanceof GenericDataProvider)) { dataProvider = new GenericDataProvider(dataProvider); holder.putUserData(DiffUserDataKeys.DATA_PROVIDER, dataProvider); } ((GenericDataProvider)dataProvider).putData(key, value); } @NotNull public static DiffSettings getDiffSettings(@NotNull DiffContext context) { DiffSettings settings = context.getUserData(DiffSettings.KEY); if (settings == null) { settings = DiffSettings.getSettings(context.getUserData(DiffUserDataKeys.PLACE)); context.putUserData(DiffSettings.KEY, settings); } return settings; } @NotNull public static <K, V> TreeMap<K, V> trimDefaultValues(@NotNull TreeMap<K, V> map, @NotNull Convertor<? super K, V> defaultValue) { TreeMap<K, V> result = new TreeMap<>(); for (Map.Entry<K, V> it : map.entrySet()) { K key = it.getKey(); V value = it.getValue(); if (!value.equals(defaultValue.convert(key))) result.put(key, value); } return result; } // // Tools // @NotNull public static <T extends DiffTool> List<T> filterSuppressedTools(@NotNull List<T> tools) { if (tools.size() < 2) return tools; final List<Class<? extends DiffTool>> suppressedTools = new ArrayList<>(); for (T tool : tools) { try { if (tool instanceof SuppressiveDiffTool) suppressedTools.addAll(((SuppressiveDiffTool)tool).getSuppressedTools()); } catch (Throwable e) { LOG.error(e); } } if (suppressedTools.isEmpty()) return tools; List<T> filteredTools = ContainerUtil.filter(tools, tool -> !suppressedTools.contains(tool.getClass())); return filteredTools.isEmpty() ? tools : filteredTools; } @Nullable public static DiffTool findToolSubstitutor(@NotNull DiffTool tool, @NotNull DiffContext context, @NotNull DiffRequest request) { for (DiffToolSubstitutor substitutor : DiffToolSubstitutor.EP_NAME.getExtensions()) { DiffTool replacement = substitutor.getReplacement(tool, context, request); if (replacement == null) continue; boolean canShow = replacement.canShow(context, request); if (!canShow) { LOG.error("DiffTool substitutor returns invalid tool"); continue; } return replacement; } return null; } // // Helpers // private static class SyncHeightComponent extends JPanel { @NotNull private final List<? extends JComponent> myComponents; SyncHeightComponent(@NotNull List<? extends JComponent> components, int index) { super(new BorderLayout()); myComponents = components; JComponent delegate = components.get(index); if (delegate != null) add(delegate, BorderLayout.CENTER); } @Override public Dimension getPreferredSize() { Dimension size = super.getPreferredSize(); size.height = getPreferredHeight(); return size; } private int getPreferredHeight() { int height = 0; for (JComponent component : myComponents) { if (component == null) continue; height = Math.max(height, component.getPreferredSize().height); } return height; } } public static class CenteredPanel extends JPanel { private final JComponent myComponent; public CenteredPanel(@NotNull JComponent component) { myComponent = component; add(component); } public CenteredPanel(@NotNull JComponent component, @NotNull Border border) { this(component); setBorder(border); } @Override public void doLayout() { final Dimension size = getSize(); final Dimension preferredSize = myComponent.getPreferredSize(); Insets insets = getInsets(); JBInsets.removeFrom(size, insets); int width = Math.min(size.width, preferredSize.width); int height = Math.min(size.height, preferredSize.height); int x = Math.max(0, (size.width - preferredSize.width) / 2); int y = Math.max(0, (size.height - preferredSize.height) / 2); myComponent.setBounds(insets.left + x, insets.top + y, width, height); } @Override public Dimension getPreferredSize() { return addInsets(myComponent.getPreferredSize()); } @Override public Dimension getMinimumSize() { return addInsets(myComponent.getMinimumSize()); } @Override public Dimension getMaximumSize() { return addInsets(myComponent.getMaximumSize()); } private Dimension addInsets(Dimension dimension) { JBInsets.addTo(dimension, getInsets()); return dimension; } } }
IDEA-215972 diff: use codestyle for specific language in diff editors GitOrigin-RevId: b3d815ad12a8a2296c098b6258934e0126332f23
platform/diff-impl/src/com/intellij/diff/util/DiffUtil.java
IDEA-215972 diff: use codestyle for specific language in diff editors
<ide><path>latform/diff-impl/src/com/intellij/diff/util/DiffUtil.java <ide> import com.intellij.openapi.editor.highlighter.EditorHighlighterFactory; <ide> import com.intellij.openapi.editor.markup.TextAttributes; <ide> import com.intellij.openapi.fileEditor.FileDocumentManager; <add>import com.intellij.openapi.fileEditor.impl.text.TextEditorImpl; <ide> import com.intellij.openapi.fileTypes.FileType; <ide> import com.intellij.openapi.fileTypes.PlainTextFileType; <ide> import com.intellij.openapi.fileTypes.SyntaxHighlighter; <ide> editor.getSettings().setTabSize(indentOptions.TAB_SIZE); <ide> editor.getSettings().setUseTabCharacter(indentOptions.USE_TAB_CHARACTER); <ide> } <add> <add> Language language = content != null ? content.getUserData(DiffUserDataKeys.LANGUAGE) : null; <add> if (language == null) language = TextEditorImpl.getDocumentLanguage(editor); <add> editor.getSettings().setLanguage(language); <add> <ide> editor.getSettings().setCaretRowShown(false); <ide> editor.reinitSettings(); <ide> }
Java
bsd-2-clause
034b26cb5896ee67738a10e3750e052d8ceb168c
0
TehSAUCE/imagej,TehSAUCE/imagej,biovoxxel/imagej,biovoxxel/imagej,TehSAUCE/imagej,biovoxxel/imagej
/* * #%L * ImageJ software for multidimensional image processing and analysis. * %% * Copyright (C) 2009 - 2013 Board of Regents of the University of * Wisconsin-Madison, Broad Institute of MIT and Harvard, and Max Planck * Institute of Molecular Cell Biology and Genetics. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of any organization. * #L% */ package imagej.updater.gui; import imagej.updater.core.FileObject; import imagej.updater.core.FileObject.Action; import imagej.updater.core.FilesCollection; import imagej.updater.core.UpdateSite; import imagej.updater.core.UploaderService; import imagej.updater.util.Util; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; import javax.swing.AbstractAction; import javax.swing.BoxLayout; import javax.swing.DefaultCellEditor; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JTextField; import javax.swing.KeyStroke; import javax.swing.ListSelectionModel; import javax.swing.event.ListSelectionEvent; import javax.swing.event.TableModelEvent; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumn; import javax.swing.table.TableColumnModel; import net.miginfocom.swing.MigLayout; /** * The dialog in which the user can choose which update sites to follow. * * @author Johannes Schindelin */ @SuppressWarnings("serial") public class SitesDialog extends JDialog implements ActionListener { protected UpdaterFrame updaterFrame; protected FilesCollection files; protected List<UpdateSite> sites; protected DataModel tableModel; protected JTable table; protected JButton addNewSite, addPersonalSite, remove, close; public SitesDialog(final UpdaterFrame owner, final FilesCollection files) { super(owner, "Manage update sites"); updaterFrame = owner; this.files = files; sites = initializeSites(files); final Container contentPane = getContentPane(); contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS)); tableModel = new DataModel(); table = new JTable(tableModel) { @Override public void valueChanged(final ListSelectionEvent e) { super.valueChanged(e); remove.setEnabled(getSelectedRow() > 0); } @Override public boolean isCellEditable(final int row, final int column) { return column >= 0 && column < getColumnCount() && row >= 0 && row < getRowCount(); } @Override public TableCellEditor getCellEditor(final int row, final int column) { if (column == 0) return super.getCellEditor(row, column); final JTextField field = new JTextField(); return new DefaultCellEditor(field) { @Override public boolean stopCellEditing() { String value = field.getText(); if ((column == 2 || column == 4) && !value.equals("") && !value.endsWith("/")) { value += "/"; } if (column == 1) { if (value.equals(getUpdateSiteName(row))) return super.stopCellEditing(); if (files.getUpdateSite(value) != null) { error("Update site '" + value + "' exists already!"); return false; } } else if (column == 2) { if ("/".equals(value)) value = ""; final UpdateSite site = getUpdateSite(row); if (value.equals(site.getURL())) return super.stopCellEditing(); if (validURL(value)) { activateUpdateSite(row); } else { if (site == null || site.getHost() == null || site.getHost().equals("")) { error("URL does not refer to an update site: " + value + "\n" + "If you want to initialize that site, you need to provide upload information first."); return false; } else { if (!showYesNoQuestion("Initialize upload site?", "It appears that the URL\n" + "\t" + value + "\n" + "is not (yet) valid. " + "Do you want to initialize it (host: " + site.getHost() + "; directory: " + site.getUploadDirectory() + ")?")) return false; if (!initializeUpdateSite((String)getValueAt(row, 0), value, site.getHost(), site.getUploadDirectory())) return false; } } } else if (column == 3) { final UpdateSite site = getUpdateSite(row); if (value.equals(site.getHost())) return super.stopCellEditing(); final int colon = value.indexOf(':'); if (colon > 0) { final String protocol = value.substring(0, colon); final UploaderService uploaderService = updaterFrame.getUploaderService(); if (null == uploaderService.installUploader(protocol, files, updaterFrame.getProgress(null))) { error("Unknown upload protocol: " + protocol); return false; } } } else if (column == 4) { final UpdateSite site = getUpdateSite(row); if (value.equals(site.getUploadDirectory())) return super.stopCellEditing(); } updaterFrame.enableUploadOrNot(); return super.stopCellEditing(); } }; } @Override public void setValueAt(final Object value, final int row, final int column) { final UpdateSite site = getUpdateSite(row); if (column == 0) { site.setActive(Boolean.TRUE.equals(value)); } else { final String string = (String)value; // if the name changed, or if we auto-fill the name from the URL switch (column) { case 1: final String name = site.getName(); if (name.equals(string)) return; files.renameUpdateSite(name, string); sites.get(row).setName(string); break; case 2: if (site.getURL().equals(string)) return; site.setURL(string); break; case 3: if (string.equals(site.getHost())) return; site.setHost(string); break; case 4: if (string.equals(site.getUploadDirectory())) return; site.setUploadDirectory(string); break; default: updaterFrame.log.error("Whoa! Column " + column + " is not handled!"); } } if (site.isActive()) { if (column == 0 || column == 2) { activateUpdateSite(row); } } else { deactivateUpdateSite(site.getName()); } } @Override public Component prepareRenderer(TableCellRenderer renderer,int row, int column) { Component component = super.prepareRenderer(renderer, row, column); if (component instanceof JComponent) { final UpdateSite site = getUpdateSite(row); if (site != null) { JComponent jcomponent = (JComponent) component; jcomponent.setToolTipText(wrapToolTip(site.getDescription(), site.getMaintainer())); } } return component; } }; table.setColumnSelectionAllowed(false); table.setRowSelectionAllowed(true); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); tableModel.setColumnWidths(); final JScrollPane scrollpane = new JScrollPane(table); scrollpane.setPreferredSize(new Dimension(tableModel.tableWidth, 400)); contentPane.add(scrollpane); final JPanel buttons = new JPanel(); addPersonalSite = SwingTools.button("Add my site", "Add my personal update site", this, buttons); addNewSite = SwingTools.button("Add", "Add", this, buttons); remove = SwingTools.button("Remove", "Remove", this, buttons); remove.setEnabled(false); close = SwingTools.button("Close", "Close", this, buttons); contentPane.add(buttons); getRootPane().setDefaultButton(close); escapeCancels(this); pack(); addNewSite.requestFocusInWindow(); setLocationRelativeTo(owner); } private static String wrapToolTip(final String description, final String maintainer) { if (description == null) return null; return "<html><p width='400'>" + description.replaceAll("\n", "<br />") + (maintainer != null ? "</p><p>Maintainer: " + maintainer + "</p>": "") + "</p></html>"; } private static List<UpdateSite> initializeSites(final FilesCollection files) { final List<UpdateSite> sites = new ArrayList<UpdateSite>(); final Map<String, Integer> url2index = new HashMap<String, Integer>(); // make sure that the main update site is the first one. final UpdateSite mainSite = new UpdateSite(FilesCollection.DEFAULT_UPDATE_SITE, Util.MAIN_URL, "", "", null, null, 0l); sites.add(mainSite); url2index.put(mainSite.getURL(), 0); // read available sites from the Fiji Wiki try { for (final UpdateSite site : getAvailableSites().values()) { Integer index = url2index.get(site.getURL()); if (index == null) { url2index.put(site.getURL(), sites.size()); sites.add(site); } else { sites.set(index.intValue(), site); } } } catch (Exception e) { e.printStackTrace(); } // add active / upload information final Set<String> names = new HashSet<String>(); for (final String name : files.getUpdateSiteNames()) { final UpdateSite site = files.getUpdateSite(name); Integer index = url2index.get(site.getURL()); if (index == null) { url2index.put(site.getURL(), sites.size()); sites.add(site); } else { final UpdateSite listed = sites.get(index.intValue()); site.setDescription(listed.getDescription()); site.setMaintainer(listed.getMaintainer()); sites.set(index.intValue(), site); } } // make sure names are unique for (final UpdateSite site : sites) { if (site.isActive()) continue; if (names.contains(site.getName())) { int i = 2; while (names.contains(site.getName() + "-" + i)) i++; site.setName(site.getName() + ("-" + i)); } names.add(site.getName()); } return sites; } protected String getUpdateSiteName(int row) { return sites.get(row).getName(); } protected UpdateSite getUpdateSite(int row) { return sites.get(row); } private void addNew() { add(new UpdateSite(makeUniqueSiteName("New"), "", "", "", null, null, 0l)); } private final static String PERSONAL_SITES_URL = "http://sites.imagej.net/"; private void addPersonalSite() { final PersonalSiteDialog dialog = new PersonalSiteDialog(); final String user = dialog.name; if (user == null) return; final String url = PERSONAL_SITES_URL + user; final int row = sites.size(); add(new UpdateSite(makeUniqueSiteName("My Site"), url, "webdav:" + user, "", null, null, 0l)); activateUpdateSite(row); } private void add(final UpdateSite site) { final int row = sites.size(); sites.add(site); tableModel.rowsChanged(); tableModel.rowChanged(row); table.setRowSelectionInterval(row, row); } private String makeUniqueSiteName(final String prefix) { final Set<String> names = new HashSet<String>(); for (final UpdateSite site : sites) names.add(site.getName()); if (!names.contains(prefix)) return prefix; for (int i = 2; ; i++) { if (!names.contains(prefix + "-" + i)) return prefix + "-" + i; } } protected void delete(final int row) { final String name = getUpdateSiteName(row); if (!showYesNoQuestion("Remove " + name + "?", "Do you really want to remove the site '" + name + "' from the list?\n" + "URL: " + getUpdateSite(row).getURL())) return; deactivateUpdateSite(name); sites.remove(row); tableModel.rowChanged(row); } private void deactivateUpdateSite(final String name) { final List<FileObject> list = new ArrayList<FileObject>(); final List<FileObject> remove = new ArrayList<FileObject>(); int count = 0; for (final FileObject file : files.forUpdateSite(name)) switch (file.getStatus()) { case NEW: case NOT_INSTALLED: case OBSOLETE_UNINSTALLED: count--; remove.add(file); break; default: count++; list.add(file); } if (count > 0) info("" + count + (count == 1 ? " file is" : " files are") + " installed from the site '" + name + "'\n" + "These files will not be deleted automatically.\n" + "Note: even if marked as 'Local-only', they might be available from other sites."); for (final FileObject file : list) { file.updateSite = null; // TODO: unshadow file.setStatus(FileObject.Status.LOCAL_ONLY); } for (final FileObject file : remove) { files.remove(file); } files.removeUpdateSite(name); updaterFrame.updateFilesTable(); } @Override public void actionPerformed(final ActionEvent e) { final Object source = e.getSource(); if (source == addNewSite) addNew(); else if (source == addPersonalSite) addPersonalSite(); else if (source == remove) delete(table.getSelectedRow()); else if (source == close) { dispose(); } } protected class DataModel extends DefaultTableModel { protected int tableWidth; protected int[] widths = { 20, 150, 280, 125, 125 }; protected String[] headers = { "Active", "Name", "URL", "Host", "Directory on Host" }; public void setColumnWidths() { final TableColumnModel columnModel = table.getColumnModel(); for (int i = 0; i < tableModel.widths.length && i < getColumnCount(); i++) { final TableColumn column = columnModel.getColumn(i); column.setPreferredWidth(tableModel.widths[i]); column.setMinWidth(tableModel.widths[i]); tableWidth += tableModel.widths[i]; } } @Override public int getColumnCount() { return 5; } @Override public String getColumnName(final int column) { return headers[column]; } @Override public Class<?> getColumnClass(final int column) { return column == 0 ? Boolean.class : String.class; } @Override public int getRowCount() { return sites.size(); } @Override public Object getValueAt(final int row, final int col) { if (col == 1) return getUpdateSiteName(row); final UpdateSite site = getUpdateSite(row); if (col == 0) return Boolean.valueOf(site.isActive()); if (col == 2) return site.getURL(); if (col == 3) return site.getHost(); if (col == 4) return site.getUploadDirectory(); return null; } public void rowChanged(final int row) { rowsChanged(row, row + 1); } public void rowsChanged() { rowsChanged(0, sites.size()); } public void rowsChanged(final int firstRow, final int lastRow) { // fireTableChanged(new TableModelEvent(this, firstRow, lastRow)); fireTableChanged(new TableModelEvent(this)); } } protected boolean validURL(String url) { if (!url.endsWith("/")) url += "/"; try { return files.util.getLastModified(new URL(url + Util.XML_COMPRESSED)) != -1; } catch (MalformedURLException e) { updaterFrame.log.error(e); return false; } } protected boolean activateUpdateSite(final int row) { final UpdateSite updateSite = getUpdateSite(row); updateSite.setActive(true); try { if (files.getUpdateSite(updateSite.getName()) == null) files.addUpdateSite(updateSite); files.reReadUpdateSite(updateSite.getName(), updaterFrame.getProgress(null)); markForUpdate(updateSite.getName(), false); updaterFrame.filesChanged(); } catch (final Exception e) { error("Not a valid URL: " + getUpdateSite(row).getURL()); return false; } return true; } private void markForUpdate(final String updateSite, final boolean evenForcedUpdates) { for (final FileObject file : files.forUpdateSite(updateSite)) { if (file.isUpdateable(evenForcedUpdates) && file.isUpdateablePlatform(files)) { file.setFirstValidAction(files, Action.UPDATE, Action.UNINSTALL, Action.INSTALL); } } } protected boolean initializeUpdateSite(final String siteName, String url, final String host, String uploadDirectory) { if (!url.endsWith("/")) url += "/"; if (!uploadDirectory.endsWith("/")) uploadDirectory += "/"; boolean result; try { result = updaterFrame.initializeUpdateSite(url, host, uploadDirectory) && validURL(url); } catch (final InstantiationException e) { updaterFrame.log.error(e); result = false; } if (result) info("Initialized update site '" + siteName + "'"); else error("Could not initialize update site '" + siteName + "'"); return result; } @Override public void dispose() { super.dispose(); updaterFrame.updateFilesTable(); updaterFrame.enableUploadOrNot(); updaterFrame.addCustomViewOptions(); } public void info(final String message) { SwingTools.showMessageBox(this, message, JOptionPane.INFORMATION_MESSAGE); } public void error(final String message) { SwingTools.showMessageBox(this, message, JOptionPane.ERROR_MESSAGE); } public boolean showYesNoQuestion(final String title, final String message) { return SwingTools.showYesNoQuestion(this, title, message); } public static void escapeCancels(final JDialog dialog) { dialog.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put( KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE"); dialog.getRootPane().getActionMap().put("ESCAPE", new AbstractAction() { @Override public void actionPerformed(final ActionEvent e) { dialog.dispose(); } }); } private static String stripWikiMarkup(final String string) { return string.replaceAll("'''", "").replaceAll("\\[\\[([^\\|\\]]*\\|)?([^\\]]*)\\]\\]", "$2").replaceAll("\\[[^\\[][^ ]*([^\\]]*)\\]", "$1"); } private static final String FIJI_WIKI_URL = "http://fiji.sc/"; private static final String SITE_LIST_PAGE_TITLE = "List of update sites"; private static Map<String, UpdateSite> getAvailableSites() throws IOException { final MediaWikiClient wiki = new MediaWikiClient(FIJI_WIKI_URL); final String text = wiki.getPageSource(SITE_LIST_PAGE_TITLE); final int start = text.indexOf("\n{| class=\"wikitable\"\n"); final int end = text.indexOf("\n|}\n", start); if (start < 0 || end < 0) { throw new Error("Could not find table"); } final String[] table = text.substring(start + 1, end).split("\n\\|-"); final Map<String, UpdateSite> result = new LinkedHashMap<String, UpdateSite>(); for (final String row : table) { if (row.matches("(?s)(\\{\\||[\\|!](style=\"vertical-align|colspan=\"4\")).*")) continue; final String[] columns = row.split("\n[\\|!]"); if (columns.length == 5 && !columns[1].endsWith("|'''Name'''")) { final UpdateSite info = new UpdateSite(stripWikiMarkup(columns[1]), stripWikiMarkup(columns[2]), null, null, stripWikiMarkup(columns[3]), stripWikiMarkup(columns[4]), 0l); result.put(info.getURL(), info); } } // Sanity checks final Iterator<UpdateSite> iter = result.values().iterator(); if (!iter.hasNext()) throw new Error("Invalid page: " + SITE_LIST_PAGE_TITLE); UpdateSite site = iter.next(); if (!site.getName().equals("ImageJ") || !site.getURL().equals("http://update.imagej.net/")) { throw new Error("Invalid page: " + SITE_LIST_PAGE_TITLE); } if (!iter.hasNext()) throw new Error("Invalid page: " + SITE_LIST_PAGE_TITLE); site = iter.next(); if (!site.getName().equals("Fiji") || !site.getURL().equals("http://fiji.sc/update/")) { throw new Error("Invalid page: " + SITE_LIST_PAGE_TITLE); } return result; } private class PersonalSiteDialog extends JDialog implements ActionListener { private String name; private JLabel userLabel, realNameLabel, emailLabel, passwordLabel; private JTextField userField, realNameField, emailField; private JPasswordField passwordField; private JButton cancel, okay; public PersonalSiteDialog() { super(SitesDialog.this, "Add Personal Site"); setLayout(new MigLayout("wrap 2")); add(new JLabel("<html><h2>Personal update site setup</h2>" + "<p width=400>For security reasons, personal update sites are associated with a Fiji Wiki account. " + "Please provide the account name of your Fiji Wiki account.</p>" + "<p width=400>If your personal udate site was not yet initialized, you can initialize it in this dialog.</p>" + "<p width=400>If you do not have a Fiji Wiki account</p></html>"), "span 2"); userLabel = new JLabel("Fiji Wiki account"); add(userLabel); userField = new JTextField(); userField.setColumns(30); add(userField); realNameLabel = new JLabel("Real Name"); add(realNameLabel); realNameField = new JTextField(); realNameField.setColumns(30); add(realNameField); emailLabel = new JLabel("Email"); add(emailLabel); emailField = new JTextField(); emailField.setColumns(30); add(emailField); passwordLabel = new JLabel("Password"); add(passwordLabel); passwordField = new JPasswordField(); passwordField.setColumns(30); add(passwordField); final JPanel panel = new JPanel(); cancel = new JButton("Cancel"); cancel.addActionListener(this); panel.add(cancel); okay = new JButton("OK"); okay.addActionListener(this); panel.add(okay); add(panel, "span 2, right"); setWikiAccountFieldsEnabled(false); setChangePasswordEnabled(false); pack(); final KeyAdapter keyListener = new KeyAdapter() { @Override public void keyReleased(final KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) dispose(); else if (e.getKeyCode() == KeyEvent.VK_ENTER) actionPerformed(new ActionEvent(okay, -1, null)); } }; userField.addKeyListener(keyListener); realNameField.addKeyListener(keyListener); emailField.addKeyListener(keyListener); passwordField.addKeyListener(keyListener); cancel.addKeyListener(keyListener); okay.addKeyListener(keyListener); setModal(true); setVisible(true); } private void setWikiAccountFieldsEnabled(final boolean enabled) { realNameLabel.setEnabled(enabled); realNameField.setEnabled(enabled); emailLabel.setEnabled(enabled); emailField.setEnabled(enabled); if (enabled) realNameField.requestFocusInWindow(); } private void setChangePasswordEnabled(final boolean enabled) { passwordLabel.setEnabled(enabled); passwordField.setEnabled(enabled); if (enabled) passwordField.requestFocusInWindow(); } @Override public void actionPerformed(ActionEvent e) { if (e.getSource() == cancel) { dispose(); return; } else if (e.getSource() == okay) { final String name = userField.getText(); if ("".equals(name)) { error("Please provide a Fiji Wiki account name!"); return; } if (validURL(PERSONAL_SITES_URL + name)) { this.name = name; dispose(); return; } // create a Fiji Wiki user if needed final MediaWikiClient wiki = new MediaWikiClient(FIJI_WIKI_URL); try { if (!wiki.userExists(name)) { if (realNameLabel.isEnabled()) { final String realName = realNameField.getText(); final String email = emailField.getText(); if ("".equals(realName) || "".equals(email)) { error("<html><p width=400>Please provide your name and email address to register an account on the Fiji Wiki!</p></html>"); } else { if (wiki.createUser(name, realName, email, "Wants a personal site")) { setWikiAccountFieldsEnabled(false); setChangePasswordEnabled(true); info("<html><p width=400>An email with the activation code was sent. " + "Please provide your Fiji Wiki password after activating the account.</p></html>"); } else { error("<html><p width=400>There was a problem creating the user account!</p></html>"); } } } else { setWikiAccountFieldsEnabled(true); error("<html><p width=400>Please provide your name and email address to register an account on the Fiji Wiki</p></html>"); } return; } // initialize the personal update site final String password = new String(passwordField.getPassword()); if (!wiki.login(name, password)) { error("Could not log in (incorrect password?)"); return; } if (!wiki.changeUploadPassword(password)) { error("Could not initialize the personal update site"); return; } wiki.logout(); this.name = name; dispose(); } catch (IOException e2) { updaterFrame.log.error(e2); error("<html><p width=400>There was a problem contacting the Fiji Wiki: " + e2 + "</p></html>"); return; } } } } }
ui/swing/updater/src/main/java/imagej/updater/gui/SitesDialog.java
/* * #%L * ImageJ software for multidimensional image processing and analysis. * %% * Copyright (C) 2009 - 2013 Board of Regents of the University of * Wisconsin-Madison, Broad Institute of MIT and Harvard, and Max Planck * Institute of Molecular Cell Biology and Genetics. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of any organization. * #L% */ package imagej.updater.gui; import imagej.updater.core.FileObject; import imagej.updater.core.FileObject.Action; import imagej.updater.core.FilesCollection; import imagej.updater.core.UpdateSite; import imagej.updater.core.UploaderService; import imagej.updater.util.Util; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; import javax.swing.AbstractAction; import javax.swing.BoxLayout; import javax.swing.DefaultCellEditor; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JTextField; import javax.swing.KeyStroke; import javax.swing.ListSelectionModel; import javax.swing.event.ListSelectionEvent; import javax.swing.event.TableModelEvent; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumn; import javax.swing.table.TableColumnModel; import net.miginfocom.swing.MigLayout; /** * The dialog in which the user can choose which update sites to follow. * * @author Johannes Schindelin */ @SuppressWarnings("serial") public class SitesDialog extends JDialog implements ActionListener { protected UpdaterFrame updaterFrame; protected FilesCollection files; protected List<UpdateSite> sites; protected DataModel tableModel; protected JTable table; protected JButton addNewSite, addPersonalSite, remove, close; public SitesDialog(final UpdaterFrame owner, final FilesCollection files) { super(owner, "Manage update sites"); updaterFrame = owner; this.files = files; sites = initializeSites(files); final Container contentPane = getContentPane(); contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS)); tableModel = new DataModel(); table = new JTable(tableModel) { @Override public void valueChanged(final ListSelectionEvent e) { super.valueChanged(e); remove.setEnabled(getSelectedRow() > 0); } @Override public boolean isCellEditable(final int row, final int column) { return column >= 0 && column < getColumnCount() && row >= 0 && row < getRowCount(); } @Override public TableCellEditor getCellEditor(final int row, final int column) { if (column == 0) return super.getCellEditor(row, column); final JTextField field = new JTextField(); return new DefaultCellEditor(field) { @Override public boolean stopCellEditing() { String value = field.getText(); if ((column == 2 || column == 4) && !value.equals("") && !value.endsWith("/")) { value += "/"; } if (column == 1) { if (value.equals(getUpdateSiteName(row))) return super.stopCellEditing(); if (files.getUpdateSite(value) != null) { error("Update site '" + value + "' exists already!"); return false; } } else if (column == 2) { if ("/".equals(value)) value = ""; final UpdateSite site = getUpdateSite(row); if (value.equals(site.getURL())) return super.stopCellEditing(); if (validURL(value)) { activateUpdateSite(row); } else { if (site == null || site.getHost() == null || site.getHost().equals("")) { error("URL does not refer to an update site: " + value + "\n" + "If you want to initialize that site, you need to provide upload information first."); return false; } else { if (!showYesNoQuestion("Initialize upload site?", "It appears that the URL\n" + "\t" + value + "\n" + "is not (yet) valid. " + "Do you want to initialize it (host: " + site.getHost() + "; directory: " + site.getUploadDirectory() + ")?")) return false; if (!initializeUpdateSite((String)getValueAt(row, 0), value, site.getHost(), site.getUploadDirectory())) return false; } } } else if (column == 3) { final UpdateSite site = getUpdateSite(row); if (value.equals(site.getHost())) return super.stopCellEditing(); final int colon = value.indexOf(':'); if (colon > 0) { final String protocol = value.substring(0, colon); final UploaderService uploaderService = updaterFrame.getUploaderService(); if (null == uploaderService.installUploader(protocol, files, updaterFrame.getProgress(null))) { error("Unknown upload protocol: " + protocol); return false; } } } else if (column == 4) { final UpdateSite site = getUpdateSite(row); if (value.equals(site.getUploadDirectory())) return super.stopCellEditing(); } updaterFrame.enableUploadOrNot(); return super.stopCellEditing(); } }; } @Override public void setValueAt(final Object value, final int row, final int column) { final UpdateSite site = getUpdateSite(row); if (column == 0) { site.setActive(Boolean.TRUE.equals(value)); } else { final String string = (String)value; // if the name changed, or if we auto-fill the name from the URL switch (column) { case 1: final String name = site.getName(); if (name.equals(string)) return; files.renameUpdateSite(name, string); sites.get(row).setName(string); break; case 2: if (site.getURL().equals(string)) return; site.setURL(string); break; case 3: if (string.equals(site.getHost())) return; site.setHost(string); break; case 4: if (string.equals(site.getUploadDirectory())) return; site.setUploadDirectory(string); break; default: updaterFrame.log.error("Whoa! Column " + column + " is not handled!"); } } if (site.isActive()) { if (column == 0 || column == 2) { activateUpdateSite(row); } } else { deactivateUpdateSite(site.getName()); } } @Override public Component prepareRenderer(TableCellRenderer renderer,int row, int column) { Component component = super.prepareRenderer(renderer, row, column); if (component instanceof JComponent) { final UpdateSite site = getUpdateSite(row); if (site != null) { JComponent jcomponent = (JComponent) component; jcomponent.setToolTipText(wrapToolTip(site.getDescription(), site.getMaintainer())); } } return component; } }; table.setColumnSelectionAllowed(false); table.setRowSelectionAllowed(true); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); tableModel.setColumnWidths(); final JScrollPane scrollpane = new JScrollPane(table); scrollpane.setPreferredSize(new Dimension(tableModel.tableWidth, 400)); contentPane.add(scrollpane); final JPanel buttons = new JPanel(); addPersonalSite = SwingTools.button("Add my site", "Add my personal update site", this, buttons); addNewSite = SwingTools.button("Add", "Add", this, buttons); remove = SwingTools.button("Remove", "Remove", this, buttons); remove.setEnabled(false); close = SwingTools.button("Close", "Close", this, buttons); contentPane.add(buttons); getRootPane().setDefaultButton(close); escapeCancels(this); pack(); addNewSite.requestFocusInWindow(); setLocationRelativeTo(owner); } private static String wrapToolTip(final String description, final String maintainer) { if (description == null) return null; return "<html><p width='400'>" + description.replaceAll("\n", "<br />") + (maintainer != null ? "</p><p>Maintainer: " + maintainer + "</p>": "") + "</p></html>"; } private static List<UpdateSite> initializeSites(final FilesCollection files) { final List<UpdateSite> sites = new ArrayList<UpdateSite>(); final Map<String, Integer> url2index = new HashMap<String, Integer>(); // make sure that the main update site is the first one. final UpdateSite mainSite = new UpdateSite(FilesCollection.DEFAULT_UPDATE_SITE, Util.MAIN_URL, "", "", null, null, 0l); sites.add(mainSite); url2index.put(mainSite.getURL(), 0); // read available sites from the Fiji Wiki try { for (final UpdateSite site : getAvailableSites().values()) { Integer index = url2index.get(site.getURL()); if (index == null) { url2index.put(site.getURL(), sites.size()); sites.add(site); } else { sites.set(index.intValue(), site); } } } catch (Exception e) { e.printStackTrace(); } // add active / upload information final Set<String> names = new HashSet<String>(); for (final String name : files.getUpdateSiteNames()) { final UpdateSite site = files.getUpdateSite(name); Integer index = url2index.get(site.getURL()); if (index == null) { url2index.put(site.getURL(), sites.size()); sites.add(site); } else { final UpdateSite listed = sites.get(index.intValue()); listed.setActive(true); listed.setName(site.getName()); listed.setHost(site.getHost()); listed.setUploadDirectory(site.getUploadDirectory()); } } // make sure names are unique for (final UpdateSite site : sites) { if (site.isActive()) continue; if (names.contains(site.getName())) { int i = 2; while (names.contains(site.getName() + "-" + i)) i++; site.setName(site.getName() + ("-" + i)); } names.add(site.getName()); } return sites; } protected String getUpdateSiteName(int row) { return sites.get(row).getName(); } protected UpdateSite getUpdateSite(int row) { return sites.get(row); } private void addNew() { add(new UpdateSite(makeUniqueSiteName("New"), "", "", "", null, null, 0l)); } private final static String PERSONAL_SITES_URL = "http://sites.imagej.net/"; private void addPersonalSite() { final PersonalSiteDialog dialog = new PersonalSiteDialog(); final String user = dialog.name; if (user == null) return; final String url = PERSONAL_SITES_URL + user; final int row = sites.size(); add(new UpdateSite(makeUniqueSiteName("My Site"), url, "webdav:" + user, "", null, null, 0l)); activateUpdateSite(row); } private void add(final UpdateSite site) { final int row = sites.size(); sites.add(site); tableModel.rowsChanged(); tableModel.rowChanged(row); table.setRowSelectionInterval(row, row); } private String makeUniqueSiteName(final String prefix) { final Set<String> names = new HashSet<String>(); for (final UpdateSite site : sites) names.add(site.getName()); if (!names.contains(prefix)) return prefix; for (int i = 2; ; i++) { if (!names.contains(prefix + "-" + i)) return prefix + "-" + i; } } protected void delete(final int row) { final String name = getUpdateSiteName(row); if (!showYesNoQuestion("Remove " + name + "?", "Do you really want to remove the site '" + name + "' from the list?\n" + "URL: " + getUpdateSite(row).getURL())) return; deactivateUpdateSite(name); sites.remove(row); tableModel.rowChanged(row); } private void deactivateUpdateSite(final String name) { final List<FileObject> list = new ArrayList<FileObject>(); final List<FileObject> remove = new ArrayList<FileObject>(); int count = 0; for (final FileObject file : files.forUpdateSite(name)) switch (file.getStatus()) { case NEW: case NOT_INSTALLED: case OBSOLETE_UNINSTALLED: count--; remove.add(file); break; default: count++; list.add(file); } if (count > 0) info("" + count + (count == 1 ? " file is" : " files are") + " installed from the site '" + name + "'\n" + "These files will not be deleted automatically.\n" + "Note: even if marked as 'Local-only', they might be available from other sites."); for (final FileObject file : list) { file.updateSite = null; // TODO: unshadow file.setStatus(FileObject.Status.LOCAL_ONLY); } for (final FileObject file : remove) { files.remove(file); } files.removeUpdateSite(name); updaterFrame.updateFilesTable(); } @Override public void actionPerformed(final ActionEvent e) { final Object source = e.getSource(); if (source == addNewSite) addNew(); else if (source == addPersonalSite) addPersonalSite(); else if (source == remove) delete(table.getSelectedRow()); else if (source == close) { dispose(); } } protected class DataModel extends DefaultTableModel { protected int tableWidth; protected int[] widths = { 20, 150, 280, 125, 125 }; protected String[] headers = { "Active", "Name", "URL", "Host", "Directory on Host" }; public void setColumnWidths() { final TableColumnModel columnModel = table.getColumnModel(); for (int i = 0; i < tableModel.widths.length && i < getColumnCount(); i++) { final TableColumn column = columnModel.getColumn(i); column.setPreferredWidth(tableModel.widths[i]); column.setMinWidth(tableModel.widths[i]); tableWidth += tableModel.widths[i]; } } @Override public int getColumnCount() { return 5; } @Override public String getColumnName(final int column) { return headers[column]; } @Override public Class<?> getColumnClass(final int column) { return column == 0 ? Boolean.class : String.class; } @Override public int getRowCount() { return sites.size(); } @Override public Object getValueAt(final int row, final int col) { if (col == 1) return getUpdateSiteName(row); final UpdateSite site = getUpdateSite(row); if (col == 0) return Boolean.valueOf(site.isActive()); if (col == 2) return site.getURL(); if (col == 3) return site.getHost(); if (col == 4) return site.getUploadDirectory(); return null; } public void rowChanged(final int row) { rowsChanged(row, row + 1); } public void rowsChanged() { rowsChanged(0, sites.size()); } public void rowsChanged(final int firstRow, final int lastRow) { // fireTableChanged(new TableModelEvent(this, firstRow, lastRow)); fireTableChanged(new TableModelEvent(this)); } } protected boolean validURL(String url) { if (!url.endsWith("/")) url += "/"; try { return files.util.getLastModified(new URL(url + Util.XML_COMPRESSED)) != -1; } catch (MalformedURLException e) { updaterFrame.log.error(e); return false; } } protected boolean activateUpdateSite(final int row) { final UpdateSite updateSite = getUpdateSite(row); updateSite.setActive(true); try { if (files.getUpdateSite(updateSite.getName()) == null) files.addUpdateSite(updateSite); files.reReadUpdateSite(updateSite.getName(), updaterFrame.getProgress(null)); markForUpdate(updateSite.getName(), false); updaterFrame.filesChanged(); } catch (final Exception e) { error("Not a valid URL: " + getUpdateSite(row).getURL()); return false; } return true; } private void markForUpdate(final String updateSite, final boolean evenForcedUpdates) { for (final FileObject file : files.forUpdateSite(updateSite)) { if (file.isUpdateable(evenForcedUpdates) && file.isUpdateablePlatform(files)) { file.setFirstValidAction(files, Action.UPDATE, Action.UNINSTALL, Action.INSTALL); } } } protected boolean initializeUpdateSite(final String siteName, String url, final String host, String uploadDirectory) { if (!url.endsWith("/")) url += "/"; if (!uploadDirectory.endsWith("/")) uploadDirectory += "/"; boolean result; try { result = updaterFrame.initializeUpdateSite(url, host, uploadDirectory) && validURL(url); } catch (final InstantiationException e) { updaterFrame.log.error(e); result = false; } if (result) info("Initialized update site '" + siteName + "'"); else error("Could not initialize update site '" + siteName + "'"); return result; } @Override public void dispose() { super.dispose(); updaterFrame.updateFilesTable(); updaterFrame.enableUploadOrNot(); updaterFrame.addCustomViewOptions(); } public void info(final String message) { SwingTools.showMessageBox(this, message, JOptionPane.INFORMATION_MESSAGE); } public void error(final String message) { SwingTools.showMessageBox(this, message, JOptionPane.ERROR_MESSAGE); } public boolean showYesNoQuestion(final String title, final String message) { return SwingTools.showYesNoQuestion(this, title, message); } public static void escapeCancels(final JDialog dialog) { dialog.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put( KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE"); dialog.getRootPane().getActionMap().put("ESCAPE", new AbstractAction() { @Override public void actionPerformed(final ActionEvent e) { dialog.dispose(); } }); } private static String stripWikiMarkup(final String string) { return string.replaceAll("'''", "").replaceAll("\\[\\[([^\\|\\]]*\\|)?([^\\]]*)\\]\\]", "$2").replaceAll("\\[[^\\[][^ ]*([^\\]]*)\\]", "$1"); } private static final String FIJI_WIKI_URL = "http://fiji.sc/"; private static final String SITE_LIST_PAGE_TITLE = "List of update sites"; private static Map<String, UpdateSite> getAvailableSites() throws IOException { final MediaWikiClient wiki = new MediaWikiClient(FIJI_WIKI_URL); final String text = wiki.getPageSource(SITE_LIST_PAGE_TITLE); final int start = text.indexOf("\n{| class=\"wikitable\"\n"); final int end = text.indexOf("\n|}\n", start); if (start < 0 || end < 0) { throw new Error("Could not find table"); } final String[] table = text.substring(start + 1, end).split("\n\\|-"); final Map<String, UpdateSite> result = new LinkedHashMap<String, UpdateSite>(); for (final String row : table) { if (row.matches("(?s)(\\{\\||[\\|!](style=\"vertical-align|colspan=\"4\")).*")) continue; final String[] columns = row.split("\n[\\|!]"); if (columns.length == 5 && !columns[1].endsWith("|'''Name'''")) { final UpdateSite info = new UpdateSite(stripWikiMarkup(columns[1]), stripWikiMarkup(columns[2]), null, null, stripWikiMarkup(columns[3]), stripWikiMarkup(columns[4]), 0l); result.put(info.getURL(), info); } } // Sanity checks final Iterator<UpdateSite> iter = result.values().iterator(); if (!iter.hasNext()) throw new Error("Invalid page: " + SITE_LIST_PAGE_TITLE); UpdateSite site = iter.next(); if (!site.getName().equals("ImageJ") || !site.getURL().equals("http://update.imagej.net/")) { throw new Error("Invalid page: " + SITE_LIST_PAGE_TITLE); } if (!iter.hasNext()) throw new Error("Invalid page: " + SITE_LIST_PAGE_TITLE); site = iter.next(); if (!site.getName().equals("Fiji") || !site.getURL().equals("http://fiji.sc/update/")) { throw new Error("Invalid page: " + SITE_LIST_PAGE_TITLE); } return result; } private class PersonalSiteDialog extends JDialog implements ActionListener { private String name; private JLabel userLabel, realNameLabel, emailLabel, passwordLabel; private JTextField userField, realNameField, emailField; private JPasswordField passwordField; private JButton cancel, okay; public PersonalSiteDialog() { super(SitesDialog.this, "Add Personal Site"); setLayout(new MigLayout("wrap 2")); add(new JLabel("<html><h2>Personal update site setup</h2>" + "<p width=400>For security reasons, personal update sites are associated with a Fiji Wiki account. " + "Please provide the account name of your Fiji Wiki account.</p>" + "<p width=400>If your personal udate site was not yet initialized, you can initialize it in this dialog.</p>" + "<p width=400>If you do not have a Fiji Wiki account</p></html>"), "span 2"); userLabel = new JLabel("Fiji Wiki account"); add(userLabel); userField = new JTextField(); userField.setColumns(30); add(userField); realNameLabel = new JLabel("Real Name"); add(realNameLabel); realNameField = new JTextField(); realNameField.setColumns(30); add(realNameField); emailLabel = new JLabel("Email"); add(emailLabel); emailField = new JTextField(); emailField.setColumns(30); add(emailField); passwordLabel = new JLabel("Password"); add(passwordLabel); passwordField = new JPasswordField(); passwordField.setColumns(30); add(passwordField); final JPanel panel = new JPanel(); cancel = new JButton("Cancel"); cancel.addActionListener(this); panel.add(cancel); okay = new JButton("OK"); okay.addActionListener(this); panel.add(okay); add(panel, "span 2, right"); setWikiAccountFieldsEnabled(false); setChangePasswordEnabled(false); pack(); final KeyAdapter keyListener = new KeyAdapter() { @Override public void keyReleased(final KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) dispose(); else if (e.getKeyCode() == KeyEvent.VK_ENTER) actionPerformed(new ActionEvent(okay, -1, null)); } }; userField.addKeyListener(keyListener); realNameField.addKeyListener(keyListener); emailField.addKeyListener(keyListener); passwordField.addKeyListener(keyListener); cancel.addKeyListener(keyListener); okay.addKeyListener(keyListener); setModal(true); setVisible(true); } private void setWikiAccountFieldsEnabled(final boolean enabled) { realNameLabel.setEnabled(enabled); realNameField.setEnabled(enabled); emailLabel.setEnabled(enabled); emailField.setEnabled(enabled); if (enabled) realNameField.requestFocusInWindow(); } private void setChangePasswordEnabled(final boolean enabled) { passwordLabel.setEnabled(enabled); passwordField.setEnabled(enabled); if (enabled) passwordField.requestFocusInWindow(); } @Override public void actionPerformed(ActionEvent e) { if (e.getSource() == cancel) { dispose(); return; } else if (e.getSource() == okay) { final String name = userField.getText(); if ("".equals(name)) { error("Please provide a Fiji Wiki account name!"); return; } if (validURL(PERSONAL_SITES_URL + name)) { this.name = name; dispose(); return; } // create a Fiji Wiki user if needed final MediaWikiClient wiki = new MediaWikiClient(FIJI_WIKI_URL); try { if (!wiki.userExists(name)) { if (realNameLabel.isEnabled()) { final String realName = realNameField.getText(); final String email = emailField.getText(); if ("".equals(realName) || "".equals(email)) { error("<html><p width=400>Please provide your name and email address to register an account on the Fiji Wiki!</p></html>"); } else { if (wiki.createUser(name, realName, email, "Wants a personal site")) { setWikiAccountFieldsEnabled(false); setChangePasswordEnabled(true); info("<html><p width=400>An email with the activation code was sent. " + "Please provide your Fiji Wiki password after activating the account.</p></html>"); } else { error("<html><p width=400>There was a problem creating the user account!</p></html>"); } } } else { setWikiAccountFieldsEnabled(true); error("<html><p width=400>Please provide your name and email address to register an account on the Fiji Wiki</p></html>"); } return; } // initialize the personal update site final String password = new String(passwordField.getPassword()); if (!wiki.login(name, password)) { error("Could not log in (incorrect password?)"); return; } if (!wiki.changeUploadPassword(password)) { error("Could not initialize the personal update site"); return; } wiki.logout(); this.name = name; dispose(); } catch (IOException e2) { updaterFrame.log.error(e2); error("<html><p width=400>There was a problem contacting the Fiji Wiki: " + e2 + "</p></html>"); return; } } } } }
Updater (Swing) Sites Dialog: change the real upload information When an update site listed in http://fiji.sc/List_of_update_sites was active, by mistake, we used a copy of the locally-listed update site in the dialog. As a consequence, only that copy's upload information was updated, not the information that would get persisted in db.xml.gz (and hence the upload information entered by the user would be simply ignored). Fix this by using the local copy, filling in the information from the Fiji page, instead of the other way round. Reported by Ignacio Arganda-Carreras. Signed-off-by: Johannes Schindelin <[email protected]>
ui/swing/updater/src/main/java/imagej/updater/gui/SitesDialog.java
Updater (Swing) Sites Dialog: change the real upload information
<ide><path>i/swing/updater/src/main/java/imagej/updater/gui/SitesDialog.java <ide> sites.add(site); <ide> } else { <ide> final UpdateSite listed = sites.get(index.intValue()); <del> listed.setActive(true); <del> listed.setName(site.getName()); <del> listed.setHost(site.getHost()); <del> listed.setUploadDirectory(site.getUploadDirectory()); <add> site.setDescription(listed.getDescription()); <add> site.setMaintainer(listed.getMaintainer()); <add> sites.set(index.intValue(), site); <ide> } <ide> } <ide>
JavaScript
agpl-3.0
81443adc70736597c17f1f8ed7dfeeb377c9c9f9
0
pombredanne/paperpile,pombredanne/paperpile,jondo/paperpile,pombredanne/paperpile,jondo/paperpile,pombredanne/paperpile,pombredanne/paperpile,jondo/paperpile,jondo/paperpile,jondo/paperpile
/* Copyright 2009, 2010 Paperpile This file is part of Paperpile Paperpile is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Paperpile is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Paperpile. If not, see http://www.gnu.org/licenses. */ Paperpile.PluginGridDB = function(config) { Ext.apply(this, config); Paperpile.PluginGridDB.superclass.constructor.call(this, {}); }; Ext.extend(Paperpile.PluginGridDB, Paperpile.PluginGrid, { plugin_base_query: '', plugin_iconCls: 'pp-icon-folder', plugin_name: 'DB', plugins: [], initComponent: function() { Paperpile.PluginGridDB.superclass.initComponent.call(this); // Replace the 'handleHdOver' with an empty function to remove the // build-in header highlighting. var view = this.getView(); view.handleHdOver = Ext.emptyFn; this.limit = Paperpile.main.globalSettings['pager_limit'] || 25; this.actions['NEW'] = new Ext.Action({ text: 'Insert Manually', iconCls: 'pp-icon-add', handler: function() { this.handleEdit(true); }, scope: this, itemId: 'new_button', tooltip: 'Manually create a new reference for your library' }); this.actions['FILE_IMPORT'] = new Ext.Action({ text: "Open Bibliography File", iconCls: 'pp-icon-import-file', tooltip: 'Import references from EndNote, BibTeX <br/> and other bibliography files.', handler: function() { Paperpile.main.fileImport(); } }); this.actions['PDF_IMPORT'] = new Ext.Action({ text: "Import PDFs", iconCls: 'pp-icon-import-pdf', tooltip: 'Import references from one or more PDFs', handler: function() { Paperpile.main.pdfExtract(); } }); this.actions['ADD_MENU'] = { text: 'Add to Library', itemId: 'ADD_MENU', iconCls: 'pp-icon-add', menu: { items: [ this.actions['NEW'], this.actions['FILE_IMPORT'], this.actions['PDF_IMPORT']] } }; var store = this.getStore(); store.baseParams['plugin_search_pdf'] = 0; store.baseParams['limit'] = this.limit; this.getBottomToolbar().pageSize = parseInt(this.limit); store.load({ params: { start: 0, limit: this.limit } }); this.on({ afterrender: { scope: this, fn: function() { this.createSortHandles(); } } }); }, loadKeyboardShortcuts: function() { Paperpile.PluginGridDB.superclass.loadKeyboardShortcuts.call(this); }, createSortHandles: function() { var target = Ext.DomHelper.append(Ext.fly(this.getView().getHeaderCell(1)), '<div id="pp-grid-sort-container_' + this.id + '" class="pp-grid-sort-container"></div>', true); var created_class, journal_class, year_class, author_class; created_class = journal_class = year_class = author_class = 'pp-grid-sort-inactive'; var field = Paperpile.main.globalSettings['sort_field']; if (field === 'created DESC') created_class = 'pp-grid-sort-desc'; if (field === 'year DESC') year_class = 'pp-grid-sort-desc'; if (field === 'journal') journal_class = 'pp-grid-sort-asc'; if (field === 'author') author_class = 'pp-grid-sort-asc'; Ext.DomHelper.append(target, '<div class="pp-grid-sort-item ' + created_class + '" action="created" status="desc" default="desc">Date added</div>'); Ext.DomHelper.append(target, '<div class="pp-grid-sort-item ' + journal_class + '" action="journal" status="inactive" default="asc">Journal</div>'); Ext.DomHelper.append(target, '<div class="pp-grid-sort-item ' + year_class + '" action="year" status="inactive" default="desc">Year</div>'); Ext.DomHelper.append(target, '<div class="pp-grid-sort-item ' + author_class + '" action="author" status="inactive" default="asc">Author</div>'); Ext.DomHelper.append(target, '<div class="pp-grid-sort-item pp-grid-sort-inactive" action="pdf" status="inactive" default="desc">PDF</div>'); Ext.DomHelper.append(target, '<div class="pp-grid-sort-item pp-grid-sort-inactive" action="attachments" status="inactive" default="desc">Supp. material</div>'); Ext.DomHelper.append(target, '<div class="pp-grid-sort-item pp-grid-sort-inactive" action="notes" status="inactive" default="desc">Notes</div>'); this.mon(target, 'click', this.handleSortButtons, this); }, handleFocusSearch: function() { this.filterField.getEl().focus(); }, currentSortField: '', handleSortButtons: function(e, el, o) { var currentClass = el.getAttribute('class'); var field = el.getAttribute('action'); var status = el.getAttribute('status'); var def = el.getAttribute('default'); // We have not hit a sort field if (!status) return; if (field != this.currentSortField) { status = "inactive"; } this.currentSortField = field; var classes = { inactive: 'pp-grid-sort-item pp-grid-sort-inactive', asc: 'pp-grid-sort-item pp-grid-sort-asc', desc: 'pp-grid-sort-item pp-grid-sort-desc' }; if (! (status == 'inactive' || status == 'asc' || status == 'desc')) return; var El = Ext.get(el); Ext.each(El.parent().query('div'), function(item) { var l = Ext.get(item); l.removeClass('pp-grid-sort-item'); l.removeClass('pp-grid-sort-asc'); l.removeClass('pp-grid-sort-desc'); l.removeClass('pp-grid-sort-inactive'); if (item == el) return; l.addClass(classes.inactive); }); var store = this.getStore(); if (status == "inactive") { if (def == 'desc') { El.addClass(classes.desc); store.baseParams['plugin_order'] = field + " DESC"; el.setAttribute('status', 'desc'); } else { El.addClass(classes.asc); store.baseParams['plugin_order'] = field + " ASC"; el.setAttribute('status', 'asc'); } } else { if (status == "desc") { store.baseParams['plugin_order'] = field; El.addClass(classes.asc); el.setAttribute('status', 'asc'); } else { El.addClass(classes.desc); store.baseParams['plugin_order'] = field + " DESC"; el.setAttribute('status', 'desc'); } } if (this.filterField.getRawValue() == "") { this.getStore().reload({ params: { start: 0, task: "NEW" } }); } else { this.filterField.onTrigger2Click(); } }, toggleFilter: function(item, checked) { var filter_button = this.filterButton; // Toggle 'search_pdf' option this.getStore().baseParams['plugin_search_pdf'] = 1; // Specific fields if (item.itemId != 'all') { if (checked) { this.filterField.singleField = item.itemId; this.getStore().baseParams['plugin_search_pdf'] = 0; } else { if (this.filterField.singleField == item.itemId) { this.filterField.singleField = ""; } } } if (!filter_button.oldIcon) { filter_button.useSetClass = false; filter_button.oldIcon = filter_button.icon; } if (checked) { if (item.itemId == 'all') { delete filter_button.minWidth; filter_button.setText(null); filter_button.setIcon(filter_button.oldIcon); filter_button.el.addClass('x-btn-icon'); filter_button.el.removeClass('x-btn-noicon'); } else { delete filter_button.minWidth; filter_button.setIcon(null); filter_button.setText(item.text); filter_button.el.addClass('x-btn-noicon'); filter_button.el.removeClass('x-btn-icon'); } this.filterField.onTrigger2Click(); } }, setSearchQuery: function(text) { this.filterField.setValue(text); this.filterField.onTrigger2Click(); }, createContextMenu: function() { Paperpile.PluginGridDB.superclass.createContextMenu.call(this); }, createToolbarMenu: function() { this.filterMenu = new Ext.menu.Menu({ defaults: { checked: false, group: 'filter' + this.id, checkHandler: this.toggleFilter, scope: this }, items: [{ text: 'All fields', checked: true, itemId: 'all' }, '-', { text: 'Author', itemId: 'author' }, { text: 'Title', itemId: 'title' }, { text: 'Journal', itemId: 'journal' }, { text: 'Abstract', itemId: 'abstract' }, { text: 'Fulltext', itemId: 'text' }, { text: 'Notes', itemId: 'notes' }, { text: 'Year', itemId: 'year' }] }); this.actions['FILTER_BUTTON'] = new Ext.Button({ itemId: 'FILTER_BUTTON', icon: '/images/icons/magnifier.png', tooltip: 'Choose field(s) to search', menu: this.filterMenu }); this.filterButton = this.actions['FILTER_BUTTON']; this.actions['FILTER_FIELD'] = new Ext.app.FilterField({ itemId: 'FILTER_FIELD', emptyText: 'Search References', store: this.getStore(), base_query: this.plugin_base_query, width: 200 }); this.filterField = this.actions['FILTER_FIELD']; this.mon(this.filterField, 'specialkey', function(f, e) { if (e.getKey() == e.ENTER) { // Select the first grid row on Enter. this.getSelectionModel().selectRowAndSetCursor(0); } }, this); Paperpile.PluginGridDB.superclass.createToolbarMenu.call(this); }, refreshCollections: function() { Paperpile.PluginGridDB.superclass.refreshCollections.call(this); }, initToolbarMenuItemIds: function() { Paperpile.PluginGridDB.superclass.initToolbarMenuItemIds.call(this); var ids = this.toolbarMenuItemIds; ids.insert(0, 'FILTER_FIELD'); ids.insert(1, 'FILTER_BUTTON'); var index = ids.indexOf('TB_FILL'); ids.insert(index + 1, 'ADD_MENU'); index = ids.indexOf('SELECT_ALL'); ids.insert(index + 0, 'EDIT'); // ids.insert(index + 1, 'EDIT'); }, isContextItem: function(item) { if (item.ownerCt.itemId == 'context') { return true; } return false; }, isToolbarItem: function(item) { return true; }, updateButtons: function() { Paperpile.PluginGridDB.superclass.updateButtons.call(this); var tbar = this.getTopToolbar(); var selectionCount = this.getSelectionModel().getCount(); if (selectionCount > 1) { var item = tbar.getComponent('EDIT'); if (item) { item.disable(); } item = tbar.getComponent('VIEW_PDF'); if (item) { item.disable(); } } }, onUpdate: function(data) { Paperpile.PluginGridDB.superclass.onUpdate.call(this, data); // If the update has to do with collections and we are // a collection tab, refresh the whole view. if (this.collection_type) { if (data.collection_delta) { this.getStore().reload(); } } }, showEmptyMessageBeforeStoreLoaded: function() { return false; }, getEmptyBeforeSearchTemplate: function() { var markup = '<div class="pp-hint-box"><p>No results to show. <a href="#" class="pp-textlink" action="close-tab">Close tab</a>.</p></div>'; // If tab is not filtered and still empty, the whole DB must be empty and we show welcome message if (this.plugin_query == '' && this.plugin_base_query == '') { markup = [ '<div class="pp-hint-box">', '<h1>Welcome to Paperpile</h1>', '<p>Your library is still empty. </p>', '<p>To get started, </p>', '<ul>', '<li>import your <a href="#" class="pp-textlink" onClick="Paperpile.main.pdfExtract();">PDF collection</a></li>', '<li>get references from a <a href="#" class="pp-textlink" onClick="Paperpile.main.fileImport();">bibliography file</a></li>', '<li>search for papers using ', '<a href="#" class="pp-textlink" onClick=', '"Paperpile.main.tabs.newPluginTab(\'PubMed\', {plugin_name: \'PubMed\', plugin_query:\'\'});">PubMed</a> or ', '<a href="#" class="pp-textlink" onClick=', '"Paperpile.main.tabs.newPluginTab(\'GoogleScholar\', {plugin_name: \'GoogleScholar\', plugin_query:\'\'});">Google Scholar</a></li>', '</ul>', '</div>']; } return new Ext.XTemplate(markup).compile(); } }); Ext.reg('pp-plugin-grid-db', Paperpile.PluginGridDB); Paperpile.PluginPanelDB = function(config) { Ext.apply(this, config); Paperpile.PluginPanelDB.superclass.constructor.call(this, {}); }; Ext.extend(Paperpile.PluginPanelDB, Paperpile.PluginPanel, { createGrid: function(params) { return new Paperpile.PluginGridDB(params); }, createAboutPanel: function() { return undefined; } });
catalyst/root/js/import/plugins/DB.js
/* Copyright 2009, 2010 Paperpile This file is part of Paperpile Paperpile is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Paperpile is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Paperpile. If not, see http://www.gnu.org/licenses. */ Paperpile.PluginGridDB = function(config) { Ext.apply(this, config); Paperpile.PluginGridDB.superclass.constructor.call(this, {}); }; Ext.extend(Paperpile.PluginGridDB, Paperpile.PluginGrid, { plugin_base_query: '', plugin_iconCls: 'pp-icon-folder', plugin_name: 'DB', plugins: [], initComponent: function() { Paperpile.PluginGridDB.superclass.initComponent.call(this); // Replace the 'handleHdOver' with an empty function to remove the // build-in header highlighting. var view = this.getView(); view.handleHdOver = Ext.emptyFn; this.limit = Paperpile.main.globalSettings['pager_limit'] || 25; this.actions['NEW'] = new Ext.Action({ text: 'New', iconCls: 'pp-icon-add', handler: function() { this.handleEdit(true); }, scope: this, itemId: 'new_button', tooltip: 'Manually create a new reference for your library' }); var store = this.getStore(); store.baseParams['plugin_search_pdf'] = 0; store.baseParams['limit'] = this.limit; this.getBottomToolbar().pageSize = parseInt(this.limit); store.load({ params: { start: 0, limit: this.limit } }); this.on({ afterrender: { scope: this, fn: function() { this.createSortHandles(); } } }); }, loadKeyboardShortcuts: function() { Paperpile.PluginGridDB.superclass.loadKeyboardShortcuts.call(this); }, createSortHandles: function() { var target = Ext.DomHelper.append(Ext.fly(this.getView().getHeaderCell(1)), '<div id="pp-grid-sort-container_' + this.id + '" class="pp-grid-sort-container"></div>', true); var created_class, journal_class, year_class, author_class; created_class = journal_class = year_class = author_class = 'pp-grid-sort-inactive'; var field = Paperpile.main.globalSettings['sort_field']; if (field === 'created DESC') created_class = 'pp-grid-sort-desc'; if (field === 'year DESC') year_class = 'pp-grid-sort-desc'; if (field === 'journal') journal_class = 'pp-grid-sort-asc'; if (field === 'author') author_class = 'pp-grid-sort-asc'; Ext.DomHelper.append(target, '<div class="pp-grid-sort-item ' + created_class + '" action="created" status="desc" default="desc">Date added</div>'); Ext.DomHelper.append(target, '<div class="pp-grid-sort-item ' + journal_class + '" action="journal" status="inactive" default="asc">Journal</div>'); Ext.DomHelper.append(target, '<div class="pp-grid-sort-item ' + year_class + '" action="year" status="inactive" default="desc">Year</div>'); Ext.DomHelper.append(target, '<div class="pp-grid-sort-item ' + author_class + '" action="author" status="inactive" default="asc">Author</div>'); Ext.DomHelper.append(target, '<div class="pp-grid-sort-item pp-grid-sort-inactive" action="pdf" status="inactive" default="desc">PDF</div>'); Ext.DomHelper.append(target, '<div class="pp-grid-sort-item pp-grid-sort-inactive" action="attachments" status="inactive" default="desc">Supp. material</div>'); Ext.DomHelper.append(target, '<div class="pp-grid-sort-item pp-grid-sort-inactive" action="notes" status="inactive" default="desc">Notes</div>'); this.mon(target, 'click', this.handleSortButtons, this); }, handleFocusSearch: function() { this.filterField.getEl().focus(); }, currentSortField: '', handleSortButtons: function(e, el, o) { var currentClass = el.getAttribute('class'); var field = el.getAttribute('action'); var status = el.getAttribute('status'); var def = el.getAttribute('default'); // We have not hit a sort field if (!status) return; if (field != this.currentSortField) { status = "inactive"; } this.currentSortField = field; var classes = { inactive: 'pp-grid-sort-item pp-grid-sort-inactive', asc: 'pp-grid-sort-item pp-grid-sort-asc', desc: 'pp-grid-sort-item pp-grid-sort-desc' }; if (! (status == 'inactive' || status == 'asc' || status == 'desc')) return; var El = Ext.get(el); Ext.each(El.parent().query('div'), function(item) { var l = Ext.get(item); l.removeClass('pp-grid-sort-item'); l.removeClass('pp-grid-sort-asc'); l.removeClass('pp-grid-sort-desc'); l.removeClass('pp-grid-sort-inactive'); if (item == el) return; l.addClass(classes.inactive); }); var store = this.getStore(); if (status == "inactive") { if (def == 'desc') { El.addClass(classes.desc); store.baseParams['plugin_order'] = field + " DESC"; el.setAttribute('status', 'desc'); } else { El.addClass(classes.asc); store.baseParams['plugin_order'] = field + " ASC"; el.setAttribute('status', 'asc'); } } else { if (status == "desc") { store.baseParams['plugin_order'] = field; El.addClass(classes.asc); el.setAttribute('status', 'asc'); } else { El.addClass(classes.desc); store.baseParams['plugin_order'] = field + " DESC"; el.setAttribute('status', 'desc'); } } if (this.filterField.getRawValue() == "") { this.getStore().reload({ params: { start: 0, task: "NEW" } }); } else { this.filterField.onTrigger2Click(); } }, toggleFilter: function(item, checked) { var filter_button = this.filterButton; // Toggle 'search_pdf' option this.getStore().baseParams['plugin_search_pdf'] = 1; // Specific fields if (item.itemId != 'all') { if (checked) { this.filterField.singleField = item.itemId; this.getStore().baseParams['plugin_search_pdf'] = 0; } else { if (this.filterField.singleField == item.itemId) { this.filterField.singleField = ""; } } } if (!filter_button.oldIcon) { filter_button.useSetClass = false; filter_button.oldIcon = filter_button.icon; } if (checked) { if (item.itemId == 'all') { delete filter_button.minWidth; filter_button.setText(null); filter_button.setIcon(filter_button.oldIcon); filter_button.el.addClass('x-btn-icon'); filter_button.el.removeClass('x-btn-noicon'); } else { delete filter_button.minWidth; filter_button.setIcon(null); filter_button.setText(item.text); filter_button.el.addClass('x-btn-noicon'); filter_button.el.removeClass('x-btn-icon'); } this.filterField.onTrigger2Click(); } }, setSearchQuery: function(text) { this.filterField.setValue(text); this.filterField.onTrigger2Click(); }, createContextMenu: function() { Paperpile.PluginGridDB.superclass.createContextMenu.call(this); }, createToolbarMenu: function() { this.filterMenu = new Ext.menu.Menu({ defaults: { checked: false, group: 'filter' + this.id, checkHandler: this.toggleFilter, scope: this }, items: [{ text: 'All fields', checked: true, itemId: 'all' }, '-', { text: 'Author', itemId: 'author' }, { text: 'Title', itemId: 'title' }, { text: 'Journal', itemId: 'journal' }, { text: 'Abstract', itemId: 'abstract' }, { text: 'Fulltext', itemId: 'text' }, { text: 'Notes', itemId: 'notes' }, { text: 'Year', itemId: 'year' }] }); this.actions['FILTER_BUTTON'] = new Ext.Button({ itemId: 'FILTER_BUTTON', icon: '/images/icons/magnifier.png', tooltip: 'Choose field(s) to search', menu: this.filterMenu }); this.filterButton = this.actions['FILTER_BUTTON']; this.actions['FILTER_FIELD'] = new Ext.app.FilterField({ itemId: 'FILTER_FIELD', emptyText: 'Search References', store: this.getStore(), base_query: this.plugin_base_query, width: 200 }); this.filterField = this.actions['FILTER_FIELD']; this.mon(this.filterField, 'specialkey', function(f, e) { if (e.getKey() == e.ENTER) { // Select the first grid row on Enter. this.getSelectionModel().selectRowAndSetCursor(0); } }, this); Paperpile.PluginGridDB.superclass.createToolbarMenu.call(this); }, refreshCollections: function() { Paperpile.PluginGridDB.superclass.refreshCollections.call(this); }, initToolbarMenuItemIds: function() { Paperpile.PluginGridDB.superclass.initToolbarMenuItemIds.call(this); var ids = this.toolbarMenuItemIds; ids.insert(0, 'FILTER_FIELD'); ids.insert(1, 'FILTER_BUTTON'); var index = ids.indexOf('TB_FILL'); ids.insert(index + 1, 'NEW'); index = ids.indexOf('SELECT_ALL'); ids.insert(index + 0, 'EDIT'); // ids.insert(index + 1, 'EDIT'); }, isContextItem: function(item) { if (item.ownerCt.itemId == 'context') { return true; } return false; }, isToolbarItem: function(item) { return true; }, updateButtons: function() { Paperpile.PluginGridDB.superclass.updateButtons.call(this); var tbar = this.getTopToolbar(); var selectionCount = this.getSelectionModel().getCount(); if (selectionCount > 1) { var item = tbar.getComponent('EDIT'); if (item) { item.disable(); } item = tbar.getComponent('VIEW_PDF'); if (item) { item.disable(); } } }, onUpdate: function(data) { Paperpile.PluginGridDB.superclass.onUpdate.call(this, data); // If the update has to do with collections and we are // a collection tab, refresh the whole view. if (this.collection_type) { if (data.collection_delta) { this.getStore().reload(); } } }, showEmptyMessageBeforeStoreLoaded: function() { return false; }, getEmptyBeforeSearchTemplate: function() { var markup = '<div class="pp-hint-box"><p>No results to show. <a href="#" class="pp-textlink" action="close-tab">Close tab</a>.</p></div>'; // If tab is not filtered and still empty, the whole DB must be empty and we show welcome message if (this.plugin_query == '' && this.plugin_base_query == '') { markup = [ '<div class="pp-hint-box">', '<h1>Welcome to Paperpile</h1>', '<p>Your library is still empty. </p>', '<p>To get started, </p>', '<ul>', '<li>import your <a href="#" class="pp-textlink" onClick="Paperpile.main.pdfExtract();">PDF collection</a></li>', '<li>get references from a <a href="#" class="pp-textlink" onClick="Paperpile.main.fileImport();">bibliography file</a></li>', '<li>search for papers using ', '<a href="#" class="pp-textlink" onClick=', '"Paperpile.main.tabs.newPluginTab(\'PubMed\', {plugin_name: \'PubMed\', plugin_query:\'\'});">PubMed</a> or ', '<a href="#" class="pp-textlink" onClick=', '"Paperpile.main.tabs.newPluginTab(\'GoogleScholar\', {plugin_name: \'GoogleScholar\', plugin_query:\'\'});">Google Scholar</a></li>', '</ul>', '</div>']; } return new Ext.XTemplate(markup).compile(); } }); Ext.reg('pp-plugin-grid-db', Paperpile.PluginGridDB); Paperpile.PluginPanelDB = function(config) { Ext.apply(this, config); Paperpile.PluginPanelDB.superclass.constructor.call(this, {}); }; Ext.extend(Paperpile.PluginPanelDB, Paperpile.PluginPanel, { createGrid: function(params) { return new Paperpile.PluginGridDB(params); }, createAboutPanel: function() { return undefined; } });
Create 'Add to Library' menu for library gridpanel toolbar. Closes #854.
catalyst/root/js/import/plugins/DB.js
Create 'Add to Library' menu for library gridpanel toolbar. Closes #854.
<ide><path>atalyst/root/js/import/plugins/DB.js <ide> this.limit = Paperpile.main.globalSettings['pager_limit'] || 25; <ide> <ide> this.actions['NEW'] = new Ext.Action({ <del> text: 'New', <add> text: 'Insert Manually', <ide> iconCls: 'pp-icon-add', <ide> handler: function() { <ide> this.handleEdit(true); <ide> itemId: 'new_button', <ide> tooltip: 'Manually create a new reference for your library' <ide> }); <add> this.actions['FILE_IMPORT'] = new Ext.Action({ <add> text: "Open Bibliography File", <add> iconCls: 'pp-icon-import-file', <add> tooltip: 'Import references from EndNote, BibTeX <br/> and other bibliography files.', <add> handler: function() { <add> Paperpile.main.fileImport(); <add> } <add> }); <add> this.actions['PDF_IMPORT'] = new Ext.Action({ <add> text: "Import PDFs", <add> iconCls: 'pp-icon-import-pdf', <add> tooltip: 'Import references from one or more PDFs', <add> handler: function() { <add> Paperpile.main.pdfExtract(); <add> } <add> }); <add> <add> this.actions['ADD_MENU'] = { <add> text: 'Add to Library', <add> itemId: 'ADD_MENU', <add> iconCls: 'pp-icon-add', <add> menu: { <add> items: [ <add> this.actions['NEW'], <add> this.actions['FILE_IMPORT'], <add> this.actions['PDF_IMPORT']] <add> } <add> }; <ide> <ide> var store = this.getStore(); <ide> store.baseParams['plugin_search_pdf'] = 0; <ide> ids.insert(1, 'FILTER_BUTTON'); <ide> <ide> var index = ids.indexOf('TB_FILL'); <del> ids.insert(index + 1, 'NEW'); <add> ids.insert(index + 1, 'ADD_MENU'); <ide> <ide> index = ids.indexOf('SELECT_ALL'); <ide> ids.insert(index + 0, 'EDIT');
JavaScript
mit
706423fd6e3ca9ba65a7266cf883076b5bfbe367
0
kapouer/window-page,kapouer/window-page
function WindowPage() { var inst = window.Page; if (inst) { // because using instanceof requires reference to the same WindowPage if (inst.name == "WindowPage") return inst; } this.name = "WindowPage"; var QueryString = require('query-string'); this.parse = function(str) { var loc = this.location ? this.location.toString() : document.location.toString(); var obj = new URL(str || "", loc); obj.query = QueryString.parse(obj.search); return obj; }.bind(this); this.format = function(obj) { var query = QueryString.stringify(obj.query); if (query) obj.search = query; else delete obj.search; if (obj.path) { var help = this.parse(obj.path); obj.pathname = help.pathname; obj.search = help.search; delete obj.path; } return obj.toString(); }; this.location = this.parse(document.location.toString()); this.reset(); this.historyListener = this.historyListener.bind(this); window.addEventListener('popstate', this.historyListener); this.route = this.chainThenable.bind(this, "route"); this.build = this.chainThenable.bind(this, "build"); this.handle = this.chainThenable.bind(this, "handle"); this.importDocument = this.importDocument.bind(this); this.waitUiReady = this.waitUiReady.bind(this); var page = this.parse(""); page.stage = this.stage(); if (page.stage == "build") page.document = window.document; this.run(page); } WindowPage.prototype.run = function(page) { var pageUrl = this.format(page); page.browsing = false; if (pageUrl != this.location.href) { page.browsing = true; } var self = this; return this.waitReady().then(function() { if (!page.document) { return self.runChain('route', page); } }).then(function() { if (page.document && page.document != window.document) { self.reset(); page.updating = false; return self.importDocument(page.document).then(function() { page.document = window.document; }); } }).then(function() { if (page.stage != "build") { // always run except if the document has just been opened in a build stage return self.runChain('build', page); } }).then(function() { return self.waitUiReady(page).then(function() { return self.runChain('handle', page); }); }).then(function() { self.location = self.parse(pageUrl); page.updating = true; }); }; WindowPage.prototype.reset = function() { this.chains = { route: {thenables: []}, build: {thenables: []}, handle: {thenables: []} }; }; WindowPage.prototype.runChain = function(stage, page) { page.stage = stage; this.stage(stage); var chain = this.chains[stage]; chain.promise = this.allFn(page, chain.thenables); return chain.promise.then(function() { return page; }); }; WindowPage.prototype.chainThenable = function(stage, fn) { var chain = this.chains[stage]; chain.thenables.push(fn); if (chain.promise && this.stage() == stage) { chain.promise = this.oneFn(chain.promise, fn); } return this; }; WindowPage.prototype.catcher = function(phase, err, fn) { console.error("Uncaught error during", phase, err, fn); }; WindowPage.prototype.oneFn = function(p, fn) { var catcher = this.catcher.bind(this); return p.then(function(page) { return Promise.resolve(page).then(fn).catch(function(err) { return catcher(page.stage, err, fn); }).then(function() { return page; }); }); }; WindowPage.prototype.allFn = function(page, list) { var p = Promise.resolve(page); var self = this; list.forEach(function(fn) { p = self.oneFn(p, fn); }); return p; }; WindowPage.prototype.stage = function(name) { var root = document.documentElement; if (name === null) root.removeAttribute("stage"); else if (name) root.setAttribute("stage", name); else name = root.getAttribute("stage"); return name; }; WindowPage.prototype.waitUiReady = function(page) { if (document.visibilityState == "prerender") { var solve, p = new Promise(function(resolve) { solve = resolve; }); function vizListener() { document.removeEventListener('visibilitychange', vizListener, false); solve(); } document.addEventListener('visibilitychange', vizListener, false); return p.then(waitImports); } else { return waitImports(); } function waitImports() { var imports = Array.from(document.querySelectorAll('link[rel="import"]')); var polyfill = window.HTMLImports; var whenReady = (function() { var promise; return function() { if (!promise) promise = new Promise(function(resolve) { polyfill.whenReady(function() { setTimeout(resolve); }); }); return promise; }; })(); return Promise.all(imports.map(function(link) { if (link.import && link.import.readyState == "complete") { // no need to wait, wether native or polyfill return Promise.resolve(); } if (polyfill) { // link.onload cannot be trusted return whenReady(); } return new Promise(function(resolve, reject) { function loadListener() { link.removeEventListener('load', loadListener); resolve(); } function errorListener() { link.removeEventListener('error', errorListener); resolve(); } link.addEventListener('load', loadListener); link.addEventListener('error', errorListener); }); })).then(function() { return page; }); } }; WindowPage.prototype.waitReady = function() { if (this.docReady) return Promise.resolve(); var solve; var p = new Promise(function(resolve) { solve = resolve; }); // https://github.com/jquery/jquery/issues/2100 if (document.readyState == "complete" || (document.readyState != "loading" && !document.documentElement.doScroll)) { this.docReady = true; setTimeout(solve); return p; } var self = this; function listener() { document.removeEventListener('DOMContentLoaded', listener); window.removeEventListener('load', listener); if (self.docReady) return; self.docReady = true; solve(); } document.addEventListener('DOMContentLoaded', listener); window.addEventListener('load', listener); return p; }; WindowPage.prototype.importDocument = function(doc) { var scripts = Array.from(doc.querySelectorAll('script')).map(function(node) { if (node.type && node.type != "text/javascript") return Promise.resolve({}); // make sure script is not loaded when inserted into document node.type = "text/plain"; // fetch script content ourselves if (node.src) return GET(node.src).then(function(txt) { return {src: node.src, txt: txt, node: node}; }).catch(function(err) { console.error("Error loading", node.src, err); return {}; }); else return Promise.resolve({ src: "inline", txt: node.textContent, node: node }); }); var imports = Array.from(doc.querySelectorAll('link[rel="import"]')); var cursor; imports.forEach(function(link) { if (!cursor) { cursor = doc.createTextNode(""); link.parentNode.insertBefore(cursor, link); } link.remove(); }); var root = document.documentElement; if (doc.attributes) for (var i=0; i < doc.attributes.length; i++) { root.setAttribute(doc.attributes[i].name, doc.attributes[i].value); } root.replaceChild(document.adoptNode(doc.head), document.head); root.replaceChild(document.adoptNode(doc.body), document.body); // execute all scripts in their original order as soon as they loaded return scripts.reduce(function(sequence, scriptPromise) { return sequence.then(function() { return scriptPromise; }).then(function(obj) { if (!obj.txt) return; var script = document.createElement("script"); script.textContent = obj.txt; document.head.appendChild(script).remove(); obj.node.type = "text/javascript"; }); }, Promise.resolve()).then(function() { imports.forEach(function(link) { cursor.parentNode.insertBefore(link, cursor); }); }); }; WindowPage.prototype.push = function(page) { return this.historyMethod('push', page); }; WindowPage.prototype.replace = function(page) { return this.historyMethod('replace', page); }; WindowPage.prototype.historyMethod = function(method, page) { return this.run(page).then(function() { method = method + 'State'; if (!window.history || !window.history[method]) return; window.history[method](null, page.document.title, this.format(page)); }.bind(this)); }; WindowPage.prototype.historyListener = function(e) { // happens on some browsers // if (document.location.href == this.format(this.page)) return; // TODO }; window.Page = new WindowPage();
index.js
function WindowPage() { var inst = window.Page; if (inst) { // because using instanceof requires reference to the same WindowPage if (inst.name == "WindowPage") return inst; } this.name = "WindowPage"; var QueryString = require('query-string'); this.parse = function(str) { var obj = new URL(str, document.location); obj.query = QueryString.parse(obj.search); return obj; }; this.format = function(obj) { var query = QueryString.stringify(obj.query); if (query) obj.search = query; else delete obj.search; if (obj.path) { var help = this.parse(obj.path); obj.pathname = help.pathname; obj.search = help.search; delete obj.path; } return obj.toString(); }; this.reset(); this.historyListener = this.historyListener.bind(this); window.addEventListener('popstate', this.historyListener); this.route = this.chainThenable.bind(this, "route"); this.build = this.chainThenable.bind(this, "build"); this.handle = this.chainThenable.bind(this, "handle"); this.importDocument = this.importDocument.bind(this); this.waitUiReady = this.waitUiReady.bind(this); var page = this.parse(""); page.stage = this.stage(); if (page.stage == "build") page.document = window.document; this.run(page); } WindowPage.prototype.run = function(page) { var pageUrl = this.format(page); page.browsing = pageUrl != document.location.toString(); var self = this; return this.waitReady().then(function() { if (!page.document) { return self.runChain('route', page); } }).then(function() { if (page.document != window.document) { self.reset(); page.updating = false; return self.importDocument(page.document).then(function() { page.document = window.document; }); } }).then(function() { if (page.stage != "build") { // always run except if the document has just been opened in a build stage return self.runChain('build', page); } }).then(function() { return self.waitUiReady(page).then(function() { return self.runChain('handle', page); }); }).then(function() { page.updating = true; }); }; WindowPage.prototype.reset = function() { this.chains = { route: {thenables: []}, build: {thenables: []}, handle: {thenables: []} }; }; WindowPage.prototype.runChain = function(stage, page) { page.stage = stage; this.stage(stage); var chain = this.chains[stage]; console.log("run chain", stage); chain.promise = this.allFn(page, chain.thenables); return chain.promise.then(function() { return page; }); }; WindowPage.prototype.chainThenable = function(stage, fn) { var chain = this.chains[stage]; chain.thenables.push(fn); if (chain.promise && this.stage() == stage) { chain.promise = this.oneFn(chain.promise, fn); } return this; }; WindowPage.prototype.catcher = function(phase, err, fn) { console.error("Uncaught error during", phase, err, fn); }; WindowPage.prototype.oneFn = function(p, fn) { var catcher = this.catcher.bind(this); return p.then(function(page) { return Promise.resolve(page).then(fn).catch(function(err) { return catcher(page.stage, err, fn); }).then(function() { return page; }); }); }; WindowPage.prototype.allFn = function(page, list) { var p = Promise.resolve(page); var self = this; list.forEach(function(fn) { p = self.oneFn(p, fn); }); return p; }; WindowPage.prototype.stage = function(name) { var root = document.documentElement; if (name === null) root.removeAttribute("stage"); else if (name) root.setAttribute("stage", name); else name = root.getAttribute("stage"); return name; }; WindowPage.prototype.waitUiReady = function(page) { if (document.visibilityState == "prerender") { var solve, p = new Promise(function(resolve) { solve = resolve; }); function vizListener() { document.removeEventListener('visibilitychange', vizListener, false); solve(); } document.addEventListener('visibilitychange', vizListener, false); return p.then(waitImports); } else { return waitImports(); } function waitImports() { var imports = Array.from(document.querySelectorAll('link[rel="import"]')); var polyfill = window.HTMLImports; var whenReady = (function() { var promise; return function() { if (!promise) promise = new Promise(function(resolve) { polyfill.whenReady(function() { setTimeout(resolve); }); }); return promise; }; })(); return Promise.all(imports.map(function(link) { if (link.import && link.import.readyState == "complete") { // no need to wait, wether native or polyfill return Promise.resolve(); } if (polyfill) { // link.onload cannot be trusted return whenReady(); } return new Promise(function(resolve, reject) { function loadListener() { link.removeEventListener('load', loadListener); resolve(); } function errorListener() { link.removeEventListener('error', errorListener); resolve(); } link.addEventListener('load', loadListener); link.addEventListener('error', errorListener); }); })).then(function() { return page; }); } }; WindowPage.prototype.waitReady = function() { if (this.docReady) return Promise.resolve(); var solve; var p = new Promise(function(resolve) { solve = resolve; }); // https://github.com/jquery/jquery/issues/2100 if (document.readyState == "complete" || (document.readyState != "loading" && !document.documentElement.doScroll)) { this.docReady = true; setTimeout(solve); return p; } var self = this; function listener() { document.removeEventListener('DOMContentLoaded', listener); window.removeEventListener('load', listener); if (self.docReady) return; self.docReady = true; solve(); } document.addEventListener('DOMContentLoaded', listener); window.addEventListener('load', listener); return p; }; WindowPage.prototype.importDocument = function(doc) { var scripts = Array.from(doc.querySelectorAll('script')).map(function(node) { if (node.type && node.type != "text/javascript") return Promise.resolve({}); // make sure script is not loaded when inserted into document node.type = "text/plain"; // fetch script content ourselves if (node.src) return GET(node.src).then(function(txt) { return {src: node.src, txt: txt, node: node}; }).catch(function(err) { console.error("Error loading", node.src, err); return {}; }); else return Promise.resolve({ src: "inline", txt: node.textContent, node: node }); }); var imports = Array.from(doc.querySelectorAll('link[rel="import"]')); var cursor; imports.forEach(function(link) { if (!cursor) { cursor = doc.createTextNode(""); link.parentNode.insertBefore(cursor, link); } link.remove(); }); var root = document.documentElement; if (doc.attributes) for (var i=0; i < doc.attributes.length; i++) { root.setAttribute(doc.attributes[i].name, doc.attributes[i].value); } root.replaceChild(document.adoptNode(doc.head), document.head); root.replaceChild(document.adoptNode(doc.body), document.body); // execute all scripts in their original order as soon as they loaded return scripts.reduce(function(sequence, scriptPromise) { return sequence.then(function() { return scriptPromise; }).then(function(obj) { if (!obj.txt) return; var script = document.createElement("script"); script.textContent = obj.txt; document.head.appendChild(script).remove(); obj.node.type = "text/javascript"; }); }, Promise.resolve()).then(function() { imports.forEach(function(link) { cursor.parentNode.insertBefore(link, cursor); }); }); }; WindowPage.prototype.push = function(page) { this.historyMethod('push', page); }; WindowPage.prototype.replace = function(page) { this.historyMethod('replace', page); }; WindowPage.prototype.historyMethod = function(method, page) { console.log("called history", method, Page.format(page)); return this.run(page).then(function() { console.log("done history"); method = method + 'State'; if (!window.history || !window.history[method]) return; window.history[method](null, page.document.title, this.format(page)); }.bind(this)); }; WindowPage.prototype.historyListener = function(e) { // happens on some browsers // if (document.location.href == this.format(this.page)) return; // TODO }; window.Page = new WindowPage();
Fixing things again...
index.js
Fixing things again...
<ide><path>ndex.js <ide> var QueryString = require('query-string'); <ide> <ide> this.parse = function(str) { <del> var obj = new URL(str, document.location); <add> var loc = this.location ? this.location.toString() : document.location.toString(); <add> var obj = new URL(str || "", loc); <ide> obj.query = QueryString.parse(obj.search); <ide> return obj; <del> }; <add> }.bind(this); <ide> this.format = function(obj) { <ide> var query = QueryString.stringify(obj.query); <ide> if (query) obj.search = query; <ide> return obj.toString(); <ide> }; <ide> <add> this.location = this.parse(document.location.toString()); <add> <ide> this.reset(); <ide> <ide> this.historyListener = this.historyListener.bind(this); <ide> <ide> WindowPage.prototype.run = function(page) { <ide> var pageUrl = this.format(page); <del> page.browsing = pageUrl != document.location.toString(); <add> page.browsing = false; <add> if (pageUrl != this.location.href) { <add> page.browsing = true; <add> } <ide> var self = this; <ide> return this.waitReady().then(function() { <ide> if (!page.document) { <ide> return self.runChain('route', page); <ide> } <ide> }).then(function() { <del> if (page.document != window.document) { <add> if (page.document && page.document != window.document) { <ide> self.reset(); <ide> page.updating = false; <ide> return self.importDocument(page.document).then(function() { <ide> return self.runChain('handle', page); <ide> }); <ide> }).then(function() { <add> self.location = self.parse(pageUrl); <ide> page.updating = true; <ide> }); <ide> }; <ide> page.stage = stage; <ide> this.stage(stage); <ide> var chain = this.chains[stage]; <del> console.log("run chain", stage); <ide> chain.promise = this.allFn(page, chain.thenables); <ide> return chain.promise.then(function() { <ide> return page; <ide> }; <ide> <ide> WindowPage.prototype.push = function(page) { <del> this.historyMethod('push', page); <add> return this.historyMethod('push', page); <ide> }; <ide> <ide> WindowPage.prototype.replace = function(page) { <del> this.historyMethod('replace', page); <add> return this.historyMethod('replace', page); <ide> }; <ide> <ide> WindowPage.prototype.historyMethod = function(method, page) { <del> console.log("called history", method, Page.format(page)); <ide> return this.run(page).then(function() { <del> console.log("done history"); <ide> method = method + 'State'; <ide> if (!window.history || !window.history[method]) return; <ide> window.history[method](null, page.document.title, this.format(page));
Java
apache-2.0
190ccc4b1a60883c685e54938a7c8199d67e1ddc
0
zangsir/ANNIS,thomaskrause/ANNIS,pixeldrama/ANNIS,amir-zeldes/ANNIS,amir-zeldes/ANNIS,zangsir/ANNIS,thomaskrause/ANNIS,amir-zeldes/ANNIS,thomaskrause/ANNIS,pixeldrama/ANNIS,pixeldrama/ANNIS,pixeldrama/ANNIS,amir-zeldes/ANNIS,zangsir/ANNIS,korpling/ANNIS,korpling/ANNIS,zangsir/ANNIS,thomaskrause/ANNIS,amir-zeldes/ANNIS,korpling/ANNIS,zangsir/ANNIS,pixeldrama/ANNIS,thomaskrause/ANNIS,zangsir/ANNIS,pixeldrama/ANNIS,korpling/ANNIS,korpling/ANNIS,amir-zeldes/ANNIS
/* * Copyright 2009 Collaborative Research Centre SFB 632 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package annis.frontend.servlets; import java.io.IOException; import java.net.URLDecoder; import java.net.URLEncoder; import java.nio.charset.Charset; import java.util.List; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; public class CitationServlet extends HttpServlet { private static final long serialVersionUID = -4188886565776492022L; public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ServletOutputStream out = response.getOutputStream(); String parameters = request.getRequestURI().replaceAll(".*?/Cite(/)?", ""); if(!"".equals(parameters)) { //set the cookie and redirect to index.jsp Cookie citationCookie = new Cookie("citation", parameters); citationCookie.setPath("/"); response.addCookie(citationCookie); } response.sendRedirect(getServletContext().getContextPath() + "/search.html"); } }
Annis-web/src/main/java/annis/frontend/servlets/CitationServlet.java
/* * Copyright 2009 Collaborative Research Centre SFB 632 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package annis.frontend.servlets; import java.io.IOException; import java.net.URLDecoder; import java.net.URLEncoder; import java.nio.charset.Charset; import java.util.List; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; public class CitationServlet extends HttpServlet { private static final long serialVersionUID = -4188886565776492022L; public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ServletOutputStream out = response.getOutputStream(); String parameters = request.getRequestURI().replaceAll(".*?/Cite(/)?", ""); if(!"".equals(parameters)) { //set the cookie and redirect to index.jsp Cookie citationCookie = new Cookie("citation", parameters); citationCookie.setPath("/"); response.addCookie(citationCookie); } response.sendRedirect(getServletContext().getContextPath()); } }
- fixing Citation, redirect must be directly to search.html if no information should be lost
Annis-web/src/main/java/annis/frontend/servlets/CitationServlet.java
- fixing Citation, redirect must be directly to search.html if no information should be lost
<ide><path>nnis-web/src/main/java/annis/frontend/servlets/CitationServlet.java <ide> citationCookie.setPath("/"); <ide> response.addCookie(citationCookie); <ide> } <del> response.sendRedirect(getServletContext().getContextPath()); <add> response.sendRedirect(getServletContext().getContextPath() + "/search.html"); <ide> } <ide> }
Java
mit
21b06009a755ef8a6d689401e0fdc2805538cd66
0
Abestanis/APython,Abestanis/APython,Abestanis/APython
package com.apython.python.pythonhost; /* * Handles the Python installation and Python modules. * * Created by Sebastian on 16.06.2015. */ import android.annotation.SuppressLint; import android.content.Context; import android.os.Build; import android.util.Log; import com.apython.python.pythonhost.interpreter.PythonInterpreter; import java.io.File; import java.io.FilenameFilter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; public class PackageManager { public static File getSharedLibrariesPath(Context context) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { return new File(context.getApplicationInfo().nativeLibraryDir); } else { return new File(context.getApplicationInfo().dataDir, "lib"); } } public static File getStandardLibPath(Context context) { return new File(context.getFilesDir(), "lib"); } public static File getPythonExecutable(Context context) { return new File(context.getApplicationInfo().dataDir, "python"); } public static File getTempDir(Context context) { return context.getCacheDir(); } public static File getSitePackages(Context context, String pythonVersion) { return new File(getStandardLibPath(context), "python" + pythonVersion + "/site-packages"); } public static File getGlobalSitePackages(Context context) { return new File(getStandardLibPath(context), "site-packages"); } public static File getXDGBase(Context context) { return new File(context.getFilesDir(), "pythonApps"); } public static File getLibDynLoad(Context context, String pythonVersion) { return new File(getStandardLibPath(context), "python" + pythonVersion + "/lib-dynload"); } public static File getDynamicLibraryPath(Context context) { return new File(context.getFilesDir(), "dynLibs"); } public static File getDataPath(Context context) { return new File(context.getFilesDir(), "data"); } public static boolean isAdditionalLibraryInstalled(Context context, String libName) { return new File(getDynamicLibraryPath(context), System.mapLibraryName(libName)).exists(); } public static boolean isPythonVersionInstalled(Context context, String pythonVersion) { return new File(getDynamicLibraryPath(context), System.mapLibraryName("python" + pythonVersion)).exists() && new File(getStandardLibPath(context), "python" + pythonVersion.replace(".", "") + ".zip").exists(); } public static ArrayList<String> getInstalledPythonVersions(Context context) { File libPath = getDynamicLibraryPath(context); ArrayList<String> versions = new ArrayList<>(); if (!libPath.exists() || !libPath.isDirectory()) { return versions; } for (File libFile : libPath.listFiles()) { String name = libFile.getName(); if (!name.startsWith("libpython") || !name.endsWith(".so") || name.contains("pythonPatch")) { continue; } String version = name.replace("libpython", "").replace(".so", ""); if (new File(getStandardLibPath(context), "python" + version.replace(".", "") + ".zip").exists()) { versions.add(version); } } return versions; } /** * Returns the installed Python version with the highest version number. * * @param context The current context. * @return The newest Python version. */ public static String getNewestInstalledPythonVersion(Context context) { String newestVersion = null; int[] newestVersionNumbers = {0, 0}; for (String version : getInstalledPythonVersions(context)) { String[] versionParts = version.split("\\."); int[] versionNumbers = {Integer.valueOf(versionParts[0]), Integer.valueOf(versionParts[1])}; if (versionNumbers[0] > newestVersionNumbers[0] || (versionNumbers[0] == newestVersionNumbers[0] && versionNumbers[1] > newestVersionNumbers[1])) { newestVersion = version; newestVersionNumbers = versionNumbers; } } return newestVersion; } /** * Return the optimal installed Python version. * * @param context The current context. * @param requestedPythonVersion A requested specific Python version. * @param minPythonVersion The minimum Python version to use. * @param maxPythonVersion The maximum Python version to use. * @param disallowedPythonVersions A list of disallowed Python versions. * @return The optimal Python version or {@code null} if no optimal version was found. */ public static String getOptimalInstalledPythonVersion(Context context, String requestedPythonVersion, String minPythonVersion, String maxPythonVersion, String[] disallowedPythonVersions) { if (requestedPythonVersion != null) { return isPythonVersionInstalled(context, requestedPythonVersion) ? requestedPythonVersion : null; } ArrayList<String> installedPythonVersions = getInstalledPythonVersions(context); if (disallowedPythonVersions != null) { installedPythonVersions.removeAll(Arrays.asList(disallowedPythonVersions)); } Collections.sort(installedPythonVersions, Collections.reverseOrder()); int[] minPyVersion = minPythonVersion != null ? Util.getNumericPythonVersion(minPythonVersion) : new int[] {-1, -1, -1}; int[] maxPyVersion = maxPythonVersion != null ? Util.getNumericPythonVersion(maxPythonVersion) : new int[] {Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE}; for (String installedPythonVersion : installedPythonVersions) { int[] version = Util.getNumericPythonVersion(installedPythonVersion); if (version[0] <= maxPyVersion[0] && version[0] >= minPyVersion[0]) { if (version[1] <= maxPyVersion[1] && version[1] >= minPyVersion[1]) { if (version[2] <= maxPyVersion[2] && version[2] >= minPyVersion[2]) { return installedPythonVersion; } } } } return null; } /** * Returns the detailed version string of the main Python version which is currently installed. * * @param context The current Application context * @param mainVersion The version which detailed version should be checked. * @return The detailed version string. */ public static String getDetailedInstalledVersion(Context context, String mainVersion) { // TODO: This must be faster return new PythonInterpreter(context, mainVersion).getPythonVersion(); } /** * Get the ABIs supported by this device. * * @return a list of supported ABIs. */ public static String[] getSupportedCPUABIS() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { //noinspection deprecation return new String[] {Build.CPU_ABI, Build.CPU_ABI2}; } else { return Build.SUPPORTED_ABIS; } } /** * Load a library that was downloaded and was not bundled with the Python Host apk. * * @param context The current context. * @param libraryName The name of the library to load. * * @throws LinkageError if the library was not downloaded or it is not in the usual directory. */ @SuppressLint("UnsafeDynamicallyLoadedCode") public static void loadDynamicLibrary(Context context, String libraryName) { System.load(new File(PackageManager.getDynamicLibraryPath(context), System.mapLibraryName(libraryName)).getAbsolutePath()); } /** * Returns a list of all additional libraries installed. * * @param context The current context. * @return A list of {@link File} objects pointing to the library files. */ public static File[] getAdditionalLibraries(Context context) { File[] additionalLibraries = getDynamicLibraryPath(context).listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String filename) { return filename.endsWith(".so") && !filename.matches(".*python\\d+\\.\\d+\\.so") && !filename.endsWith("pythonPatch.so"); } }); return additionalLibraries != null ? additionalLibraries : new File[0]; } /** * Returns a list of all additional Python modules installed for the given Python version. * * @param context The current context. * @param pythonVersion The Python version for which to search for libraries. * @return A list of {@link File} objects pointing to the library files. */ public static File[] getAdditionalModules(Context context, String pythonVersion) { File[] additionalModules = getLibDynLoad(context, pythonVersion).listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String filename) { return filename.endsWith(".so"); } }); return additionalModules != null ? additionalModules : new File[0]; } /** * Loads all additional libraries that are installed. * * @param context The current context. */ @SuppressLint("UnsafeDynamicallyLoadedCode") public static void loadAdditionalLibraries(Context context) { File[] additionalLibraries = getAdditionalLibraries(context); if (additionalLibraries.length == 0) return; int numPrevFailed = additionalLibraries.length; ArrayList<File> failedLibs = new ArrayList<>(additionalLibraries.length); while (additionalLibraries[0] != null) { for (File additionalLibrary : additionalLibraries) { if (additionalLibrary == null) break; try { System.load(additionalLibrary.getAbsolutePath()); } catch (UnsatisfiedLinkError unused) { failedLibs.add(additionalLibrary); } } if (numPrevFailed == failedLibs.size()) { Log.w(MainActivity.TAG, "The following additional libraries could not be loaded:"); for (File failedLib : failedLibs) { Log.w(MainActivity.TAG, failedLib.getAbsolutePath()); } return; } additionalLibraries = failedLibs.toArray(additionalLibraries); numPrevFailed = failedLibs.size(); failedLibs.clear(); } } /** * Calculates the storage space currently used by the given Python version. * * @param context The current context. * @param pythonVersion The Python version to calculate the used storage space for. * @return The used storage space in bytes. */ public static long getUsedStorageSpace(Context context, String pythonVersion) { File pythonDir = new File(getStandardLibPath(context), "python" + pythonVersion); File pythonLib = new File(PackageManager.getDynamicLibraryPath(context), System.mapLibraryName("python" + pythonVersion)); File pythonModules = new File(PackageManager.getStandardLibPath(context), pythonVersion.replace(".", "") + ".zip"); return pythonLib.length() + pythonModules.length() + Util.calculateDirectorySize(pythonDir); } // Checks that all components of this Python installation are present. public static boolean ensurePythonInstallation(Context context, String pythonVersion, ProgressHandler progressHandler) { return installPythonExecutable(context, progressHandler) //&& installPythonLibraries(context, progressHandler) //&& installPip(context, progressHandler) && checkSitePackagesAvailability(context, pythonVersion, progressHandler); } public static boolean installPythonExecutable(Context context, ProgressHandler progressHandler) { File executable = getPythonExecutable(context); if (executable.exists()) { // TODO: Check if we really need to update it. if (!executable.delete()) { Log.w(MainActivity.TAG, "Could not delete previously installed python executable."); return true; // That's hopefully ok. } } if (progressHandler != null) { progressHandler.enable(context.getString(R.string.install_executable)); } return executable.exists() || Util.installFromInputStream(executable, context.getResources().openRawResource(R.raw.python), progressHandler); } public static boolean installRequirements(final Context context, String requirements, String pythonVersion, final ProgressHandler progressHandler) { return Pip.install(context, pythonVersion, progressHandler) && Pip.installRequirements(context, requirements, pythonVersion, progressHandler); } public static boolean checkSitePackagesAvailability(Context context, String pythonVersion, ProgressHandler progressHandler) { File sitePackages = getSitePackages(context, pythonVersion); if (sitePackages.exists()) { if (!Util.makePathAccessible(sitePackages, context.getFilesDir())) { return false; } ArrayList<File> files = Util.checkDirContentsAccessibility(sitePackages); if (!files.isEmpty()) { if (progressHandler != null) { progressHandler.enable(context.getString(R.string.changing_sitePackages_permissions)); } int i; int size = files.size(); for (i = 0; i < size; i++) { Util.makeFileAccessible(files.get(i), files.get(i).isDirectory()); if (progressHandler != null) { progressHandler.setProgress((float) (i + 1) / size); } } if (progressHandler != null) { progressHandler.setProgress(-1); } } } return true; } public static ArrayList<String> getInstalledDynLibraries(Context context) { ArrayList<String> installedLibs = new ArrayList<>(); File[] files = getDynamicLibraryPath(context).listFiles(); if (files != null) { for (File file : files) { installedLibs.add(Util.getLibraryName(file)); } } return installedLibs; } }
app/src/main/java/com/apython/python/pythonhost/PackageManager.java
package com.apython.python.pythonhost; /* * Handles the Python installation and Python modules. * * Created by Sebastian on 16.06.2015. */ import android.annotation.SuppressLint; import android.content.Context; import android.os.Build; import android.util.Log; import com.apython.python.pythonhost.interpreter.PythonInterpreter; import java.io.File; import java.io.FilenameFilter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; public class PackageManager { public static File getSharedLibrariesPath(Context context) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { return new File(context.getApplicationInfo().nativeLibraryDir); } else { return new File(context.getApplicationInfo().dataDir, "lib"); } } public static File getStandardLibPath(Context context) { return new File(context.getFilesDir(), "lib"); } public static File getPythonExecutable(Context context) { return new File(context.getApplicationInfo().dataDir, "python"); } public static File getTempDir(Context context) { return context.getCacheDir(); } public static File getSitePackages(Context context, String pythonVersion) { return new File(getStandardLibPath(context), "python" + pythonVersion + "/site-packages"); } public static File getGlobalSitePackages(Context context) { return new File(getStandardLibPath(context), "site-packages"); } public static File getXDGBase(Context context) { return new File(context.getFilesDir(), "pythonApps"); } public static File getLibDynLoad(Context context, String pythonVersion) { return new File(getStandardLibPath(context), "python" + pythonVersion + "/lib-dynload"); } public static File getDynamicLibraryPath(Context context) { return new File(context.getFilesDir(), "dynLibs"); } public static File getDataPath(Context context) { return new File(context.getFilesDir(), "data"); } public static boolean isAdditionalLibraryInstalled(Context context, String libName) { return new File(getDynamicLibraryPath(context), System.mapLibraryName(libName)).exists(); } public static boolean isPythonVersionInstalled(Context context, String pythonVersion) { return new File(getDynamicLibraryPath(context), System.mapLibraryName("python" + pythonVersion)).exists() && new File(getStandardLibPath(context), "python" + pythonVersion.replace(".", "") + ".zip").exists(); } public static ArrayList<String> getInstalledPythonVersions(Context context) { File libPath = getDynamicLibraryPath(context); ArrayList<String> versions = new ArrayList<>(); if (!libPath.exists() || !libPath.isDirectory()) { return versions; } for (File libFile : libPath.listFiles()) { String name = libFile.getName(); if (!name.startsWith("libpython") || !name.endsWith(".so") || name.contains("pythonPatch")) { continue; } String version = name.replace("libpython", "").replace(".so", ""); if (new File(getStandardLibPath(context), "python" + version.replace(".", "") + ".zip").exists()) { versions.add(version); } } return versions; } /** * Returns the installed Python version with the highest version number. * * @param context The current context. * @return The newest Python version. */ public static String getNewestInstalledPythonVersion(Context context) { String newestVersion = null; int[] newestVersionNumbers = {0, 0}; for (String version : getInstalledPythonVersions(context)) { String[] versionParts = version.split("\\."); int[] versionNumbers = {Integer.valueOf(versionParts[0]), Integer.valueOf(versionParts[1])}; if (versionNumbers[0] > newestVersionNumbers[0] || (versionNumbers[0] == newestVersionNumbers[0] && versionNumbers[1] > newestVersionNumbers[1])) { newestVersion = version; newestVersionNumbers = versionNumbers; } } return newestVersion; } /** * Return the optimal installed Python version. * * @param context The current context. * @param requestedPythonVersion A requested specific Python version. * @param minPythonVersion The minimum Python version to use. * @param maxPythonVersion The maximum Python version to use. * @param disallowedPythonVersions A list of disallowed Python versions. * @return The optimal Python version or {@code null} if no optimal version was found. */ public static String getOptimalInstalledPythonVersion(Context context, String requestedPythonVersion, String minPythonVersion, String maxPythonVersion, String[] disallowedPythonVersions) { if (requestedPythonVersion != null) { return isPythonVersionInstalled(context, requestedPythonVersion) ? requestedPythonVersion : null; } ArrayList<String> installedPythonVersions = getInstalledPythonVersions(context); if (disallowedPythonVersions != null) { installedPythonVersions.removeAll(Arrays.asList(disallowedPythonVersions)); } Collections.sort(installedPythonVersions, Collections.reverseOrder()); int[] minPyVersion = minPythonVersion != null ? Util.getNumericPythonVersion(minPythonVersion) : new int[] {-1, -1, -1}; int[] maxPyVersion = maxPythonVersion != null ? Util.getNumericPythonVersion(maxPythonVersion) : new int[] {Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE}; for (String installedPythonVersion : installedPythonVersions) { int[] version = Util.getNumericPythonVersion(installedPythonVersion); if (version[0] <= maxPyVersion[0] && version[0] >= minPyVersion[0]) { if (version[1] <= maxPyVersion[1] && version[1] >= minPyVersion[1]) { if (version[2] <= maxPyVersion[2] && version[2] >= minPyVersion[2]) { return installedPythonVersion; } } } } return null; } /** * Returns the detailed version string of the main Python version which is currently installed. * * @param context The current Application context * @param mainVersion The version which detailed version should be checked. * @return The detailed version string. */ public static String getDetailedInstalledVersion(Context context, String mainVersion) { // TODO: This must be faster return new PythonInterpreter(context, mainVersion).getPythonVersion(); } /** * Get the ABIs supported by this device. * * @return a list of supported ABIs. */ public static String[] getSupportedCPUABIS() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { //noinspection deprecation return new String[] {Build.CPU_ABI, Build.CPU_ABI2}; } else { return Build.SUPPORTED_ABIS; } } /** * Load a library that was downloaded and was not bundled with the Python Host apk. * * @param context The current context. * @param libraryName The name of the library to load. * * @throws LinkageError if the library was not downloaded or it is not in the usual directory. */ @SuppressLint("UnsafeDynamicallyLoadedCode") public static void loadDynamicLibrary(Context context, String libraryName) { System.load(new File(PackageManager.getDynamicLibraryPath(context), System.mapLibraryName(libraryName)).getAbsolutePath()); } /** * Returns a list of all additional libraries installed. * * @param context The current context. * @return A list of {@link File} objects pointing to the library files. */ public static File[] getAdditionalLibraries(Context context) { File[] additionalLibraries = getDynamicLibraryPath(context).listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String filename) { return filename.endsWith(".so") && !filename.matches(".*python\\d+\\.\\d+\\.so") && !filename.endsWith("pythonPatch.so"); } }); return additionalLibraries != null ? additionalLibraries : new File[0]; } /** * Returns a list of all additional Python modules installed for the given Python version. * * @param context The current context. * @param pythonVersion The Python version for which to search for libraries. * @return A list of {@link File} objects pointing to the library files. */ public static File[] getAdditionalModules(Context context, String pythonVersion) { File[] additionalModules = getLibDynLoad(context, pythonVersion).listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String filename) { return filename.endsWith(".so"); } }); return additionalModules != null ? additionalModules : new File[0]; } /** * Loads all additional libraries that are installed. * * @param context The current context. */ @SuppressLint("UnsafeDynamicallyLoadedCode") public static void loadAdditionalLibraries(Context context) { for (File additionalLibrary : getAdditionalLibraries(context)) { System.load(additionalLibrary.getAbsolutePath()); } } /** * Calculates the storage space currently used by the given Python version. * * @param context The current context. * @param pythonVersion The Python version to calculate the used storage space for. * @return The used storage space in bytes. */ public static long getUsedStorageSpace(Context context, String pythonVersion) { File pythonDir = new File(getStandardLibPath(context), "python" + pythonVersion); File pythonLib = new File(PackageManager.getDynamicLibraryPath(context), System.mapLibraryName("python" + pythonVersion)); File pythonModules = new File(PackageManager.getStandardLibPath(context), pythonVersion.replace(".", "") + ".zip"); return pythonLib.length() + pythonModules.length() + Util.calculateDirectorySize(pythonDir); } // Checks that all components of this Python installation are present. public static boolean ensurePythonInstallation(Context context, String pythonVersion, ProgressHandler progressHandler) { return installPythonExecutable(context, progressHandler) //&& installPythonLibraries(context, progressHandler) //&& installPip(context, progressHandler) && checkSitePackagesAvailability(context, pythonVersion, progressHandler); } public static boolean installPythonExecutable(Context context, ProgressHandler progressHandler) { File executable = getPythonExecutable(context); if (executable.exists()) { // TODO: Check if we really need to update it. if (!executable.delete()) { Log.w(MainActivity.TAG, "Could not delete previously installed python executable."); return true; // That's hopefully ok. } } if (progressHandler != null) { progressHandler.enable(context.getString(R.string.install_executable)); } return executable.exists() || Util.installFromInputStream(executable, context.getResources().openRawResource(R.raw.python), progressHandler); } public static boolean installRequirements(final Context context, String requirements, String pythonVersion, final ProgressHandler progressHandler) { return Pip.install(context, pythonVersion, progressHandler) && Pip.installRequirements(context, requirements, pythonVersion, progressHandler); } public static boolean checkSitePackagesAvailability(Context context, String pythonVersion, ProgressHandler progressHandler) { File sitePackages = getSitePackages(context, pythonVersion); if (sitePackages.exists()) { if (!Util.makePathAccessible(sitePackages, context.getFilesDir())) { return false; } ArrayList<File> files = Util.checkDirContentsAccessibility(sitePackages); if (!files.isEmpty()) { if (progressHandler != null) { progressHandler.enable(context.getString(R.string.changing_sitePackages_permissions)); } int i; int size = files.size(); for (i = 0; i < size; i++) { Util.makeFileAccessible(files.get(i), files.get(i).isDirectory()); if (progressHandler != null) { progressHandler.setProgress((float) (i + 1) / size); } } if (progressHandler != null) { progressHandler.setProgress(-1); } } } return true; } public static ArrayList<String> getInstalledDynLibraries(Context context) { ArrayList<String> installedLibs = new ArrayList<>(); File[] files = getDynamicLibraryPath(context).listFiles(); if (files != null) { for (File file : files) { installedLibs.add(Util.getLibraryName(file)); } } return installedLibs; } }
Fix crash during loading of additional dynamic libraries Some of these libraries depend on others to be loaded. The dynamic linker on the Api 19 emulator could load the libraries in the same directory, but the one on the Api 18 emulator does not seem to be able to do so.
app/src/main/java/com/apython/python/pythonhost/PackageManager.java
Fix crash during loading of additional dynamic libraries
<ide><path>pp/src/main/java/com/apython/python/pythonhost/PackageManager.java <ide> */ <ide> @SuppressLint("UnsafeDynamicallyLoadedCode") <ide> public static void loadAdditionalLibraries(Context context) { <del> for (File additionalLibrary : getAdditionalLibraries(context)) { <del> System.load(additionalLibrary.getAbsolutePath()); <add> File[] additionalLibraries = getAdditionalLibraries(context); <add> if (additionalLibraries.length == 0) return; <add> int numPrevFailed = additionalLibraries.length; <add> ArrayList<File> failedLibs = new ArrayList<>(additionalLibraries.length); <add> while (additionalLibraries[0] != null) { <add> for (File additionalLibrary : additionalLibraries) { <add> if (additionalLibrary == null) break; <add> try { <add> System.load(additionalLibrary.getAbsolutePath()); <add> } catch (UnsatisfiedLinkError unused) { <add> failedLibs.add(additionalLibrary); <add> } <add> } <add> if (numPrevFailed == failedLibs.size()) { <add> Log.w(MainActivity.TAG, "The following additional libraries could not be loaded:"); <add> for (File failedLib : failedLibs) { <add> Log.w(MainActivity.TAG, failedLib.getAbsolutePath()); <add> } <add> return; <add> } <add> additionalLibraries = failedLibs.toArray(additionalLibraries); <add> numPrevFailed = failedLibs.size(); <add> failedLibs.clear(); <ide> } <ide> } <ide>
Java
apache-2.0
37836f07fb13681b4557f7e66c07337fb221e079
0
OmniKryptec/OmniKryptec-Engine
/* * Copyright 2017 - 2019 Roman Borris (pcfreak9000), Paul Hagedorn (Panzer1119) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package de.omnikryptec.libapi.exposed.input; import de.omnikryptec.event.EventBus; import de.omnikryptec.event.EventSubscription; import de.omnikryptec.libapi.exposed.window.InputEvent; import de.omnikryptec.util.settings.KeySettings; import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFWKeyCallback; import java.util.Arrays; import java.util.concurrent.atomic.AtomicReference; //FIXME synchronized causes bad performance // Who says that? public class KeyboardHandler implements InputHandler { private final byte[] keys = new byte[GLFW.GLFW_KEY_LAST + 1]; //TODO Test if this includes every key //TODO Maybe this is no longer necessary, because the KeySettings Keys having their own isPressed state, BUT this is necessary, because maybe you want to save ALL key states, so this should stay private final long window; private final GLFWKeyCallback keyCallback; private final AtomicReference<String> inputString = new AtomicReference<>(""); // Configurable variables private final boolean appendToString = false; // Temporary variables private byte[] keysLastTime = null; public KeyboardHandler(EventBus bus) { this(0); bus.register(this); } @EventSubscription public void onKeyEvent(InputEvent.KeyEvent ev) { this.keys[ev.key] = (byte) ev.action; } public KeyboardHandler(final long window) { this.window = window; this.keyCallback = new GLFWKeyCallback() { @Override public void invoke(final long window, final int key, final int scancode, final int action, final int mods) { if (KeyboardHandler.this.window != window) { return; } synchronized (KeyboardHandler.this.keys) { final byte actionByte = (byte) action; KeyboardHandler.this.keys[key] = actionByte; if (KeyboardHandler.this.appendToString && (actionByte == KeySettings.KEY_PRESSED || actionByte == KeySettings.KEY_REPEATED)) { final String keyString = GLFW.glfwGetKeyName(key, scancode); // FIXME Is this deprecated? if (keyString != null) { KeyboardHandler.this.inputString.updateAndGet((inputString_) -> inputString_ + keyString); } } } } }; } @Override public synchronized InputHandler init() { GLFW.glfwSetKeyCallback(this.window, this.keyCallback); return this; } @Override public synchronized InputHandler preUpdate(final double currentTime, final KeySettings keySettings) { this.keysLastTime = Arrays.copyOf(this.keys, this.keys.length); return this; } @Override public synchronized InputHandler update(final double currentTime, final KeySettings keySettings) { for (int i = 0; i < this.keys.length; i++) { if (this.keysLastTime[i] != this.keys[i]) { keySettings.updateKeys(currentTime, i, true, this.keys[i]); } } return this; } @Override public synchronized InputHandler postUpdate(final double currentTime, final KeySettings keySettings) { //this.keysLastTime = null; // Is this good for performance or not? // makes no sense return this; } @Override public synchronized InputHandler close() { if (this.keyCallback != null) { this.keyCallback.close(); } return this; } public synchronized byte getKeyState(final int keyCode) { return this.keys[keyCode]; } public synchronized boolean isKeyUnknown(final int keyCode) { return this.keys[keyCode] == KeySettings.KEY_UNKNOWN; } public synchronized boolean isKeyNothing(final int keyCode) { return this.keys[keyCode] == KeySettings.KEY_NOTHING; } public synchronized boolean isKeyReleased(final int keyCode) { return this.keys[keyCode] == KeySettings.KEY_RELEASED; } public synchronized boolean isKeyPressed(final int keyCode) { return this.keys[keyCode] == KeySettings.KEY_PRESSED; } public synchronized boolean isKeyRepeated(final int keyCode) { return this.keys[keyCode] == KeySettings.KEY_REPEATED; } public synchronized String getInputString() { return this.inputString.get(); } public synchronized void clearInputString() { this.inputString.set(""); } public synchronized String consumeInputString() { final String temp = getInputString(); clearInputString(); return temp; } public int size() { return this.keys.length; } public long getWindow() { return this.window; } }
src/main/java/de/omnikryptec/libapi/exposed/input/KeyboardHandler.java
/* * Copyright 2017 - 2019 Roman Borris (pcfreak9000), Paul Hagedorn (Panzer1119) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package de.omnikryptec.libapi.exposed.input; import java.util.Arrays; import java.util.concurrent.atomic.AtomicReference; import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFWKeyCallback; import de.omnikryptec.event.EventBus; import de.omnikryptec.event.EventSubscription; import de.omnikryptec.libapi.exposed.window.InputEvent; import de.omnikryptec.util.settings.KeySettings; //FIXME synchronized causes bad performance // Who says that? public class KeyboardHandler implements InputHandler { // private final InputState[] keys = new InputState[65536]; //TODO Clean this // private final byte[] keys = new byte[65536]; //TODO Clean this private final byte[] keys = new byte[GLFW.GLFW_KEY_LAST + 1]; //TODO Test if this includes every key //TODO Maybe this is no longer necessary, because the KeySettings Keys having their own isPressed state, BUT this is necessary, because maybe you want to save ALL key states, so this should stay private final KeyboardHandler ME = this; private final long window; private final GLFWKeyCallback keyCallback; private final AtomicReference<String> inputString = new AtomicReference<>(""); // Configurable variables private final boolean appendToString = false; // Temporary variables private byte[] keysLastTime = null; public KeyboardHandler(EventBus bus) { this(0); bus.register(this); } @EventSubscription public void onKeyEvent(InputEvent.KeyEvent ev) { this.keys[ev.key] = (byte) ev.action; } public KeyboardHandler(final long window) { this.window = window; this.keyCallback = new GLFWKeyCallback() { @Override public void invoke(final long window, final int key, final int scancode, final int action, final int mods) { if (KeyboardHandler.this.ME.window != window) { return; } synchronized (KeyboardHandler.this.keys) { // final InputState inputState = InputState.ofState(action); //TODO Clean this // keys[key] = inputState; //TODO Clean this final byte actionByte = (byte) action; KeyboardHandler.this.keys[key] = actionByte; if (KeyboardHandler.this.appendToString && (actionByte == KeySettings.KEY_PRESSED || actionByte == KeySettings.KEY_REPEATED)) { final String keyString = GLFW.glfwGetKeyName(key, scancode); // FIXME Is this deprecated? if (keyString != null) { KeyboardHandler.this.inputString.updateAndGet((inputString_) -> inputString_ + keyString); } } } } }; } @Override public synchronized InputHandler init() { GLFW.glfwSetKeyCallback(this.window, this.keyCallback); return this; } @Override public synchronized InputHandler preUpdate(final double currentTime, final KeySettings keySettings) { this.keysLastTime = Arrays.copyOf(this.keys, this.keys.length); return this; } @Override public synchronized InputHandler update(final double currentTime, final KeySettings keySettings) { for (int i = 0; i < this.keys.length; i++) { if (this.keysLastTime[i] != this.keys[i]) { keySettings.updateKeys(currentTime, i, true, this.keys[i]); } } return this; } @Override public synchronized InputHandler postUpdate(final double currentTime, final KeySettings keySettings) { //this.keysLastTime = null; // Is this good for performance or not? // makes no sense return this; } @Override public synchronized InputHandler close() { if (this.keyCallback != null) { this.keyCallback.close(); } return this; } /* * //TODO Clean this public synchronized InputState getKeyState(int keyCode) { * return keys[keyCode]; } */ public synchronized byte getKeyState(final int keyCode) { return this.keys[keyCode]; } public synchronized boolean isKeyUnknown(final int keyCode) { return this.keys[keyCode] == KeySettings.KEY_UNKNOWN; } public synchronized boolean isKeyNothing(final int keyCode) { return this.keys[keyCode] == KeySettings.KEY_NOTHING; } public synchronized boolean isKeyReleased(final int keyCode) { return this.keys[keyCode] == KeySettings.KEY_RELEASED; } public synchronized boolean isKeyPressed(final int keyCode) { return this.keys[keyCode] == KeySettings.KEY_PRESSED; } public synchronized boolean isKeyRepeated(final int keyCode) { return this.keys[keyCode] == KeySettings.KEY_REPEATED; } public synchronized String getInputString() { return this.inputString.get(); } public synchronized void clearInputString() { this.inputString.set(""); } public synchronized String consumeInputString() { final String temp = getInputString(); clearInputString(); return temp; } public int size() { return this.keys.length; } public long getWindow() { return this.window; } }
Edited KeyboardHandler.java Signed-off-by: Paul Hagedorn <[email protected]>
src/main/java/de/omnikryptec/libapi/exposed/input/KeyboardHandler.java
Edited KeyboardHandler.java
<ide><path>rc/main/java/de/omnikryptec/libapi/exposed/input/KeyboardHandler.java <ide> <ide> package de.omnikryptec.libapi.exposed.input; <ide> <del>import java.util.Arrays; <del>import java.util.concurrent.atomic.AtomicReference; <del> <del>import org.lwjgl.glfw.GLFW; <del>import org.lwjgl.glfw.GLFWKeyCallback; <del> <ide> import de.omnikryptec.event.EventBus; <ide> import de.omnikryptec.event.EventSubscription; <ide> import de.omnikryptec.libapi.exposed.window.InputEvent; <ide> import de.omnikryptec.util.settings.KeySettings; <add>import org.lwjgl.glfw.GLFW; <add>import org.lwjgl.glfw.GLFWKeyCallback; <add> <add>import java.util.Arrays; <add>import java.util.concurrent.atomic.AtomicReference; <ide> <ide> //FIXME synchronized causes bad performance // Who says that? <ide> public class KeyboardHandler implements InputHandler { <ide> <del> // private final InputState[] keys = new InputState[65536]; //TODO Clean this <del> // private final byte[] keys = new byte[65536]; //TODO Clean this <ide> private final byte[] keys = new byte[GLFW.GLFW_KEY_LAST + 1]; //TODO Test if this includes every key //TODO Maybe this is no longer necessary, because the KeySettings Keys having their own isPressed state, BUT this is necessary, because maybe you want to save ALL key states, so this should stay <del> private final KeyboardHandler ME = this; <ide> private final long window; <ide> private final GLFWKeyCallback keyCallback; <ide> private final AtomicReference<String> inputString = new AtomicReference<>(""); <ide> this.keyCallback = new GLFWKeyCallback() { <ide> @Override <ide> public void invoke(final long window, final int key, final int scancode, final int action, final int mods) { <del> if (KeyboardHandler.this.ME.window != window) { <add> if (KeyboardHandler.this.window != window) { <ide> return; <ide> } <ide> synchronized (KeyboardHandler.this.keys) { <del> // final InputState inputState = InputState.ofState(action); //TODO Clean this <del> // keys[key] = inputState; //TODO Clean this <ide> final byte actionByte = (byte) action; <ide> KeyboardHandler.this.keys[key] = actionByte; <del> if (KeyboardHandler.this.appendToString <del> && (actionByte == KeySettings.KEY_PRESSED || actionByte == KeySettings.KEY_REPEATED)) { <add> if (KeyboardHandler.this.appendToString && (actionByte == KeySettings.KEY_PRESSED || actionByte == KeySettings.KEY_REPEATED)) { <ide> final String keyString = GLFW.glfwGetKeyName(key, scancode); // FIXME Is this deprecated? <ide> if (keyString != null) { <ide> KeyboardHandler.this.inputString.updateAndGet((inputString_) -> inputString_ + keyString); <ide> } <ide> return this; <ide> } <del> <del> /* <del> * //TODO Clean this public synchronized InputState getKeyState(int keyCode) { <del> * return keys[keyCode]; } <del> */ <ide> <ide> public synchronized byte getKeyState(final int keyCode) { <ide> return this.keys[keyCode];
Java
apache-2.0
25814d341d0278348b74a92679148145fc943d58
0
adairtaosy/spring-security,diegofernandes/spring-security,dsyer/spring-security,pwheel/spring-security,mdeinum/spring-security,forestqqqq/spring-security,tekul/spring-security,pwheel/spring-security,rwinch/spring-security,panchenko/spring-security,Xcorpio/spring-security,adairtaosy/spring-security,Peter32/spring-security,tekul/spring-security,follow99/spring-security,olezhuravlev/spring-security,dsyer/spring-security,Xcorpio/spring-security,chinazhaoht/spring-security,justinedelson/spring-security,ractive/spring-security,zshift/spring-security,spring-projects/spring-security,follow99/spring-security,zhaoqin102/spring-security,chinazhaoht/spring-security,likaiwalkman/spring-security,mparaz/spring-security,xingguang2013/spring-security,zgscwjm/spring-security,fhanik/spring-security,xingguang2013/spring-security,vitorgv/spring-security,Xcorpio/spring-security,djechelon/spring-security,driftman/spring-security,djechelon/spring-security,spring-projects/spring-security,pkdevbox/spring-security,raindev/spring-security,spring-projects/spring-security,olezhuravlev/spring-security,panchenko/spring-security,yinhe402/spring-security,yinhe402/spring-security,caiwenshu/spring-security,Krasnyanskiy/spring-security,izeye/spring-security,wilkinsona/spring-security,zhaoqin102/spring-security,fhanik/spring-security,thomasdarimont/spring-security,caiwenshu/spring-security,mrkingybc/spring-security,panchenko/spring-security,liuguohua/spring-security,tekul/spring-security,Krasnyanskiy/spring-security,fhanik/spring-security,Krasnyanskiy/spring-security,xingguang2013/spring-security,mounb/spring-security,pwheel/spring-security,jgrandja/spring-security,forestqqqq/spring-security,Peter32/spring-security,kazuki43zoo/spring-security,rwinch/spring-security,izeye/spring-security,olezhuravlev/spring-security,Peter32/spring-security,liuguohua/spring-security,jmnarloch/spring-security,olezhuravlev/spring-security,thomasdarimont/spring-security,wilkinsona/spring-security,kazuki43zoo/spring-security,mdeinum/spring-security,ajdinhedzic/spring-security,tekul/spring-security,spring-projects/spring-security,forestqqqq/spring-security,mrkingybc/spring-security,zgscwjm/spring-security,Krasnyanskiy/spring-security,wkorando/spring-security,caiwenshu/spring-security,wkorando/spring-security,pkdevbox/spring-security,jmnarloch/spring-security,justinedelson/spring-security,jgrandja/spring-security,mounb/spring-security,wilkinsona/spring-security,djechelon/spring-security,adairtaosy/spring-security,eddumelendez/spring-security,mrkingybc/spring-security,MatthiasWinzeler/spring-security,ractive/spring-security,follow99/spring-security,rwinch/spring-security,mounb/spring-security,vitorgv/spring-security,mparaz/spring-security,thomasdarimont/spring-security,pkdevbox/spring-security,rwinch/spring-security,liuguohua/spring-security,rwinch/spring-security,driftman/spring-security,Xcorpio/spring-security,wilkinsona/spring-security,hippostar/spring-security,cyratech/spring-security,spring-projects/spring-security,dsyer/spring-security,izeye/spring-security,diegofernandes/spring-security,zshift/spring-security,ajdinhedzic/spring-security,MatthiasWinzeler/spring-security,kazuki43zoo/spring-security,mdeinum/spring-security,justinedelson/spring-security,justinedelson/spring-security,thomasdarimont/spring-security,MatthiasWinzeler/spring-security,zhaoqin102/spring-security,likaiwalkman/spring-security,eddumelendez/spring-security,fhanik/spring-security,diegofernandes/spring-security,Peter32/spring-security,panchenko/spring-security,ollie314/spring-security,zgscwjm/spring-security,pwheel/spring-security,eddumelendez/spring-security,fhanik/spring-security,follow99/spring-security,rwinch/spring-security,caiwenshu/spring-security,hippostar/spring-security,jgrandja/spring-security,pkdevbox/spring-security,diegofernandes/spring-security,liuguohua/spring-security,likaiwalkman/spring-security,zgscwjm/spring-security,hippostar/spring-security,cyratech/spring-security,vitorgv/spring-security,cyratech/spring-security,raindev/spring-security,djechelon/spring-security,mrkingybc/spring-security,driftman/spring-security,SanjayUser/SpringSecurityPro,zshift/spring-security,djechelon/spring-security,yinhe402/spring-security,eddumelendez/spring-security,mparaz/spring-security,chinazhaoht/spring-security,jgrandja/spring-security,ractive/spring-security,raindev/spring-security,ollie314/spring-security,xingguang2013/spring-security,vitorgv/spring-security,mounb/spring-security,forestqqqq/spring-security,wkorando/spring-security,fhanik/spring-security,jgrandja/spring-security,raindev/spring-security,thomasdarimont/spring-security,SanjayUser/SpringSecurityPro,ractive/spring-security,SanjayUser/SpringSecurityPro,chinazhaoht/spring-security,driftman/spring-security,ollie314/spring-security,dsyer/spring-security,MatthiasWinzeler/spring-security,ajdinhedzic/spring-security,yinhe402/spring-security,adairtaosy/spring-security,spring-projects/spring-security,zhaoqin102/spring-security,pwheel/spring-security,izeye/spring-security,mparaz/spring-security,wkorando/spring-security,SanjayUser/SpringSecurityPro,spring-projects/spring-security,mdeinum/spring-security,jmnarloch/spring-security,olezhuravlev/spring-security,ollie314/spring-security,ajdinhedzic/spring-security,likaiwalkman/spring-security,cyratech/spring-security,hippostar/spring-security,eddumelendez/spring-security,jmnarloch/spring-security,zshift/spring-security,jgrandja/spring-security,dsyer/spring-security,kazuki43zoo/spring-security,kazuki43zoo/spring-security,SanjayUser/SpringSecurityPro
/* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.security.ui.logout; import org.springframework.security.Authentication; import org.springframework.security.context.SecurityContextHolder; import org.springframework.util.Assert; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; /** * Performs a logout by modifying the {@link org.springframework.security.context.SecurityContextHolder}. * <p> * Will also invalidate the {@link HttpSession} if {@link #isInvalidateHttpSession()} is <code>true</code> and the * session is not <code>null</code>. * * @author Ben Alex * @version $Id$ */ public class SecurityContextLogoutHandler implements LogoutHandler { private boolean invalidateHttpSession = true; //~ Methods ======================================================================================================== /** * Requires the request to be passed in. * * @param request from which to obtain a HTTP session (cannot be null) * @param response not used (can be <code>null</code>) * @param authentication not used (can be <code>null</code>) */ public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { Assert.notNull(request, "HttpServletRequest required"); if (invalidateHttpSession) { HttpSession session = request.getSession(false); if (session != null) { session.invalidate(); } } SecurityContextHolder.clearContext(); } public boolean isInvalidateHttpSession() { return invalidateHttpSession; } /** * Causes the {@link HttpSession} to be invalidated when this {@link LogoutHandler} is invoked. Defaults to true. * * @param invalidateHttpSession true if you wish the session to be invalidated (default) or false if it should * not be. */ public void setInvalidateHttpSession(boolean invalidateHttpSession) { this.invalidateHttpSession = invalidateHttpSession; } }
core/src/main/java/org/springframework/security/ui/logout/SecurityContextLogoutHandler.java
/* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.security.ui.logout; import org.springframework.security.Authentication; import org.springframework.security.context.SecurityContextHolder; import org.springframework.util.Assert; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; /** * Performs a logout by modifying the {@link org.springframework.security.context.SecurityContextHolder}. * <p> * Will also invalidate the {@link HttpSession} if {@link #isInvalidateHttpSession()} is <code>true</code> and the * session is not <code>null</code>. * * @author Ben Alex * @version $Id$ */ public class SecurityContextLogoutHandler implements LogoutHandler { //~ Methods ======================================================================================================== private boolean invalidateHttpSession = true; /** * Requires the request to be passed in. * * @param request from which to obtain a HTTP session (cannot be null) * @param response not used (can be <code>null</code>) * @param authentication not used (can be <code>null</code>) */ public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { Assert.notNull(request, "HttpServletRequest required"); if (invalidateHttpSession) { HttpSession session = request.getSession(false); if (session != null) { session.invalidate(); } } SecurityContextHolder.clearContext(); } public boolean isInvalidateHttpSession() { return invalidateHttpSession; } /** * Causes the {@link HttpSession} to be invalidated when this {@link LogoutHandler} is invoked. Defaults to true. * * @param invalidateHttpSession true if you wish the session to be invalidated (default) or false if it should * not be. */ public void setInvalidateHttpSession(boolean invalidateHttpSession) { this.invalidateHttpSession = invalidateHttpSession; } }
Tidying.
core/src/main/java/org/springframework/security/ui/logout/SecurityContextLogoutHandler.java
Tidying.
<ide><path>ore/src/main/java/org/springframework/security/ui/logout/SecurityContextLogoutHandler.java <ide> * @version $Id$ <ide> */ <ide> public class SecurityContextLogoutHandler implements LogoutHandler { <add> private boolean invalidateHttpSession = true; <add> <ide> //~ Methods ======================================================================================================== <del> <del> private boolean invalidateHttpSession = true; <ide> <ide> /** <ide> * Requires the request to be passed in. <ide> */ <ide> public void setInvalidateHttpSession(boolean invalidateHttpSession) { <ide> this.invalidateHttpSession = invalidateHttpSession; <del> } <add> } <ide> <ide> }
Java
bsd-3-clause
2b75959b07620f76c83c735377edd0d31b9baa23
0
Clunker5/tregmine-2.0,Clunker5/tregmine-2.0
package info.tregmine.commands; import static org.bukkit.ChatColor.AQUA; import static org.bukkit.ChatColor.RED; import static org.bukkit.ChatColor.YELLOW; import java.util.List; import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.World; import info.tregmine.Tregmine; import info.tregmine.api.TregminePlayer; import info.tregmine.database.DAOException; import info.tregmine.database.IContext; import info.tregmine.database.IHomeDAO; public class HomeCommand extends AbstractCommand { private Tregmine tregmine; public HomeCommand(Tregmine tregmine) { super(tregmine, "home"); this.tregmine = tregmine; } private boolean deleteHome(TregminePlayer player, String name) { if (!player.getRank().canSaveHome()) { return true; } Location playerLoc = player.getLocation(); World playerWorld = playerLoc.getWorld(); if ("world_the_end".equalsIgnoreCase(playerWorld.getName())) { player.sendStringMessage(RED + "You can't set your home in The End"); return true; } try (IContext ctx = tregmine.createContext()) { IHomeDAO homeDAO = ctx.getHomeDAO(); homeDAO.deleteHome(player.getId(), name); } catch (DAOException e) { throw new RuntimeException(e); } player.sendStringMessage(AQUA + "Home " + name + " deleted!"); return true; } @Override public boolean handlePlayer(TregminePlayer player, String[] args) { if (args.length == 0) { return teleport(player, "default"); } else if ("save".equalsIgnoreCase(args[0])) { if (args.length == 2) { return save(player, args[1]); } else { return save(player, "default"); } } else if ("delete".equalsIgnoreCase(args[0]) && args.length == 2) { return deleteHome(player, args[1]); } else if ("go".equalsIgnoreCase(args[0])) { if (args.length < 2) { player.sendStringMessage(RED + "Usage: /home go <name>."); return true; } return teleport(player, args[1]); } else if ("list".equalsIgnoreCase(args[0])) { if (args.length == 2) { return list(player, args[1]); } else { return list(player, null); } } else if ("to".equalsIgnoreCase(args[0])) { if (args.length == 3) { return teleportTo(player, args[1], args[2]); } else if (args.length == 2) { return teleportTo(player, args[1], "default"); } else if (args.length < 2) { player.sendStringMessage(RED + "Usage: /home to <player> <name>"); return true; } } else { player.sendStringMessage(RED + "Incorrect Usage:"); player.sendStringMessage(RED + "/home go <home name> - To go to a home"); player.sendStringMessage(RED + "/home save <home name> - To save a home"); player.sendStringMessage(RED + "/home delete <home name> - To delete a home"); player.sendStringMessage(RED + "/home list - To list your homes"); if (player.getRank().canVisitHomes()) { player.sendStringMessage(RED + "/home to <player> <name>"); } } return true; } private boolean list(TregminePlayer player, String playerName) { TregminePlayer target = player; if (playerName != null) { if (!player.getRank().canVisitHomes()) { return true; } target = tregmine.getPlayerOffline(playerName); if (target == null) { player.sendStringMessage(RED + playerName + " was not found in database."); return true; } } List<String> names = null; try (IContext ctx = tregmine.createContext()) { IHomeDAO homeDAO = ctx.getHomeDAO(); names = homeDAO.getHomeNames(target.getId()); } catch (DAOException e) { throw new RuntimeException(e); } if (names.size() > 0) { StringBuilder buffer = new StringBuilder(); String delim = ""; for (String name : names) { buffer.append(delim); buffer.append(name); delim = ", "; } player.sendStringMessage(YELLOW + "List of homes:"); player.sendStringMessage(YELLOW + buffer.toString()); } else { player.sendStringMessage(YELLOW + "No homes found!"); } return true; } private boolean save(TregminePlayer player, String name) { if (!player.getRank().canSaveHome()) { return true; } Location playerLoc = player.getLocation(); World playerWorld = playerLoc.getWorld(); if ("world_the_end".equalsIgnoreCase(playerWorld.getName())) { player.sendStringMessage(RED + "You can't set your home in The End"); return true; } try (IContext ctx = tregmine.createContext()) { IHomeDAO homeDAO = ctx.getHomeDAO(); List<String> homes = homeDAO.getHomeNames(player.getId()); int limit = player.getRank().getHomeLimit(); if (homes.size() > limit) { player.sendStringMessage(RED + "You can't have more than " + limit + " homes."); return true; } homeDAO.insertHome(player, name, playerLoc); } catch (DAOException e) { throw new RuntimeException(e); } player.sendStringMessage(AQUA + "Home saved!"); return true; } private boolean teleport(TregminePlayer player, String name) { Location loc = null; try (IContext ctx = tregmine.createContext()) { IHomeDAO homeDAO = ctx.getHomeDAO(); loc = homeDAO.getHome(player, name); } catch (DAOException e) { throw new RuntimeException(e); } if (loc == null) { player.sendStringMessage(RED + "Telogric lift malfunctioned. " + "Teleportation failed."); return true; } World world = loc.getWorld(); Chunk chunk = world.getChunkAt(loc); world.loadChunk(chunk); if (world.isChunkLoaded(chunk)) { if (!world.getName().equalsIgnoreCase(player.getWorld().getName())) { player.sendStringMessage(RED + "You can't use a home thats in another world!"); return true; } player.teleportWithHorse(loc); player.sendStringMessage(AQUA + "Hoci poci, little gnome. Magic worked, " + "you're in your home!"); } else { player.sendStringMessage(RED + "Loading your home chunk failed, try /home again."); } return true; } private boolean teleportTo(TregminePlayer player, String playerName, String name) { if (!player.getRank().canVisitHomes()) { player.sendStringMessage(RED + "You can't teleport to other player's homes"); } TregminePlayer target = tregmine.getPlayerOffline(playerName); if (target == null) { player.sendStringMessage(RED + playerName + " was not found in database."); return true; } Location loc = null; try (IContext ctx = tregmine.createContext()) { IHomeDAO homeDAO = ctx.getHomeDAO(); loc = homeDAO.getHome(target.getId(), name, tregmine.getServer()); } catch (DAOException e) { throw new RuntimeException(e); } if (loc == null) { player.sendStringMessage(RED + "Telogric lift malfunctioned. Teleportation failed."); return true; } World world = loc.getWorld(); Chunk chunk = world.getChunkAt(loc); world.loadChunk(chunk); if (world.isChunkLoaded(chunk)) { player.teleportWithHorse(loc); player.sendStringMessage(AQUA + "Like a drunken gnome, you fly across the world to " + playerName + "'s home. Try not to hit any birds."); } else { player.sendStringMessage(RED + "Loading of home chunk failed, try /home again"); } return true; } }
src/info/tregmine/commands/HomeCommand.java
package info.tregmine.commands; import static org.bukkit.ChatColor.AQUA; import static org.bukkit.ChatColor.RED; import static org.bukkit.ChatColor.YELLOW; import java.util.List; import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.World; import info.tregmine.Tregmine; import info.tregmine.api.TregminePlayer; import info.tregmine.api.UUIDFetcher; import info.tregmine.database.DAOException; import info.tregmine.database.IContext; import info.tregmine.database.IHomeDAO; public class HomeCommand extends AbstractCommand { private Tregmine tregmine; public HomeCommand(Tregmine tregmine) { super(tregmine, "home"); this.tregmine = tregmine; } private boolean deleteHome(TregminePlayer player, String name) { if (!player.getRank().canSaveHome()) { return true; } Location playerLoc = player.getLocation(); World playerWorld = playerLoc.getWorld(); if ("world_the_end".equalsIgnoreCase(playerWorld.getName())) { player.sendStringMessage(RED + "You can't set your home in The End"); return true; } try (IContext ctx = tregmine.createContext()) { IHomeDAO homeDAO = ctx.getHomeDAO(); homeDAO.deleteHome(player.getId(), name); } catch (DAOException e) { throw new RuntimeException(e); } player.sendStringMessage(AQUA + "Home " + name + " deleted!"); return true; } @Override public boolean handlePlayer(TregminePlayer player, String[] args) { if (args.length == 0) { return teleport(player, "default"); } else if ("save".equalsIgnoreCase(args[0])) { if (args.length == 2) { return save(player, args[1]); } else { return save(player, "default"); } } else if ("delete".equalsIgnoreCase(args[0]) && args.length == 2) { return deleteHome(player, args[1]); } else if ("go".equalsIgnoreCase(args[0])) { if (args.length < 2) { player.sendStringMessage(RED + "Usage: /home go <name>."); return true; } return teleport(player, args[1]); } else if ("list".equalsIgnoreCase(args[0])) { if (args.length == 2) { return list(player, args[1]); } else { return list(player, null); } } else if ("to".equalsIgnoreCase(args[0])) { if (args.length == 3) { return teleportTo(player, args[1], args[2]); } else if (args.length == 2) { return teleportTo(player, args[1], "default"); } else if (args.length < 2) { player.sendStringMessage(RED + "Usage: /home to <player> <name>"); return true; } } else { player.sendStringMessage(RED + "Incorrect Usage:"); player.sendStringMessage(RED + "/home go <home name> - To go to a home"); player.sendStringMessage(RED + "/home save <home name> - To save a home"); player.sendStringMessage(RED + "/home delete <home name> - To delete a home"); player.sendStringMessage(RED + "/home list - To list your homes"); if (player.getRank().canVisitHomes()) { player.sendStringMessage(RED + "/home to <player> <name>"); } } return true; } private boolean list(TregminePlayer player, String playerName) { TregminePlayer target = player; if (playerName != null) { if (!player.getRank().canVisitHomes()) { return true; } target = tregmine.getPlayerOffline(playerName); if (target == null) { player.sendStringMessage(RED + playerName + " was not found in database."); return true; } } List<String> names = null; try (IContext ctx = tregmine.createContext()) { IHomeDAO homeDAO = ctx.getHomeDAO(); names = homeDAO.getHomeNames(target.getId()); } catch (DAOException e) { throw new RuntimeException(e); } if (names.size() > 0) { StringBuilder buffer = new StringBuilder(); String delim = ""; for (String name : names) { buffer.append(delim); buffer.append(name); delim = ", "; } player.sendStringMessage(YELLOW + "List of homes:"); player.sendStringMessage(YELLOW + buffer.toString()); } else { player.sendStringMessage(YELLOW + "No homes found!"); } return true; } private boolean save(TregminePlayer player, String name) { if (!player.getRank().canSaveHome()) { return true; } Location playerLoc = player.getLocation(); World playerWorld = playerLoc.getWorld(); if ("world_the_end".equalsIgnoreCase(playerWorld.getName())) { player.sendStringMessage(RED + "You can't set your home in The End"); return true; } try (IContext ctx = tregmine.createContext()) { IHomeDAO homeDAO = ctx.getHomeDAO(); List<String> homes = homeDAO.getHomeNames(player.getId()); int limit = player.getRank().getHomeLimit(); if (homes.size() > limit) { player.sendStringMessage(RED + "You can't have more than " + limit + " homes."); return true; } homeDAO.insertHome(player, name, playerLoc); } catch (DAOException e) { throw new RuntimeException(e); } player.sendStringMessage(AQUA + "Home saved!"); return true; } private boolean teleport(TregminePlayer player, String name) { Location loc = null; try (IContext ctx = tregmine.createContext()) { IHomeDAO homeDAO = ctx.getHomeDAO(); loc = homeDAO.getHome(player, name); } catch (DAOException e) { throw new RuntimeException(e); } if (loc == null) { player.sendStringMessage(RED + "Telogric lift malfunctioned. " + "Teleportation failed."); return true; } World world = loc.getWorld(); Chunk chunk = world.getChunkAt(loc); world.loadChunk(chunk); if (world.isChunkLoaded(chunk)) { if (!world.getName().equalsIgnoreCase(player.getWorld().getName())) { player.sendStringMessage(RED + "You can't use a home thats in another world!"); return true; } player.teleportWithHorse(loc); player.sendStringMessage(AQUA + "Hoci poci, little gnome. Magic worked, " + "you're in your home!"); } else { player.sendStringMessage(RED + "Loading your home chunk failed, try /home again."); } return true; } private boolean teleportTo(TregminePlayer player, String playerName, String name) { if (!player.getRank().canVisitHomes()) { player.sendStringMessage(RED + "You can't teleport to other player's homes"); } TregminePlayer target = tregmine.getPlayerOffline(playerName); if (target == null) { player.sendStringMessage(RED + playerName + " was not found in database."); return true; } Location loc = null; try (IContext ctx = tregmine.createContext()) { IHomeDAO homeDAO = ctx.getHomeDAO(); loc = homeDAO.getHome(target.getId(), name, tregmine.getServer()); } catch (DAOException e) { throw new RuntimeException(e); } if (loc == null) { player.sendStringMessage(RED + "Telogric lift malfunctioned. Teleportation failed."); return true; } World world = loc.getWorld(); Chunk chunk = world.getChunkAt(loc); world.loadChunk(chunk); if (world.isChunkLoaded(chunk)) { player.teleportWithHorse(loc); player.sendStringMessage(AQUA + "Like a drunken gnome, you fly across the world to " + playerName + "'s home. Try not to hit any birds."); } else { player.sendStringMessage(RED + "Loading of home chunk failed, try /home again"); } return true; } }
Removed reference of UUIDFetcher
src/info/tregmine/commands/HomeCommand.java
Removed reference of UUIDFetcher
<ide><path>rc/info/tregmine/commands/HomeCommand.java <ide> <ide> import info.tregmine.Tregmine; <ide> import info.tregmine.api.TregminePlayer; <del>import info.tregmine.api.UUIDFetcher; <ide> import info.tregmine.database.DAOException; <ide> import info.tregmine.database.IContext; <ide> import info.tregmine.database.IHomeDAO;
JavaScript
mit
7d7ff04fd26f0159ccae9c8528391389834c57d6
0
leungwensen/xmind-sdk-node,leungwensen/xmind-sdk-node
/* jshint undef: true, unused: true, node: true */ /* global require, describe, it */ var assert = require('assert'); //var path = require('path'), //resolve = path.resolve; var xmind = require('../../index'), Workbook = xmind.Workbook; describe('Workbook', function () { it('creating with first sheet name and root topic name', function () { assert.doesNotThrow(function() { console.log(new Workbook({ firstSheetName: 'hello', rootTopicName: 'world', }).toJSON()); }, 'failed to create a Workbook instance'); }); it('creating with doc, stylesDoc and attachments', function () { }); });
test/mocha/workbook.spec.js
/* jshint undef: true, unused: true, node: true */ /* global require, describe, it */ var assert = require('assert'); //var path = require('path'), //resolve = path.resolve; var xmind = require('../../index'), Workbook = xmind.Workbook; describe('Workbook', function () { it('creating with first sheet name and root topic name', function () { assert.doesNotThrow(function() { new Workbook({ firstSheetName: 'hello', rootTopicName: 'world', }); }, 'failed to create a Workbook instance'); }); it('creating with doc, stylesDoc and attachments', function () { }); });
check data structure
test/mocha/workbook.spec.js
check data structure
<ide><path>est/mocha/workbook.spec.js <ide> describe('Workbook', function () { <ide> it('creating with first sheet name and root topic name', function () { <ide> assert.doesNotThrow(function() { <del> new Workbook({ <add> console.log(new Workbook({ <ide> firstSheetName: 'hello', <ide> rootTopicName: 'world', <del> }); <add> }).toJSON()); <ide> }, 'failed to create a Workbook instance'); <ide> }); <ide> it('creating with doc, stylesDoc and attachments', function () {
Java
mit
9018d628185eac8fa105f72c18cb797032728c4e
0
chengtalent/ethereumj,loxal/FreeEthereum,loxal/ethereumj,loxal/FreeEthereum,caxqueiroz/ethereumj,loxal/FreeEthereum
package org.ethereum.config; import com.typesafe.config.*; import org.junit.Assert; import org.junit.Test; import java.io.File; import java.util.List; import java.util.Map; /** * Created by Anton Nashatyrev on 13.07.2015. */ public class ConfigTest { @Test public void simpleTest() { Config config = ConfigFactory.parseResources("ethereumj.conf"); System.out.println(config.root().render(ConfigRenderOptions.defaults().setComments(false))); for (Map.Entry<String, ConfigValue> entry : config.entrySet()) { // System.out.println("Name: " + entry.getKey()); // System.out.println(entry); } System.out.println("peer.listen.port: " + config.getInt("peer.listen.port")); System.out.println("peer.discovery.ip.list: " + config.getAnyRefList("peer.discovery.ip.list")); System.out.println("peer.discovery.ip.list: " + config.getAnyRefList("peer.active")); List<? extends ConfigObject> list = config.getObjectList("peer.active"); for (ConfigObject configObject : list) { if (configObject.get("url") != null) { System.out.println("URL: " + configObject.get("url")); } if (configObject.get("ip") != null) { System.out.println("IP: " + configObject); } } System.out.println("blocks.loader = " + config.hasPath("blocks.loader")); System.out.println("blocks.loader = " + config.getAnyRef("blocks.loader")); } @Test public void fallbackTest() { System.setProperty("blocks.loader", "bla-bla"); Config config = ConfigFactory.load("ethereumj.conf"); // Ignore this assertion since the SystemProperties are loaded by the static initializer // so if the ConfigFactory was used prior to this test the setProperty() has no effect // Assert.assertEquals("bla-bla", config.getString("blocks.loader")); String string = config.getString("keyvalue.datasource"); Assert.assertNotNull(string); Config overrides = ConfigFactory.parseString("blocks.loader=another, peer.active=[{url=sdfsfd}]"); Config merged = overrides.withFallback(config); Assert.assertEquals("another", merged.getString("blocks.loader")); Assert.assertTrue(merged.getObjectList("peer.active").size() == 1); Assert.assertNotNull(merged.getString("keyvalue.datasource")); Config emptyConf = ConfigFactory.parseFile(new File("nosuchfile.conf"), ConfigParseOptions.defaults()); Assert.assertFalse(emptyConf.hasPath("blocks.loader")); } @Test public void ethereumjConfTest() { System.out.println("'" + SystemProperties.CONFIG.databaseDir() + "'"); System.out.println(SystemProperties.CONFIG.peerActive()); } }
ethereumj-core/src/test/java/org/ethereum/config/ConfigTest.java
package org.ethereum.config; import com.typesafe.config.*; import org.junit.Assert; import org.junit.Test; import java.io.File; import java.util.List; import java.util.Map; /** * Created by Anton Nashatyrev on 13.07.2015. */ public class ConfigTest { @Test public void simpleTest() { Config config = ConfigFactory.parseResources("ethereumj.conf"); System.out.println(config.root().render(ConfigRenderOptions.defaults().setComments(false))); for (Map.Entry<String, ConfigValue> entry : config.entrySet()) { // System.out.println("Name: " + entry.getKey()); // System.out.println(entry); } System.out.println("peer.listen.port: " + config.getInt("peer.listen.port")); System.out.println("peer.discovery.ip.list: " + config.getAnyRefList("peer.discovery.ip.list")); System.out.println("peer.discovery.ip.list: " + config.getAnyRefList("peer.active")); List<? extends ConfigObject> list = config.getObjectList("peer.active"); for (ConfigObject configObject : list) { if (configObject.get("url") != null) { System.out.println("URL: " + configObject.get("url")); } if (configObject.get("ip") != null) { System.out.println("IP: " + configObject); } } System.out.println("blocks.loader = " + config.hasPath("blocks.loader")); System.out.println("blocks.loader = " + config.getAnyRef("blocks.loader")); } @Test public void fallbackTest() { System.setProperty("blocks.loader", "bla-bla"); Config config = ConfigFactory.load("ethereumj.conf"); Assert.assertEquals("bla-bla", config.getString("blocks.loader")); String string = config.getString("keyvalue.datasource"); Assert.assertNotNull(string); Config overrides = ConfigFactory.parseString("blocks.loader=another, peer.active=[{url=sdfsfd}]"); Config merged = overrides.withFallback(config); Assert.assertEquals("another", merged.getString("blocks.loader")); Assert.assertTrue(merged.getObjectList("peer.active").size() == 1); Assert.assertNotNull(merged.getString("keyvalue.datasource")); Config emptyConf = ConfigFactory.parseFile(new File("nosuchfile.conf"), ConfigParseOptions.defaults()); Assert.assertFalse(emptyConf.hasPath("blocks.loader")); } @Test public void ethereumjConfTest() { System.out.println("'" + SystemProperties.CONFIG.databaseDir() + "'"); System.out.println(SystemProperties.CONFIG.peerActive()); } }
Comment test assertion which may fail due to unpredictable tests order
ethereumj-core/src/test/java/org/ethereum/config/ConfigTest.java
Comment test assertion which may fail due to unpredictable tests order
<ide><path>thereumj-core/src/test/java/org/ethereum/config/ConfigTest.java <ide> public void fallbackTest() { <ide> System.setProperty("blocks.loader", "bla-bla"); <ide> Config config = ConfigFactory.load("ethereumj.conf"); <del> Assert.assertEquals("bla-bla", config.getString("blocks.loader")); <add> // Ignore this assertion since the SystemProperties are loaded by the static initializer <add> // so if the ConfigFactory was used prior to this test the setProperty() has no effect <add>// Assert.assertEquals("bla-bla", config.getString("blocks.loader")); <ide> String string = config.getString("keyvalue.datasource"); <ide> Assert.assertNotNull(string); <ide>
JavaScript
mit
830928b6aa95b50d5ab24b677bca4c56a0403047
0
aheckmann/mongoose-long
// mongoose-long module.exports = exports = function NumberLong (mongoose) { var Schema = mongoose.Schema , SchemaType = mongoose.SchemaType , Types = mongoose.Types , mongo = mongoose.mongo; /** * Long constructor * * @inherits SchemaType * @param {String} key * @param {Object} [options] */ function Long (key, options) { SchemaType.call(this, key, options); } /*! * inherits */ Long.prototype.__proto__ = SchemaType.prototype; /** * Implement checkRequired method. * * @param {any} val * @return {Boolean} */ Long.prototype.checkRequired = function (val) { return null != val; } /** * Implement casting. * * @param {any} val * @param {Object} [scope] * @param {Boolean} [init] * @return {mongo.Long|null} */ Long.prototype.cast = function (val, scope, init) { if (null === val) return val; if ('' === val) return null; if (val instanceof mongo.Long) return val; if (val instanceof Number || 'number' == typeof val) return mongo.Long.fromNumber(val); if (!Array.isArray(val) && val.toString) return mongo.Long.fromString(val.toString()); throw new SchemaType.CastError('Long', val) } /*! * ignore */ function handleSingle (val) { return this.cast(val) } function handleArray (val) { var self = this; return val.map( function (m) { return self.cast(m) }); } SchemaNumber.prototype.$conditionalHandlers = { '$lt' : handleSingle , '$lte': handleSingle , '$gt' : handleSingle , '$gte': handleSingle , '$ne' : handleSingle , '$in' : handleArray , '$nin': handleArray , '$mod': handleArray , '$all': handleArray }; /** * Implement query casting, for mongoose 3.0 * * @param {String} $conditional * @param {*} [value] */ Long.prototype.castForQuery = function($conditional, value) { var handler; if( arguments.length === 2 ) { handler = this.$conditionalHandlers[$conditional]; if( !handler ) { throw new Error("Can't use " + $conditional + " with Long."); } return handler.call(this, value); } else { return this.cast($conditional); } } /** * Expose */ Schema.Types.Long = Long; Types.Long = mongo.Long; return Long; }
lib/index.js
// mongoose-long module.exports = exports = function NumberLong (mongoose) { var Schema = mongoose.Schema , SchemaType = mongoose.SchemaType , Types = mongoose.Types , mongo = mongoose.mongo; /** * Long constructor * * @inherits SchemaType * @param {String} key * @param {Object} [options] */ function Long (key, options) { SchemaType.call(this, key, options); } /*! * inherits */ Long.prototype.__proto__ = SchemaType.prototype; /** * Implement checkRequired method. * * @param {any} val * @return {Boolean} */ Long.prototype.checkRequired = function (val) { return null != val; } /** * Implement casting. * * @param {any} val * @param {Object} [scope] * @param {Boolean} [init] * @return {mongo.Long|null} */ Long.prototype.cast = function (val, scope, init) { if (null === val) return val; if ('' === val) return null; if (val instanceof mongo.Long) return val; if (val instanceof Number || 'number' == typeof val) return mongo.Long.fromNumber(val); if (!Array.isArray(val) && val.toString) return mongo.Long.fromString(val.toString()); throw new SchemaType.CastError('Long', val) } /** * Expose */ Schema.Types.Long = Long; Types.Long = mongo.Long; return Long; }
[NEW] #castForQuery().
lib/index.js
[NEW] #castForQuery().
<ide><path>ib/index.js <ide> throw new SchemaType.CastError('Long', val) <ide> } <ide> <add>/*! <add> * ignore <add> */ <add> <add>function handleSingle (val) { <add> return this.cast(val) <add>} <add> <add>function handleArray (val) { <add> var self = this; <add> return val.map( function (m) { <add> return self.cast(m) <add> }); <add>} <add> <add>SchemaNumber.prototype.$conditionalHandlers = { <add> '$lt' : handleSingle <add> , '$lte': handleSingle <add> , '$gt' : handleSingle <add> , '$gte': handleSingle <add> , '$ne' : handleSingle <add> , '$in' : handleArray <add> , '$nin': handleArray <add> , '$mod': handleArray <add> , '$all': handleArray <add>}; <add> <add> /** <add> * Implement query casting, for mongoose 3.0 <add> * <add> * @param {String} $conditional <add> * @param {*} [value] <add> */ <add> <add> Long.prototype.castForQuery = function($conditional, value) { <add> var handler; <add> if( arguments.length === 2 ) { <add> handler = this.$conditionalHandlers[$conditional]; <add> if( !handler ) { <add> throw new Error("Can't use " + $conditional + " with Long."); <add> } <add> return handler.call(this, value); <add> } <add> else { <add> return this.cast($conditional); <add> } <add> } <add> <ide> /** <ide> * Expose <ide> */
Java
mit
78f0aa7d9ef0f2fcb1c52af6cb3679ff7ff98759
0
bitcoin-solutions/multibit-hd,akonring/multibit-hd-modified,oscarguindzberg/multibit-hd,akonring/multibit-hd-modified,oscarguindzberg/multibit-hd,bitcoin-solutions/multibit-hd,akonring/multibit-hd-modified,oscarguindzberg/multibit-hd,bitcoin-solutions/multibit-hd
package org.multibit.hd.ui.views; import com.google.common.base.Optional; import com.google.common.eventbus.Subscribe; import net.miginfocom.swing.MigLayout; import org.multibit.hd.core.api.MessageKey; import org.multibit.hd.core.config.BitcoinConfiguration; import org.multibit.hd.core.config.Configurations; import org.multibit.hd.core.config.I18NConfiguration; import org.multibit.hd.core.services.CoreServices; import org.multibit.hd.ui.events.controller.ControllerEvents; import org.multibit.hd.ui.events.controller.RemoveAlertEvent; import org.multibit.hd.ui.events.view.AlertAddedEvent; import org.multibit.hd.ui.events.view.BalanceChangedEvent; import org.multibit.hd.ui.events.view.LocaleChangedEvent; import org.multibit.hd.ui.i18n.BitcoinSymbol; import org.multibit.hd.ui.i18n.Formats; import org.multibit.hd.ui.i18n.Languages; import org.multibit.hd.ui.models.AlertModel; import org.multibit.hd.ui.views.components.Labels; import org.multibit.hd.ui.views.components.PanelDecorator; import org.multibit.hd.ui.views.components.Panels; import org.multibit.hd.ui.views.fonts.AwesomeDecorator; import org.multibit.hd.ui.views.fonts.AwesomeIcon; import org.multibit.hd.ui.views.themes.Themes; import javax.swing.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; /** * <p>View to provide the following to application:</p> * <ul> * <li>Provision of components and layout for the balance display</li> * </ul> * * @since 0.0.1 *   */ public class HeaderView { private JLabel primaryBalanceLabel; private JLabel secondaryBalanceLabel; private JLabel trailingSymbolLabel; private JLabel exchangeLabel; private JLabel alertMessageLabel; private JLabel alertRemainingLabel; private Optional<BalanceChangedEvent> latestBalanceChangedEvent = Optional.absent(); private final JPanel contentPanel; private final JPanel alertPanel; private final JPanel balancePanel; public HeaderView() { CoreServices.uiEventBus.register(this); // Create the content panel contentPanel = Panels.newPanel(new MigLayout( "insets 15 8,hidemode 1,fillx", // Layout "[]", // Columns "[]10[shrink]" // Rows )); // Create the balance panel - forcing a LTR layout to ensure correct placement of labels balancePanel = Panels.newPanel(new MigLayout( "fill,ltr", // Layout "[][][][][]", // Columns "[]10[shrink]" // Rows )); // Create the alert panel alertPanel = Panels.newPanel(new MigLayout( "fillx,ins 5,hidemode 3", "[grow][][]", // Columns "[]" // Rows )); // Start off in hiding alertPanel.setVisible(false); // Apply the theme contentPanel.setBackground(Themes.currentTheme.headerPanelBackground()); balancePanel.setBackground(Themes.currentTheme.headerPanelBackground()); // Create the balance labels JLabel[] balanceLabels = Labels.newBalanceLabels(); primaryBalanceLabel = balanceLabels[0]; secondaryBalanceLabel = balanceLabels[1]; trailingSymbolLabel = balanceLabels[2]; exchangeLabel = balanceLabels[3]; contentPanel.add(balancePanel, "grow,wrap"); contentPanel.add(alertPanel, "grow,push"); onLocaleChangedEvent(null); } /** * @return The content panel for this View */ public JPanel getContentPanel() { return contentPanel; } /** * <p>Handles the representation of the header when a locale change occurs</p> * * @param event The balance change event */ @Subscribe public void onLocaleChangedEvent(LocaleChangedEvent event) { populateBalancePanel(); populateAlertPanel(); } /** * <p>Handles the representation of the balance based on the current configuration</p> * * @param event The balance change event */ @Subscribe public void onBalanceChangedEvent(BalanceChangedEvent event) { // Keep track of the latest balance latestBalanceChangedEvent = Optional.of(event); // Handle the update handleBalanceChange(); } /** * <p>Handles the presentation of a new alert</p> * * @param event The show alert event */ @Subscribe public void onAlertAddedEvent(AlertAddedEvent event) { AlertModel alertModel = event.getAlertModel(); // Update the text according to the model alertMessageLabel.setText(alertModel.getLocalisedMessage()); alertRemainingLabel.setText(alertModel.getRemainingText()); switch (alertModel.getSeverity()) { case RED: PanelDecorator.applyDangerTheme(alertPanel); break; case AMBER: PanelDecorator.applyWarningTheme(alertPanel); break; case GREEN: PanelDecorator.applySuccessTheme(alertPanel); break; default: throw new IllegalStateException("Unknown severity: " + alertModel.getSeverity().name()); } alertPanel.setVisible(true); } /** * <p>Remove any existing alert</p> * * @param event The remove alert event */ @Subscribe public void onAlertRemovedEvent(RemoveAlertEvent event) { // Hide the alert panel alertPanel.setVisible(false); } private void populateAlertPanel() { alertPanel.removeAll(); alertMessageLabel = new JLabel(); alertRemainingLabel = new JLabel(); JLabel closeLabel = Labels.newPanelCloseLabel(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { ControllerEvents.fireRemoveAlertEvent(); } }); // Determine how to add them back into the panel if (Languages.isLeftToRight()) { alertPanel.add(alertMessageLabel, "push"); alertPanel.add(alertRemainingLabel, "shrink,right"); alertPanel.add(closeLabel); } else { alertPanel.add(closeLabel); alertPanel.add(alertRemainingLabel, "shrink,left"); alertPanel.add(alertMessageLabel, "push"); } } private void populateBalancePanel() { balancePanel.removeAll(); // Determine how to add them back into the panel if (Languages.isLeftToRight()) { balancePanel.add(primaryBalanceLabel, "left,shrink,baseline"); balancePanel.add(secondaryBalanceLabel, "left,shrink,gap 0"); balancePanel.add(trailingSymbolLabel, "left,shrink,gap 0"); balancePanel.add(exchangeLabel, "left,shrink,gap 0"); balancePanel.add(new JLabel(), "push,wrap"); // Provides a flexible column } else { balancePanel.add(exchangeLabel, "right,shrink,gap 0"); balancePanel.add(primaryBalanceLabel, "right,shrink,baseline"); balancePanel.add(secondaryBalanceLabel, "right,shrink,gap 0"); balancePanel.add(trailingSymbolLabel, "right,shrink,gap 0"); balancePanel.add(new JLabel(), "push,wrap"); // Provides a flexible column } if (latestBalanceChangedEvent.isPresent()) { handleBalanceChange(); } } /** * <p>Reflect the current balance on the UI</p> */ private void handleBalanceChange() { BitcoinConfiguration bitcoinConfiguration = Configurations.currentConfiguration.getBitcoinConfiguration(); I18NConfiguration i18nConfiguration = Configurations.currentConfiguration.getI18NConfiguration(); String[] balance = Formats.formatBitcoinBalance(latestBalanceChangedEvent.get().getBtcBalance().getAmount()); String localBalance = Formats.formatLocalBalance(latestBalanceChangedEvent.get().getLocalBalance().getAmount()); BitcoinSymbol symbol = BitcoinSymbol.valueOf(bitcoinConfiguration.getBitcoinSymbol()); if (i18nConfiguration.isCurrencySymbolLeading()) { handleLeadingSymbol(balance, symbol); } else { handleTrailingSymbol(symbol); } primaryBalanceLabel.setText(balance[0]); secondaryBalanceLabel.setText(balance[1]); exchangeLabel.setText( Languages.safeText( MessageKey.EXCHANGE_FIAT_RATE, localBalance, latestBalanceChangedEvent.get().getRateProvider() )); } /** * <p>Place currency symbol before the number</p> * * @param symbol The symbol to use */ private void handleLeadingSymbol(String[] balance, BitcoinSymbol symbol) { // Placement is primary, secondary, trailing, exchange (reading LTR) if (BitcoinSymbol.ICON.equals(symbol)) { // Icon leads primary balance but decorator will automatically swap which is undesired if (Languages.isLeftToRight()) { AwesomeDecorator.applyIcon(AwesomeIcon.BITCOIN, primaryBalanceLabel, true, (int) Labels.BALANCE_LARGE_FONT_SIZE); } else { AwesomeDecorator.applyIcon(AwesomeIcon.BITCOIN, primaryBalanceLabel, false, (int) Labels.BALANCE_LARGE_FONT_SIZE); } AwesomeDecorator.removeIcon(trailingSymbolLabel); trailingSymbolLabel.setText(""); } else { // Symbol leads primary balance balance[0] = symbol.getSymbol() + " " + balance[0]; AwesomeDecorator.removeIcon(primaryBalanceLabel); AwesomeDecorator.removeIcon(trailingSymbolLabel); } } /** * <p>Place currency symbol after the number</p> * * @param symbol The symbol to use */ private void handleTrailingSymbol(BitcoinSymbol symbol) { if (BitcoinSymbol.ICON.equals(symbol)) { // Icon trails secondary balance AwesomeDecorator.applyIcon(AwesomeIcon.BITCOIN, trailingSymbolLabel, true, (int) Labels.BALANCE_LARGE_FONT_SIZE); AwesomeDecorator.removeIcon(primaryBalanceLabel); trailingSymbolLabel.setText(""); } else { // Symbol trails secondary balance trailingSymbolLabel.setText(symbol.getSymbol()); AwesomeDecorator.removeIcon(primaryBalanceLabel); AwesomeDecorator.removeIcon(trailingSymbolLabel); } } }
mbhd-swing/src/main/java/org/multibit/hd/ui/views/HeaderView.java
package org.multibit.hd.ui.views; import com.google.common.base.Optional; import com.google.common.eventbus.Subscribe; import net.miginfocom.swing.MigLayout; import org.multibit.hd.core.api.MessageKey; import org.multibit.hd.core.config.BitcoinConfiguration; import org.multibit.hd.core.config.Configurations; import org.multibit.hd.core.config.I18NConfiguration; import org.multibit.hd.core.services.CoreServices; import org.multibit.hd.ui.events.controller.ControllerEvents; import org.multibit.hd.ui.events.controller.RemoveAlertEvent; import org.multibit.hd.ui.events.view.AlertAddedEvent; import org.multibit.hd.ui.events.view.BalanceChangedEvent; import org.multibit.hd.ui.events.view.LocaleChangedEvent; import org.multibit.hd.ui.i18n.BitcoinSymbol; import org.multibit.hd.ui.i18n.Formats; import org.multibit.hd.ui.i18n.Languages; import org.multibit.hd.ui.models.AlertModel; import org.multibit.hd.ui.views.components.Labels; import org.multibit.hd.ui.views.components.PanelDecorator; import org.multibit.hd.ui.views.components.Panels; import org.multibit.hd.ui.views.fonts.AwesomeDecorator; import org.multibit.hd.ui.views.fonts.AwesomeIcon; import org.multibit.hd.ui.views.themes.Themes; import javax.swing.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; /** * <p>View to provide the following to application:</p> * <ul> * <li>Provision of components and layout for the balance display</li> * </ul> * * @since 0.0.1 *   */ public class HeaderView { private JLabel primaryBalanceLabel; private JLabel secondaryBalanceLabel; private JLabel trailingSymbolLabel; private JLabel exchangeLabel; private JLabel alertMessageLabel; private JLabel alertRemainingLabel; private Optional<BalanceChangedEvent> latestBalanceChangedEvent = Optional.absent(); private final JPanel contentPanel; private final JPanel alertPanel; private final JPanel balancePanel; public HeaderView() { CoreServices.uiEventBus.register(this); // Create the content panel contentPanel = Panels.newPanel(new MigLayout( "insets 15 8,hidemode 1", // Layout "[]", // Columns "[]10[shrink]" // Rows )); // Create the balance panel - forcing a LTR layout to ensure correct placement of labels balancePanel = Panels.newPanel(new MigLayout( "fill,ltr", // Layout "[][][][][]", // Columns "[]10[shrink]" // Rows )); // Create the alert panel alertPanel = Panels.newPanel(new MigLayout( "fill,ins 5,hidemode 3", "[grow][][]", // Columns "[]" // Rows )); // Start off in hiding alertPanel.setVisible(false); // Apply the theme contentPanel.setBackground(Themes.currentTheme.headerPanelBackground()); balancePanel.setBackground(Themes.currentTheme.headerPanelBackground()); // Create the balance labels JLabel[] balanceLabels = Labels.newBalanceLabels(); primaryBalanceLabel = balanceLabels[0]; secondaryBalanceLabel = balanceLabels[1]; trailingSymbolLabel = balanceLabels[2]; exchangeLabel = balanceLabels[3]; contentPanel.add(balancePanel, "grow"); contentPanel.add(alertPanel, "grow"); onLocaleChangedEvent(null); } /** * @return The content panel for this View */ public JPanel getContentPanel() { return contentPanel; } /** * <p>Handles the representation of the header when a locale change occurs</p> * * @param event The balance change event */ @Subscribe public void onLocaleChangedEvent(LocaleChangedEvent event) { populateBalancePanel(); populateAlertPanel(); } /** * <p>Handles the representation of the balance based on the current configuration</p> * * @param event The balance change event */ @Subscribe public void onBalanceChangedEvent(BalanceChangedEvent event) { // Keep track of the latest balance latestBalanceChangedEvent = Optional.of(event); // Handle the update handleBalanceChange(); } /** * <p>Handles the presentation of a new alert</p> * * @param event The show alert event */ @Subscribe public void onAlertAddedEvent(AlertAddedEvent event) { AlertModel alertModel = event.getAlertModel(); // Update the text according to the model alertMessageLabel.setText(alertModel.getLocalisedMessage()); alertRemainingLabel.setText(alertModel.getRemainingText()); switch (alertModel.getSeverity()) { case RED: PanelDecorator.applyDangerTheme(alertPanel); break; case AMBER: PanelDecorator.applyWarningTheme(alertPanel); break; case GREEN: PanelDecorator.applySuccessTheme(alertPanel); break; default: throw new IllegalStateException("Unknown severity: " + alertModel.getSeverity().name()); } alertPanel.setVisible(true); } /** * <p>Remove any existing alert</p> * * @param event The remove alert event */ @Subscribe public void onAlertRemovedEvent(RemoveAlertEvent event) { // Hide the alert panel alertPanel.setVisible(false); } private void populateAlertPanel() { alertPanel.removeAll(); alertMessageLabel = new JLabel(); alertRemainingLabel = new JLabel(); JLabel closeLabel = Labels.newPanelCloseLabel(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { ControllerEvents.fireRemoveAlertEvent(); } }); // Determine how to add them back into the panel if (Languages.isLeftToRight()) { alertPanel.add(alertMessageLabel, "push"); alertPanel.add(alertRemainingLabel, "shrink,right"); alertPanel.add(closeLabel); } else { alertPanel.add(closeLabel); alertPanel.add(alertRemainingLabel, "shrink,left"); alertPanel.add(alertMessageLabel, "push"); } } private void populateBalancePanel() { balancePanel.removeAll(); // Determine how to add them back into the panel if (Languages.isLeftToRight()) { balancePanel.add(primaryBalanceLabel, "left,shrink,baseline"); balancePanel.add(secondaryBalanceLabel, "left,shrink,gap 0"); balancePanel.add(trailingSymbolLabel, "left,shrink,gap 0"); balancePanel.add(exchangeLabel, "left,shrink,gap 0"); balancePanel.add(new JLabel(), "push,wrap"); // Provides a flexible column } else { balancePanel.add(exchangeLabel, "right,shrink,gap 0"); balancePanel.add(primaryBalanceLabel, "right,shrink,baseline"); balancePanel.add(secondaryBalanceLabel, "right,shrink,gap 0"); balancePanel.add(trailingSymbolLabel, "right,shrink,gap 0"); balancePanel.add(new JLabel(), "push,wrap"); // Provides a flexible column } if (latestBalanceChangedEvent.isPresent()) { handleBalanceChange(); } } /** * <p>Reflect the current balance on the UI</p> */ private void handleBalanceChange() { BitcoinConfiguration bitcoinConfiguration = Configurations.currentConfiguration.getBitcoinConfiguration(); I18NConfiguration i18nConfiguration = Configurations.currentConfiguration.getI18NConfiguration(); String[] balance = Formats.formatBitcoinBalance(latestBalanceChangedEvent.get().getBtcBalance().getAmount()); String localBalance = Formats.formatLocalBalance(latestBalanceChangedEvent.get().getLocalBalance().getAmount()); BitcoinSymbol symbol = BitcoinSymbol.valueOf(bitcoinConfiguration.getBitcoinSymbol()); if (i18nConfiguration.isCurrencySymbolLeading()) { handleLeadingSymbol(balance, symbol); } else { handleTrailingSymbol(symbol); } primaryBalanceLabel.setText(balance[0]); secondaryBalanceLabel.setText(balance[1]); exchangeLabel.setText( Languages.safeText( MessageKey.EXCHANGE_FIAT_RATE, localBalance, latestBalanceChangedEvent.get().getRateProvider() )); } /** * <p>Place currency symbol before the number</p> * * @param symbol The symbol to use */ private void handleLeadingSymbol(String[] balance, BitcoinSymbol symbol) { // Placement is primary, secondary, trailing, exchange (reading LTR) if (BitcoinSymbol.ICON.equals(symbol)) { // Icon leads primary balance but decorator will automatically swap which is undesired if (Languages.isLeftToRight()) { AwesomeDecorator.applyIcon(AwesomeIcon.BITCOIN, primaryBalanceLabel, true, (int) Labels.BALANCE_LARGE_FONT_SIZE); } else { AwesomeDecorator.applyIcon(AwesomeIcon.BITCOIN, primaryBalanceLabel, false, (int) Labels.BALANCE_LARGE_FONT_SIZE); } AwesomeDecorator.removeIcon(trailingSymbolLabel); trailingSymbolLabel.setText(""); } else { // Symbol leads primary balance balance[0] = symbol.getSymbol() + " " + balance[0]; AwesomeDecorator.removeIcon(primaryBalanceLabel); AwesomeDecorator.removeIcon(trailingSymbolLabel); } } /** * <p>Place currency symbol after the number</p> * * @param symbol The symbol to use */ private void handleTrailingSymbol(BitcoinSymbol symbol) { if (BitcoinSymbol.ICON.equals(symbol)) { // Icon trails secondary balance AwesomeDecorator.applyIcon(AwesomeIcon.BITCOIN, trailingSymbolLabel, true, (int) Labels.BALANCE_LARGE_FONT_SIZE); AwesomeDecorator.removeIcon(primaryBalanceLabel); trailingSymbolLabel.setText(""); } else { // Symbol trails secondary balance trailingSymbolLabel.setText(symbol.getSymbol()); AwesomeDecorator.removeIcon(primaryBalanceLabel); AwesomeDecorator.removeIcon(trailingSymbolLabel); } } }
Fixed the alert presentation
mbhd-swing/src/main/java/org/multibit/hd/ui/views/HeaderView.java
Fixed the alert presentation
<ide><path>bhd-swing/src/main/java/org/multibit/hd/ui/views/HeaderView.java <ide> <ide> // Create the content panel <ide> contentPanel = Panels.newPanel(new MigLayout( <del> "insets 15 8,hidemode 1", // Layout <add> "insets 15 8,hidemode 1,fillx", // Layout <ide> "[]", // Columns <ide> "[]10[shrink]" // Rows <ide> )); <ide> <ide> // Create the alert panel <ide> alertPanel = Panels.newPanel(new MigLayout( <del> "fill,ins 5,hidemode 3", <add> "fillx,ins 5,hidemode 3", <ide> "[grow][][]", // Columns <ide> "[]" // Rows <ide> )); <ide> trailingSymbolLabel = balanceLabels[2]; <ide> exchangeLabel = balanceLabels[3]; <ide> <del> contentPanel.add(balancePanel, "grow"); <del> contentPanel.add(alertPanel, "grow"); <add> contentPanel.add(balancePanel, "grow,wrap"); <add> contentPanel.add(alertPanel, "grow,push"); <ide> <ide> onLocaleChangedEvent(null); <ide> }
Java
mit
09e534d29a4b078ff375f15a58f750974ac1c628
0
auth0/Lock.Android,auth0/Lock.Android
/* * PasswordlessFormView.java * * Copyright (c) 2016 Auth0 (http://auth0.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package com.auth0.android.lock.views; import android.support.annotation.Nullable; import android.view.View; import android.widget.TextView; import com.auth0.android.lock.R; import com.auth0.android.lock.adapters.Country; import com.auth0.android.lock.enums.PasswordlessMode; import com.auth0.android.lock.events.PasswordlessLoginEvent; import com.auth0.android.lock.views.interfaces.LockWidgetPasswordless; public class PasswordlessFormView extends FormView implements View.OnClickListener { private static final String TAG = PasswordlessFormView.class.getSimpleName(); private final LockWidgetPasswordless lockWidget; private final OnPasswordlessRetryListener callback; private ValidatedInputView passwordlessInput; private PasswordlessMode choosenMode; private boolean waitingForCode; private final boolean showTitle; private TextView topMessage; private TextView resendButton; private int sentMessage; private CountryCodeSelectorView countryCodeSelector; private String submittedEmailOrNumber; private String previousInput; public PasswordlessFormView(LockWidgetPasswordless lockWidget, OnPasswordlessRetryListener callback) { super(lockWidget.getContext()); choosenMode = lockWidget.getConfiguration().getPasswordlessMode(); showTitle = lockWidget.getConfiguration().getSocialStrategies().isEmpty(); this.lockWidget = lockWidget; this.callback = callback; init(); } private void init() { inflate(getContext(), R.layout.com_auth0_lock_passwordless_form_view, this); topMessage = (TextView) findViewById(R.id.com_auth0_lock_text); resendButton = (TextView) findViewById(R.id.com_auth0_lock_resend); resendButton.setOnClickListener(this); passwordlessInput = (ValidatedInputView) findViewById(R.id.com_auth0_lock_input_passwordless); countryCodeSelector = (CountryCodeSelectorView) findViewById(R.id.com_auth0_lock_country_code_selector); countryCodeSelector.setOnClickListener(this); selectPasswordlessMode(); } private void selectPasswordlessMode() { int titleMessage = 0; switch (choosenMode) { case EMAIL_CODE: titleMessage = R.string.com_auth0_lock_title_passwordless_email; sentMessage = R.string.com_auth0_lock_title_passwordless_code_email_sent; passwordlessInput.setDataType(ValidatedInputView.DataType.EMAIL); countryCodeSelector.setVisibility(GONE); break; case EMAIL_LINK: titleMessage = R.string.com_auth0_lock_title_passwordless_email; passwordlessInput.setDataType(ValidatedInputView.DataType.EMAIL); countryCodeSelector.setVisibility(GONE); break; case SMS_CODE: titleMessage = R.string.com_auth0_lock_title_passwordless_sms; sentMessage = R.string.com_auth0_lock_title_passwordless_code_sms_sent; passwordlessInput.setDataType(ValidatedInputView.DataType.PHONE_NUMBER); countryCodeSelector.setVisibility(VISIBLE); break; case SMS_LINK: titleMessage = R.string.com_auth0_lock_title_passwordless_sms; passwordlessInput.setDataType(ValidatedInputView.DataType.PHONE_NUMBER); countryCodeSelector.setVisibility(VISIBLE); break; } passwordlessInput.setVisibility(VISIBLE); passwordlessInput.clearInput(); resendButton.setVisibility(GONE); setTopMessage(showTitle ? getResources().getString(titleMessage) : null); } @Override public Object getActionEvent() { if (waitingForCode) { return new PasswordlessLoginEvent(choosenMode, submittedEmailOrNumber, getInputText()); } else { previousInput = getInputText(); submittedEmailOrNumber = countryCodeSelector.getSelectedCountry().getDialCode() + previousInput; return new PasswordlessLoginEvent(choosenMode, submittedEmailOrNumber); } } private String getInputText() { return passwordlessInput.getText().replace(" ", ""); } @Override public boolean validateForm() { return passwordlessInput.validate(true); } @Nullable @Override public Object submitForm() { return validateForm() ? getActionEvent() : null; } /** * Triggers the back action on the form. * * @return true if it was handled, false otherwise */ public boolean onBackPressed() { if (waitingForCode) { waitingForCode = false; selectPasswordlessMode(); return true; } return false; } /** * Notifies the form that the code was correctly sent and it should now wait * for the user to input the valid code. */ public void codeSent() { countryCodeSelector.setVisibility(GONE); resendButton.setVisibility(VISIBLE); if (choosenMode == PasswordlessMode.EMAIL_CODE || choosenMode == PasswordlessMode.SMS_CODE) { setTopMessage(String.format(getResources().getString(sentMessage), submittedEmailOrNumber)); passwordlessInput.setDataType(ValidatedInputView.DataType.NUMBER); passwordlessInput.clearInput(); } else { passwordlessInput.setVisibility(GONE); } waitingForCode = true; } /** * Notifies the form that a new country code was selected by the user. * * @param country the selected country iso code (2 chars). * @param dialCode the dial code for this country */ public void onCountryCodeSelected(String country, String dialCode) { Country selectedCountry = new Country(country, dialCode); countryCodeSelector.setSelectedCountry(selectedCountry); } @Override public void onClick(View v) { int id = v.getId(); if (id == R.id.com_auth0_lock_resend) { if (callback != null) { waitingForCode = false; selectPasswordlessMode(); passwordlessInput.setText(previousInput); callback.onPasswordlessRetry(); } } else if (id == R.id.com_auth0_lock_country_code_selector) { lockWidget.onCountryCodeChangeRequest(); } } private void setTopMessage(String text) { if (text == null) { topMessage.setVisibility(View.GONE); } else { topMessage.setText(text); topMessage.setVisibility(View.VISIBLE); } } public interface OnPasswordlessRetryListener { /** * Called when the form needs to remove the "Waiting for the code" view and show * the email/phone input again. */ void onPasswordlessRetry(); } }
lock/src/main/java/com/auth0/android/lock/views/PasswordlessFormView.java
/* * PasswordlessFormView.java * * Copyright (c) 2016 Auth0 (http://auth0.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package com.auth0.android.lock.views; import android.support.annotation.Nullable; import android.view.View; import android.widget.TextView; import com.auth0.android.lock.R; import com.auth0.android.lock.adapters.Country; import com.auth0.android.lock.enums.PasswordlessMode; import com.auth0.android.lock.events.PasswordlessLoginEvent; import com.auth0.android.lock.views.interfaces.LockWidgetPasswordless; public class PasswordlessFormView extends FormView implements View.OnClickListener { private static final String TAG = PasswordlessFormView.class.getSimpleName(); private final LockWidgetPasswordless lockWidget; private final OnPasswordlessRetryListener callback; private ValidatedInputView passwordlessInput; private PasswordlessMode choosenMode; private boolean waitingForCode; private final boolean showTitle; private TextView topMessage; private TextView resendButton; private int sentMessage; private CountryCodeSelectorView countryCodeSelector; private String submittedEmailOrNumber; private String previousInput; public PasswordlessFormView(LockWidgetPasswordless lockWidget, OnPasswordlessRetryListener callback) { super(lockWidget.getContext()); choosenMode = lockWidget.getConfiguration().getPasswordlessMode(); showTitle = lockWidget.getConfiguration().getSocialStrategies().isEmpty(); this.lockWidget = lockWidget; this.callback = callback; init(); } private void init() { inflate(getContext(), R.layout.com_auth0_lock_passwordless_form_view, this); topMessage = (TextView) findViewById(R.id.com_auth0_lock_text); resendButton = (TextView) findViewById(R.id.com_auth0_lock_resend); resendButton.setOnClickListener(this); passwordlessInput = (ValidatedInputView) findViewById(R.id.com_auth0_lock_input_passwordless); countryCodeSelector = (CountryCodeSelectorView) findViewById(R.id.com_auth0_lock_country_code_selector); countryCodeSelector.setOnClickListener(this); selectPasswordlessMode(); } private void selectPasswordlessMode() { int titleMessage = 0; switch (choosenMode) { case EMAIL_CODE: titleMessage = R.string.com_auth0_lock_title_passwordless_email; sentMessage = R.string.com_auth0_lock_title_passwordless_code_email_sent; passwordlessInput.setDataType(ValidatedInputView.DataType.EMAIL); countryCodeSelector.setVisibility(GONE); break; case EMAIL_LINK: titleMessage = R.string.com_auth0_lock_title_passwordless_email; passwordlessInput.setDataType(ValidatedInputView.DataType.EMAIL); countryCodeSelector.setVisibility(GONE); break; case SMS_CODE: titleMessage = R.string.com_auth0_lock_title_passwordless_sms; sentMessage = R.string.com_auth0_lock_title_passwordless_code_sms_sent; passwordlessInput.setDataType(ValidatedInputView.DataType.PHONE_NUMBER); countryCodeSelector.setVisibility(VISIBLE); break; case SMS_LINK: titleMessage = R.string.com_auth0_lock_title_passwordless_sms; passwordlessInput.setDataType(ValidatedInputView.DataType.PHONE_NUMBER); countryCodeSelector.setVisibility(VISIBLE); break; } passwordlessInput.setVisibility(VISIBLE); passwordlessInput.clearInput(); resendButton.setVisibility(GONE); setTopMessage(showTitle ? getResources().getString(titleMessage) : null); } @Override public Object getActionEvent() { if (waitingForCode) { return new PasswordlessLoginEvent(choosenMode, submittedEmailOrNumber, getInputText()); } else { return new PasswordlessLoginEvent(choosenMode, getInputText()); } } private String getInputText() { String withoutBlanks = passwordlessInput.getText().replace(" ", ""); switch (choosenMode) { case SMS_CODE: case SMS_LINK: if (countryCodeSelector.getVisibility() == VISIBLE) { previousInput = withoutBlanks; submittedEmailOrNumber = countryCodeSelector.getSelectedCountry().getDialCode() + withoutBlanks; return submittedEmailOrNumber; } } return withoutBlanks; } @Override public boolean validateForm() { return passwordlessInput.validate(true); } @Nullable @Override public Object submitForm() { return validateForm() ? getActionEvent() : null; } /** * Triggers the back action on the form. * * @return true if it was handled, false otherwise */ public boolean onBackPressed() { if (waitingForCode) { waitingForCode = false; selectPasswordlessMode(); return true; } return false; } /** * Notifies the form that the code was correctly sent and it should now wait * for the user to input the valid code. */ public void codeSent() { countryCodeSelector.setVisibility(GONE); resendButton.setVisibility(VISIBLE); if (choosenMode == PasswordlessMode.EMAIL_CODE || choosenMode == PasswordlessMode.SMS_CODE) { setTopMessage(String.format(getResources().getString(sentMessage), submittedEmailOrNumber)); passwordlessInput.setDataType(ValidatedInputView.DataType.NUMBER); passwordlessInput.clearInput(); } else { passwordlessInput.setVisibility(GONE); } waitingForCode = true; } /** * Notifies the form that a new country code was selected by the user. * * @param country the selected country iso code (2 chars). * @param dialCode the dial code for this country */ public void onCountryCodeSelected(String country, String dialCode) { Country selectedCountry = new Country(country, dialCode); countryCodeSelector.setSelectedCountry(selectedCountry); } @Override public void onClick(View v) { int id = v.getId(); if (id == R.id.com_auth0_lock_resend) { if (callback != null) { waitingForCode = false; selectPasswordlessMode(); passwordlessInput.setText(previousInput); callback.onPasswordlessRetry(); } } else if (id == R.id.com_auth0_lock_country_code_selector) { lockWidget.onCountryCodeChangeRequest(); } } private void setTopMessage(String text) { if (text == null) { topMessage.setVisibility(View.GONE); } else { topMessage.setText(text); topMessage.setVisibility(View.VISIBLE); } } public interface OnPasswordlessRetryListener { /** * Called when the form needs to remove the "Waiting for the code" view and show * the email/phone input again. */ void onPasswordlessRetry(); } }
refactor getter logic
lock/src/main/java/com/auth0/android/lock/views/PasswordlessFormView.java
refactor getter logic
<ide><path>ock/src/main/java/com/auth0/android/lock/views/PasswordlessFormView.java <ide> if (waitingForCode) { <ide> return new PasswordlessLoginEvent(choosenMode, submittedEmailOrNumber, getInputText()); <ide> } else { <del> return new PasswordlessLoginEvent(choosenMode, getInputText()); <add> previousInput = getInputText(); <add> submittedEmailOrNumber = countryCodeSelector.getSelectedCountry().getDialCode() + previousInput; <add> return new PasswordlessLoginEvent(choosenMode, submittedEmailOrNumber); <ide> } <ide> } <ide> <ide> private String getInputText() { <del> String withoutBlanks = passwordlessInput.getText().replace(" ", ""); <del> switch (choosenMode) { <del> case SMS_CODE: <del> case SMS_LINK: <del> if (countryCodeSelector.getVisibility() == VISIBLE) { <del> previousInput = withoutBlanks; <del> submittedEmailOrNumber = countryCodeSelector.getSelectedCountry().getDialCode() + withoutBlanks; <del> return submittedEmailOrNumber; <del> } <del> } <del> return withoutBlanks; <add> return passwordlessInput.getText().replace(" ", ""); <ide> } <ide> <ide> @Override
Java
apache-2.0
b24b4d5416cd84481db062fbf86fac6d6d48ff9e
0
mcculls/maven-plugins,hazendaz/maven-plugins,rkorpachyov/maven-plugins,hazendaz/maven-plugins,hazendaz/maven-plugins,apache/maven-plugins,apache/maven-plugins,hazendaz/maven-plugins,apache/maven-plugins,lennartj/maven-plugins,lennartj/maven-plugins,hazendaz/maven-plugins,HubSpot/maven-plugins,HubSpot/maven-plugins,rkorpachyov/maven-plugins,mcculls/maven-plugins,lennartj/maven-plugins,hgschmie/apache-maven-plugins,hgschmie/apache-maven-plugins,rkorpachyov/maven-plugins,rkorpachyov/maven-plugins,apache/maven-plugins,rkorpachyov/maven-plugins,HubSpot/maven-plugins,apache/maven-plugins,hgschmie/apache-maven-plugins,mcculls/maven-plugins,hgschmie/apache-maven-plugins,mcculls/maven-plugins,lennartj/maven-plugins,HubSpot/maven-plugins
package org.apache.maven.plugins.war; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import java.util.Arrays; import org.apache.maven.archiver.MavenArchiver; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DependencyResolutionRequiredException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.plugins.war.util.ClassesPackager; import org.apache.maven.project.MavenProjectHelper; import org.codehaus.plexus.archiver.Archiver; import org.codehaus.plexus.archiver.ArchiverException; import org.codehaus.plexus.archiver.jar.ManifestException; import org.codehaus.plexus.archiver.war.WarArchiver; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; /** * Build a WAR file. * * @author <a href="[email protected]">Emmanuel Venisse</a> * @version $Id$ */ // CHECKSTYLE_OFF: LineLength @Mojo( name = "war", defaultPhase = LifecyclePhase.PACKAGE, threadSafe = true, requiresDependencyResolution = ResolutionScope.RUNTIME ) // CHECKSTYLE_ON: LineLength public class WarMojo extends AbstractWarMojo { /** * The directory for the generated WAR. */ @Parameter( defaultValue = "${project.build.directory}", required = true ) private String outputDirectory; /** * The name of the generated WAR. */ @Parameter( defaultValue = "${project.build.finalName}", required = true, readonly = true ) private String warName; /** * Classifier to add to the generated WAR. If given, the artifact will be an attachment instead. The classifier will * not be applied to the JAR file of the project - only to the WAR file. */ @Parameter private String classifier; /** * The comma separated list of tokens to exclude from the WAR before packaging. This option may be used to implement * the skinny WAR use case. Note that you can use the Java Regular Expressions engine to include and exclude * specific pattern using the expression %regex[]. Hint: read the about (?!Pattern). * * @since 2.1-alpha-2 */ @Parameter private String packagingExcludes; /** * The comma separated list of tokens to include in the WAR before packaging. By default everything is included. * This option may be used to implement the skinny WAR use case. Note that you can use the Java Regular Expressions * engine to include and exclude specific pattern using the expression %regex[]. * * @since 2.1-beta-1 */ @Parameter private String packagingIncludes; /** * The WAR archiver. */ @Component( role = Archiver.class, hint = "war" ) private WarArchiver warArchiver; /** */ @Component private MavenProjectHelper projectHelper; /** * Whether this is the main artifact being built. Set to <code>false</code> if you don't want to install or deploy * it to the local repository instead of the default one in an execution. */ @Parameter( property = "primaryArtifact", defaultValue = "true" ) private boolean primaryArtifact = true; /** * Whether or not to fail the build if the <code>web.xml</code> file is missing. Set to <code>false</code> if you * want you WAR built without a <code>web.xml</code> file. This may be useful if you are building an overlay that * has no web.xml file. * * @since 2.1-alpha-2 */ @Parameter( property = "failOnMissingWebXml", defaultValue = "true" ) private boolean failOnMissingWebXml = true; /** * Whether classes (that is the content of the WEB-INF/classes directory) should be attached to the project as an * additional artifact. * <p> * By default the classifier for the additional artifact is 'classes'. You can change it with the * <code><![CDATA[<classesClassifier>someclassifier</classesClassifier>]]></code> parameter. * </p> * <p> * If this parameter true, another project can depend on the classes by writing something like: * * <pre> * <![CDATA[<dependency> * <groupId>myGroup</groupId> * <artifactId>myArtifact</artifactId> * <version>myVersion</myVersion> * <classifier>classes</classifier> * </dependency>]]> * </pre> * </p> * * @since 2.1-alpha-2 */ @Parameter( defaultValue = "false" ) private boolean attachClasses = false; /** * The classifier to use for the attached classes artifact. * * @since 2.1-alpha-2 */ @Parameter( defaultValue = "classes" ) private String classesClassifier = "classes"; /** * You can skip the execution of the plugin if you need to. Its use is NOT RECOMMENDED, but quite convenient on * occasion. * * @since 3.0.0 */ @Parameter( property = "maven.war.skip", defaultValue = "false" ) private boolean skip; // ---------------------------------------------------------------------- // Implementation // ---------------------------------------------------------------------- /** * Executes the WarMojo on the current project. * * @throws MojoExecutionException if an error occurred while building the webapp * @throws MojoFailureException if an error. */ public void execute() throws MojoExecutionException, MojoFailureException { if ( isSkip() ) { getLog().info( "Skipping the execution." ); return; } File warFile = getTargetWarFile(); try { performPackaging( warFile ); } catch ( DependencyResolutionRequiredException e ) { throw new MojoExecutionException( "Error assembling WAR: " + e.getMessage(), e ); } catch ( ManifestException e ) { throw new MojoExecutionException( "Error assembling WAR", e ); } catch ( IOException e ) { throw new MojoExecutionException( "Error assembling WAR", e ); } catch ( ArchiverException e ) { throw new MojoExecutionException( "Error assembling WAR: " + e.getMessage(), e ); } } /** * Generates the webapp according to the <tt>mode</tt> attribute. * * @param warFile the target WAR file * @throws IOException if an error occurred while copying files * @throws ArchiverException if the archive could not be created * @throws ManifestException if the manifest could not be created * @throws DependencyResolutionRequiredException if an error occurred while resolving the dependencies * @throws MojoExecutionException if the execution failed * @throws MojoFailureException if a fatal exception occurred */ private void performPackaging( File warFile ) throws IOException, ManifestException, DependencyResolutionRequiredException, MojoExecutionException, MojoFailureException { getLog().info( "Packaging webapp" ); buildExplodedWebapp( getWebappDirectory() ); MavenArchiver archiver = new MavenArchiver(); archiver.setArchiver( warArchiver ); archiver.setOutputFile( warFile ); // CHECKSTYLE_OFF: LineLength getLog().debug( "Excluding " + Arrays.asList( getPackagingExcludes() ) + " from the generated webapp archive." ); getLog().debug( "Including " + Arrays.asList( getPackagingIncludes() ) + " in the generated webapp archive." ); // CHECKSTYLE_ON: LineLength warArchiver.addDirectory( getWebappDirectory(), getPackagingIncludes(), getPackagingExcludes() ); final File webXmlFile = new File( getWebappDirectory(), "WEB-INF/web.xml" ); if ( webXmlFile.exists() ) { warArchiver.setWebxml( webXmlFile ); } warArchiver.setRecompressAddedZips( isRecompressZippedFiles() ); warArchiver.setIncludeEmptyDirs( isIncludeEmptyDirectories() ); if ( !failOnMissingWebXml ) { getLog().debug( "Build won't fail if web.xml file is missing." ); warArchiver.setExpectWebXml( false ); } // create archive archiver.createArchive( getSession(), getProject(), getArchive() ); // create the classes to be attached if necessary if ( isAttachClasses() ) { if ( isArchiveClasses() && getJarArchiver().getDestFile() != null ) { // special handling in case of archived classes: MWAR-240 File targetClassesFile = getTargetClassesFile(); FileUtils.copyFile( getJarArchiver().getDestFile(), targetClassesFile ); projectHelper.attachArtifact( getProject(), "jar", getClassesClassifier(), targetClassesFile ); } else { ClassesPackager packager = new ClassesPackager(); final File classesDirectory = packager.getClassesDirectory( getWebappDirectory() ); if ( classesDirectory.exists() ) { getLog().info( "Packaging classes" ); packager.packageClasses( classesDirectory, getTargetClassesFile(), getJarArchiver(), getSession(), getProject(), getArchive() ); projectHelper.attachArtifact( getProject(), "jar", getClassesClassifier(), getTargetClassesFile() ); } } } if ( this.classifier != null ) { projectHelper.attachArtifact( getProject(), "war", this.classifier, warFile ); } else { Artifact artifact = getProject().getArtifact(); if ( primaryArtifact ) { artifact.setFile( warFile ); } else if ( artifact.getFile() == null || artifact.getFile().isDirectory() ) { artifact.setFile( warFile ); } } } /** * @param basedir The basedir * @param finalName The finalName * @param classifier The classifier. * @param type The type. * @return {@link File} */ protected static File getTargetFile( File basedir, String finalName, String classifier, String type ) { if ( classifier == null ) { classifier = ""; } else if ( classifier.trim().length() > 0 && !classifier.startsWith( "-" ) ) { classifier = "-" + classifier; } return new File( basedir, finalName + classifier + "." + type ); } /** * @return The war {@link File} */ protected File getTargetWarFile() { return getTargetFile( new File( getOutputDirectory() ), getWarName(), getClassifier(), "war" ); } /** * @return The target class {@link File} */ protected File getTargetClassesFile() { return getTargetFile( new File( getOutputDirectory() ), getWarName(), getClassesClassifier(), "jar" ); } // Getters and Setters /** * @return {@link #classifier} */ public String getClassifier() { return classifier; } /** * @param classifier {@link #classifier} */ public void setClassifier( String classifier ) { this.classifier = classifier; } /** * @return The package excludes. */ public String[] getPackagingExcludes() { if ( StringUtils.isEmpty( packagingExcludes ) ) { return new String[0]; } else { return StringUtils.split( packagingExcludes, "," ); } } /** * @param packagingExcludes {@link #packagingExcludes} */ public void setPackagingExcludes( String packagingExcludes ) { this.packagingExcludes = packagingExcludes; } /** * @return The packaging includes. */ public String[] getPackagingIncludes() { if ( StringUtils.isEmpty( packagingIncludes ) ) { return new String[] { "**" }; } else { return StringUtils.split( packagingIncludes, "," ); } } /** * @param packagingIncludes {@link #packagingIncludes} */ public void setPackagingIncludes( String packagingIncludes ) { this.packagingIncludes = packagingIncludes; } /** * @return {@link #outputDirectory} */ public String getOutputDirectory() { return outputDirectory; } /** * @param outputDirectory {@link #outputDirectory} */ public void setOutputDirectory( String outputDirectory ) { this.outputDirectory = outputDirectory; } /** * @return {@link #warName} */ public String getWarName() { return warName; } /** * @param warName {@link #warName} */ public void setWarName( String warName ) { this.warName = warName; } /** * @return {@link #warArchiver} */ public WarArchiver getWarArchiver() { return warArchiver; } /** * @param warArchiver {@link #warArchiver} */ public void setWarArchiver( WarArchiver warArchiver ) { this.warArchiver = warArchiver; } /** * @return {@link #projectHelper} */ public MavenProjectHelper getProjectHelper() { return projectHelper; } /** * @param projectHelper {@link #projectHelper} */ public void setProjectHelper( MavenProjectHelper projectHelper ) { this.projectHelper = projectHelper; } /** * @return {@link #primaryArtifact} */ public boolean isPrimaryArtifact() { return primaryArtifact; } /** * @param primaryArtifact {@link #primaryArtifact} */ public void setPrimaryArtifact( boolean primaryArtifact ) { this.primaryArtifact = primaryArtifact; } /** * @return {@link #attachClasses} */ public boolean isAttachClasses() { return attachClasses; } /** * @param attachClasses {@link #attachClasses} */ public void setAttachClasses( boolean attachClasses ) { this.attachClasses = attachClasses; } /** * @return {@link #classesClassifier} */ public String getClassesClassifier() { return classesClassifier; } /** * @param classesClassifier {@link #classesClassifier} */ public void setClassesClassifier( String classesClassifier ) { this.classesClassifier = classesClassifier; } /** * @return {@link #failOnMissingWebXml} */ public boolean isFailOnMissingWebXml() { return failOnMissingWebXml; } /** * @param failOnMissingWebXml {@link #failOnMissingWebXml} */ public void setFailOnMissingWebXml( boolean failOnMissingWebXml ) { this.failOnMissingWebXml = failOnMissingWebXml; } public boolean isSkip() { return skip; } }
maven-war-plugin/src/main/java/org/apache/maven/plugins/war/WarMojo.java
package org.apache.maven.plugins.war; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import java.util.Arrays; import org.apache.maven.archiver.MavenArchiver; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DependencyResolutionRequiredException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.plugins.war.util.ClassesPackager; import org.apache.maven.project.MavenProjectHelper; import org.codehaus.plexus.archiver.Archiver; import org.codehaus.plexus.archiver.ArchiverException; import org.codehaus.plexus.archiver.jar.ManifestException; import org.codehaus.plexus.archiver.war.WarArchiver; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; /** * Build a WAR file. * * @author <a href="[email protected]">Emmanuel Venisse</a> * @version $Id$ */ // CHECKSTYLE_OFF: LineLength @Mojo( name = "war", defaultPhase = LifecyclePhase.PACKAGE, threadSafe = true, requiresDependencyResolution = ResolutionScope.RUNTIME ) // CHECKSTYLE_ON: LineLength public class WarMojo extends AbstractWarMojo { /** * The directory for the generated WAR. */ @Parameter( defaultValue = "${project.build.directory}", required = true ) private String outputDirectory; /** * The name of the generated WAR. */ @Parameter( defaultValue = "${project.build.finalName}", property = "war.warName", required = true ) private String warName; /** * Classifier to add to the generated WAR. If given, the artifact will be an attachment instead. The classifier will * not be applied to the JAR file of the project - only to the WAR file. */ @Parameter private String classifier; /** * The comma separated list of tokens to exclude from the WAR before packaging. This option may be used to implement * the skinny WAR use case. Note that you can use the Java Regular Expressions engine to include and exclude * specific pattern using the expression %regex[]. Hint: read the about (?!Pattern). * * @since 2.1-alpha-2 */ @Parameter private String packagingExcludes; /** * The comma separated list of tokens to include in the WAR before packaging. By default everything is included. * This option may be used to implement the skinny WAR use case. Note that you can use the Java Regular Expressions * engine to include and exclude specific pattern using the expression %regex[]. * * @since 2.1-beta-1 */ @Parameter private String packagingIncludes; /** * The WAR archiver. */ @Component( role = Archiver.class, hint = "war" ) private WarArchiver warArchiver; /** */ @Component private MavenProjectHelper projectHelper; /** * Whether this is the main artifact being built. Set to <code>false</code> if you don't want to install or deploy * it to the local repository instead of the default one in an execution. */ @Parameter( property = "primaryArtifact", defaultValue = "true" ) private boolean primaryArtifact = true; /** * Whether or not to fail the build if the <code>web.xml</code> file is missing. Set to <code>false</code> if you * want you WAR built without a <code>web.xml</code> file. This may be useful if you are building an overlay that * has no web.xml file. * * @since 2.1-alpha-2 */ @Parameter( property = "failOnMissingWebXml", defaultValue = "true" ) private boolean failOnMissingWebXml = true; /** * Whether classes (that is the content of the WEB-INF/classes directory) should be attached to the project as an * additional artifact. * <p> * By default the classifier for the additional artifact is 'classes'. You can change it with the * <code><![CDATA[<classesClassifier>someclassifier</classesClassifier>]]></code> parameter. * </p> * <p> * If this parameter true, another project can depend on the classes by writing something like: * * <pre> * <![CDATA[<dependency> * <groupId>myGroup</groupId> * <artifactId>myArtifact</artifactId> * <version>myVersion</myVersion> * <classifier>classes</classifier> * </dependency>]]> * </pre> * </p> * * @since 2.1-alpha-2 */ @Parameter( defaultValue = "false" ) private boolean attachClasses = false; /** * The classifier to use for the attached classes artifact. * * @since 2.1-alpha-2 */ @Parameter( defaultValue = "classes" ) private String classesClassifier = "classes"; /** * You can skip the execution of the plugin if you need to. Its use is NOT RECOMMENDED, but quite convenient on * occasion. * * @since 3.0.0 */ @Parameter( property = "maven.war.skip", defaultValue = "false" ) private boolean skip; // ---------------------------------------------------------------------- // Implementation // ---------------------------------------------------------------------- /** * Executes the WarMojo on the current project. * * @throws MojoExecutionException if an error occurred while building the webapp * @throws MojoFailureException if an error. */ public void execute() throws MojoExecutionException, MojoFailureException { if ( isSkip() ) { getLog().info( "Skipping the execution." ); return; } File warFile = getTargetWarFile(); try { performPackaging( warFile ); } catch ( DependencyResolutionRequiredException e ) { throw new MojoExecutionException( "Error assembling WAR: " + e.getMessage(), e ); } catch ( ManifestException e ) { throw new MojoExecutionException( "Error assembling WAR", e ); } catch ( IOException e ) { throw new MojoExecutionException( "Error assembling WAR", e ); } catch ( ArchiverException e ) { throw new MojoExecutionException( "Error assembling WAR: " + e.getMessage(), e ); } } /** * Generates the webapp according to the <tt>mode</tt> attribute. * * @param warFile the target WAR file * @throws IOException if an error occurred while copying files * @throws ArchiverException if the archive could not be created * @throws ManifestException if the manifest could not be created * @throws DependencyResolutionRequiredException if an error occurred while resolving the dependencies * @throws MojoExecutionException if the execution failed * @throws MojoFailureException if a fatal exception occurred */ private void performPackaging( File warFile ) throws IOException, ManifestException, DependencyResolutionRequiredException, MojoExecutionException, MojoFailureException { getLog().info( "Packaging webapp" ); buildExplodedWebapp( getWebappDirectory() ); MavenArchiver archiver = new MavenArchiver(); archiver.setArchiver( warArchiver ); archiver.setOutputFile( warFile ); // CHECKSTYLE_OFF: LineLength getLog().debug( "Excluding " + Arrays.asList( getPackagingExcludes() ) + " from the generated webapp archive." ); getLog().debug( "Including " + Arrays.asList( getPackagingIncludes() ) + " in the generated webapp archive." ); // CHECKSTYLE_ON: LineLength warArchiver.addDirectory( getWebappDirectory(), getPackagingIncludes(), getPackagingExcludes() ); final File webXmlFile = new File( getWebappDirectory(), "WEB-INF/web.xml" ); if ( webXmlFile.exists() ) { warArchiver.setWebxml( webXmlFile ); } warArchiver.setRecompressAddedZips( isRecompressZippedFiles() ); warArchiver.setIncludeEmptyDirs( isIncludeEmptyDirectories() ); if ( !failOnMissingWebXml ) { getLog().debug( "Build won't fail if web.xml file is missing." ); warArchiver.setExpectWebXml( false ); } // create archive archiver.createArchive( getSession(), getProject(), getArchive() ); // create the classes to be attached if necessary if ( isAttachClasses() ) { if ( isArchiveClasses() && getJarArchiver().getDestFile() != null ) { // special handling in case of archived classes: MWAR-240 File targetClassesFile = getTargetClassesFile(); FileUtils.copyFile( getJarArchiver().getDestFile(), targetClassesFile ); projectHelper.attachArtifact( getProject(), "jar", getClassesClassifier(), targetClassesFile ); } else { ClassesPackager packager = new ClassesPackager(); final File classesDirectory = packager.getClassesDirectory( getWebappDirectory() ); if ( classesDirectory.exists() ) { getLog().info( "Packaging classes" ); packager.packageClasses( classesDirectory, getTargetClassesFile(), getJarArchiver(), getSession(), getProject(), getArchive() ); projectHelper.attachArtifact( getProject(), "jar", getClassesClassifier(), getTargetClassesFile() ); } } } if ( this.classifier != null ) { projectHelper.attachArtifact( getProject(), "war", this.classifier, warFile ); } else { Artifact artifact = getProject().getArtifact(); if ( primaryArtifact ) { artifact.setFile( warFile ); } else if ( artifact.getFile() == null || artifact.getFile().isDirectory() ) { artifact.setFile( warFile ); } } } /** * @param basedir The basedir * @param finalName The finalName * @param classifier The classifier. * @param type The type. * @return {@link File} */ protected static File getTargetFile( File basedir, String finalName, String classifier, String type ) { if ( classifier == null ) { classifier = ""; } else if ( classifier.trim().length() > 0 && !classifier.startsWith( "-" ) ) { classifier = "-" + classifier; } return new File( basedir, finalName + classifier + "." + type ); } /** * @return The war {@link File} */ protected File getTargetWarFile() { return getTargetFile( new File( getOutputDirectory() ), getWarName(), getClassifier(), "war" ); } /** * @return The target class {@link File} */ protected File getTargetClassesFile() { return getTargetFile( new File( getOutputDirectory() ), getWarName(), getClassesClassifier(), "jar" ); } // Getters and Setters /** * @return {@link #classifier} */ public String getClassifier() { return classifier; } /** * @param classifier {@link #classifier} */ public void setClassifier( String classifier ) { this.classifier = classifier; } /** * @return The package excludes. */ public String[] getPackagingExcludes() { if ( StringUtils.isEmpty( packagingExcludes ) ) { return new String[0]; } else { return StringUtils.split( packagingExcludes, "," ); } } /** * @param packagingExcludes {@link #packagingExcludes} */ public void setPackagingExcludes( String packagingExcludes ) { this.packagingExcludes = packagingExcludes; } /** * @return The packaging includes. */ public String[] getPackagingIncludes() { if ( StringUtils.isEmpty( packagingIncludes ) ) { return new String[] { "**" }; } else { return StringUtils.split( packagingIncludes, "," ); } } /** * @param packagingIncludes {@link #packagingIncludes} */ public void setPackagingIncludes( String packagingIncludes ) { this.packagingIncludes = packagingIncludes; } /** * @return {@link #outputDirectory} */ public String getOutputDirectory() { return outputDirectory; } /** * @param outputDirectory {@link #outputDirectory} */ public void setOutputDirectory( String outputDirectory ) { this.outputDirectory = outputDirectory; } /** * @return {@link #warName} */ public String getWarName() { return warName; } /** * @param warName {@link #warName} */ public void setWarName( String warName ) { this.warName = warName; } /** * @return {@link #warArchiver} */ public WarArchiver getWarArchiver() { return warArchiver; } /** * @param warArchiver {@link #warArchiver} */ public void setWarArchiver( WarArchiver warArchiver ) { this.warArchiver = warArchiver; } /** * @return {@link #projectHelper} */ public MavenProjectHelper getProjectHelper() { return projectHelper; } /** * @param projectHelper {@link #projectHelper} */ public void setProjectHelper( MavenProjectHelper projectHelper ) { this.projectHelper = projectHelper; } /** * @return {@link #primaryArtifact} */ public boolean isPrimaryArtifact() { return primaryArtifact; } /** * @param primaryArtifact {@link #primaryArtifact} */ public void setPrimaryArtifact( boolean primaryArtifact ) { this.primaryArtifact = primaryArtifact; } /** * @return {@link #attachClasses} */ public boolean isAttachClasses() { return attachClasses; } /** * @param attachClasses {@link #attachClasses} */ public void setAttachClasses( boolean attachClasses ) { this.attachClasses = attachClasses; } /** * @return {@link #classesClassifier} */ public String getClassesClassifier() { return classesClassifier; } /** * @param classesClassifier {@link #classesClassifier} */ public void setClassesClassifier( String classesClassifier ) { this.classesClassifier = classesClassifier; } /** * @return {@link #failOnMissingWebXml} */ public boolean isFailOnMissingWebXml() { return failOnMissingWebXml; } /** * @param failOnMissingWebXml {@link #failOnMissingWebXml} */ public void setFailOnMissingWebXml( boolean failOnMissingWebXml ) { this.failOnMissingWebXml = failOnMissingWebXml; } public boolean isSkip() { return skip; } }
[MWAR-373] Make finalName readonly parameter o Made finalName readonly and remove the property. git-svn-id: 6038db50b076e48c7926ed71fd94f8e91be2fbc9@1740688 13f79535-47bb-0310-9956-ffa450edef68
maven-war-plugin/src/main/java/org/apache/maven/plugins/war/WarMojo.java
[MWAR-373] Make finalName readonly parameter o Made finalName readonly and remove the property.
<ide><path>aven-war-plugin/src/main/java/org/apache/maven/plugins/war/WarMojo.java <ide> /** <ide> * The name of the generated WAR. <ide> */ <del> @Parameter( defaultValue = "${project.build.finalName}", property = "war.warName", required = true ) <add> @Parameter( defaultValue = "${project.build.finalName}", required = true, readonly = true ) <ide> private String warName; <ide> <ide> /**
Java
apache-2.0
8c5ab966365f62698a6108e6730d530b17ef1c13
0
Talend/components,Talend/components
// ============================================================================ // // Copyright (C) 2006-2017 Talend Inc. - www.talend.com // // This source code is available under agreement available at // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt // // You should have received a copy of the agreement // along with this program; if not, write to Talend SA // 9 rue Pages 92150 Suresnes, France // // ============================================================================ package org.talend.components.processing.filterrow; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Set; import org.apache.avro.Schema; import org.talend.components.api.component.Connector; import org.talend.components.api.component.ISchemaListener; import org.talend.components.api.component.PropertyPathConnector; import org.talend.components.common.FixedConnectorsComponentProperties; import org.talend.components.common.SchemaProperties; import org.talend.daikon.avro.AvroUtils; import org.talend.daikon.properties.presentation.Form; import org.talend.daikon.properties.property.Property; import org.talend.daikon.properties.property.PropertyFactory; /** * TODO We currently support only one condition for each FilterRow. * * We can, for example, filter the name equals to "talend" or we can filter the age superior at 20, but there is no * possibility to do both on a single component. This is due to a restriction on the daikon framework, that do not * support a way to represent the Talend Studio tab, where you can dynamically add, remove and sort elements. * * (see TKDN-84) */ public class FilterRowProperties extends FixedConnectorsComponentProperties { // Define the Property // input schema public transient PropertyPathConnector MAIN_CONNECTOR = new PropertyPathConnector(Connector.MAIN_NAME, "main"); public SchemaProperties main = new SchemaProperties("main") { @SuppressWarnings("unused") public void afterSchema() { updateOutputSchemas(); } }; // output schema public transient PropertyPathConnector FLOW_CONNECTOR = new PropertyPathConnector(Connector.MAIN_NAME, "schemaFlow"); public SchemaProperties schemaFlow = new SchemaProperties("schemaFlow"); // reject schema public transient PropertyPathConnector REJECT_CONNECTOR = new PropertyPathConnector(Connector.REJECT_NAME, "schemaReject"); public SchemaProperties schemaReject = new SchemaProperties("schemaReject"); /** * This enum will be filled with the name of the input columns. */ public Property<String> columnName = PropertyFactory.newString("columnName", ""); /** * This enum represent the function applicable to the input value before making the comparison. The functions * displayed by the UI are dependent of the type of the columnName. * * If columnName's type is numerical (Integer, Long, Float or Double), Function will contain "ABS_VALUE" and "EMPTY" * * If columnName's type is String, Function will contain "LC", "UC", "LCFIRST", "UCFIRST", "LENGTH", "MATCH" and * "EMPTY" * * For any other case, Function will contain "EMPTY". */ public Property<String> function = PropertyFactory.newString("function", "EMPTY") .setPossibleValues(ConditionsRowConstant.ALL_FUNCTIONS); /** * This enum represent the comparison function. The operator displayed by the UI are dependent of the function * selected by the user. * * If the function is "MATCH", Operator will contain only "==" and "!=". * * If the function is not "MATCH" but the columnName's type is String, Operator will contain only "==", "!=", * "<", "<=", ">", ">=" and "CONTAINS". * * For any other case, Operator will contain "==", "!=", "<", "<=", ">" and ">=". */ public Property<String> operator = PropertyFactory.newString("operator", "==") .setPossibleValues(ConditionsRowConstant.DEFAULT_OPERATORS); /** * This field is the reference value of the comparison. It will be filled directly by the user. */ public Property<String> value = PropertyFactory.newString("value"); public transient ISchemaListener schemaListener; public FilterRowProperties(String name) { super(name); } @Override public void setupLayout() { super.setupLayout(); Form mainForm = new Form(this, Form.MAIN); mainForm.addRow(columnName); mainForm.addColumn(function); mainForm.addColumn(operator); mainForm.addColumn(value); } @Override public void setupProperties() { super.setupProperties(); schemaListener = new ISchemaListener() { @Override public void afterSchema() { updateOutputSchemas(); updateConditionsRow(); } }; } @Override public void refreshLayout(Form form) { super.refreshLayout(form); if (form.getName().equals(Form.MAIN)) { updateConditionsRow(); } } @Override protected Set<PropertyPathConnector> getAllSchemaPropertiesConnectors(boolean isOutputConnection) { HashSet<PropertyPathConnector> connectors = new LinkedHashSet<PropertyPathConnector>(); if (isOutputConnection) { // output schemas connectors.add(FLOW_CONNECTOR); connectors.add(REJECT_CONNECTOR); } else { // input schema connectors.add(MAIN_CONNECTOR); } return connectors; } protected void updateOutputSchemas() { // Copy the "main" schema into the "flow" schema Schema inputSchema = main.schema.getValue(); schemaFlow.schema.setValue(inputSchema); // Add error field to create the "reject" schema Schema rejectSchema = AvroUtils.createRejectSchema(inputSchema, "rejectOutput"); schemaReject.schema.setValue(rejectSchema); } /** * TODO: This method will be used once trigger will be implemented on TFD UI */ private void updateOperatorColumn() { operator.setPossibleValues(ConditionsRowConstant.DEFAULT_OPERATORS); } /** * TODO: This method will be used once the field autocompletion will be implemented */ private void updateFunctionColumn() { function.setPossibleValues(ConditionsRowConstant.ALL_FUNCTIONS); // Finally check the operator updateOperatorColumn(); } /** * TODO: This method will be used once the field autocompletion will be implemented */ protected void updateConditionsRow() { updateFunctionColumn(); } /** * TODO: This method will be used once the field autocompletion will be implemented */ private Boolean isString(Schema.Type type) { return Schema.Type.STRING.equals(type); } /** * TODO: This method will be used once the field autocompletion will be implemented */ private Boolean isNumerical(Schema.Type type) { return Schema.Type.INT.equals(type) || Schema.Type.LONG.equals(type) // || Schema.Type.DOUBLE.equals(type) || Schema.Type.FLOAT.equals(type); } }
components/components-processing/processing-definition/src/main/java/org/talend/components/processing/filterrow/FilterRowProperties.java
// ============================================================================ // // Copyright (C) 2006-2017 Talend Inc. - www.talend.com // // This source code is available under agreement available at // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt // // You should have received a copy of the agreement // along with this program; if not, write to Talend SA // 9 rue Pages 92150 Suresnes, France // // ============================================================================ package org.talend.components.processing.filterrow; import java.util.HashSet; import java.util.Set; import org.apache.avro.Schema; import org.talend.components.api.component.Connector; import org.talend.components.api.component.ISchemaListener; import org.talend.components.api.component.PropertyPathConnector; import org.talend.components.common.FixedConnectorsComponentProperties; import org.talend.components.common.SchemaProperties; import org.talend.daikon.avro.AvroUtils; import org.talend.daikon.properties.presentation.Form; import org.talend.daikon.properties.property.Property; import org.talend.daikon.properties.property.PropertyFactory; /** * TODO We currently support only one condition for each FilterRow. * * We can, for example, filter the name equals to "talend" or we can filter the age superior at 20, but there is no * possibility to do both on a single component. This is due to a restriction on the daikon framework, that do not * support a way to represent the Talend Studio tab, where you can dynamically add, remove and sort elements. * * (see TKDN-84) */ public class FilterRowProperties extends FixedConnectorsComponentProperties { // Define the Property // input schema public transient PropertyPathConnector MAIN_CONNECTOR = new PropertyPathConnector(Connector.MAIN_NAME, "main"); public SchemaProperties main = new SchemaProperties("main") { @SuppressWarnings("unused") public void afterSchema() { updateOutputSchemas(); } }; // output schema public transient PropertyPathConnector FLOW_CONNECTOR = new PropertyPathConnector(Connector.MAIN_NAME, "schemaFlow"); public SchemaProperties schemaFlow = new SchemaProperties("schemaFlow"); // reject schema public transient PropertyPathConnector REJECT_CONNECTOR = new PropertyPathConnector(Connector.REJECT_NAME, "schemaReject"); public SchemaProperties schemaReject = new SchemaProperties("schemaReject"); /** * This enum will be filled with the name of the input columns. */ public Property<String> columnName = PropertyFactory.newString("columnName", ""); /** * This enum represent the function applicable to the input value before making the comparison. The functions * displayed by the UI are dependent of the type of the columnName. * * If columnName's type is numerical (Integer, Long, Float or Double), Function will contain "ABS_VALUE" and "EMPTY" * * If columnName's type is String, Function will contain "LC", "UC", "LCFIRST", "UCFIRST", "LENGTH", "MATCH" and * "EMPTY" * * For any other case, Function will contain "EMPTY". */ public Property<String> function = PropertyFactory.newString("function", "EMPTY") .setPossibleValues(ConditionsRowConstant.ALL_FUNCTIONS); /** * This enum represent the comparison function. The operator displayed by the UI are dependent of the function * selected by the user. * * If the function is "MATCH", Operator will contain only "==" and "!=". * * If the function is not "MATCH" but the columnName's type is String, Operator will contain only "==", "!=", * "<", "<=", ">", ">=" and "CONTAINS". * * For any other case, Operator will contain "==", "!=", "<", "<=", ">" and ">=". */ public Property<String> operator = PropertyFactory.newString("operator", "==") .setPossibleValues(ConditionsRowConstant.DEFAULT_OPERATORS); /** * This field is the reference value of the comparison. It will be filled directly by the user. */ public Property<String> value = PropertyFactory.newString("value"); public transient ISchemaListener schemaListener; public FilterRowProperties(String name) { super(name); } @Override public void setupLayout() { super.setupLayout(); Form mainForm = new Form(this, Form.MAIN); mainForm.addRow(columnName); mainForm.addColumn(function); mainForm.addColumn(operator); mainForm.addColumn(value); } @Override public void setupProperties() { super.setupProperties(); schemaListener = new ISchemaListener() { @Override public void afterSchema() { updateOutputSchemas(); updateConditionsRow(); } }; } @Override public void refreshLayout(Form form) { super.refreshLayout(form); if (form.getName().equals(Form.MAIN)) { updateConditionsRow(); } } @Override protected Set<PropertyPathConnector> getAllSchemaPropertiesConnectors(boolean isOutputConnection) { HashSet<PropertyPathConnector> connectors = new HashSet<PropertyPathConnector>(); if (isOutputConnection) { // output schemas connectors.add(FLOW_CONNECTOR); connectors.add(REJECT_CONNECTOR); } else { // input schema connectors.add(MAIN_CONNECTOR); } return connectors; } protected void updateOutputSchemas() { // Copy the "main" schema into the "flow" schema Schema inputSchema = main.schema.getValue(); schemaFlow.schema.setValue(inputSchema); // Add error field to create the "reject" schema Schema rejectSchema = AvroUtils.createRejectSchema(inputSchema, "rejectOutput"); schemaReject.schema.setValue(rejectSchema); } /** * TODO: This method will be used once trigger will be implemented on TFD UI */ private void updateOperatorColumn() { operator.setPossibleValues(ConditionsRowConstant.DEFAULT_OPERATORS); } /** * TODO: This method will be used once the field autocompletion will be implemented */ private void updateFunctionColumn() { function.setPossibleValues(ConditionsRowConstant.ALL_FUNCTIONS); // Finally check the operator updateOperatorColumn(); } /** * TODO: This method will be used once the field autocompletion will be implemented */ protected void updateConditionsRow() { updateFunctionColumn(); } /** * TODO: This method will be used once the field autocompletion will be implemented */ private Boolean isString(Schema.Type type) { return Schema.Type.STRING.equals(type); } /** * TODO: This method will be used once the field autocompletion will be implemented */ private Boolean isNumerical(Schema.Type type) { return Schema.Type.INT.equals(type) || Schema.Type.LONG.equals(type) // || Schema.Type.DOUBLE.equals(type) || Schema.Type.FLOAT.equals(type); } }
bug(TFD-840): force the output link order on FilterRow. (#603)
components/components-processing/processing-definition/src/main/java/org/talend/components/processing/filterrow/FilterRowProperties.java
bug(TFD-840): force the output link order on FilterRow. (#603)
<ide><path>omponents/components-processing/processing-definition/src/main/java/org/talend/components/processing/filterrow/FilterRowProperties.java <ide> package org.talend.components.processing.filterrow; <ide> <ide> import java.util.HashSet; <add>import java.util.LinkedHashSet; <ide> import java.util.Set; <ide> <ide> import org.apache.avro.Schema; <ide> <ide> @Override <ide> protected Set<PropertyPathConnector> getAllSchemaPropertiesConnectors(boolean isOutputConnection) { <del> HashSet<PropertyPathConnector> connectors = new HashSet<PropertyPathConnector>(); <add> HashSet<PropertyPathConnector> connectors = new LinkedHashSet<PropertyPathConnector>(); <ide> if (isOutputConnection) { <ide> // output schemas <ide> connectors.add(FLOW_CONNECTOR);
Java
mit
4a64cb3337bdd467f465c856f9fec1e63259bb39
0
TinusTinus/snakesolver
package nl.mvdr.snake.solver; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Optional; import java.util.Set; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; import nl.mvdr.snake.model.Snake; import nl.mvdr.snake.model.TurnDirection; import nl.mvdr.snake.util.Primes; /** * Creates a prime snake using brute force methods. * * @author Martijn van de Rijdt */ public class LimitedBruteForceSolver implements Supplier<Snake> { /** Comparator for increasing score values. */ private static final Comparator<Snake> SCORE_COMPARATOR = (left, right) -> Integer.compare(left.getScore(), right.getScore()); /** Maximum number of intermediate results. */ private static final int MAX_INTERMEDIATE_RESULTS = 2_000; /** Intended length of the snake. */ private final int length; /** * Constructor. * * @param length intended length for the snake */ public LimitedBruteForceSolver(int length) { super(); if (length < 2) { throw new IllegalArgumentException("Length must be at least 2, was " + length); } this.length = length; } /** {@inheritDoc} */ @Override public Snake get() { // solutions are symmetrical in the first turn; just pick a direction Snake startSnake = new Snake() .step().get() .step().get() .turn(TurnDirection.LEFT); Set<Snake> results = Collections.singleton(startSnake); List<Integer> primeGaps = Primes.sieveGaps(length); int stepsTaken = 2; for (int i = 1; i < primeGaps.size(); i++) { int stepsUntilNextTurn = primeGaps.get(i); results = results.parallelStream() .map(snake -> snake.step(stepsUntilNextTurn)) .filter(optional -> optional.isPresent()) .map(Optional::get) .flatMap(snake -> Stream.of(snake.turn(TurnDirection.LEFT), snake.turn(TurnDirection.RIGHT))) // In order to keep the data set from growing exponentially, // only keep the first MAX_INTERMEDIATE_RESULTS snakes with the lowest scores. // Note that this means this algorithm is not guaranteed to provide a minimal score answer! // The result will be a local minimum. .sorted(SCORE_COMPARATOR) .limit(MAX_INTERMEDIATE_RESULTS) .collect(Collectors.toSet()); stepsTaken += stepsUntilNextTurn; System.out.println(stepsTaken + " / " + length + " steps"); } int stepsLeft = length - stepsTaken; // Take the final steps to create a snake of the desired total length, and find one with the lowest score return results.parallelStream() .map(snake -> snake.step(stepsLeft)) .filter(optional -> optional.isPresent()) .map(Optional::get) .min(SCORE_COMPARATOR) .orElseThrow(() -> new IllegalStateException("Failed to calculate a fitting snake.")); } }
nl/mvdr/snake/solver/LimitedBruteForceSolver.java
package nl.mvdr.snake.solver; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Optional; import java.util.Set; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; import nl.mvdr.snake.model.Snake; import nl.mvdr.snake.model.TurnDirection; import nl.mvdr.snake.util.Primes; /** * Creates a prime snake using brute force methods. * * @author Martijn van de Rijdt */ public class LimitedBruteForceSolver implements Supplier<Snake> { /** Comparator for increasing score values. */ private static final Comparator<Snake> SCORE_COMPARATOR = (left, right) -> Integer.compare(left.getScore(), right.getScore()); /** Maximum number of intermediate results. */ private static final int MAX_INTERMEDIATE_RESULTS = 500; /** Intended length of the snake. */ private final int length; /** * Constructor. * * @param length intended length for the snake */ public LimitedBruteForceSolver(int length) { super(); if (length < 2) { throw new IllegalArgumentException("Length must be at least 2, was " + length); } this.length = length; } /** {@inheritDoc} */ @Override public Snake get() { // solutions are symmetrical in the first turn; just pick a direction Snake startSnake = new Snake() .step().get() .step().get() .turn(TurnDirection.LEFT); Set<Snake> results = Collections.singleton(startSnake); List<Integer> primeGaps = Primes.sieveGaps(length); int stepsTaken = 2; for (int i = 1; i < primeGaps.size(); i++) { int stepsUntilNextTurn = primeGaps.get(i); results = results.parallelStream() .map(snake -> snake.step(stepsUntilNextTurn)) .filter(optional -> optional.isPresent()) .map(Optional::get) .flatMap(snake -> Stream.of(snake.turn(TurnDirection.LEFT), snake.turn(TurnDirection.RIGHT))) // In order to keep the data set under control, only keep the first MAX_INTERMEDIATE_RESULTS snakes with the lowest scores. // Note that this means this algorithm is not GUARANTEED to provide a minimal score answer. .sorted(SCORE_COMPARATOR) .limit(MAX_INTERMEDIATE_RESULTS) .collect(Collectors.toSet()); stepsTaken += stepsUntilNextTurn; System.out.println(stepsTaken + " steps taken"); } int stepsLeft = length - stepsTaken; // Take the final steps to create a snake of the desired total length, and find one with the lowest score return results.parallelStream() .map(snake -> snake.step(stepsLeft)) .filter(optional -> optional.isPresent()) .map(Optional::get) .min(SCORE_COMPARATOR) .orElseThrow(() -> new IllegalStateException("Failed to calculate a fitting snake.")); } }
Comments / logging.
nl/mvdr/snake/solver/LimitedBruteForceSolver.java
Comments / logging.
<ide><path>l/mvdr/snake/solver/LimitedBruteForceSolver.java <ide> private static final Comparator<Snake> SCORE_COMPARATOR = (left, right) -> Integer.compare(left.getScore(), right.getScore()); <ide> <ide> /** Maximum number of intermediate results. */ <del> private static final int MAX_INTERMEDIATE_RESULTS = 500; <add> private static final int MAX_INTERMEDIATE_RESULTS = 2_000; <ide> <ide> /** Intended length of the snake. */ <ide> private final int length; <ide> .filter(optional -> optional.isPresent()) <ide> .map(Optional::get) <ide> .flatMap(snake -> Stream.of(snake.turn(TurnDirection.LEFT), snake.turn(TurnDirection.RIGHT))) <del> // In order to keep the data set under control, only keep the first MAX_INTERMEDIATE_RESULTS snakes with the lowest scores. <del> // Note that this means this algorithm is not GUARANTEED to provide a minimal score answer. <add> // In order to keep the data set from growing exponentially, <add> // only keep the first MAX_INTERMEDIATE_RESULTS snakes with the lowest scores. <add> // Note that this means this algorithm is not guaranteed to provide a minimal score answer! <add> // The result will be a local minimum. <ide> .sorted(SCORE_COMPARATOR) <ide> .limit(MAX_INTERMEDIATE_RESULTS) <ide> .collect(Collectors.toSet()); <ide> <ide> stepsTaken += stepsUntilNextTurn; <ide> <del> System.out.println(stepsTaken + " steps taken"); <add> System.out.println(stepsTaken + " / " + length + " steps"); <ide> } <ide> <ide> int stepsLeft = length - stepsTaken;
Java
apache-2.0
error: pathspec 'jsimpledb-coreapi/src/test/java/org/jsimpledb/core/DeleteCascadeTest.java' did not match any file(s) known to git
f3283dffdabc0e4cbe3b95f380e8aa9d6b62ecc9
1
archiecobbs/jsimpledb,permazen/permazen,archiecobbs/jsimpledb,archiecobbs/jsimpledb,permazen/permazen,permazen/permazen
/* * Copyright (C) 2015 Archie L. Cobbs. All rights reserved. */ package org.jsimpledb.core; import java.io.ByteArrayInputStream; import org.jsimpledb.kv.simple.SimpleKVDatabase; import org.jsimpledb.schema.SchemaModel; import org.testng.Assert; import org.testng.annotations.Test; public class DeleteCascadeTest extends CoreAPITestSupport { @Test public void testDeleteCascade() throws Exception { final SimpleKVDatabase kvstore = new SimpleKVDatabase(); final Database db = new Database(kvstore); final String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<Schema formatVersion=\"1\">\n" + " <ObjectType name=\"Person\" storageId=\"1\">\n" + " <ReferenceField storageId=\"2\" name=\"Person\" cascadeDelete=\"true\" onDelete=\"EXCEPTION\"/>\n" + " </ObjectType>\n" + "</Schema>\n"; final SchemaModel schema = SchemaModel.fromXML(new ByteArrayInputStream(xml.getBytes("UTF-8"))); final Transaction tx = db.createTransaction(schema, 1, true); final ObjId id1 = tx.create(1); final ObjId id2 = tx.create(1); tx.writeSimpleField(id1, 2, id2, false); tx.delete(id1); Assert.assertFalse(tx.exists(id1)); Assert.assertFalse(tx.exists(id2)); tx.commit(); } }
jsimpledb-coreapi/src/test/java/org/jsimpledb/core/DeleteCascadeTest.java
Add simple unit test for delete cascade.
jsimpledb-coreapi/src/test/java/org/jsimpledb/core/DeleteCascadeTest.java
Add simple unit test for delete cascade.
<ide><path>simpledb-coreapi/src/test/java/org/jsimpledb/core/DeleteCascadeTest.java <add> <add>/* <add> * Copyright (C) 2015 Archie L. Cobbs. All rights reserved. <add> */ <add> <add>package org.jsimpledb.core; <add> <add>import java.io.ByteArrayInputStream; <add> <add>import org.jsimpledb.kv.simple.SimpleKVDatabase; <add>import org.jsimpledb.schema.SchemaModel; <add>import org.testng.Assert; <add>import org.testng.annotations.Test; <add> <add>public class DeleteCascadeTest extends CoreAPITestSupport { <add> <add> @Test <add> public void testDeleteCascade() throws Exception { <add> <add> final SimpleKVDatabase kvstore = new SimpleKVDatabase(); <add> final Database db = new Database(kvstore); <add> <add> final String xml = <add> "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" <add> + "<Schema formatVersion=\"1\">\n" <add> + " <ObjectType name=\"Person\" storageId=\"1\">\n" <add> + " <ReferenceField storageId=\"2\" name=\"Person\" cascadeDelete=\"true\" onDelete=\"EXCEPTION\"/>\n" <add> + " </ObjectType>\n" <add> + "</Schema>\n"; <add> final SchemaModel schema = SchemaModel.fromXML(new ByteArrayInputStream(xml.getBytes("UTF-8"))); <add> <add> final Transaction tx = db.createTransaction(schema, 1, true); <add> <add> final ObjId id1 = tx.create(1); <add> final ObjId id2 = tx.create(1); <add> <add> tx.writeSimpleField(id1, 2, id2, false); <add> <add> tx.delete(id1); <add> <add> Assert.assertFalse(tx.exists(id1)); <add> Assert.assertFalse(tx.exists(id2)); <add> <add> tx.commit(); <add> } <add>} <add>
Java
apache-2.0
7291031a46d2d280c3e9b70c2c48793828e7e6b0
0
apache/directory-server,drankye/directory-server,drankye/directory-server,apache/directory-server
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.server.core.authn; import java.net.SocketAddress; import org.apache.directory.api.ldap.model.constants.AuthenticationLevel; import org.apache.directory.api.ldap.model.entry.Entry; import org.apache.directory.api.ldap.model.exception.LdapAuthenticationException; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.name.Dn; import org.apache.directory.api.util.Strings; import org.apache.directory.ldap.client.api.LdapConnectionConfig; import org.apache.directory.ldap.client.api.LdapNetworkConnection; import org.apache.directory.ldap.client.api.NoVerificationTrustManager; import org.apache.directory.server.core.api.LdapPrincipal; import org.apache.directory.server.core.api.interceptor.context.BindOperationContext; import org.apache.directory.server.i18n.I18n; import org.apache.mina.core.session.IoSession; /** * Authenticator delegating to another LDAP server. * * @author <a href="mailto:[email protected]">Apache Directory Project</a> */ public class DelegatingAuthenticator extends AbstractAuthenticator { /** A speedup for logger in debug mode */ private static final boolean IS_DEBUG = LOG.isDebugEnabled(); /** The host in charge of delegated authentication */ private String delegateHost; /** The associated port */ private int delegatePort; /** Tells if we use SSL to connect */ private boolean delegateSsl; /** Tells if we use StartTLS to connect */ private boolean delegateTls; /** The base DN which will be the starting point from which we use the delegator authenticator */ private String delegateBaseDn; /** The SSL TrustManager FQCN to use */ private String delegateSslTrustManagerFQCN; /** The startTLS TrustManager FQCN to use */ private String delegateTlsTrustManagerFQCN; /** * Creates a new instance. * @see AbstractAuthenticator */ public DelegatingAuthenticator() { super( AuthenticationLevel.SIMPLE ); } /** * Creates a new instance, for a specific authentication level. * @see AbstractAuthenticator * @param type The relevant AuthenticationLevel */ protected DelegatingAuthenticator( AuthenticationLevel type ) { super( type ); } /** * @return the delegateHost */ public String getDelegateHost() { return delegateHost; } /** * @param delegateHost the delegateHost to set */ public void setDelegateHost( String delegateHost ) { this.delegateHost = delegateHost; } /** * @return the delegatePort */ public int getDelegatePort() { return delegatePort; } /** * @param delegatePort the delegatePort to set */ public void setDelegatePort( int delegatePort ) { this.delegatePort = delegatePort; } /** * @return the delegateSsl */ public boolean isDelegateSsl() { return delegateSsl; } /** * @param delegateSsl the delegateSsl to set */ public void setDelegateSsl( boolean delegateSsl ) { this.delegateSsl = delegateSsl; } /** * @return the delegateBaseDn */ public String getDelegateBaseDn() { return delegateBaseDn; } /** * @param delegateBaseDn the delegateBaseDn to set */ public void setDelegateBaseDn( String delegateBaseDn ) { this.delegateBaseDn = delegateBaseDn; } /** * @return the delegateTls */ public boolean isDelegateTls() { return delegateTls; } /** * @param delegateTls the delegateTls to set */ public void setDelegateTls( boolean delegateTls ) { this.delegateTls = delegateTls; } /** * @return the delegateSslTrustManagerFQCN */ public String getDelegateSslTrustManagerFQCN() { return delegateSslTrustManagerFQCN; } /** * @param delegateSslTrustManagerFQCN the delegateSslTrustManagerFQCN to set */ public void setDelegateSslTrustManagerFQCN( String delegateSslTrustManagerFQCN ) { this.delegateSslTrustManagerFQCN = delegateSslTrustManagerFQCN; } /** * @return the delegateTlsTrustManagerFQCN */ public String getDelegateTlsTrustManagerFQCN() { return delegateTlsTrustManagerFQCN; } /** * @param delegateTlsTrustManagerFQCN the delegateTlsTrustManagerFQCN to set */ public void setDelegateTlsTrustManagerFQCN( String delegateTlsTrustManagerFQCN ) { this.delegateTlsTrustManagerFQCN = delegateTlsTrustManagerFQCN; } /** * {@inheritDoc} */ public LdapPrincipal authenticate( BindOperationContext bindContext ) throws Exception { LdapPrincipal principal = null; if ( IS_DEBUG ) { LOG.debug( "Authenticating {}", bindContext.getDn() ); } // First, check that the Bind DN is under the delegateBaseDn Dn bindDn = bindContext.getDn(); // Don't authenticate using this authenticator if the Bind ND is not a descendant of the // configured delegate base DN (or if it's null) if ( ( delegateBaseDn == null ) || ( !bindDn.isDescendantOf( delegateBaseDn ) ) ) { return null; } LdapConnectionConfig connectionConfig; LdapNetworkConnection ldapConnection; // Create a connection on the remote host if ( delegateTls ) { connectionConfig = new LdapConnectionConfig(); connectionConfig.setLdapHost( delegateHost ); connectionConfig.setLdapPort( delegatePort ); connectionConfig.setTrustManagers( new NoVerificationTrustManager() ); ldapConnection = new LdapNetworkConnection( connectionConfig ); ldapConnection.connect(); ldapConnection.startTls(); } else if ( delegateSsl ) { connectionConfig = new LdapConnectionConfig(); connectionConfig.setLdapHost( delegateHost ); connectionConfig.setUseSsl( true ); connectionConfig.setLdapPort( delegatePort ); connectionConfig.setTrustManagers( new NoVerificationTrustManager() ); ldapConnection = new LdapNetworkConnection( connectionConfig ); ldapConnection.connect(); } else { connectionConfig = new LdapConnectionConfig(); connectionConfig.setLdapHost( delegateHost ); connectionConfig.setLdapPort( delegatePort ); ldapConnection = new LdapNetworkConnection( delegateHost, delegatePort ); ldapConnection.connect(); } ldapConnection.setTimeOut( 0L ); try { // Try to bind try { ldapConnection.bind( bindDn, Strings.utf8ToString( bindContext.getCredentials() ) ); // no need to remain bound to delegate host ldapConnection.unBind(); } catch ( LdapException le ) { String message = I18n.err( I18n.ERR_230, bindDn.getName() ); LOG.info( message ); throw new LdapAuthenticationException( message ); } // Create the new principal principal = new LdapPrincipal( getDirectoryService().getSchemaManager(), bindDn, AuthenticationLevel.SIMPLE, bindContext.getCredentials() ); IoSession session = bindContext.getIoSession(); if ( session != null ) { SocketAddress clientAddress = session.getRemoteAddress(); principal.setClientAddress( clientAddress ); SocketAddress serverAddress = session.getServiceAddress(); principal.setServerAddress( serverAddress ); } return principal; } catch ( LdapException e ) { // Bad password ... String message = I18n.err( I18n.ERR_230, bindDn.getName() ); LOG.info( message ); throw new LdapAuthenticationException( message ); } finally { ldapConnection.close(); } } /** * We don't handle any password policy when using a delegated authentication */ public void checkPwdPolicy( Entry userEntry ) throws LdapException { // no check for delegating authentication } /** * We don't handle any cache when using a delegated authentication */ public void invalidateCache( Dn bindDn ) { // cache is not implemented here } }
interceptors/authn/src/main/java/org/apache/directory/server/core/authn/DelegatingAuthenticator.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.directory.server.core.authn; import java.net.SocketAddress; import org.apache.directory.api.ldap.model.constants.AuthenticationLevel; import org.apache.directory.api.ldap.model.entry.Entry; import org.apache.directory.api.ldap.model.exception.LdapAuthenticationException; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.name.Dn; import org.apache.directory.api.util.Strings; import org.apache.directory.ldap.client.api.LdapConnectionConfig; import org.apache.directory.ldap.client.api.LdapNetworkConnection; import org.apache.directory.ldap.client.api.NoVerificationTrustManager; import org.apache.directory.server.core.api.LdapPrincipal; import org.apache.directory.server.core.api.interceptor.context.BindOperationContext; import org.apache.directory.server.i18n.I18n; import org.apache.mina.core.session.IoSession; /** * Authenticator delegating to another LDAP server. * * @author <a href="mailto:[email protected]">Apache Directory Project</a> */ public class DelegatingAuthenticator extends AbstractAuthenticator { /** A speedup for logger in debug mode */ private static final boolean IS_DEBUG = LOG.isDebugEnabled(); /** The host in charge of delegated authentication */ private String delegateHost; /** The associated port */ private int delegatePort; /** Tells if we use SSL to connect */ private boolean delegateSsl; /** Tells if we use StartTLS to connect */ private boolean delegateTls; /** The base DN which will be the starting point from which we use the delegator authenticator */ private String delegateBaseDn; /** The SSL TrustManager FQCN to use */ private String delegateSslTrustManagerFQCN; /** The startTLS TrustManager FQCN to use */ private String delegateTlsTrustManagerFQCN; /** * Creates a new instance. * @see AbstractAuthenticator */ public DelegatingAuthenticator() { super( AuthenticationLevel.SIMPLE ); } /** * Creates a new instance, for a specific authentication level. * @see AbstractAuthenticator * @param type The relevant AuthenticationLevel */ protected DelegatingAuthenticator( AuthenticationLevel type ) { super( type ); } /** * @return the delegateHost */ public String getDelegateHost() { return delegateHost; } /** * @param delegateHost the delegateHost to set */ public void setDelegateHost( String delegateHost ) { this.delegateHost = delegateHost; } /** * @return the delegatePort */ public int getDelegatePort() { return delegatePort; } /** * @param delegatePort the delegatePort to set */ public void setDelegatePort( int delegatePort ) { this.delegatePort = delegatePort; } /** * @return the delegateSsl */ public boolean isDelegateSsl() { return delegateSsl; } /** * @param delegateSsl the delegateSsl to set */ public void setDelegateSsl( boolean delegateSsl ) { this.delegateSsl = delegateSsl; } /** * @return the delegateBaseDn */ public String getDelegateBaseDn() { return delegateBaseDn; } /** * @param delegateBaseDn the delegateBaseDn to set */ public void setDelegateBaseDn( String delegateBaseDn ) { this.delegateBaseDn = delegateBaseDn; } /** * @return the delegateTls */ public boolean isDelegateTls() { return delegateTls; } /** * @param delegateTls the delegateTls to set */ public void setDelegateTls( boolean delegateTls ) { this.delegateTls = delegateTls; } /** * @return the delegateSslTrustManagerFQCN */ public String getDelegateSslTrustManagerFQCN() { return delegateSslTrustManagerFQCN; } /** * @param delegateSslTrustManagerFQCN the delegateSslTrustManagerFQCN to set */ public void setDelegateSslTrustManagerFQCN( String delegateSslTrustManagerFQCN ) { this.delegateSslTrustManagerFQCN = delegateSslTrustManagerFQCN; } /** * @return the delegateTlsTrustManagerFQCN */ public String getDelegateTlsTrustManagerFQCN() { return delegateTlsTrustManagerFQCN; } /** * @param delegateTlsTrustManagerFQCN the delegateTlsTrustManagerFQCN to set */ public void setDelegateTlsTrustManagerFQCN( String delegateTlsTrustManagerFQCN ) { this.delegateTlsTrustManagerFQCN = delegateTlsTrustManagerFQCN; } /** * {@inheritDoc} */ public LdapPrincipal authenticate( BindOperationContext bindContext ) throws Exception { LdapPrincipal principal = null; if ( IS_DEBUG ) { LOG.debug( "Authenticating {}", bindContext.getDn() ); } // First, check that the Bind DN is under the delegateBaseDn Dn bindDn = bindContext.getDn(); if ( ( delegateBaseDn != null ) && ( !bindDn.isDescendantOf( delegateBaseDn ) ) ) { return null; } LdapConnectionConfig connectionConfig; LdapNetworkConnection ldapConnection; // Create a connection on the remote host if ( delegateTls ) { connectionConfig = new LdapConnectionConfig(); connectionConfig.setLdapHost( delegateHost ); connectionConfig.setLdapPort( delegatePort ); connectionConfig.setTrustManagers( new NoVerificationTrustManager() ); ldapConnection = new LdapNetworkConnection( connectionConfig ); ldapConnection.connect(); ldapConnection.startTls(); } else if ( delegateSsl ) { connectionConfig = new LdapConnectionConfig(); connectionConfig.setLdapHost( delegateHost ); connectionConfig.setUseSsl( true ); connectionConfig.setLdapPort( delegatePort ); connectionConfig.setTrustManagers( new NoVerificationTrustManager() ); ldapConnection = new LdapNetworkConnection( connectionConfig ); ldapConnection.connect(); } else { connectionConfig = new LdapConnectionConfig(); connectionConfig.setLdapHost( delegateHost ); connectionConfig.setLdapPort( delegatePort ); ldapConnection = new LdapNetworkConnection( delegateHost, delegatePort ); ldapConnection.connect(); } ldapConnection.setTimeOut( 0L ); try { // Try to bind try { ldapConnection.bind( bindDn, Strings.utf8ToString( bindContext.getCredentials() ) ); // no need to remain bound to delegate host ldapConnection.unBind(); } catch ( LdapException le ) { String message = I18n.err( I18n.ERR_230, bindDn.getName() ); LOG.info( message ); throw new LdapAuthenticationException( message ); } // Create the new principal principal = new LdapPrincipal( getDirectoryService().getSchemaManager(), bindDn, AuthenticationLevel.SIMPLE, bindContext.getCredentials() ); IoSession session = bindContext.getIoSession(); if ( session != null ) { SocketAddress clientAddress = session.getRemoteAddress(); principal.setClientAddress( clientAddress ); SocketAddress serverAddress = session.getServiceAddress(); principal.setServerAddress( serverAddress ); } return principal; } catch ( LdapException e ) { // Bad password ... String message = I18n.err( I18n.ERR_230, bindDn.getName() ); LOG.info( message ); throw new LdapAuthenticationException( message ); } finally { ldapConnection.close(); } } /** * We don't handle any password policy when using a delegated authentication */ public void checkPwdPolicy( Entry userEntry ) throws LdapException { // no check for delegating authentication } /** * We don't handle any cache when using a delegated authentication */ public void invalidateCache( Dn bindDn ) { // cache is not implemented here } }
Fixed the check for the delegateBaseDN git-svn-id: 90776817adfbd895fc5cfa90f675377e0a62e745@1675229 13f79535-47bb-0310-9956-ffa450edef68
interceptors/authn/src/main/java/org/apache/directory/server/core/authn/DelegatingAuthenticator.java
Fixed the check for the delegateBaseDN
<ide><path>nterceptors/authn/src/main/java/org/apache/directory/server/core/authn/DelegatingAuthenticator.java <ide> // First, check that the Bind DN is under the delegateBaseDn <ide> Dn bindDn = bindContext.getDn(); <ide> <del> if ( ( delegateBaseDn != null ) && ( !bindDn.isDescendantOf( delegateBaseDn ) ) ) <add> // Don't authenticate using this authenticator if the Bind ND is not a descendant of the <add> // configured delegate base DN (or if it's null) <add> if ( ( delegateBaseDn == null ) || ( !bindDn.isDescendantOf( delegateBaseDn ) ) ) <ide> { <ide> return null; <ide> }
JavaScript
mit
e58e039a58b7f953f6818d9dee65a5e6804ec1c0
0
anutron/art-widgets,cloudera/art-widgets
/* --- description: Creates a SplitView instances for all elements that have the css class .splitview (and children with .left_col and .right_col). provides: [Behavior.SplitView] requires: [Behavior/Behavior, Widgets/ART.SplitView, More/Element.Delegation] script: Behavior.SplitView.js ... */ (function(){ Behavior.addGlobalFilters({ SplitView: function(element, methods) { //get the left and right column and instantiate an ART.SplitView //if the container has the class "resizable" then make it so //ditto for the foldable option //if the left or right columns have explicit style="width: Xpx" assignments //resize the side to match that statement; if both have it, the right one wins var left = element.getElement('.left_col'); var right = element.getElement('.right_col'); var top = element.getElement('.top_col'); var bottom = element.getElement('.bottom_col'); var originalSize = element.getSize(); if (!originalSize.x && element.getStyle('width') != "auto") originalSize.x = element.getStyle('width').toInt(); if (!originalSize.y && element.getStyle('height') != "auto") originalSize.y = element.getStyle('height').toInt(); if (!(left && right) && !(top && bottom)) { methods.error('found split view element, but could not find top/botom or left/right; exiting'); return; } element.getParent().setStyle('overflow', 'hidden'); var conf; if (left) { conf = { sides: ['left', 'right'], elements: { left: left, right: right }, dimension: 'width' }; } else { conf = { sides: ['top', 'bottom'], elements: { top: top, bottom: bottom }, dimension: 'height' }; } var inlineSize = {}; conf.sides.each(function(side) { var size = conf.elements[side].style[conf.dimension]; if (size) { inlineSize[side] = size.toInt(); conf.fixed = side; } conf.elements[side].setStyle(conf.dimension, 'auto'); }); var styles = {}, splitterHidden; var splitter = element.getElement('.splitter_col'); if (splitter) { if (splitter.getStyle('display', 'none')) { splitterHidden = true; splitter.setStyle('display', 'block'); } if (left) styles['splitter-width'] = splitter.getSize().x; else styles['splitter-height'] = splitter.getSize().y; } var whichSplit = left ? ART.SplitView : ART.SplitView.Vertical; var parent = element.get('parentWidget'); var splitview = new whichSplit({ resizable: element.hasClass("resizable"), foldable: element.hasClass("foldable"), splitterContent: element.getElement('.splitter_col'), styles: styles, fixed: conf.fixed || 'left' }).inject(parent || element, element, 'after'); splitview.draw(); addLinkers(document.id(splitview)); var sized; conf.sides.each(function(side) { splitview['set' + side.capitalize() + 'Content'](conf.elements[side]); splitview[side].addClass('save_scroll'); if (sized) return; if (conf.elements[side].getStyle('display') == 'none') { splitview.fold(side, 0, splitterHidden, true); conf.elements[side].setStyle('display', 'block'); sized = true; } else if (inlineSize[side] != null) { splitview['resize'+side.capitalize()](inlineSize[side]); sized = true; } }); var classes = element.get('class').split(' '); var filters = element.getDataFilters(); element.dispose().store('SplitView', splitview); classes.each(splitview.addClass, splitview); filters.each(splitview.element.addDataFilter, splitview.element); splitview.resizer = function(x, y){ var offsets = { x: element.get('data', 'split-offset-x', true), y: element.get('data', 'split-offset-y', true) }; if (offsets.x) x = x - offsets.x; if (offsets.y) y = y - offsets.y; if (x != undefined && y != undefined) { originalSize = { x: x, y: y }; splitview.resize(x, y); } else { splitview.resizer.delay(1); } }.bind(this); splitview.element.getElements('[data-splitview-toggle]').each(function(toggle){ manageToggleState(splitview, toggle); }); methods.addEvents({ resize: splitview.resizer, show: function(){ var size = methods.getContainerSize(); if (!size) size = originalSize; splitview.resizer(size.x, size.y); } }); var size = methods.getContainerSize() || element.getSize(); if (size.x || size.y) splitview.resizer(size.x, size.y); this.markForCleanup(element, function(){ methods.removeEvent('resize', splitview.resizer); splitview.eject(); }.bind(this)); } }); var getWidget = function(link) { var splitview = link.getParent('[data-filters*=SplitView]'); if (!splitview) return; return splitview.get('widget'); }; var getWidthStr = function(side) { return { 'left': 'leftWidth', 'right': 'rightWidth', 'top':'topHeight', 'bottom':'bottomHeight' }[side]; }; var manageToggleState = function(widget, toggle) { var params = toggle.get('data', 'splitview-toggle', true); if (widget[getWidthStr(params.side)] == 0) { toggle.getElements('.toggle-shown').hide(); toggle.getElements('.toggle-hidden').show(); } else { toggle.getElements('.toggle-shown').show(); toggle.getElements('.toggle-hidden').hide(); } }; var addLinkers = function(element){ element.addEvents({ 'click:relay([data-splitview-resize])': function(e, link){ if (document.id(e.target).get('tag') == 'a') e.preventDefault(); var widget = getWidget(link); if (!widget) return; var resize = link.get('data', 'splitview-resize', true); if (!resize) return; var side; var sides = ['left', 'right', 'top', 'bottom']; for (key in resize) { if (sides.contains(key)) side = key; } widget.fold(side, resize[side], resize.hideSplitter).chain(function(){ widget.fireEvent('postFold', [resize, e, link]); }); }, 'click:relay([data-splitview-toggle])': function(e, link){ if (document.id(e.target).get('tag') == 'a') e.preventDefault(); var widget = getWidget(link); if (!widget) return; var resize = link.get('data', 'splitview-toggle', true); if (!resize) return; widget.toggle(resize.side, resize.hideSplitter).chain(function(){ widget.fireEvent('postFold', [resize, e, link]); manageToggleState(widget, link); }); } }); }; })();
Source/Behaviors/Behavior.SplitView.js
/* --- description: Creates a SplitView instances for all elements that have the css class .splitview (and children with .left_col and .right_col). provides: [Behavior.SplitView] requires: [Behavior/Behavior, Widgets/ART.SplitView, More/Element.Delegation] script: Behavior.SplitView.js ... */ (function(){ Behavior.addGlobalFilters({ SplitView: function(element, methods) { //get the left and right column and instantiate an ART.SplitView //if the container has the class "resizable" then make it so //ditto for the foldable option //if the left or right columns have explicit style="width: Xpx" assignments //resize the side to match that statement; if both have it, the right one wins var left = element.getElement('.left_col'); var right = element.getElement('.right_col'); var top = element.getElement('.top_col'); var bottom = element.getElement('.bottom_col'); var originalSize = element.getSize(); if (!originalSize.x && element.getStyle('width') != "auto") originalSize.x = element.getStyle('width').toInt(); if (!originalSize.y && element.getStyle('height') != "auto") originalSize.y = element.getStyle('height').toInt(); if (!(left && right) && !(top && bottom)) { methods.error('found split view element, but could not find top/botom or left/right; exiting'); return; } element.getParent().setStyle('overflow', 'hidden'); var conf; if (left) { conf = { sides: ['left', 'right'], elements: { left: left, right: right }, dimension: 'width' }; } else { conf = { sides: ['top', 'bottom'], elements: { top: top, bottom: bottom }, dimension: 'height' }; } var inlineSize = {}; conf.sides.each(function(side) { var size = conf.elements[side].style[conf.dimension]; if (size) { inlineSize[side] = size.toInt(); conf.fixed = side; } conf.elements[side].setStyle(conf.dimension, 'auto'); }); var styles = {}, splitterHidden; var splitter = element.getElement('.splitter_col'); if (splitter) { if (splitter.getStyle('display', 'none')) { splitterHidden = true; splitter.setStyle('display', 'block'); } if (left) styles['splitter-width'] = splitter.getSize().x; else styles['splitter-height'] = splitter.getSize().y; } var whichSplit = left ? ART.SplitView : ART.SplitView.Vertical; var parent = element.get('parentWidget'); var splitview = new whichSplit({ resizable: element.hasClass("resizable"), foldable: element.hasClass("foldable"), splitterContent: element.getElement('.splitter_col'), styles: styles, fixed: conf.fixed || 'left' }).inject(parent || element, element, 'after'); splitview.draw(); addLinkers(document.id(splitview)); var sized; conf.sides.each(function(side) { splitview['set' + side.capitalize() + 'Content'](conf.elements[side]); splitview[side].addClass('save_scroll'); if (sized) return; if (conf.elements[side].getStyle('display') == 'none') { splitview.fold(side, 0, splitterHidden, true); conf.elements[side].setStyle('display', 'block'); sized = true; } else if (inlineSize[side] != null) { splitview['resize'+side.capitalize()](inlineSize[side]); sized = true; } }); var classes = element.get('class').split(' '); var filters = element.getDataFilters(); element.dispose().store('SplitView', splitview); classes.each(splitview.addClass, splitview); filters.each(splitview.element.addDataFilter, splitview.element); splitview.resizer = function(x, y){ var offsets = { x: element.get('data', 'split-offset-x', true), y: element.get('data', 'split-offset-y', true) }; if (offsets.x) x = x - offsets.x; if (offsets.y) y = y - offsets.y; if (x != undefined && y != undefined) { originalSize = { x: x, y: y }; splitview.resize(x, y); } else { splitview.resizer.delay(1); } }.bind(this); methods.addEvents({ resize: splitview.resizer, show: function(){ var size = methods.getContainerSize(); if (!size) size = originalSize; splitview.resizer(size.x, size.y); } }); var size = methods.getContainerSize() || element.getSize(); if (size.x || size.y) splitview.resizer(size.x, size.y); this.markForCleanup(element, function(){ methods.removeEvent('resize', splitview.resizer); splitview.eject(); }.bind(this)); } }); var getWidget = function(link) { var splitview = link.getParent('[data-filters*=SplitView]'); if (!splitview) return; return splitview.get('widget'); }; var addLinkers = function(element){ element.addEvents({ 'click:relay([data-splitview-resize])': function(e, link){ if (document.id(e.target).get('tag') == 'a') e.preventDefault(); var widget = getWidget(link); if (!widget) return; var resize = link.get('data', 'splitview-resize', true); if (!resize) return; var side; var sides = ['left', 'right', 'top', 'bottom']; for (key in resize) { if (sides.contains(key)) side = key; } widget.fold(side, resize[side], resize.hideSplitter).chain(function(){ widget.fireEvent('postFold', [resize, e, link]); }); }, 'click:relay([data-splitview-toggle])': function(e, link){ if (document.id(e.target).get('tag') == 'a') e.preventDefault(); var widget = getWidget(link); if (!widget) return; var resize = link.get('data', 'splitview-toggle', true); if (!resize) return; widget.toggle(resize.side, resize.hideSplitter).chain(function(){ widget.fireEvent('postFold', [resize, e, link]); if (widget[resize.side + "Height"] == 0) { link.getElements('.toggle-shown').hide(); link.getElements('.toggle-hidden').show(); } else { link.getElements('.toggle-shown').show(); link.getElements('.toggle-hidden').hide(); } }); } }); }; })();
Add initial check and set for splitview toggle toggle-shown and toggle-hidden elements
Source/Behaviors/Behavior.SplitView.js
Add initial check and set for splitview toggle toggle-shown and toggle-hidden elements
<ide><path>ource/Behaviors/Behavior.SplitView.js <ide> splitview.resizer.delay(1); <ide> } <ide> }.bind(this); <add> splitview.element.getElements('[data-splitview-toggle]').each(function(toggle){ <add> manageToggleState(splitview, toggle); <add> }); <ide> methods.addEvents({ <ide> resize: splitview.resizer, <ide> show: function(){ <ide> if (!splitview) return; <ide> return splitview.get('widget'); <ide> }; <add> <add>var getWidthStr = function(side) { <add> return { <add> 'left': 'leftWidth', <add> 'right': 'rightWidth', <add> 'top':'topHeight', <add> 'bottom':'bottomHeight' <add> }[side]; <add> }; <add> <add>var manageToggleState = function(widget, toggle) { <add> var params = toggle.get('data', 'splitview-toggle', true); <add> if (widget[getWidthStr(params.side)] == 0) { <add> toggle.getElements('.toggle-shown').hide(); <add> toggle.getElements('.toggle-hidden').show(); <add> } else { <add> toggle.getElements('.toggle-shown').show(); <add> toggle.getElements('.toggle-hidden').hide(); <add> } <add>}; <add> <add> <ide> <ide> var addLinkers = function(element){ <ide> element.addEvents({ <ide> if (!resize) return; <ide> widget.toggle(resize.side, resize.hideSplitter).chain(function(){ <ide> widget.fireEvent('postFold', [resize, e, link]); <del> if (widget[resize.side + "Height"] == 0) { <del> link.getElements('.toggle-shown').hide(); <del> link.getElements('.toggle-hidden').show(); <del> } else { <del> link.getElements('.toggle-shown').show(); <del> link.getElements('.toggle-hidden').hide(); <del> } <del> }); <add> manageToggleState(widget, link); <add> }); <ide> } <ide> }); <ide> };
Java
epl-1.0
c4614009d562621b82d5df1c2a2600555d44da77
0
junit-team/junit-lambda,sbrannen/junit-lambda
/* * Copyright 2015-2018 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which * accompanies this distribution and is available at * * http://www.eclipse.org/legal/epl-v20.html */ package org.junit.jupiter.engine.extension; import static org.junit.jupiter.api.extension.ConditionEvaluationResult.disabled; import static org.junit.jupiter.api.extension.ConditionEvaluationResult.enabled; import static org.junit.platform.commons.util.AnnotationUtils.findAnnotation; import java.util.Arrays; import java.util.Optional; import java.util.function.Consumer; import javax.script.Bindings; import javax.script.ScriptContext; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; import org.junit.jupiter.api.EnabledIf; import org.junit.jupiter.api.extension.ConditionEvaluationResult; import org.junit.jupiter.api.extension.ExecutionCondition; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.platform.commons.JUnitException; import org.junit.platform.commons.logging.Logger; import org.junit.platform.commons.logging.LoggerFactory; import org.junit.platform.commons.util.Preconditions; import org.junit.platform.commons.util.StringUtils; /** * {@link ExecutionCondition} that supports the {@link EnabledIf @EnabledIf} * annotation. * * @since 5.1 * @see #evaluateExecutionCondition(ExtensionContext) */ class EnabledIfCondition implements ExecutionCondition { private static final Logger logger = LoggerFactory.getLogger(EnabledIfCondition.class); /** * {@code ConditionEvaluationResult} singleton that is returned when no * {@code @EnabledIf} annotation is (meta-)present on the current element. */ private static final ConditionEvaluationResult ENABLED_BY_DEFAULT = enabled("@EnabledIf is not present"); // --- Values used in Bindings --------------------------------------------- private static final Accessor systemPropertyAccessor = new SystemPropertyAccessor(); private static final Accessor environmentVariableAccessor = new EnvironmentVariableAccessor(); // --- Placeholders usable in reason messages ------------------------------ private static final String REASON_ANNOTATION_PLACEHOLDER = "{annotation}"; private static final String REASON_SCRIPT_PLACEHOLDER = "{script}"; private static final String REASON_RESULT_PLACEHOLDER = "{result}"; @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { Optional<EnabledIf> optionalAnnotation = findAnnotation(context.getElement(), EnabledIf.class); if (!optionalAnnotation.isPresent()) { return ENABLED_BY_DEFAULT; } // Bind context-aware names to their current values Accessor configurationParameterAccessor = new ConfigurationParameterAccessor(context); Consumer<Bindings> contextBinder = bindings -> { bindings.put(EnabledIf.Bind.JUNIT_TAGS, context.getTags()); bindings.put(EnabledIf.Bind.JUNIT_UNIQUE_ID, context.getUniqueId()); bindings.put(EnabledIf.Bind.JUNIT_DISPLAY_NAME, context.getDisplayName()); bindings.put(EnabledIf.Bind.JUNIT_CONFIGURATION_PARAMETER, configurationParameterAccessor); }; return evaluate(optionalAnnotation.get(), contextBinder); } ConditionEvaluationResult evaluate(EnabledIf annotation, Consumer<Bindings> binder) { Preconditions.notNull(annotation, "annotation must not be null"); Preconditions.notNull(binder, "binder must not be null"); Preconditions.notEmpty(annotation.value(), "String[] returned by @EnabledIf.value() must not be empty"); // Find script engine ScriptEngine scriptEngine = findScriptEngine(annotation.engine()); logger.debug(() -> "ScriptEngine: " + scriptEngine); // Prepare bindings Bindings bindings = scriptEngine.getBindings(ScriptContext.ENGINE_SCOPE); bindings.put(EnabledIf.Bind.SYSTEM_PROPERTY, systemPropertyAccessor); bindings.put(EnabledIf.Bind.SYSTEM_ENVIRONMENT, environmentVariableAccessor); binder.accept(bindings); logger.debug(() -> "Bindings: " + bindings); // Build actual script text from annotation properties String script = createScript(annotation, scriptEngine.getFactory().getLanguageName()); logger.debug(() -> "Script: " + script); return evaluate(annotation, scriptEngine, script); } private ConditionEvaluationResult evaluate(EnabledIf annotation, ScriptEngine scriptEngine, String script) { Object result; try { result = scriptEngine.eval(script); } catch (ScriptException e) { String caption = "Evaluation of @EnabledIf script failed."; String bindings = scriptEngine.getBindings(ScriptContext.ENGINE_SCOPE).entrySet().toString(); String message = String.format("%s script=`%s`, bindings=%s", caption, script, bindings); throw new JUnitException(message, e); } // Trivial case: script returned a custom ConditionEvaluationResult instance. if (result instanceof ConditionEvaluationResult) { return (ConditionEvaluationResult) result; } String resultAsString = String.valueOf(result); String reason = createReason(annotation, script, resultAsString); boolean enabled; if (result instanceof Boolean) { enabled = (Boolean) result; } else { enabled = Boolean.parseBoolean(resultAsString); } return enabled ? enabled(reason) : disabled(reason); } ScriptEngine findScriptEngine(String engine) { ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine scriptEngine = manager.getEngineByName(engine); if (scriptEngine == null) { scriptEngine = manager.getEngineByExtension(engine); } if (scriptEngine == null) { scriptEngine = manager.getEngineByMimeType(engine); } Preconditions.notNull(scriptEngine, () -> "Script engine not found: " + engine); return scriptEngine; } String createScript(EnabledIf annotation, String language) { String[] lines = annotation.value(); // trivial case: one liner if (lines.length == 1) { return lines[0]; } return joinLines(System.lineSeparator(), Arrays.asList(lines)); } String createReason(EnabledIf annotation, String script, String result) { String reason = annotation.reason(); reason = reason.replace(REASON_ANNOTATION_PLACEHOLDER, annotation.toString()); reason = reason.replace(REASON_SCRIPT_PLACEHOLDER, script); reason = reason.replace(REASON_RESULT_PLACEHOLDER, result); return reason; } private String joinLines(String delimiter, Iterable<? extends CharSequence> elements) { if (StringUtils.isBlank(delimiter)) { delimiter = System.lineSeparator(); } return String.join(delimiter, elements); } /** * Used to access named properties without exposing direct access to the * underlying source. */ // apparently needs to be public (even if in a package private class); otherwise // we encounter errors such as the following during script evaluation: // TypeError: junitConfigurationParameter.get is not a function public interface Accessor { /** * Get the value of the property with the supplied name. * * @param name the name of the property to look up * @return the value assigned to the specified name; may be {@code null} */ String get(String name); } private static class SystemPropertyAccessor implements Accessor { @Override public String get(String name) { return System.getProperty(name); } } private static class EnvironmentVariableAccessor implements Accessor { @Override public String get(String name) { return System.getenv(name); } } private static class ConfigurationParameterAccessor implements Accessor { private final ExtensionContext context; ConfigurationParameterAccessor(ExtensionContext context) { this.context = context; } @Override public String get(String key) { return this.context.getConfigurationParameter(key).orElse(null); } } }
junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/EnabledIfCondition.java
/* * Copyright 2015-2018 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which * accompanies this distribution and is available at * * http://www.eclipse.org/legal/epl-v20.html */ package org.junit.jupiter.engine.extension; import static org.junit.jupiter.api.extension.ConditionEvaluationResult.disabled; import static org.junit.jupiter.api.extension.ConditionEvaluationResult.enabled; import static org.junit.platform.commons.util.AnnotationUtils.findAnnotation; import java.util.Arrays; import java.util.Optional; import java.util.function.Consumer; import javax.script.Bindings; import javax.script.ScriptContext; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; import org.junit.jupiter.api.EnabledIf; import org.junit.jupiter.api.extension.ConditionEvaluationResult; import org.junit.jupiter.api.extension.ExecutionCondition; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.platform.commons.JUnitException; import org.junit.platform.commons.logging.Logger; import org.junit.platform.commons.logging.LoggerFactory; import org.junit.platform.commons.util.Preconditions; import org.junit.platform.commons.util.StringUtils; /** * {@link ExecutionCondition} that supports the {@link EnabledIf @EnabledIf} * annotation. * * @since 5.1 * @see #evaluateExecutionCondition(ExtensionContext) */ class EnabledIfCondition implements ExecutionCondition { private static final Logger logger = LoggerFactory.getLogger(EnabledIfCondition.class); /** * {@code ConditionEvaluationResult} singleton that is returned when no * {@code @EnabledIf} annotation is (meta-)present on the current element. */ private static final ConditionEvaluationResult ENABLED_BY_DEFAULT = enabled("@EnabledIf is not present"); // --- Values used in Bindings --------------------------------------------- private static final Accessor systemPropertyAccessor = new SystemPropertyAccessor(); private static final Accessor environmentVariableAccessor = new EnvironmentVariableAccessor(); // --- Placeholders usable in reason messages ------------------------------ private static final String REASON_ANNOTATION_PLACEHOLDER = "{annotation}"; private static final String REASON_SCRIPT_PLACEHOLDER = "{script}"; private static final String REASON_RESULT_PLACEHOLDER = "{result}"; @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { Optional<EnabledIf> optionalAnnotation = findAnnotation(context.getElement(), EnabledIf.class); if (!optionalAnnotation.isPresent()) { return ENABLED_BY_DEFAULT; } // Bind context-aware names to their current values Accessor configurationParameterAccessor = new ConfigurationParameterAccessor(context); Consumer<Bindings> contextBinder = bindings -> { bindings.put(EnabledIf.Bind.JUNIT_TAGS, context.getTags()); bindings.put(EnabledIf.Bind.JUNIT_UNIQUE_ID, context.getUniqueId()); bindings.put(EnabledIf.Bind.JUNIT_DISPLAY_NAME, context.getDisplayName()); bindings.put(EnabledIf.Bind.JUNIT_CONFIGURATION_PARAMETER, configurationParameterAccessor); }; return evaluate(optionalAnnotation.get(), contextBinder); } ConditionEvaluationResult evaluate(EnabledIf annotation, Consumer<Bindings> binder) { Preconditions.notNull(annotation, "annotation must not be null"); Preconditions.notNull(binder, "binder must not be null"); Preconditions.notEmpty(annotation.value(), "String[] returned by @EnabledIf.value() must not be empty"); // Find script engine ScriptEngine scriptEngine = findScriptEngine(annotation.engine()); logger.debug(() -> "ScriptEngine: " + scriptEngine); // Prepare bindings Bindings bindings = scriptEngine.getBindings(ScriptContext.ENGINE_SCOPE); bindings.put(EnabledIf.Bind.SYSTEM_PROPERTY, systemPropertyAccessor); bindings.put(EnabledIf.Bind.SYSTEM_ENVIRONMENT, environmentVariableAccessor); binder.accept(bindings); logger.debug(() -> "Bindings: " + bindings); // Build actual script text from annotation properties String script = createScript(annotation, scriptEngine.getFactory().getLanguageName()); logger.debug(() -> "Script: " + script); return evaluate(annotation, scriptEngine, script); } private ConditionEvaluationResult evaluate(EnabledIf annotation, ScriptEngine scriptEngine, String script) { Object result; try { result = scriptEngine.eval(script); } catch (ScriptException e) { String caption = "Evaluation of @EnabledIf script failed."; String bindings = scriptEngine.getBindings(ScriptContext.ENGINE_SCOPE).entrySet().toString(); String message = String.format("%s script=`%s`, bindings=%s", caption, script, bindings); throw new JUnitException(message, e); } // Trivial case: script returned a custom ConditionEvaluationResult instance. if (result instanceof ConditionEvaluationResult) { return (ConditionEvaluationResult) result; } String resultAsString = String.valueOf(result); String reason = createReason(annotation, script, resultAsString); boolean enabled; if (result instanceof Boolean) { enabled = ((Boolean) result).booleanValue(); } else { enabled = Boolean.parseBoolean(resultAsString); } return enabled ? enabled(reason) : disabled(reason); } ScriptEngine findScriptEngine(String engine) { ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine scriptEngine = manager.getEngineByName(engine); if (scriptEngine == null) { scriptEngine = manager.getEngineByExtension(engine); } if (scriptEngine == null) { scriptEngine = manager.getEngineByMimeType(engine); } Preconditions.notNull(scriptEngine, () -> "Script engine not found: " + engine); return scriptEngine; } String createScript(EnabledIf annotation, String language) { String[] lines = annotation.value(); // trivial case: one liner if (lines.length == 1) { return lines[0]; } return joinLines(System.lineSeparator(), Arrays.asList(lines)); } String createReason(EnabledIf annotation, String script, String result) { String reason = annotation.reason(); reason = reason.replace(REASON_ANNOTATION_PLACEHOLDER, annotation.toString()); reason = reason.replace(REASON_SCRIPT_PLACEHOLDER, script); reason = reason.replace(REASON_RESULT_PLACEHOLDER, result); return reason; } private String joinLines(String delimiter, Iterable<? extends CharSequence> elements) { if (StringUtils.isBlank(delimiter)) { delimiter = System.lineSeparator(); } return String.join(delimiter, elements); } /** * Used to access named properties without exposing direct access to the * underlying source. */ // apparently needs to be public (even if in a package private class); otherwise // we encounter errors such as the following during script evaluation: // TypeError: junitConfigurationParameter.get is not a function public interface Accessor { /** * Get the value of the property with the supplied name. * * @param name the name of the property to look up * @return the value assigned to the specified name; may be {@code null} */ String get(String name); } private static class SystemPropertyAccessor implements Accessor { @Override public String get(String name) { return System.getProperty(name); } } private static class EnvironmentVariableAccessor implements Accessor { @Override public String get(String name) { return System.getenv(name); } } private static class ConfigurationParameterAccessor implements Accessor { private final ExtensionContext context; ConfigurationParameterAccessor(ExtensionContext context) { this.context = context; } @Override public String get(String key) { return this.context.getConfigurationParameter(key).orElse(null); } } }
Unpolish the unnecessary polishing ;-)
junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/EnabledIfCondition.java
Unpolish the unnecessary polishing ;-)
<ide><path>unit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/EnabledIfCondition.java <ide> boolean enabled; <ide> <ide> if (result instanceof Boolean) { <del> enabled = ((Boolean) result).booleanValue(); <add> enabled = (Boolean) result; <ide> } <ide> else { <ide> enabled = Boolean.parseBoolean(resultAsString);
Java
apache-2.0
23c67334c81333a45f1f8cd903853bc29889b8c5
0
Frameworkium/frameworkium,robertgates55/frameworkium,robertgates55/frameworkium-core,Frameworkium/frameworkium-core
package com.frameworkium.capture; import java.net.InetAddress; import java.net.URL; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.remote.RemoteWebDriver; import com.frameworkium.capture.model.Command; import com.frameworkium.capture.model.message.CreateExecution; import com.frameworkium.capture.model.message.CreateScreenshot; import com.frameworkium.config.DriverType; import com.frameworkium.config.SystemProperty; import com.jayway.restassured.RestAssured; import com.jayway.restassured.http.ContentType; public class ScreenshotCapture { private static final Logger logger = LogManager.getLogger(ScreenshotCapture.class); private String executionID; public ScreenshotCapture(String testID, WebDriver webdriver) { initExecution(new CreateExecution(testID, getNode())); } public void takeAndSendScreenshot(Command command, WebDriver webdriver, String errorMessage) { String url = DriverType.isNative() ? "" : webdriver.getCurrentUrl(); TakesScreenshot ts = ((TakesScreenshot) webdriver); String screenshotBase64 = ts.getScreenshotAs(OutputType.BASE64); CreateScreenshot message = new CreateScreenshot(executionID, command, url, errorMessage, screenshotBase64); sendScreenshot(message); } private void sendScreenshot(CreateScreenshot createScreenshotmessage) { String uri = SystemProperty.CAPTURE_URL.getValue() + "/screenshot"; RestAssured.given().contentType(ContentType.JSON).body(createScreenshotmessage).when().post(uri) .then().log().headers().statusCode(201); } public static boolean isRequired() { return SystemProperty.CAPTURE_URL.isSpecified() && !DriverType.isNative(); } private void initExecution(CreateExecution createExecutionMessage) { String uri = SystemProperty.CAPTURE_URL.getValue() + "/execution"; executionID = RestAssured.given().log().body().contentType(ContentType.JSON).body(createExecutionMessage).when() .post(uri).then().statusCode(201).extract().path("executionID").toString(); logger.info("executionID = " + executionID); } private String getNode() { String node = "n/a"; if (DriverType.useRemoteWebDriver) { try { RemoteWebDriver r = (RemoteWebDriver) webdriver; URL gridURL = new URL(SystemProperty.GRID_URL); String url = gridURL.getProtocol() + gridURL.getHost() + ':' + gridURL.getPort() + "/grid/api/testsession?session=" + r.getSessionId(); node = RestAssured.post(url).andReturn().jsonPath().getString("proxyId"); } catch (Throwable t) { logger.warn("Failed to get node address of remote web driver", t); } } else { try { node = InetAddress.getLocalHost().getCanonicalHostName(); } catch (UnknownHostException e) { logger.warn("Failed to get local machine name", e); } } return node; } }
src/test/java/com/frameworkium/capture/ScreenshotCapture.java
package com.frameworkium.capture; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.remote.RemoteWebDriver; import com.frameworkium.capture.model.Command; import com.frameworkium.capture.model.message.CreateExecution; import com.frameworkium.capture.model.message.CreateScreenshot; import com.frameworkium.config.DriverType; import com.frameworkium.config.SystemProperty; import com.jayway.restassured.RestAssured; import com.jayway.restassured.http.ContentType; public class ScreenshotCapture { private static final Logger logger = LogManager.getLogger(ScreenshotCapture.class); private String executionID; public ScreenshotCapture(String testID, WebDriver webdriver) { String node = "TODO"; if (DriverType.useRemoteWebDriver) { RemoteWebDriver r = (RemoteWebDriver) webdriver; // TODO: get remote address etc. } initExecution(new CreateExecution(testID, node)); } public void takeAndSendScreenshot(Command command, WebDriver webdriver, String errorMessage) { String url = DriverType.isNative() ? "" : webdriver.getCurrentUrl(); TakesScreenshot ts = ((TakesScreenshot) webdriver); String screenshotBase64 = ts.getScreenshotAs(OutputType.BASE64); CreateScreenshot message = new CreateScreenshot(executionID, command, url, errorMessage, screenshotBase64); sendScreenshot(message); } private void sendScreenshot(CreateScreenshot createScreenshotmessage) { String uri = SystemProperty.CAPTURE_URL.getValue() + "/screenshot"; RestAssured.given().contentType(ContentType.JSON).body(createScreenshotmessage).when().post(uri) .then().log().headers().statusCode(201); } private void initExecution(CreateExecution createExecutionMessage) { String uri = SystemProperty.CAPTURE_URL.getValue() + "/execution"; executionID = RestAssured.given().log().body().contentType(ContentType.JSON).body(createExecutionMessage).when() .post(uri).then().statusCode(201).extract().path("executionID").toString(); logger.info("executionID = " + executionID); } public static boolean isRequired() { return SystemProperty.CAPTURE_URL.isSpecified() && !DriverType.isNative(); } }
Attempted to implement get node address.
src/test/java/com/frameworkium/capture/ScreenshotCapture.java
Attempted to implement get node address.
<ide><path>rc/test/java/com/frameworkium/capture/ScreenshotCapture.java <ide> package com.frameworkium.capture; <add> <add>import java.net.InetAddress; <add>import java.net.URL; <ide> <ide> import org.apache.logging.log4j.LogManager; <ide> import org.apache.logging.log4j.Logger; <ide> private String executionID; <ide> <ide> public ScreenshotCapture(String testID, WebDriver webdriver) { <del> String node = "TODO"; <del> if (DriverType.useRemoteWebDriver) { <del> RemoteWebDriver r = (RemoteWebDriver) webdriver; <del> // TODO: get remote address etc. <del> } <del> initExecution(new CreateExecution(testID, node)); <add> initExecution(new CreateExecution(testID, getNode())); <ide> } <del> <add> <ide> public void takeAndSendScreenshot(Command command, WebDriver webdriver, String errorMessage) { <ide> <ide> String url = DriverType.isNative() ? "" : webdriver.getCurrentUrl(); <ide> .then().log().headers().statusCode(201); <ide> } <ide> <add> public static boolean isRequired() { <add> return SystemProperty.CAPTURE_URL.isSpecified() && !DriverType.isNative(); <add> } <add> <ide> private void initExecution(CreateExecution createExecutionMessage) { <ide> <ide> String uri = SystemProperty.CAPTURE_URL.getValue() + "/execution"; <ide> logger.info("executionID = " + executionID); <ide> } <ide> <del> public static boolean isRequired() { <del> return SystemProperty.CAPTURE_URL.isSpecified() && !DriverType.isNative(); <add> private String getNode() { <add> <add> String node = "n/a"; <add> if (DriverType.useRemoteWebDriver) { <add> try { <add> RemoteWebDriver r = (RemoteWebDriver) webdriver; <add> URL gridURL = new URL(SystemProperty.GRID_URL); <add> String url = gridURL.getProtocol() + gridURL.getHost() + ':' + gridURL.getPort() <add> + "/grid/api/testsession?session=" + r.getSessionId(); <add> node = RestAssured.post(url).andReturn().jsonPath().getString("proxyId"); <add> } catch (Throwable t) { <add> logger.warn("Failed to get node address of remote web driver", t); <add> } <add> } else { <add> try { <add> node = InetAddress.getLocalHost().getCanonicalHostName(); <add> } catch (UnknownHostException e) { <add> logger.warn("Failed to get local machine name", e); <add> } <add> } <add> return node; <ide> } <ide> <ide> }
Java
mit
4cc496fd044bd92ebf852c575b0dcb85f30bea69
0
danleavitt0/todomvc,robwilde/todomvc,AngelValdes/todomvc,dylanham/todomvc,ZusOR/todomvc,lorgiorepo/todomvc,PolarBearAndrew/todomvc,weivea/todomvc,troopjs-university/todomvc,kaidokert/todomvc,glizer/todomvc,troopjs-university/todomvc,bdylanwalker/todomvc,altmind/todomvc,bsoe003/todomvc,Duc-Ngo-CSSE/todomvc,Qwenbo/todomvc,unmanbearpig/todomvc,cyberkoi/todomvc,bryan7c/todomvc,CreaturePhil/todomvc,kingsj/todomvc,Keystion/todomvc,fszlin/todomvc,niki571/todomvc,mikesprague/todomvc,Senhordim/todomvc,beni55/todomvc,pawelqbera/todomvc,zeropool/todomvc,pbaron977/todomvc,s-endres/todomvc,rodrigoolivares/todomvc,joelmatiassilva/todomvc,meligatt/todomvc,eatrocks/todomvc,dasaprakashk/todomvc,MakarovMax/todomvc,nitish1125/todomvc,edueo/todomvc,jchadwick/todomvc,jcpeters/todomvc,kasperpeulen/todomvc,edwardpark/todomvc,zingorn/todomvc,kidbai/todomvc,eatrocks/todomvc,brsteele/todomvc,Keystion/todomvc,electricessence/todomvc,kasperpeulen/todomvc,Drup/todomvc,gmoura/todomvc,silentHoo/todomvc-ngpoly,ajansa/todomvc,slegrand45/todomvc,biomassives/angular2_todomvc,jaredhensley/todomvc,MakarovMax/todomvc,youprofit/todomvc,bondvt04/todomvc,dcrlz/todomvc,fangjing828/todomvc,jdfeemster/todomvc,Live4Code/todomvc,XiaominnHoo/todomvc,Aupajo/todomvc,pro100jam/todomvc,suryasingh/todomvc,colinkuo/todomvc,AmilaViduranga/todomvc,jcpeters/todomvc,alohaglenn/todomvc,albrow/todomvc,bonbonez/todomvc,chrisfcarroll/todomvc,sohucw/todomvc,rdingwall/todomvc,john-jay/todomvc,natalieparellano/todomvc,pandoraui/todomvc,RaveJS/todomvc,petebacondarwin/todomvc,winweb/todomvc,somallg/todomvc,ajream/todomvc,oskargustafsson/todomvc,mikesprague/todomvc,thibaultzanini/todomvc,trexnix/todomvc,rdingwall/todomvc,guillermodiazga/todomvc,johnbender/todomvc,feathersjs/todomvc,thebkbuffalo/todomvc,andrepitombeira/todomvc,kmalakoff/todomvc,griffiti/todomvc,kidbai/todomvc,Drup/todomvc,guillermodiazga/todomvc,babarqb/todomvc,blink2ce/todomvc,Senhordim/todomvc,massimiliano-mantione/todomvc,ngbrya/todomvc,altmind/todomvc,watonyweng/todomvc,yzfcxr/todomvc,pandoraui/todomvc,shawn-dsz/todomvc,yuetsh/todomvc,shanemgrey/todomvc,fchareyr/todomvc,jrpeasee/todomvc,robwilde/todomvc,wishpishh/todomvc,sammcgrail/todomvc,PolarBearAndrew/todomvc,edygar/todomvc,JinaLeeK/todomvc,msi008/todomvc,planttheidea/todomvc,luxiaojian/todomvc,arunrajnayak/todomvc,trungtranthanh93/todomvc,sammcgrail/todomvc,dchambers/todomvc,Keystion/todomvc,niki571/todomvc,allanbrito/todomvc,ksteigerwald/todomvc,weijye91/todomvc,andreaswachowski/todomvc,nweber/todomvc,sohucw/todomvc,arthurvr/todomvc,MikeDulik/todomvc,trexnix/todomvc,luxiaojian/todomvc,Duc-Ngo-CSSE/todomvc,craigmckeachie/todomvc,colingourlay/todomvc,jcpeters/todomvc,balintsoos/todomvc,sohucw/todomvc,alohaglenn/todomvc,dsumac/todomvc,rodrigoolivares/todomvc,trexnix/todomvc,ClashTheBunny/todomvc,v2018z/todomvc,wangdahoo/todomvc,stoeffel/todomvc,edwardpark/todomvc,YaqubGhazi/todomvc,pbaron977/todomvc,digideskio/todomvc,alohaglenn/todomvc,kmalakoff/todomvc,arunrajnayak/todomvc,bonbonez/todomvc,marchant/todomvc,jaredhensley/todomvc,johnbender/todomvc,laomagege/todomvc,laomagege/todomvc,Keystion/todomvc,laomagege/todomvc,v2018z/todomvc,joelmatiassilva/todomvc,cyberkoi/todomvc,ssarber/todo-mvc-angular,mweststrate/todomvc,jeff235255/todomvc,guillermodiazga/todomvc,ivanKaunov/todomvc,vuejs/todomvc,eduardogomes/todomvc,lorgiorepo/todomvc,bsoe003/todomvc,electricessence/todomvc,biomassives/angular2_todomvc,bonbonez/todomvc,bonbonez/todomvc,weijye91/todomvc,Brycetastic/todomvc,suryasingh/todomvc,theflimflam/todomvc,webcoding/todomvc,jcpeters/todomvc,Live4Code/todomvc,Duc-Ngo-CSSE/todomvc,biomassives/angular2_todomvc,benmccormick/todomvc,baymaxi/todomvc,bdylanwalker/todomvc,samccone/todomvc,teng2015/todomvc,ac-adekunle/todomvc,mboudreau/todomvc,jdlawrence/todomvc,biomassives/angular2_todomvc,sjclijie/todomvc,jeremyeaton89/todomvc,stevengregory/todomvc,briancavalier/todomvc-fab,yyx990803/todomvc,patrick-frontend/todomvc,watonyweng/todomvc,rwson/todomvc,guillermodiazga/todomvc,gmoura/todomvc,mweststrate/todomvc,sammcgrail/todomvc,edueo/todomvc,Aupajo/todomvc,Live4Code/todomvc,zeropool/todomvc,fchareyr/todomvc,trexnix/todomvc,glizer/todomvc,lgsanjos/todomvc,jwabbitt/todomvc,patrick-frontend/todomvc,ZusOR/todomvc,AngelValdes/todomvc,leverz/todomvc,dylanham/todomvc,ryoia/todomvc,vikbert/todomvc,txchen/todomvc,nancy44/todomvc,blink1073/todomvc,edueo/todomvc,Bieliakov/todomvc,jkf91/todomvc,ssarber/todo-mvc-angular,4talesa/todomvc,massimiliano-mantione/todomvc,evansendra/todomvc,ajansa/todomvc,dcrlz/todomvc,podefr/todomvc,chrisfcarroll/todomvc,niki571/todomvc,wangjun/todomvc,startersacademy/todomvc,massimiliano-mantione/todomvc,YaqubGhazi/todomvc,brsteele/todomvc,vicentemaximilianoh/todomvc,youprofit/todomvc,cyberkoi/todomvc,feathersjs/todomvc,lgsanjos/todomvc,kidbai/todomvc,baymaxi/todomvc,mweststrate/todomvc,weivea/todomvc,natalieparellano/todomvc,cledwyn/todomvc,arthurvr/todomvc,yalishizhude/todomvc,xtian/todomvc,yblee85/todomvc,mweststrate/todomvc,szytko/todomvc,bowcot84/todomvc,teng2015/todomvc,yalishizhude/todomvc,babarqb/todomvc,oskargustafsson/todomvc,SooyoungYoon/todomvc,urkaver/todomvc,sohucw/todomvc,johnbender/todomvc,weivea/todomvc,natelaclaire/todomvc,pgraff/js4secourse,ryoia/todomvc,ivanKaunov/todomvc,niki571/todomvc,ABaldwinHunter/todomvc-clone,dudeOFprosper/todomvc,wangdahoo/todomvc,electricessence/todomvc,aitchkhan/todomvc,nharada1/todomvc,asudoh/todomvc,andrepitombeira/todomvc,passy/fakemvc,nitish1125/todomvc,leverz/todomvc,blink2ce/todomvc,arthurvr/todomvc,cbolton97/todomvc,miyai-chihiro/todomvc,bondvt04/todomvc,dakannan/TODOs,briancavalier/todomvc-fab,shawn-dsz/todomvc,zingorn/todomvc,Gsearch/todomvc,lingjuan/todomvc,dasaprakashk/todomvc,ajream/todomvc,michalsnik/todomvc,dsumac/todomvc,cledwyn/todomvc,RaveJS/todomvc,niki571/todomvc,Granze/todomvc,skatejs/todomvc,pbaron977/todomvc,stoeffel/todomvc,edueo/todomvc,watonyweng/todomvc,evansendra/todomvc,pgraff/js4secourse,pro100jam/todomvc,Anasskebabi/todomvc,kpaxqin/todomvc,JinaLeeK/todomvc,edwardpark/todomvc,vuejs/todomvc,watonyweng/todomvc,commana/todomvc,margaritis/todomvc,vicentemaximilianoh/todomvc,webcoding/todomvc,mikesprague/todomvc,arunrajnayak/todomvc,patrick-frontend/todomvc,shui91/todomvc,Senhordim/todomvc,mhoyer/todomvc,nweber/todomvc,dylanham/todomvc,Drup/todomvc,samccone/todomvc,neapolitan-a-la-code/todoAngJS,sjclijie/todomvc,andrepitombeira/todomvc,fr0609/todomvc,natalieparellano/todomvc,passy/fakemvc,bowcot84/todomvc,CreaturePhil/todomvc,holydevilboy/todomvc,dcrlz/todomvc,sethkrasnianski/todomvc,aarai/todomvc,TodoFlux/todoflux,makelivedotnet/todomvc,planttheidea/todomvc,vikbert/todomvc,zingorn/todomvc,andreaswachowski/todomvc,eatrocks/todomvc,cbolton97/todomvc,yisbug/todomvc,sjclijie/todomvc,michalsnik/todomvc,ZusOR/todomvc,sohucw/todomvc,arunrajnayak/todomvc,passy/fakemvc,MariaSimion/todomvc,natelaclaire/todomvc,bryanborough/todomvc,therebelbeta/todomvc,rwson/todomvc,colinkuo/todomvc,Anasskebabi/todomvc,benmccormick/todomvc,pawelqbera/todomvc,xtian/todomvc,trungtranthanh93/todomvc,arthurvr/todomvc,MarkHarper/todomvc,szytko/todomvc,peterkokot/todomvc,yalishizhude/todomvc,dcrlz/todomvc,vanyadymousky/todomvc,samccone/todomvc,luxiaojian/todomvc,biomassives/angular2_todomvc,kpaxqin/todomvc,yblee85/todomvc,sammcgrail/todomvc,arunrajnayak/todomvc,v2018z/todomvc,dchambers/todomvc,jrpeasee/todomvc,Anasskebabi/todomvc,vite21/todomvc,brenopolanski/todomvc,fr0609/todomvc,fszlin/todomvc,tianskyluj/todomvc,korrawit/todomvc,Qwenbo/todomvc,therebelbeta/todomvc,weijye91/todomvc,tianskyluj/todomvc,ngbrya/todomvc,andreaswachowski/todomvc,Granze/todomvc,pandoraui/todomvc,brenopolanski/todomvc,theflimflam/todomvc,cledwyn/todomvc,aitchkhan/todomvc,ClashTheBunny/todomvc,Garbar/todomvc,baiyaaaaa/todomvc,cssJumper1995/todomvc,vanyadymousky/todomvc,wallacecmo86/todomvc,nharada1/todomvc,NickManos/todoMVC,colinkuo/todomvc,Drup/todomvc,startersacademy/todomvc,pplgin/todomvc,baiyaaaaa/todomvc,kmalakoff/todomvc,andreaswachowski/todomvc,jchadwick/todomvc,glizer/todomvc,joelmatiassilva/todomvc,Bieliakov/todomvc,youprofit/todomvc,massimiliano-mantione/todomvc,mikesprague/todomvc,jj4th/todomvc-poc,txchen/todomvc,pgraff/js4secourse,Yogi-Jiang/todomvc,jdlawrence/todomvc,Brycetastic/todomvc,unmanbearpig/todomvc,kasperpeulen/todomvc,lingjuan/todomvc,gmoura/todomvc,xtian/todomvc,nancy44/todomvc,kaidokert/todomvc,margaritis/todomvc,amorphid/todomvc,yblee85/todomvc,RaveJS/todomvc,dakannan/TODOs,Live4Code/todomvc,wangcan2014/todomvc,sergeirybalko/todomvc,danleavitt0/todomvc,nancy44/todomvc,tweinfeld/todomvc,allanbrito/todomvc,smasala/todomvc,bryanborough/todomvc,gmoura/todomvc,yzfcxr/todomvc,commana/todomvc,edueo/todomvc,ac-adekunle/todomvc,natalieparellano/todomvc,Live4Code/todomvc,Kedarnath13/todomvc,slegrand45/todomvc,ryoia/todomvc,s-endres/todomvc,elacin/todomvc,joelmatiassilva/todomvc,lh8725473/todomvc,somallg/todomvc,andreaswachowski/todomvc,kingsj/todomvc,yalishizhude/todomvc,ccpowell/todomvc,4talesa/todomvc,smasala/todomvc,korrawit/todomvc,planttheidea/todomvc,freeyiyi1993/todomvc,electricessence/todomvc,blink1073/todomvc,fszlin/todomvc,nordfjord/todomvc,cssJumper1995/todomvc,flaviotsf/todomvc,bondvt04/todomvc,sammcgrail/todomvc,zxc0328/todomvc,asudoh/todomvc,shanemgrey/todomvc,aarai/todomvc,santhoshi-viriventi/todomvc,jeff235255/todomvc,oskargustafsson/todomvc,Keystion/todomvc,nancy44/todomvc,cbolton97/todomvc,cyberkoi/todomvc,tweinfeld/todomvc,jdfeemster/todomvc,xtian/todomvc,olegbc/todomvc,amy-chiu/todomvc,sergeirybalko/todomvc,CreaturePhil/todomvc,mroserov/todomvc,beni55/todomvc,wangcan2014/todomvc,zxc0328/todomvc,chrisdarroch/todomvc,guillermodiazga/todomvc,planttheidea/todomvc,edwardpark/todomvc,cledwyn/todomvc,andreaswachowski/todomvc,electricessence/todomvc,Qwenbo/todomvc,arunrajnayak/todomvc,asudoh/todomvc,SooyoungYoon/todomvc,webcoding/todomvc,shui91/todomvc,patrick-frontend/todomvc,slegrand45/todomvc,wangjun/todomvc,joelmatiassilva/todomvc,Gsearch/todomvc,luxiaojian/todomvc,allanbrito/todomvc,mroserov/todomvc,msi008/todomvc,podefr/todomvc,lh8725473/todomvc,cbolton97/todomvc,AmilaViduranga/todomvc,somallg/todomvc,theoldnewbie/todomvc,ivanKaunov/todomvc,lingjuan/todomvc,mboudreau/todomvc,wcyz666/todomvc,tianskyluj/todomvc,dylanham/todomvc,jkf91/todomvc,pbaron977/todomvc,robwilde/todomvc,CreaturePhil/todomvc,shanemgrey/todomvc,TodoFlux/todoflux,ebidel/todomvc,johnbender/todomvc,tianskyluj/todomvc,dylanham/todomvc,albrow/todomvc,hefangshi/todomvc,suryasingh/todomvc,Live4Code/todomvc,nancy44/todomvc,arthurvr/todomvc,CreaturePhil/todomvc,wallacecmo86/todomvc,wangdahoo/todomvc,AmilaViduranga/todomvc,dcrlz/todomvc,cyberkoi/todomvc,nordfjord/todomvc,bryanborough/todomvc,StanislavMar/todomvc,briancavalier/todomvc-fab,dudeOFprosper/todomvc,dudeOFprosper/todomvc,Yogi-Jiang/todomvc,dchambers/todomvc,theflimflam/todomvc,RaveJS/todomvc,trexnix/todomvc,mhoyer/todomvc,smasala/todomvc,mikesprague/todomvc,colinkuo/todomvc,jkf91/todomvc,neapolitan-a-la-code/todoAngJS,msi008/todomvc,jchadwick/todomvc,wishpishh/todomvc,therebelbeta/todomvc,therebelbeta/todomvc,pro100jam/todomvc,pandoraui/todomvc,amy-chiu/todomvc,msi008/todomvc,lingjuan/todomvc,sophiango/todomvc,v2018z/todomvc,shanemgrey/todomvc,AngelValdes/todomvc,Drup/todomvc,ozywuli/todomvc,szytko/todomvc,YaqubGhazi/todomvc,brsteele/todomvc,vikbert/todomvc,youprofit/todomvc,ClashTheBunny/todomvc,shanemgrey/todomvc,Garbar/todomvc,raiamber1/todomvc,craigmckeachie/todomvc,cbolton97/todomvc,colinkuo/todomvc,ccpowell/todomvc,bowcot84/todomvc,akollegger/todomvc,patrick-frontend/todomvc,Aupajo/todomvc,flaviotsf/todomvc,StanislavMar/todomvc,peterkokot/todomvc,peterkokot/todomvc,colinkuo/todomvc,aarai/todomvc,commana/todomvc,ssarber/todo-mvc-angular,suryasingh/todomvc,chrisfcarroll/todomvc,pawelqbera/todomvc,amy-chiu/todomvc,troopjs-university/todomvc,startersacademy/todomvc,planttheidea/todomvc,hefangshi/todomvc,dudeOFprosper/todomvc,youprofit/todomvc,PolarBearAndrew/todomvc,olegbc/todomvc,slegrand45/todomvc,ABaldwinHunter/todomvc-clone,pandoraui/todomvc,MarkHarper/todomvc,commana/todomvc,lorgiorepo/todomvc,2011uit1719/todomvc,ivanKaunov/todomvc,kaidokert/todomvc,rodrigoolivares/todomvc,john-jay/todomvc,lorgiorepo/todomvc,makelivedotnet/todomvc,urkaver/todomvc,andrepitombeira/todomvc,troopjs-university/todomvc,jaredhensley/todomvc,ebidel/todomvc,dsumac/todomvc,marcolamberto/todomvc,petebacondarwin/todomvc,yisbug/todomvc,Granze/todomvc,Yogi-Jiang/todomvc,edueo/todomvc,massimiliano-mantione/todomvc,bowcot84/todomvc,ozywuli/todomvc,feathersjs/todomvc,planttheidea/todomvc,wishpishh/todomvc,willycz/todomvc,yzfcxr/todomvc,cssJumper1995/todomvc,kaidokert/todomvc,podefr/todomvc,sergeirybalko/todomvc,elacin/todomvc,wcyz666/todomvc,AngelValdes/todomvc,elacin/todomvc,baiyaaaaa/todomvc,watonyweng/todomvc,maksymkhar/todomvc,unmanbearpig/todomvc,joelmatiassilva/todomvc,jcpeters/todomvc,jeff235255/todomvc,maksymkhar/todomvc,s-endres/todomvc,mboudreau/todomvc,peterkokot/todomvc,colingourlay/todomvc,somallg/todomvc,bryan7c/todomvc,asudoh/todomvc,zingorn/todomvc,arthurvr/todomvc,slegrand45/todomvc,electricessence/todomvc,albrow/todomvc,stevengregory/todomvc,Brycetastic/todomvc,eatrocks/todomvc,teng2015/todomvc,bryan7c/todomvc,lh8725473/todomvc,amorphid/todomvc,jj4th/todomvc-poc,baymaxi/todomvc,meligatt/todomvc,yalishizhude/todomvc,Granze/todomvc,therebelbeta/todomvc,chrisfcarroll/todomvc,unmanbearpig/todomvc,lorgiorepo/todomvc,Kedarnath13/todomvc,neapolitan-a-la-code/todoAngJS,maksymkhar/todomvc,jwabbitt/todomvc,tianskyluj/todomvc,YaqubGhazi/todomvc,nharada1/todomvc,michalsnik/todomvc,dylanham/todomvc,bondvt04/todomvc,fangjing828/todomvc,margaritis/todomvc,yejodido/todomvc,RaveJS/todomvc,NickManos/todoMVC,shawn-dsz/todomvc,mhoyer/todomvc,ebidel/todomvc,santhoshi-viriventi/todomvc,fr0609/todomvc,sethkrasnianski/todomvc,neapolitan-a-la-code/todoAngJS,silentHoo/todomvc-ngpoly,cledwyn/todomvc,v2018z/todomvc,natalieparellano/todomvc,Yogi-Jiang/todomvc,sohucw/todomvc,willycz/todomvc,Garbar/todomvc,sjclijie/todomvc,dudeOFprosper/todomvc,Rithie/todomvc,jwabbitt/todomvc,pbaron977/todomvc,hefangshi/todomvc,pgraff/js4secourse,pgraff/js4secourse,yuetsh/todomvc,urkaver/todomvc,biomassives/angular2_todomvc,akollegger/todomvc,miyai-chihiro/todomvc,digideskio/todomvc,lingjuan/todomvc,pandoraui/todomvc,MariaSimion/todomvc,peterkokot/todomvc,msi008/todomvc,santhoshi-viriventi/todomvc,SooyoungYoon/todomvc,brenopolanski/todomvc,flaviotsf/todomvc,Rithie/todomvc,shanemgrey/todomvc,lh8725473/todomvc,wangcan2014/todomvc,wcyz666/todomvc,ksteigerwald/todomvc,korrawit/todomvc,winweb/todomvc,yuetsh/todomvc,stoeffel/todomvc,samccone/todomvc,chrisdarroch/todomvc,dasaprakashk/todomvc,2011uit1719/todomvc,thebkbuffalo/todomvc,MariaSimion/todomvc,lingjuan/todomvc,smasala/todomvc,luxiaojian/todomvc,sophiango/todomvc,chrisfcarroll/todomvc,zingorn/todomvc,MikeDulik/todomvc,cbolton97/todomvc,eatrocks/todomvc,Senhordim/todomvc,pplgin/todomvc,jdlawrence/todomvc,cyberkoi/todomvc,tianskyluj/todomvc,MakarovMax/todomvc,troopjs-university/todomvc,craigmckeachie/todomvc,ssarber/todo-mvc-angular,Qwenbo/todomvc,rwson/todomvc,bowcot84/todomvc,yzfcxr/todomvc,jdfeemster/todomvc,meligatt/todomvc,zxc0328/todomvc,altmind/todomvc,lorgiorepo/todomvc,sjclijie/todomvc,somallg/todomvc,skatejs/todomvc,bdylanwalker/todomvc,2011uit1719/todomvc,edwardpark/todomvc,Kedarnath13/todomvc,yzfcxr/todomvc,AngelValdes/todomvc,XiaominnHoo/todomvc,laomagege/todomvc,Drup/todomvc,tweinfeld/todomvc,pplgin/todomvc,Anasskebabi/todomvc,nitish1125/todomvc,Anasskebabi/todomvc,cledwyn/todomvc,olegbc/todomvc,NickManos/todoMVC,Senhordim/todomvc,cornerbodega/todomvc,nancy44/todomvc,Rithie/todomvc,4talesa/todomvc,willycz/todomvc,holydevilboy/todomvc,smasala/todomvc,briancavalier/todomvc-fab,silentHoo/todomvc-ngpoly,vanyadymousky/todomvc,andrepitombeira/todomvc,mroserov/todomvc,rdingwall/todomvc,ivanKaunov/todomvc,sammcgrail/todomvc,bryan7c/todomvc,trungtranthanh93/todomvc,zxc0328/todomvc,evansendra/todomvc,benmccormick/todomvc,jrpeasee/todomvc,laomagege/todomvc,ajansa/todomvc,altmind/todomvc,troopjs-university/todomvc,smasala/todomvc,eatrocks/todomvc,pbaron977/todomvc,ajream/todomvc,bonbonez/todomvc,bsoe003/todomvc,bowcot84/todomvc,JinaLeeK/todomvc,balintsoos/todomvc,miyai-chihiro/todomvc,somallg/todomvc,sjclijie/todomvc,cornerbodega/todomvc,nbr1ninrsan2/todomvc,vikbert/todomvc,marchant/todomvc,youprofit/todomvc,hefangshi/todomvc,msi008/todomvc,jdlawrence/todomvc,passy/fakemvc,nbr1ninrsan2/todomvc,raiamber1/todomvc,fangjing828/todomvc,jdlawrence/todomvc,yyx990803/todomvc,TodoFlux/todoflux,unmanbearpig/todomvc,marcolamberto/todomvc,yejodido/todomvc,marchant/todomvc,freeyiyi1993/todomvc,blink1073/todomvc,samccone/todomvc,massimiliano-mantione/todomvc,trexnix/todomvc,NickManos/todoMVC,yyx990803/todomvc,dakannan/TODOs,slegrand45/todomvc,raiamber1/todomvc,dakannan/TODOs,kaidokert/todomvc,winweb/todomvc,mikesprague/todomvc,Anasskebabi/todomvc,StanislavMar/todomvc,margaritis/todomvc,mweststrate/todomvc,Qwenbo/todomvc,jrpeasee/todomvc,rdingwall/todomvc,startersacademy/todomvc,griffiti/todomvc,guillermodiazga/todomvc,wallacecmo86/todomvc,vikbert/todomvc,Bieliakov/todomvc,suryasingh/todomvc,CreaturePhil/todomvc,ivanKaunov/todomvc,jcpeters/todomvc,dcrlz/todomvc,griffiti/todomvc,holydevilboy/todomvc,skatejs/todomvc,patrick-frontend/todomvc,zxc0328/todomvc,nordfjord/todomvc,edwardpark/todomvc,SooyoungYoon/todomvc,laomagege/todomvc,jj4th/todomvc-poc,v2018z/todomvc,chrisdarroch/todomvc,ABaldwinHunter/todomvc-clone,colingourlay/todomvc,sophiango/todomvc,akollegger/todomvc,nweber/todomvc,xtian/todomvc,john-jay/todomvc,unmanbearpig/todomvc,petebacondarwin/todomvc,natelaclaire/todomvc,Gsearch/todomvc,txchen/todomvc,shui91/todomvc,theoldnewbie/todomvc,SooyoungYoon/todomvc,Granze/todomvc,xtian/todomvc,eduardogomes/todomvc,freeyiyi1993/todomvc,Granze/todomvc,ccpowell/todomvc,leverz/todomvc,zeropool/todomvc,kpaxqin/todomvc,fchareyr/todomvc,jrpeasee/todomvc,jrpeasee/todomvc,MarkHarper/todomvc,amorphid/todomvc,dudeOFprosper/todomvc,niki571/todomvc,MikeDulik/todomvc,natalieparellano/todomvc,blink2ce/todomvc,SooyoungYoon/todomvc,YaqubGhazi/todomvc,ksteigerwald/todomvc,gmoura/todomvc,jdlawrence/todomvc,balintsoos/todomvc,zingorn/todomvc,thibaultzanini/todomvc,cornerbodega/todomvc,fr0609/todomvc,digideskio/todomvc,yejodido/todomvc,andrepitombeira/todomvc,YaqubGhazi/todomvc,Senhordim/todomvc,pgraff/js4secourse,theoldnewbie/todomvc,skatejs/todomvc,aitchkhan/todomvc,ngbrya/todomvc,rdingwall/todomvc,samccone/todomvc,XiaominnHoo/todomvc,danleavitt0/todomvc,nbr1ninrsan2/todomvc,skatejs/todomvc,yzfcxr/todomvc,chrisfcarroll/todomvc,bondvt04/todomvc,yyx990803/todomvc,jeremyeaton89/todomvc,vicentemaximilianoh/todomvc,thibaultzanini/todomvc,ozywuli/todomvc,mweststrate/todomvc,kaidokert/todomvc,altmind/todomvc,startersacademy/todomvc,bondvt04/todomvc,zxc0328/todomvc,thebkbuffalo/todomvc,vuejs/todomvc,rdingwall/todomvc,lgsanjos/todomvc,gmoura/todomvc,skatejs/todomvc,startersacademy/todomvc,vite21/todomvc,edygar/todomvc,lh8725473/todomvc,yisbug/todomvc,stevengregory/todomvc,babarqb/todomvc,marcolamberto/todomvc,wangjun/todomvc,Keystion/todomvc,sethkrasnianski/todomvc,bonbonez/todomvc,vite21/todomvc,bryan7c/todomvc,ac-adekunle/todomvc,lh8725473/todomvc,jeremyeaton89/todomvc,Qwenbo/todomvc,bryan7c/todomvc,luxiaojian/todomvc,makelivedotnet/todomvc,edygar/todomvc,watonyweng/todomvc
package com.todo.client; import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.InputElement; import com.google.gwt.dom.client.SpanElement; import com.google.gwt.dom.client.Style.Display; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyUpEvent; import com.google.gwt.event.dom.client.KeyUpHandler; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.cellview.client.CellList; import com.google.gwt.user.cellview.client.HasKeyboardSelectionPolicy.KeyboardSelectionPolicy; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.EventListener; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Hyperlink; import com.google.gwt.user.client.ui.Widget; import com.google.gwt.view.client.AbstractDataProvider; import com.todo.client.ToDoPresenter.ViewEventHandler; /** * A view for the {@link ToDoPresenter} * */ public class ToDoView extends Composite implements ToDoPresenter.View { private static ToDoViewUiBinder uiBinder = GWT.create(ToDoViewUiBinder.class); interface ToDoViewUiBinder extends UiBinder<Widget, ToDoView> { } @UiField Hyperlink routingAll; @UiField Hyperlink routingActive; @UiField Hyperlink routingCompleted; @UiField TextBoxWithPlaceholder taskText; @UiField Element remainingTasksCount; @UiField SpanElement remainingTasksLabel; @UiField Element mainSection; @UiField Element todoStatsContainer; @UiField SpanElement clearTasksCount; @UiField Button clearCompleted; @UiField InputElement toggleAll; @UiField(provided = true) CellList<ToDoItem> todoTable = new CellList<ToDoItem>(new ToDoCell()); public ToDoView() { initWidget(uiBinder.createAndBindUi(this)); // removes the yellow highlight todoTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED); // add IDs to the elements that have ui:field attributes. This is required because the UiBinder // does not permit the addition of ID attributes to elements marked with ui:field. // *SIGH* mainSection.setId("main"); clearCompleted.getElement().setId("clear-completed"); taskText.getElement().setId("new-todo"); todoStatsContainer.setId("footer"); toggleAll.setId("toggle-all"); } @Override public String getTaskText() { return taskText.getText(); } @Override public void addhandler(final ViewEventHandler handler) { // wire-up the events from the UI to the presenter. // The TodoMVC project template has a markup / style that is not compatible with the markup // generated by the GWT CheckBox control. For this reason, here we are using an InputElement // directly. As a result, we handle low-level DOM events rather than the GWT higher level // abstractions, e.g. ClickHandlers. A typical GWT application would not do this, however, // this nicely illustrates how you can develop GWT applications // that program directly against the DOM. final com.google.gwt.user.client.Element clientToggleElement = toggleAll.cast(); DOM.sinkEvents(clientToggleElement, Event.ONCLICK); DOM.setEventListener(clientToggleElement, new EventListener() { @Override public void onBrowserEvent(Event event) { handler.markAllCompleted(toggleAll.isChecked()); } }); taskText.addKeyUpHandler(new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { handler.addTask(); } } }); clearCompleted.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { handler.clearCompletedTasks(); } }); } @Override public void setDataProvider(AbstractDataProvider<ToDoItem> data) { data.addDataDisplay(todoTable); } @Override public void clearTaskText() { taskText.setText(""); } @Override public void setTaskStatistics(int totalTasks, int completedTasks) { int remainingTasks = totalTasks - completedTasks; displayOrHide(mainSection, totalTasks == 0); displayOrHide(todoStatsContainer, totalTasks == 0); displayOrHide(clearCompleted.getElement(), completedTasks == 0); remainingTasksCount.setInnerText(Integer.toString(remainingTasks)); remainingTasksLabel.setInnerText(remainingTasks > 1 || remainingTasks == 0 ? "items" : "item"); clearTasksCount.setInnerHTML(Integer.toString(completedTasks)); toggleAll.setChecked(totalTasks == completedTasks); } @Override public void setRouting(ToDoRouting routing) { selectRoutingHyperlink(routingAll, ToDoRouting.ALL, routing); selectRoutingHyperlink(routingActive, ToDoRouting.ACTIVE, routing); selectRoutingHyperlink(routingCompleted, ToDoRouting.COMPLETED, routing); } private void selectRoutingHyperlink(Hyperlink hyperlink, ToDoRouting currentRoutingState, ToDoRouting routingStateToMatch) { if (currentRoutingState == routingStateToMatch) { hyperlink.getElement().addClassName("selected"); } else { hyperlink.getElement().removeClassName("selected"); } } private void displayOrHide(Element element, boolean hide) { if (hide) { element.getStyle().setDisplay(Display.NONE); } else { element.getStyle().setDisplay(Display.BLOCK); } } }
architecture-examples/gwt/src/com/todo/client/ToDoView.java
package com.todo.client; import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.InputElement; import com.google.gwt.dom.client.SpanElement; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyUpEvent; import com.google.gwt.event.dom.client.KeyUpHandler; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.cellview.client.CellList; import com.google.gwt.user.cellview.client.HasKeyboardSelectionPolicy.KeyboardSelectionPolicy; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.EventListener; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Hyperlink; import com.google.gwt.user.client.ui.Widget; import com.google.gwt.view.client.AbstractDataProvider; import com.todo.client.ToDoPresenter.ViewEventHandler; /** * A view for the {@link ToDoPresenter} * */ public class ToDoView extends Composite implements ToDoPresenter.View { private static ToDoViewUiBinder uiBinder = GWT.create(ToDoViewUiBinder.class); interface ToDoViewUiBinder extends UiBinder<Widget, ToDoView> { } @UiField Hyperlink routingAll; @UiField Hyperlink routingActive; @UiField Hyperlink routingCompleted; @UiField TextBoxWithPlaceholder taskText; @UiField Element remainingTasksCount; @UiField SpanElement remainingTasksLabel; @UiField Element mainSection; @UiField Element todoStatsContainer; @UiField SpanElement clearTasksCount; @UiField Button clearCompleted; @UiField InputElement toggleAll; @UiField(provided = true) CellList<ToDoItem> todoTable = new CellList<ToDoItem>(new ToDoCell()); public ToDoView() { initWidget(uiBinder.createAndBindUi(this)); // removes the yellow highlight todoTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED); // add IDs to the elements that have ui:field attributes. This is required because the UiBinder // does not permit the addition of ID attributes to elements marked with ui:field. // *SIGH* mainSection.setId("main"); clearCompleted.getElement().setId("clear-completed"); taskText.getElement().setId("new-todo"); todoStatsContainer.setId("footer"); toggleAll.setId("toggle-all"); } @Override public String getTaskText() { return taskText.getText(); } @Override public void addhandler(final ViewEventHandler handler) { // wire-up the events from the UI to the presenter. // The TodoMVC project template has a markup / style that is not compatible with the markup // generated by the GWT CheckBox control. For this reason, here we are using an InputElement // directly. As a result, we handle low-level DOM events rather than the GWT higher level // abstractions, e.g. ClickHandlers. A typical GWT application would not do this, however, // this nicely illustrates how you can develop GWT applications // that program directly against the DOM. final com.google.gwt.user.client.Element clientToggleElement = toggleAll.cast(); DOM.sinkEvents(clientToggleElement, Event.ONCLICK); DOM.setEventListener(clientToggleElement, new EventListener() { @Override public void onBrowserEvent(Event event) { handler.markAllCompleted(toggleAll.isChecked()); } }); taskText.addKeyUpHandler(new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { handler.addTask(); } } }); clearCompleted.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { handler.clearCompletedTasks(); } }); } @Override public void setDataProvider(AbstractDataProvider<ToDoItem> data) { data.addDataDisplay(todoTable); } @Override public void clearTaskText() { taskText.setText(""); } @Override public void setTaskStatistics(int totalTasks, int completedTasks) { int remainingTasks = totalTasks - completedTasks; hideElement(mainSection, totalTasks == 0); hideElement(todoStatsContainer, totalTasks == 0); hideElement(clearCompleted.getElement(), completedTasks == 0); remainingTasksCount.setInnerText(Integer.toString(remainingTasks)); remainingTasksLabel.setInnerText(remainingTasks > 1 || remainingTasks == 0 ? "items" : "item"); clearTasksCount.setInnerHTML(Integer.toString(completedTasks)); toggleAll.setChecked(totalTasks == completedTasks); } @Override public void setRouting(ToDoRouting routing) { selectRoutingHyperlink(routingAll, ToDoRouting.ALL, routing); selectRoutingHyperlink(routingActive, ToDoRouting.ACTIVE, routing); selectRoutingHyperlink(routingCompleted, ToDoRouting.COMPLETED, routing); } private void selectRoutingHyperlink(Hyperlink hyperlink, ToDoRouting currentRoutingState, ToDoRouting routingStateToMatch) { if (currentRoutingState == routingStateToMatch) { hyperlink.getElement().addClassName("selected"); } else { hyperlink.getElement().removeClassName("selected"); } } private void hideElement(Element element, boolean hide) { if (hide) { element.setAttribute("style", "display:none;"); } else { element.setAttribute("style", "display:block;"); } } }
gwt - improvement: use setDisplay()
architecture-examples/gwt/src/com/todo/client/ToDoView.java
gwt - improvement: use setDisplay()
<ide><path>rchitecture-examples/gwt/src/com/todo/client/ToDoView.java <ide> import com.google.gwt.dom.client.Element; <ide> import com.google.gwt.dom.client.InputElement; <ide> import com.google.gwt.dom.client.SpanElement; <add>import com.google.gwt.dom.client.Style.Display; <ide> import com.google.gwt.event.dom.client.ClickEvent; <ide> import com.google.gwt.event.dom.client.ClickHandler; <ide> import com.google.gwt.event.dom.client.KeyCodes; <ide> public void setTaskStatistics(int totalTasks, int completedTasks) { <ide> int remainingTasks = totalTasks - completedTasks; <ide> <del> hideElement(mainSection, totalTasks == 0); <del> hideElement(todoStatsContainer, totalTasks == 0); <del> hideElement(clearCompleted.getElement(), completedTasks == 0); <add> displayOrHide(mainSection, totalTasks == 0); <add> displayOrHide(todoStatsContainer, totalTasks == 0); <add> displayOrHide(clearCompleted.getElement(), completedTasks == 0); <ide> <ide> remainingTasksCount.setInnerText(Integer.toString(remainingTasks)); <ide> remainingTasksLabel.setInnerText(remainingTasks > 1 || remainingTasks == 0 ? "items" : "item"); <ide> } <ide> } <ide> <del> private void hideElement(Element element, boolean hide) { <add> private void displayOrHide(Element element, boolean hide) { <ide> if (hide) { <del> element.setAttribute("style", "display:none;"); <add> element.getStyle().setDisplay(Display.NONE); <ide> } else { <del> element.setAttribute("style", "display:block;"); <add> element.getStyle().setDisplay(Display.BLOCK); <ide> } <ide> } <ide> }
JavaScript
apache-2.0
17939dc2c5d9d248179e546a1b2f48fa2b1d8995
0
fusepoolP3/p3-silk,fusepoolP3/p3-silk,fusepoolP3/p3-silk
var aggregatecounter = 0; var transformcounter = 0; var comparecounter = 0; var sourcecounter = 0; var targetcounter = 0; var transformations = new Object(); var comparators = new Object(); var aggregators = new Object(); var sources = new Array(); var targets = new Array(); var interlinkId = ""; var sourceDataSet = ""; var targetDataSet = ""; var sourceDataSetVar = ""; var targetDataSetVar = ""; var sourceDataSetRestriction = ""; var targetDataSetRestriction = ""; jsPlumb.Defaults.Container = "droppable"; var endpointOptions = { endpoint: new jsPlumb.Endpoints.Dot( { radius: 5 }), isSource: true, style: { fillStyle: '#890685' }, connectorStyle: { gradient: { stops: [ [0, '#890685'], [1, '#359ace'] ] }, strokeStyle: '#890685', lineWidth: 5 }, isTarget: false, anchor: "RightMiddle", dropOptions:{ disabled: true } }; var endpointOptions1 = { endpoint: new jsPlumb.Endpoints.Dot( { radius: 5 }), isSource: false, style: { fillStyle: '#359ace' }, connectorStyle: { gradient: { stops: [ [0, '#359ace'], [1, '#35ceb7'] ] }, strokeStyle: '#359ace', lineWidth: 5 }, isTarget: true, maxConnections: 4, anchor: "LeftMiddle" }; var endpointOptions2 = { endpoint: new jsPlumb.Endpoints.Dot( { radius: 5 }), isSource: true, style: { fillStyle: '#35ceb7' }, connectorStyle: { gradient: { stops: [ [0, '#35ceb7'], [1, '#359ace'] ] }, strokeStyle: '#359ace', lineWidth: 5 }, isTarget: true, maxConnections: 1, anchor: "RightMiddle", dropOptions:{ disabled: true } }; document.onselectstart = function () { return false; }; Array.max = function(array) { return Math.max.apply(Math, array); }; function findLongestPath(xml) { if ($(xml).children().length > 0) { var xmlHeight = []; var i = 0; $(xml).children().each(function() { xmlHeight[i] = findLongestPath($(this)); i = i+1; }); maxLength = Math.max.apply(null, xmlHeight); return 1 + maxLength; } else { return 0; } } function getHelpIcon(description, marginTop) { var helpIcon = $(document.createElement('img')); helpIcon.attr("src", "static/img/help.png"); if ((marginTop == null) || (marginTop > 0)) { helpIcon.attr("style", "margin-top: 6px; cursor:help;"); } else { helpIcon.attr("style", "margin-bottom: 3px; cursor:help;"); } helpIcon.attr("align", "right"); helpIcon.attr("title", description); return helpIcon; } function getDeleteIcon(elementId) { var img = $(document.createElement('img')); img.attr("src", "static/img/delete.png"); img.attr("align", "right"); img.attr("style", "cursor:pointer;"); img.attr("onclick", "jsPlumb.removeAllEndpoints('" + elementId+"');$('" + elementId+"').remove();"); return img; } function parseXML(xml, level, level_y, last_element, max_level, lastElementId) { $(xml).find("> Aggregate").each(function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv aggregateDiv'); box1.attr("id", "aggregate_" + aggregatecounter); var height = aggregatecounter * 120 + 120; var left = (max_level*250) - ((level + 1) * 250) + 260; box1.attr("style", "left: " + left + "px; top: " + height + "px; position: absolute;"); var number = "#aggregate_" + aggregatecounter; box1.draggable( { containment: '#droppable' }); box1.appendTo("#droppable"); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode($(this).attr("type")); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Aggregate"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", aggregators[$(this).attr("type")]["name"] + " (Aggregator)") var mytext = document.createTextNode(aggregators[$(this).attr("type")]["name"] + " (Aggregator)"); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#aggregate_" + aggregatecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); var mytext = document.createTextNode("required: "); box2.append(mytext); var box3 = $(document.createElement('input')); box3.attr("name", "required"); box3.attr("type", "checkbox"); if ($(this).attr("required") == "true") { box3.attr("checked", "checked"); } box2.append(box3); var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode("weight: "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("type", "text"); box5.attr("name", "weight"); box5.attr("size", "2"); box5.attr("value", $(this).attr("weight")); box2.append(box5); $params = Object(); $(this).find("> Param").each(function () { $params[$(this).attr("name")] = $(this).attr("value"); }); $.each(aggregators[$(this).attr("type")]["parameters"], function(j, parameter) { var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode(parameter.name + ": "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("type", "text"); box5.attr("name", parameter.name); box5.attr("size", "10"); if ($params[parameter.name]) { box5.attr("value", $params[parameter.name]); } box2.append(box5); }); box2.append(getHelpIcon(aggregators[$(this).attr("type")]["description"])); box1.append(box2); var endp_left = jsPlumb.addEndpoint('aggregate_' + aggregatecounter, jsPlumb.extend({dropOptions:{ accept: 'canvas[elId^="compare"], canvas[elId^="aggregate"]', activeClass: 'accepthighlight', hoverClass: 'accepthoverhighlight', over: function(event, ui) { $("body").css('cursor','pointer'); }, out: function(event, ui) { $("body").css('cursor','default'); } }}, endpointOptions1)); var endp_right = jsPlumb.addEndpoint('aggregate_' + aggregatecounter, endpointOptions2); aggregatecounter = aggregatecounter + 1; if (last_element != "") { jsPlumb.connect( { sourceEndpoint: endp_right, targetEndpoint: last_element }); } parseXML($(this), level + 1, 0, endp_left, max_level, box1.attr("id")); }); $(xml).find("> Compare").each(function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv compareDiv'); box1.attr("id", "compare_" + comparecounter); var height = comparecounter * 120 + 120; var left = (max_level*250) - ((level + 1) * 250) + 260; box1.attr("style", "left: " + left + "px; top: " + height + "px; position: absolute;"); var number = "#compare_" + comparecounter; box1.draggable( { containment: '#droppable' }); box1.appendTo("#droppable"); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode($(this).attr("metric")); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Compare"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", comparators[$(this).attr("metric")]["name"] + " (Comparator)") var mytext = document.createTextNode(comparators[$(this).attr("metric")]["name"] + " (Comparator)"); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#compare_" + comparecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); var mytext = document.createTextNode("required: "); box2.append(mytext); var box3 = $(document.createElement('input')); box3.attr("name", "required"); box3.attr("type", "checkbox"); if ($(this).attr("required") == "true") { box3.attr("checked", "checked"); } box2.append(box3); var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode("weight: "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("type", "text"); box5.attr("name", "weight"); box5.attr("size", "2"); box5.attr("value", $(this).attr("weight")); box2.append(box5); $params = Object(); $(this).find("> Param").each(function () { $params[$(this).attr("name")] = $(this).attr("value"); }); $.each(comparators[$(this).attr("metric")]["parameters"], function(j, parameter) { var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode(parameter.name + ": "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("type", "text"); box5.attr("name", parameter.name); box5.attr("size", "10"); if ($params[parameter.name]) { box5.attr("value", $params[parameter.name]); } box2.append(box5); }); box2.append(getHelpIcon(comparators[$(this).attr("metric")]["description"])); box1.append(box2); var endp_left = jsPlumb.addEndpoint('compare_' + comparecounter, jsPlumb.extend({dropOptions:{ accept: 'canvas[elId^="transform"], canvas[elId^="source"], canvas[elId^="target"]', activeClass: 'accepthighlight', hoverClass: 'accepthoverhighlight', over: function(event, ui) { $("body").css('cursor','pointer'); }, out: function(event, ui) { $("body").css('cursor','default'); } }}, endpointOptions1)); var endp_right = jsPlumb.addEndpoint('compare_' + comparecounter, endpointOptions2); comparecounter = comparecounter + 1; if (last_element != "") { jsPlumb.connect( { sourceEndpoint: endp_right, targetEndpoint: last_element }); } parseXML($(this), level + 1, 0, endp_left, max_level, box1.attr("id")); }); $(xml).find("> TransformInput").each(function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv transformDiv'); box1.attr("id", "transform_" + transformcounter); var height = transformcounter * 120 + 120; var left = (max_level*250) - ((level + 1) * 250) + 260; box1.attr("style", "left: " + left + "px; top: " + height + "px; position: absolute;"); var number = "#transform_" + transformcounter; box1.draggable( { containment: '#droppable' }); box1.appendTo("#droppable"); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode($(this).attr("function")); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("TransformInput"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", transformations[$(this).attr("function")]["name"] + " (Transformation)") var mytext = document.createTextNode(transformations[$(this).attr("function")]["name"] + " (Transformation)"); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#transform_" + transformcounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); $params = Object(); $(this).find("> Param").each(function () { $params[$(this).attr("name")] = $(this).attr("value"); }); $.each(transformations[$(this).attr("function")]["parameters"], function(j, parameter) { if (j > 0) { var box4 = $(document.createElement('br')); } box2.append(box4); var mytext = document.createTextNode(parameter.name + ": "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("type", "text"); box5.attr("name", parameter.name); box5.attr("size", "10"); if ($params[parameter.name]) { box5.attr("value", $params[parameter.name]); } box2.append(box5); }); box2.append(getHelpIcon(transformations[$(this).attr("function")]["description"], transformations[$(this).attr("function")]["parameters"].length)); box1.append(box2); var endp_left = jsPlumb.addEndpoint('transform_' + transformcounter, jsPlumb.extend({dropOptions:{ accept: 'canvas[elId^="transform"], canvas[elId^="source"], canvas[elId^="target"]', activeClass: 'accepthighlight', hoverClass: 'accepthoverhighlight', over: function(event, ui) { $("body").css('cursor','pointer'); }, out: function(event, ui) { $("body").css('cursor','default'); } }}, endpointOptions1)); var endp_right = jsPlumb.addEndpoint('transform_' + transformcounter, endpointOptions2); transformcounter = transformcounter + 1; if (last_element != "") { jsPlumb.connect( { sourceEndpoint: endp_right, targetEndpoint: last_element }); } parseXML($(this), level + 1, 0, endp_left, max_level, box1.attr("id")); }); $(xml).find("> Input").each(function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv sourcePath'); box1.attr("id", "source_" + sourcecounter); var height = sourcecounter * 120 + 120; var left = (max_level*250) - ((level + 1) * 250) + 260; box1.attr("style", "left: " + left + "px; top: " + height + "px; position: absolute;"); var number = "#source_" + sourcecounter; box1.draggable( { containment: '#droppable' }); box1.appendTo("#droppable"); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode(encodeHtml($(this).attr("path"))); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Input"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); // TODO /* if (($(this).attr("path")).indexOf("\\") > 0) { alert($(this).attr("path")); } */ span.attr("title", encodeHtmlInput($(this).attr("path"))); var mytext = document.createTextNode(encodeHtmlInput($(this).attr("path"))); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#source_" + sourcecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); box1.append(box2); var endp_right = jsPlumb.addEndpoint('source_' + sourcecounter, endpointOptions); sourcecounter = sourcecounter + 1; if (last_element != "") { jsPlumb.connect( { sourceEndpoint: endp_right, targetEndpoint: last_element }); } parseXML($(this), level + 1, 0, endp_right, max_level, box1.attr("id")); }); } function load() { //alert(linkSpec); $(linkSpec).find("> SourceDataset").each(function () { sourceDataSet = $(this).attr("dataSource"); sourceDataSetVar = $(this).attr("var"); $(this).find("> RestrictTo").each(function () { sourceDataSetRestriction = $(this).text(); }); }); $(linkSpec).find("> TargetDataset").each(function () { targetDataSet = $(this).attr("dataSource"); targetDataSetVar = $(this).attr("var"); $(this).find("> RestrictTo").each(function () { targetDataSetRestriction = $(this).text(); }); }); $(linkSpec).find("> LinkCondition").each(function () { var max_level = findLongestPath($(this)); /* var userAgent = navigator.userAgent.toLowerCase(); // Figure out what browser is being used jQuery.browser = { version: (userAgent.match( /.+(?:rv|it|ra|ie|me)[\/: ]([\d.]+)/ ) || [])[1], chrome: /chrome/.test( userAgent ), safari: /webkit/.test( userAgent ) && !/chrome/.test( userAgent ), opera: /opera/.test( userAgent ), msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) }; var is_chrome = /chrome/.test( navigator.userAgent.toLowerCase()); var is_safari = /safari/.test( navigator.userAgent.toLowerCase()); */ parseXML($(this), 0, 0, "", max_level, ""); if ((sourcecounter*120 + 20) > 800) { $("#droppable").css( { "height": (sourcecounter*120 + 20) + "px" }); } }); $(linkSpec).find("> LinkType").each(function () { $("#linktype").attr("value", $(this).text()); }); $(linkSpec).find("> Filter").each(function () { if ($(this).attr("limit") > 0) { $("select[id=linklimit] option[text="+$(this).attr("limit")+"]").attr("selected", true); } $("#threshold").attr("value", $(this).attr("threshold")); }); updateWindowWidth(); } function updateWindowWidth() { var window_width = $(window).width(); if (window_width>1100) { $(".wrapper").width(window_width-10); $("#droppable").width(window_width-290); } else { $(".wrapper").width(1000+1200-window_width); $("#droppable").width(830); } } function getHTML(who, deep) { if (!who || !who.tagName) return ''; var txt, el = document.createElement("div"); el.appendChild(who.cloneNode(deep)); txt = el.innerHTML; el = null; return txt; } function createNewElement(elementId) { var elementIdName = "#"+elementId; var elName = ($(elementIdName).children(".name").text()); var elType = ($(elementIdName).children(".type").text()); var xml = document.createElement(elType); if (elType == "Input") { if (elName == "") { xml.setAttribute("path", $(elementIdName+" > h5 > input").val()); } else { xml.setAttribute("path", decodeHtml(elName)); } } else if (elType == "TransformInput") { xml.setAttribute("function", elName); } else if (elType == "Aggregate") { xml.setAttribute("type", elName); } else if (elType == "Compare") { xml.setAttribute("metric", elName); } var params = $(elementIdName+" > div.content > input"); var c = jsPlumb.getConnections(); for (var i = 0; i < c[jsPlumb.getDefaultScope()].length; i++) { var source = c[jsPlumb.getDefaultScope()][i].sourceId; var target = c[jsPlumb.getDefaultScope()][i].targetId; if (target == elementId) { xml.appendChild(createNewElement(source)); } } for (var l = 0; l < params.length; l++) { if ($(params[l]).attr("name") == "required") { if (($(elementIdName+" > div.content > input[name=required]:checked").val()) == "on") { xml.setAttribute("required", "true"); } else { xml.setAttribute("required", "false"); } } else if ($(params[l]).attr("name") == "weight") { xml.setAttribute("weight", $(params[l]).attr("value")); } else { if (elType == "Compare") { if ($(params[l]).val() != "") { var xml_param = document.createElement("Param"); xml_param.setAttribute("name", $(params[l]).attr("name")); xml_param.setAttribute("value", $(params[l]).val()); xml.appendChild(xml_param); } } else { var xml_param = document.createElement("Param"); xml_param.setAttribute("name", $(params[l]).attr("name")); xml_param.setAttribute("value", $(params[l]).val()); xml.appendChild(xml_param); } } } return xml; } function serializeLinkSpec() { //alert (JSON.stringify(c)); var c = jsPlumb.getConnections(); if (c[jsPlumb.getDefaultScope()] !== undefined) { var connections = ""; for (var i = 0; i < c[jsPlumb.getDefaultScope()].length; i++) { var source = c[jsPlumb.getDefaultScope()][i].sourceId; var target = c[jsPlumb.getDefaultScope()][i].targetId; sources[target] = source; targets[source] = target; connections = connections + source + " -> " + target + ", "; } //alert (connections); var root = null; for (var key in sources) { if (!targets[key]) { root = key; } } } // alert(connections + "\n\n" + root); var xml = document.createElement("Interlink"); xml.setAttribute("id", interlinkId); var linktype = document.createElement("LinkType"); var linktypeText = document.createTextNode($("#linktype").val()); linktype.appendChild(linktypeText); xml.appendChild(linktype); var sourceDataset = document.createElement("SourceDataset"); sourceDataset.setAttribute("var", sourceDataSetVar); sourceDataset.setAttribute("dataSource", sourceDataSet); var restriction = document.createElement("RestrictTo"); var restrictionText = document.createTextNode(sourceDataSetRestriction); restriction.appendChild(restrictionText); sourceDataset.appendChild(restriction); xml.appendChild(sourceDataset); var targetDataset = document.createElement("TargetDataset"); targetDataset.setAttribute("var", targetDataSetVar); targetDataset.setAttribute("dataSource", targetDataSet); var restriction = document.createElement("RestrictTo"); var restrictionText = document.createTextNode(targetDataSetRestriction); restriction.appendChild(restrictionText); targetDataset.appendChild(restriction); xml.appendChild(targetDataset); var linkcondition = document.createElement("LinkCondition"); if (root != null) { linkcondition.appendChild(createNewElement(root)); } xml.appendChild(linkcondition); var filter = document.createElement("Filter"); if ($("#linklimit :selected").text() != "unlimited") { filter.setAttribute("limit", $("#linklimit :selected").text()); } filter.setAttribute("threshold", $("#threshold").val()); xml.appendChild(filter); var outputs = document.createElement("Outputs"); xml.appendChild(outputs); var xmlString = getHTML(xml, true); xmlString = xmlString.replace('xmlns="http://www.w3.org/1999/xhtml"', ""); // alert(xmlString); return xmlString; } $(function () { $("#droppable").droppable( //{ tolerance: 'touch' }, { drop: function (ev, ui) { if ($("#droppable").find("> #"+ui.helper.attr('id')+"").length == 0) { //$(this).append($(ui.helper).clone()); $.ui.ddmanager.current.cancelHelperRemoval = true; ui.helper.appendTo(this); /* styleString = $("#"+ui.helper.attr('id')).attr("style"); styleString = styleString.replace("position: absolute", ""); $("#"+ui.helper.attr('id')).attr("style", styleString); */ if (ui.helper.attr('id').search(/aggregate/) != -1) { jsPlumb.addEndpoint('aggregate_' + aggregatecounter, jsPlumb.extend({dropOptions:{ accept: 'canvas[elId^="compare"], canvas[elId^="aggregate"]', activeClass: 'accepthighlight', hoverClass: 'accepthoverhighlight', over: function(event, ui) { $("body").css('cursor','pointer'); }, out: function(event, ui) { $("body").css('cursor','default'); } }}, endpointOptions1)); jsPlumb.addEndpoint('aggregate_' + aggregatecounter, endpointOptions2); var number = "#aggregate_" + aggregatecounter; $(number).draggable( { containment: '#droppable', drag: function(event, ui) { jsPlumb.repaint(number); }, stop: function(event, ui) { jsPlumb.repaint(number); } }); aggregatecounter = aggregatecounter + 1; } if (ui.helper.attr('id').search(/transform/) != -1) { jsPlumb.addEndpoint('transform_' + transformcounter, jsPlumb.extend({dropOptions:{ accept: 'canvas[elId^="transform"], canvas[elId^="source"], canvas[elId^="target"]', activeClass: 'accepthighlight', hoverClass: 'accepthoverhighlight', over: function(event, ui) { $("body").css('cursor','pointer'); }, out: function(event, ui) { $("body").css('cursor','default'); } }}, endpointOptions1)); jsPlumb.addEndpoint('transform_' + transformcounter, endpointOptions2); var number = "#transform_" + transformcounter; $(number).draggable( { containment: '#droppable', drag: function(event, ui) { jsPlumb.repaint(number); }, stop: function(event, ui) { jsPlumb.repaint(number); } }); transformcounter = transformcounter + 1; } if (ui.helper.attr('id').search(/compare/) != -1) { jsPlumb.addEndpoint('compare_' + comparecounter, jsPlumb.extend({dropOptions:{ accept: 'canvas[elId^="transform"], canvas[elId^="source"], canvas[elId^="target"]', activeClass: 'accepthighlight', hoverClass: 'accepthoverhighlight', over: function(event, ui) { $("body").css('cursor','pointer'); }, out: function(event, ui) { $("body").css('cursor','default'); } }}, endpointOptions1)); jsPlumb.addEndpoint('compare_' + comparecounter, endpointOptions2); var number = "#compare_" + comparecounter; $(number).draggable( { containment: '#droppable', drag: function(event, ui) { jsPlumb.repaint(number); }, stop: function(event, ui) { jsPlumb.repaint(number); } }); comparecounter = comparecounter + 1; } if (ui.helper.attr('id').search(/source/) != -1) { jsPlumb.addEndpoint('source_' + sourcecounter, endpointOptions); var number = "#source_" + sourcecounter; $(number).draggable( { containment: '#droppable', drag: function(event, ui) { jsPlumb.repaint(number); }, stop: function(event, ui) { jsPlumb.repaint(number); } }); sourcecounter = sourcecounter + 1; } if (ui.helper.attr('id').search(/target/) != -1) { jsPlumb.addEndpoint('target_' + targetcounter, endpointOptions); var number = "#target_" + targetcounter; $(number).draggable( { containment: '#droppable', drag: function(event, ui) { jsPlumb.repaint(number); }, stop: function(event, ui) { jsPlumb.repaint(number); } }); targetcounter = targetcounter + 1; } // fix the position of the new added box var offset = $(number).offset(); var scrollleft = $("#droppable").scrollLeft(); var scrolltop = $("#droppable").scrollTop(); var top = offset.top-204+scrolltop+scrolltop; var left = offset.left-502+scrollleft+scrollleft; $(number).attr("style", "left: " + left + "px; top: " + top + "px; position: absolute;"); jsPlumb.repaint(number); } } }); }); function decodeHtml(value) { encodedHtml = value.replace("&lt;", "<"); encodedHtml = encodedHtml.replace("&gt;", ">"); return encodedHtml; } function encodeHtml(value) { encodedHtml = value.replace("<", "&lt;"); encodedHtml = encodedHtml.replace(">", "&gt;"); encodedHtml = encodedHtml.replace("\"", '\\"'); return encodedHtml; } function encodeHtmlInput(value) { var encodedHtml = value.replace('\\', "&#92;"); return encodedHtml; } function getPropertyPaths(deleteExisting) { if (deleteExisting) { $("#paths").empty(); var box = $(document.createElement('div')); box.attr("id", "loading"); box.attr("style", "width: 230px;"); var text = document.createTextNode("loading ..."); box.append(text); box.appendTo("#paths"); } var url = "api/project/paths"; // ?max=10 $.getJSON(url, function (data) { if(data.isLoading) { var dot = document.createTextNode("."); document.getElementById("loading").appendChild(dot); setTimeout("getPropertyPaths();", 1000); } else if (data.error !== undefined) { alert("Could not load property paths.\nError: " + data.error); } else { document.getElementById("paths").removeChild(document.getElementById("loading")); var list_item_id = 0; var box = $(document.createElement('div')); box.html("<span style='font-weight: bold;'>Source:</span> " + data.source.id).appendTo("#paths"); box.appendTo("#paths"); var box = $(document.createElement('div')); box.addClass('more'); box.html("<span style='font-weight: bold;'>Restriction:</span> " + data.source.restrictions).appendTo("#paths"); box.appendTo("#paths"); var box = $(document.createElement('div')); box.attr("id", "sourcepaths"); box.addClass("scrollboxes"); box.appendTo("#paths"); var sourcepaths = data.source.paths; $.each(sourcepaths, function (i, item) { var box = $(document.createElement('div')); box.addClass('draggable'); box.attr("id", "source" + list_item_id); box.attr("title", encodeHtml(item.path)); box.html("<span></span><p style=\"white-space:nowrap; overflow:hidden;\">" + encodeHtml(item.path) + "</p>"); box.draggable( { helper: function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv sourcePath'); box1.attr("id", "source_" + sourcecounter); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode(encodeHtml(item.path)); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Input"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", item.path); var mytext = document.createTextNode(item.path); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#source_" + sourcecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); box1.append(box2); return box1; } }); box.appendTo("#sourcepaths"); list_item_id = list_item_id + 1; }); var box = $(document.createElement('div')); box.addClass('draggable'); box.attr("id", "source" + list_item_id); box.html("<span> </span><small> </small><p>(custom path)</p>"); box.draggable( { helper: function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv sourcePath'); box1.attr("id", "source_" + sourcecounter); var box2 = $(document.createElement('small')); box2.addClass('name'); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Input"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); box2.attr("style", "height: 19px;"); var input = $(document.createElement('input')); input.attr("style", "width: 165px;"); input.attr("type", "text"); input.val("?" + sourceDataSetVar); box2.append(input); box2.append(getDeleteIcon("#source_" + sourcecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); box1.append(box2); return box1; } }); box.appendTo("#sourcepaths"); /* var availablePaths = data.source.availablePaths; if (max_paths < availablePaths) { var box = $(document.createElement('div')); box.html("<a href='/linkSpec' class='more'>&darr; more source paths...</a>"); box.appendTo("#paths"); } */ var box = $(document.createElement('div')); box.html("<span style='font-weight: bold;'>Target:</span> " + data.target.id).appendTo("#paths"); box.appendTo("#paths"); var box = $(document.createElement('div')); box.addClass('more'); box.html("<span style='font-weight: bold;'>Restriction:</span> " + data.target.restrictions).appendTo("#paths"); box.appendTo("#paths"); var list_item_id = 0; var box = $(document.createElement('div')); box.attr("id", "targetpaths"); box.addClass("scrollboxes"); box.appendTo("#paths"); var sourcepaths = data.target.paths; $.each(sourcepaths, function (i, item) { var box = $(document.createElement('div')); box.addClass('draggable'); box.attr("id", "target" + list_item_id); box.attr("title", encodeHtml(item.path)); box.html("<span></span><small>" + encodeHtml(item.path) + "</small><p style=\"white-space:nowrap; overflow:hidden;\">" + encodeHtml(item.path) + "</p>"); box.draggable( { helper: function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv targetPath'); box1.attr("id", "target_" + targetcounter); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode(encodeHtml(item.path)); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Input"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", item.path); var mytext = document.createTextNode(item.path); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#target_" + targetcounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); box1.append(box2); return box1; } }); box.appendTo("#targetpaths"); list_item_id = list_item_id + 1; }); var box = $(document.createElement('div')); box.addClass('draggable'); box.attr("id", "target" + list_item_id); box.html("<span> </span><small> </small><p>(custom path)</p>"); box.draggable( { helper: function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv sourcePath'); box1.attr("id", "source_" + sourcecounter); var box2 = $(document.createElement('small')); box2.addClass('name'); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Input"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); box2.attr("style", "height: 19px;"); var input = $(document.createElement('input')); input.attr("style", "width: 165px;"); input.attr("type", "text"); input.val("?" + targetDataSetVar); box2.append(input); box2.append(getDeleteIcon("#source_" + sourcecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); box1.append(box2); return box1; } }); box.appendTo("#targetpaths"); /* var availablePaths = data.target.availablePaths; if (max_paths < availablePaths) { var box = $(document.createElement('div')); box.html('<a href="" class="more">&darr; more target paths... (' + availablePaths + ' in total)</a>'); box.appendTo("#paths"); } */ } }); } function getOperators() { $.ajax( { type: "GET", url: "api/project/operators", contentType: "application/json; charset=utf-8", dataType: "json", timeout: 2000, success: function (data, textStatus, XMLHttpRequest) { // alert("success: " + data + " " + textStatus + " " + XMLHttpRequest.status); if (XMLHttpRequest.status >= 200 && XMLHttpRequest.status < 300) { var list_item_id = 0; var box = $(document.createElement('div')); box.attr("style", "color: #0cc481;"); box.addClass("boxheaders"); box.html("Transformations").appendTo("#operators"); box.appendTo("#operators"); var box = $(document.createElement('div')); box.attr("id", "transformationbox"); box.addClass("scrollboxes"); box.appendTo("#operators"); var sourcepaths = data.transformations; $.each(sourcepaths, function (i, item) { transformations[item.id] = new Object(); transformations[item.id]["name"] = item.label; transformations[item.id]["description"] = item.description; transformations[item.id]["parameters"] = item.parameters; var box = $(document.createElement('div')); box.addClass('draggable tranformations'); box.attr("id", "transformation" + list_item_id); box.attr("title", item.description); box.html("<span></span><small>" + item.label + "</small><p>" + item.label + "</p>"); box.draggable( { helper: function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv transformDiv'); box1.attr("id", "transform_" + transformcounter); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode(item.id); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("TransformInput"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", item.label + " (Transformation)") var mytext = document.createTextNode(item.label + " (Transformation)"); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#transform_" + transformcounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); $.each(item.parameters, function (j, parameter) { if (j > 0) { var box4 = $(document.createElement('br')); box2.append(box4); } var mytext = document.createTextNode(parameter.name + ": "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("name", parameter.name); box5.attr("type", "text"); box5.attr("size", "10"); box2.append(box5); }); box2.append(getHelpIcon(item.description, item.parameters.length)); box1.append(box2); return box1; } }); box.appendTo("#transformationbox"); list_item_id = list_item_id + 1; }); var list_item_id = 0; var box = $(document.createElement('div')); box.attr("style", "color: #e59829;"); box.addClass("boxheaders"); box.html("Comparators").appendTo("#operators"); box.appendTo("#operators"); var box = $(document.createElement('div')); box.attr("id", "comparatorbox"); box.addClass("scrollboxes"); box.appendTo("#operators"); var sourcepaths = data.comparators; $.each(sourcepaths, function (i, item) { comparators[item.id] = new Object(); comparators[item.id]["name"] = item.label; comparators[item.id]["description"] = item.description; comparators[item.id]["parameters"] = item.parameters; var box = $(document.createElement('div')); box.addClass('draggable comparators'); box.attr("id", "comparator" + list_item_id); box.attr("title", item.description); box.html("<span></span><small>" + item.label + "</small><p>" + item.label + "</p>"); box.draggable( { helper: function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv compareDiv'); box1.attr("id", "compare_" + comparecounter); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode(item.id); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Compare"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", item.label + " (Comparator)") var mytext = document.createTextNode(item.label + " (Comparator)"); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#compare_" + comparecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); var mytext = document.createTextNode("required: "); box2.append(mytext); var box3 = $(document.createElement('input')); box3.attr("type", "checkbox"); box3.attr("name", "required"); box2.append(box3); var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode("weight: "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("name", "weight"); box5.attr("type", "text"); box5.attr("size", "2"); box5.attr("value", "1"); box2.append(box5); $.each(item.parameters, function (j, parameter) { var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode(parameter.name + ": "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("name", parameter.name); box5.attr("type", "text"); box5.attr("size", "10");; box2.append(box5); }); box2.append(getHelpIcon(item.description)); box1.append(box2); // jsPlumb.addEndpoint('compare_1', endpointOptions); return box1; } }); box.appendTo("#comparatorbox"); list_item_id = list_item_id + 1; }); var list_item_id = 0; var box = $(document.createElement('div')); box.attr("style", "color: #1484d4;"); box.addClass("boxheaders"); box.html("Aggregators").appendTo("#operators"); box.appendTo("#operators"); var box = $(document.createElement('div')); box.attr("id", "aggregatorbox"); box.addClass("scrollboxes"); box.appendTo("#operators"); var sourcepaths = data.aggregators; $.each(sourcepaths, function (i, item) { aggregators[item.id] = new Object(); aggregators[item.id]["name"] = item.label; aggregators[item.id]["description"] = item.description; aggregators[item.id]["parameters"] = item.parameters; var box = $(document.createElement('div')); box.addClass('draggable aggregators'); box.attr("title", item.description); box.attr("id", "aggregator" + list_item_id); box.html("<span></span><small>" + item.label + "</small><p>" + item.label + "</p>"); box.draggable( { helper: function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv aggregateDiv'); box1.attr("id", "aggregate_" + aggregatecounter); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode(item.id); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Aggregate"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", item.label + " (Aggregator)") var mytext = document.createTextNode(item.label + " (Aggregator)"); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#aggregate_" + aggregatecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); var mytext = document.createTextNode("required: "); box2.append(mytext); var box3 = $(document.createElement('input')); box3.attr("name", "required"); box3.attr("type", "checkbox"); box2.append(box3); var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode("weight: "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("type", "text"); box5.attr("size", "2"); box5.attr("name", "weight"); box5.attr("value", "1"); box2.append(box5); $.each(item.parameters, function (j, parameter) { var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode(parameter.name + ": "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("name", parameter.name); box5.attr("type", "text"); box5.attr("size", "10");; box2.append(box5); }); box2.append(getHelpIcon(item.description)); box1.append(box2); return box1; } }); box.appendTo("#aggregatorbox"); list_item_id = list_item_id + 1; }); load(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("Error: " + textStatus + " " + errorThrown); } }); }
silk2/silk-workbench/silk-workbench-webapp/src/main/webapp/static/js/editor.js
var aggregatecounter = 0; var transformcounter = 0; var comparecounter = 0; var sourcecounter = 0; var targetcounter = 0; var transformations = new Object(); var comparators = new Object(); var aggregators = new Object(); var sources = new Array(); var targets = new Array(); var interlinkId = ""; var sourceDataSet = ""; var targetDataSet = ""; var sourceDataSetVar = ""; var targetDataSetVar = ""; var sourceDataSetRestriction = ""; var targetDataSetRestriction = ""; jsPlumb.Defaults.Container = "droppable"; var endpointOptions = { endpoint: new jsPlumb.Endpoints.Dot( { radius: 5 }), isSource: true, style: { fillStyle: '#890685' }, connectorStyle: { gradient: { stops: [ [0, '#890685'], [1, '#359ace'] ] }, strokeStyle: '#890685', lineWidth: 5 }, isTarget: false, anchor: "RightMiddle", dropOptions:{ disabled: true } }; var endpointOptions1 = { endpoint: new jsPlumb.Endpoints.Dot( { radius: 5 }), isSource: false, style: { fillStyle: '#359ace' }, connectorStyle: { gradient: { stops: [ [0, '#359ace'], [1, '#35ceb7'] ] }, strokeStyle: '#359ace', lineWidth: 5 }, isTarget: true, maxConnections: 4, anchor: "LeftMiddle" }; var endpointOptions2 = { endpoint: new jsPlumb.Endpoints.Dot( { radius: 5 }), isSource: true, style: { fillStyle: '#35ceb7' }, connectorStyle: { gradient: { stops: [ [0, '#35ceb7'], [1, '#359ace'] ] }, strokeStyle: '#359ace', lineWidth: 5 }, isTarget: true, maxConnections: 1, anchor: "RightMiddle", dropOptions:{ disabled: true } }; document.onselectstart = function () { return false; }; Array.max = function(array) { return Math.max.apply(Math, array); }; function findLongestPath(xml) { if ($(xml).children().length > 0) { var xmlHeight = []; var i = 0; $(xml).children().each(function() { xmlHeight[i] = findLongestPath($(this)); i = i+1; }); maxLength = Math.max.apply(null, xmlHeight); return 1 + maxLength; } else { return 0; } } function getHelpIcon(description, marginTop) { var helpIcon = $(document.createElement('img')); helpIcon.attr("src", "static/img/help.png"); if ((marginTop == null) || (marginTop > 0)) { helpIcon.attr("style", "margin-top: 6px; cursor:help;"); } else { helpIcon.attr("style", "margin-bottom: 3px; cursor:help;"); } helpIcon.attr("align", "right"); helpIcon.attr("title", description); return helpIcon; } function getDeleteIcon(elementId) { var img = $(document.createElement('img')); img.attr("src", "static/img/delete.png"); img.attr("align", "right"); img.attr("style", "cursor:pointer;"); img.attr("onclick", "jsPlumb.removeAllEndpoints('" + elementId+"');$('" + elementId+"').remove();"); return img; } function parseXML(xml, level, level_y, last_element, max_level, lastElementId) { $(xml).find("> Aggregate").each(function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv aggregateDiv'); box1.attr("id", "aggregate_" + aggregatecounter); var height = aggregatecounter * 120 + 120; var left = (max_level*250) - ((level + 1) * 250) + 260; box1.attr("style", "left: " + left + "px; top: " + height + "px; position: absolute;"); var number = "#aggregate_" + aggregatecounter; box1.draggable( { containment: '#droppable' }); box1.appendTo("#droppable"); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode($(this).attr("type")); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Aggregate"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", aggregators[$(this).attr("type")]["name"] + " (Aggregator)") var mytext = document.createTextNode(aggregators[$(this).attr("type")]["name"] + " (Aggregator)"); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#aggregate_" + aggregatecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); var mytext = document.createTextNode("required: "); box2.append(mytext); var box3 = $(document.createElement('input')); box3.attr("name", "required"); box3.attr("type", "checkbox"); if ($(this).attr("required") == "true") { box3.attr("checked", "checked"); } box2.append(box3); var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode("weight: "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("type", "text"); box5.attr("name", "weight"); box5.attr("size", "2"); box5.attr("value", $(this).attr("weight")); box2.append(box5); $params = Object(); $(this).find("> Param").each(function () { $params[$(this).attr("name")] = $(this).attr("value"); }); $.each(aggregators[$(this).attr("type")]["parameters"], function(j, parameter) { var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode(parameter.name + ": "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("type", "text"); box5.attr("name", parameter.name); box5.attr("size", "10"); if ($params[parameter.name]) { box5.attr("value", $params[parameter.name]); } box2.append(box5); }); box2.append(getHelpIcon(aggregators[$(this).attr("type")]["description"])); box1.append(box2); var endp_left = jsPlumb.addEndpoint('aggregate_' + aggregatecounter, jsPlumb.extend({dropOptions:{ accept: 'canvas[elId^="compare"], canvas[elId^="aggregate"]', activeClass: 'accepthighlight', hoverClass: 'accepthoverhighlight', over: function(event, ui) { $("body").css('cursor','pointer'); }, out: function(event, ui) { $("body").css('cursor','default'); } }}, endpointOptions1)); var endp_right = jsPlumb.addEndpoint('aggregate_' + aggregatecounter, endpointOptions2); aggregatecounter = aggregatecounter + 1; if (last_element != "") { jsPlumb.connect( { sourceEndpoint: endp_right, targetEndpoint: last_element }); } parseXML($(this), level + 1, 0, endp_left, max_level, box1.attr("id")); }); $(xml).find("> Compare").each(function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv compareDiv'); box1.attr("id", "compare_" + comparecounter); var height = comparecounter * 120 + 120; var left = (max_level*250) - ((level + 1) * 250) + 260; box1.attr("style", "left: " + left + "px; top: " + height + "px; position: absolute;"); var number = "#compare_" + comparecounter; box1.draggable( { containment: '#droppable' }); box1.appendTo("#droppable"); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode($(this).attr("metric")); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Compare"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", comparators[$(this).attr("metric")]["name"] + " (Comparator)") var mytext = document.createTextNode(comparators[$(this).attr("metric")]["name"] + " (Comparator)"); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#compare_" + comparecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); var mytext = document.createTextNode("required: "); box2.append(mytext); var box3 = $(document.createElement('input')); box3.attr("name", "required"); box3.attr("type", "checkbox"); if ($(this).attr("required") == "true") { box3.attr("checked", "checked"); } box2.append(box3); var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode("weight: "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("type", "text"); box5.attr("name", "weight"); box5.attr("size", "2"); box5.attr("value", $(this).attr("weight")); box2.append(box5); $params = Object(); $(this).find("> Param").each(function () { $params[$(this).attr("name")] = $(this).attr("value"); }); $.each(comparators[$(this).attr("metric")]["parameters"], function(j, parameter) { var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode(parameter.name + ": "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("type", "text"); box5.attr("name", parameter.name); box5.attr("size", "10"); if ($params[parameter.name]) { box5.attr("value", $params[parameter.name]); } box2.append(box5); }); box2.append(getHelpIcon(comparators[$(this).attr("metric")]["description"])); box1.append(box2); var endp_left = jsPlumb.addEndpoint('compare_' + comparecounter, jsPlumb.extend({dropOptions:{ accept: 'canvas[elId^="transform"], canvas[elId^="source"], canvas[elId^="target"]', activeClass: 'accepthighlight', hoverClass: 'accepthoverhighlight', over: function(event, ui) { $("body").css('cursor','pointer'); }, out: function(event, ui) { $("body").css('cursor','default'); } }}, endpointOptions1)); var endp_right = jsPlumb.addEndpoint('compare_' + comparecounter, endpointOptions2); comparecounter = comparecounter + 1; if (last_element != "") { jsPlumb.connect( { sourceEndpoint: endp_right, targetEndpoint: last_element }); } parseXML($(this), level + 1, 0, endp_left, max_level, box1.attr("id")); }); $(xml).find("> TransformInput").each(function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv transformDiv'); box1.attr("id", "transform_" + transformcounter); var height = transformcounter * 120 + 120; var left = (max_level*250) - ((level + 1) * 250) + 260; box1.attr("style", "left: " + left + "px; top: " + height + "px; position: absolute;"); var number = "#transform_" + transformcounter; box1.draggable( { containment: '#droppable' }); box1.appendTo("#droppable"); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode($(this).attr("function")); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("TransformInput"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", transformations[$(this).attr("function")]["name"] + " (Transformation)") var mytext = document.createTextNode(transformations[$(this).attr("function")]["name"] + " (Transformation)"); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#transform_" + transformcounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); $params = Object(); $(this).find("> Param").each(function () { $params[$(this).attr("name")] = $(this).attr("value"); }); $.each(transformations[$(this).attr("function")]["parameters"], function(j, parameter) { if (j > 0) { var box4 = $(document.createElement('br')); } box2.append(box4); var mytext = document.createTextNode(parameter.name + ": "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("type", "text"); box5.attr("name", parameter.name); box5.attr("size", "10"); if ($params[parameter.name]) { box5.attr("value", $params[parameter.name]); } box2.append(box5); }); box2.append(getHelpIcon(transformations[$(this).attr("function")]["description"], transformations[$(this).attr("function")]["parameters"].length)); box1.append(box2); var endp_left = jsPlumb.addEndpoint('transform_' + transformcounter, jsPlumb.extend({dropOptions:{ accept: 'canvas[elId^="transform"], canvas[elId^="source"], canvas[elId^="target"]', activeClass: 'accepthighlight', hoverClass: 'accepthoverhighlight', over: function(event, ui) { $("body").css('cursor','pointer'); }, out: function(event, ui) { $("body").css('cursor','default'); } }}, endpointOptions1)); var endp_right = jsPlumb.addEndpoint('transform_' + transformcounter, endpointOptions2); transformcounter = transformcounter + 1; if (last_element != "") { jsPlumb.connect( { sourceEndpoint: endp_right, targetEndpoint: last_element }); } parseXML($(this), level + 1, 0, endp_left, max_level, box1.attr("id")); }); $(xml).find("> Input").each(function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv sourcePath'); box1.attr("id", "source_" + sourcecounter); var height = sourcecounter * 120 + 120; var left = (max_level*250) - ((level + 1) * 250) + 260; box1.attr("style", "left: " + left + "px; top: " + height + "px; position: absolute;"); var number = "#source_" + sourcecounter; box1.draggable( { containment: '#droppable' }); box1.appendTo("#droppable"); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode(encodeHtml($(this).attr("path"))); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Input"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); // TODO /* if (($(this).attr("path")).indexOf("\\") > 0) { alert($(this).attr("path")); } */ span.attr("title", encodeHtmlInput($(this).attr("path"))); var mytext = document.createTextNode(encodeHtmlInput($(this).attr("path"))); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#source_" + sourcecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); box1.append(box2); var endp_right = jsPlumb.addEndpoint('source_' + sourcecounter, endpointOptions); sourcecounter = sourcecounter + 1; if (last_element != "") { jsPlumb.connect( { sourceEndpoint: endp_right, targetEndpoint: last_element }); } parseXML($(this), level + 1, 0, endp_right, max_level, box1.attr("id")); }); } function load() { //alert(linkSpec); $(linkSpec).find("> SourceDataset").each(function () { sourceDataSet = $(this).attr("dataSource"); sourceDataSetVar = $(this).attr("var"); $(this).find("> RestrictTo").each(function () { sourceDataSetRestriction = $(this).text(); }); }); $(linkSpec).find("> TargetDataset").each(function () { targetDataSet = $(this).attr("dataSource"); targetDataSetVar = $(this).attr("var"); $(this).find("> RestrictTo").each(function () { targetDataSetRestriction = $(this).text(); }); }); $(linkSpec).find("> LinkCondition").each(function () { var max_level = findLongestPath($(this)); /* var userAgent = navigator.userAgent.toLowerCase(); // Figure out what browser is being used jQuery.browser = { version: (userAgent.match( /.+(?:rv|it|ra|ie|me)[\/: ]([\d.]+)/ ) || [])[1], chrome: /chrome/.test( userAgent ), safari: /webkit/.test( userAgent ) && !/chrome/.test( userAgent ), opera: /opera/.test( userAgent ), msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) }; var is_chrome = /chrome/.test( navigator.userAgent.toLowerCase()); var is_safari = /safari/.test( navigator.userAgent.toLowerCase()); */ parseXML($(this), 0, 0, "", max_level, ""); if ((sourcecounter*120 + 20) > 800) { $("#droppable").css( { "height": (sourcecounter*120 + 20) + "px" }); } }); $(linkSpec).find("> LinkType").each(function () { $("#linktype").attr("value", $(this).text()); }); $(linkSpec).find("> Filter").each(function () { if ($(this).attr("limit") > 0) { $("select[id=linklimit] option[text="+$(this).attr("limit")+"]").attr("selected", true); } $("#threshold").attr("value", $(this).attr("threshold")); }); updateWindowWidth(); } function updateWindowWidth() { var window_width = $(window).width(); if (window_width>1100) { $(".wrapper").width(window_width-10); $("#droppable").width(window_width-290); } else { $(".wrapper").width(1000+1200-window_width); $("#droppable").width(830); } } function getHTML(who, deep) { if (!who || !who.tagName) return ''; var txt, el = document.createElement("div"); el.appendChild(who.cloneNode(deep)); txt = el.innerHTML; el = null; return txt; } function createNewElement(elementId) { var elementIdName = "#"+elementId; var elName = ($(elementIdName).children(".name").text()); var elType = ($(elementIdName).children(".type").text()); var xml = document.createElement(elType); if (elType == "Input") { if (elName == "") { xml.setAttribute("path", $(elementIdName+" > h5 > input").val()); } else { xml.setAttribute("path", decodeHtml(elName)); } } else if (elType == "TransformInput") { xml.setAttribute("function", elName); } else if (elType == "Aggregate") { xml.setAttribute("type", elName); } else if (elType == "Compare") { xml.setAttribute("metric", elName); } var params = $(elementIdName+" > div.content > input"); var c = jsPlumb.getConnections(); for (var i = 0; i < c[jsPlumb.getDefaultScope()].length; i++) { var source = c[jsPlumb.getDefaultScope()][i].sourceId; var target = c[jsPlumb.getDefaultScope()][i].targetId; if (target == elementId) { xml.appendChild(createNewElement(source)); } } for (var l = 0; l < params.length; l++) { if ($(params[l]).attr("name") == "required") { if (($(elementIdName+" > div.content > input[name=required]:checked").val()) == "on") { xml.setAttribute("required", "true"); } else { xml.setAttribute("required", "false"); } } else if ($(params[l]).attr("name") == "weight") { xml.setAttribute("weight", $(params[l]).attr("value")); } else { if (elType == "Compare") { if ($(params[l]).val() != "") { var xml_param = document.createElement("Param"); xml_param.setAttribute("name", $(params[l]).attr("name")); xml_param.setAttribute("value", $(params[l]).val()); xml.appendChild(xml_param); } } else { var xml_param = document.createElement("Param"); xml_param.setAttribute("name", $(params[l]).attr("name")); xml_param.setAttribute("value", $(params[l]).val()); xml.appendChild(xml_param); } } } return xml; } function serializeLinkSpec() { //alert (JSON.stringify(c)); var c = jsPlumb.getConnections(); if (c[jsPlumb.getDefaultScope()] !== undefined) { var connections = ""; for (var i = 0; i < c[jsPlumb.getDefaultScope()].length; i++) { var source = c[jsPlumb.getDefaultScope()][i].sourceId; var target = c[jsPlumb.getDefaultScope()][i].targetId; sources[target] = source; targets[source] = target; connections = connections + source + " -> " + target + ", "; } //alert (connections); var root = null; for (var key in sources) { if (!targets[key]) { root = key; } } } // alert(connections + "\n\n" + root); var xml = document.createElement("Interlink"); xml.setAttribute("id", interlinkId); var linktype = document.createElement("LinkType"); var linktypeText = document.createTextNode($("#linktype").val()); linktype.appendChild(linktypeText); xml.appendChild(linktype); var sourceDataset = document.createElement("SourceDataset"); sourceDataset.setAttribute("var", sourceDataSetVar); sourceDataset.setAttribute("dataSource", sourceDataSet); var restriction = document.createElement("RestrictTo"); var restrictionText = document.createTextNode(sourceDataSetRestriction); restriction.appendChild(restrictionText); sourceDataset.appendChild(restriction); xml.appendChild(sourceDataset); var targetDataset = document.createElement("TargetDataset"); targetDataset.setAttribute("var", targetDataSetVar); targetDataset.setAttribute("dataSource", targetDataSet); var restriction = document.createElement("RestrictTo"); var restrictionText = document.createTextNode(targetDataSetRestriction); restriction.appendChild(restrictionText); targetDataset.appendChild(restriction); xml.appendChild(targetDataset); var linkcondition = document.createElement("LinkCondition"); if (root != null) { linkcondition.appendChild(createNewElement(root)); } xml.appendChild(linkcondition); var filter = document.createElement("Filter"); if ($("#linklimit :selected").text() != "unlimited") { filter.setAttribute("limit", $("#linklimit :selected").text()); } filter.setAttribute("threshold", $("#threshold").val()); xml.appendChild(filter); var outputs = document.createElement("Outputs"); xml.appendChild(outputs); var xmlString = getHTML(xml, true); xmlString = xmlString.replace('xmlns="http://www.w3.org/1999/xhtml"', ""); // alert(xmlString); return xmlString; } $(function () { $("#droppable").droppable( //{ tolerance: 'touch' }, { drop: function (ev, ui) { if ($("#droppable").find("> #"+ui.helper.attr('id')+"").length == 0) { //$(this).append($(ui.helper).clone()); $.ui.ddmanager.current.cancelHelperRemoval = true; ui.helper.appendTo(this); /* styleString = $("#"+ui.helper.attr('id')).attr("style"); styleString = styleString.replace("position: absolute", ""); $("#"+ui.helper.attr('id')).attr("style", styleString); */ if (ui.helper.attr('id').search(/aggregate/) != -1) { jsPlumb.addEndpoint('aggregate_' + aggregatecounter, jsPlumb.extend({dropOptions:{ accept: 'canvas[elId^="compare"], canvas[elId^="aggregate"]', activeClass: 'accepthighlight', hoverClass: 'accepthoverhighlight', over: function(event, ui) { $("body").css('cursor','pointer'); }, out: function(event, ui) { $("body").css('cursor','default'); } }}, endpointOptions1)); jsPlumb.addEndpoint('aggregate_' + aggregatecounter, endpointOptions2); var number = "#aggregate_" + aggregatecounter; $(number).draggable( { containment: '#droppable', drag: function(event, ui) { jsPlumb.repaint(number); }, stop: function(event, ui) { jsPlumb.repaint(number); } }); aggregatecounter = aggregatecounter + 1; } if (ui.helper.attr('id').search(/transform/) != -1) { jsPlumb.addEndpoint('transform_' + transformcounter, jsPlumb.extend({dropOptions:{ accept: 'canvas[elId^="transform"], canvas[elId^="source"], canvas[elId^="target"]', activeClass: 'accepthighlight', hoverClass: 'accepthoverhighlight', over: function(event, ui) { $("body").css('cursor','pointer'); }, out: function(event, ui) { $("body").css('cursor','default'); } }}, endpointOptions1)); jsPlumb.addEndpoint('transform_' + transformcounter, endpointOptions2); var number = "#transform_" + transformcounter; $(number).draggable( { containment: '#droppable', drag: function(event, ui) { jsPlumb.repaint(number); }, stop: function(event, ui) { jsPlumb.repaint(number); } }); transformcounter = transformcounter + 1; } if (ui.helper.attr('id').search(/compare/) != -1) { jsPlumb.addEndpoint('compare_' + comparecounter, jsPlumb.extend({dropOptions:{ accept: 'canvas[elId^="transform"], canvas[elId^="source"], canvas[elId^="target"]', activeClass: 'accepthighlight', hoverClass: 'accepthoverhighlight', over: function(event, ui) { $("body").css('cursor','pointer'); }, out: function(event, ui) { $("body").css('cursor','default'); } }}, endpointOptions1)); jsPlumb.addEndpoint('compare_' + comparecounter, endpointOptions2); var number = "#compare_" + comparecounter; $(number).draggable( { containment: '#droppable', drag: function(event, ui) { jsPlumb.repaint(number); }, stop: function(event, ui) { jsPlumb.repaint(number); } }); comparecounter = comparecounter + 1; } if (ui.helper.attr('id').search(/source/) != -1) { jsPlumb.addEndpoint('source_' + sourcecounter, endpointOptions); var number = "#source_" + sourcecounter; $(number).draggable( { containment: '#droppable', drag: function(event, ui) { jsPlumb.repaint(number); }, stop: function(event, ui) { jsPlumb.repaint(number); } }); sourcecounter = sourcecounter + 1; } if (ui.helper.attr('id').search(/target/) != -1) { jsPlumb.addEndpoint('target_' + targetcounter, endpointOptions); var number = "#target_" + targetcounter; $(number).draggable( { containment: '#droppable', drag: function(event, ui) { jsPlumb.repaint(number); }, stop: function(event, ui) { jsPlumb.repaint(number); } }); targetcounter = targetcounter + 1; } /* todo: correct box position after dropping var left = 100; var top = 100; //$(number).attr("style","left: " + left + "px; top: " + top + "px;"); jsPlumb.repaint(number); */ } } }); }); function decodeHtml(value) { encodedHtml = value.replace("&lt;", "<"); encodedHtml = encodedHtml.replace("&gt;", ">"); return encodedHtml; } function encodeHtml(value) { encodedHtml = value.replace("<", "&lt;"); encodedHtml = encodedHtml.replace(">", "&gt;"); encodedHtml = encodedHtml.replace("\"", '\\"'); return encodedHtml; } function encodeHtmlInput(value) { var encodedHtml = value.replace('\\', "&#92;"); return encodedHtml; } function getPropertyPaths(deleteExisting) { if (deleteExisting) { $("#paths").empty(); var box = $(document.createElement('div')); box.attr("id", "loading"); box.attr("style", "width: 230px;"); var text = document.createTextNode("loading ..."); box.append(text); box.appendTo("#paths"); } var url = "api/project/paths"; // ?max=10 $.getJSON(url, function (data) { if(data.isLoading) { var dot = document.createTextNode("."); document.getElementById("loading").appendChild(dot); setTimeout("getPropertyPaths();", 1000); } else if (data.error !== undefined) { alert("Could not load property paths.\nError: " + data.error); } else { document.getElementById("paths").removeChild(document.getElementById("loading")); var list_item_id = 0; var box = $(document.createElement('div')); box.html("<span style='font-weight: bold;'>Source:</span> " + data.source.id).appendTo("#paths"); box.appendTo("#paths"); var box = $(document.createElement('div')); box.addClass('more'); box.html("<span style='font-weight: bold;'>Restriction:</span> " + data.source.restrictions).appendTo("#paths"); box.appendTo("#paths"); var box = $(document.createElement('div')); box.attr("id", "sourcepaths"); box.addClass("scrollboxes"); box.appendTo("#paths"); var sourcepaths = data.source.paths; $.each(sourcepaths, function (i, item) { var box = $(document.createElement('div')); box.addClass('draggable'); box.attr("id", "source" + list_item_id); box.attr("title", encodeHtml(item.path)); box.html("<span></span><p style=\"white-space:nowrap; overflow:hidden;\">" + encodeHtml(item.path) + "</p>"); box.draggable( { helper: function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv sourcePath'); box1.attr("id", "source_" + sourcecounter); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode(encodeHtml(item.path)); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Input"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", item.path); var mytext = document.createTextNode(item.path); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#source_" + sourcecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); box1.append(box2); return box1; } }); box.appendTo("#sourcepaths"); list_item_id = list_item_id + 1; }); var box = $(document.createElement('div')); box.addClass('draggable'); box.attr("id", "source" + list_item_id); box.html("<span> </span><small> </small><p>(custom path)</p>"); box.draggable( { helper: function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv sourcePath'); box1.attr("id", "source_" + sourcecounter); var box2 = $(document.createElement('small')); box2.addClass('name'); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Input"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); box2.attr("style", "height: 19px;"); var input = $(document.createElement('input')); input.attr("style", "width: 165px;"); input.attr("type", "text"); input.val("?" + sourceDataSetVar); box2.append(input); box2.append(getDeleteIcon("#source_" + sourcecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); box1.append(box2); return box1; } }); box.appendTo("#sourcepaths"); /* var availablePaths = data.source.availablePaths; if (max_paths < availablePaths) { var box = $(document.createElement('div')); box.html("<a href='/linkSpec' class='more'>&darr; more source paths...</a>"); box.appendTo("#paths"); } */ var box = $(document.createElement('div')); box.html("<span style='font-weight: bold;'>Target:</span> " + data.target.id).appendTo("#paths"); box.appendTo("#paths"); var box = $(document.createElement('div')); box.addClass('more'); box.html("<span style='font-weight: bold;'>Restriction:</span> " + data.target.restrictions).appendTo("#paths"); box.appendTo("#paths"); var list_item_id = 0; var box = $(document.createElement('div')); box.attr("id", "targetpaths"); box.addClass("scrollboxes"); box.appendTo("#paths"); var sourcepaths = data.target.paths; $.each(sourcepaths, function (i, item) { var box = $(document.createElement('div')); box.addClass('draggable'); box.attr("id", "target" + list_item_id); box.attr("title", encodeHtml(item.path)); box.html("<span></span><small>" + encodeHtml(item.path) + "</small><p style=\"white-space:nowrap; overflow:hidden;\">" + encodeHtml(item.path) + "</p>"); box.draggable( { helper: function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv targetPath'); box1.attr("id", "target_" + targetcounter); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode(encodeHtml(item.path)); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Input"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", item.path); var mytext = document.createTextNode(item.path); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#target_" + targetcounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); box1.append(box2); return box1; } }); box.appendTo("#targetpaths"); list_item_id = list_item_id + 1; }); var box = $(document.createElement('div')); box.addClass('draggable'); box.attr("id", "target" + list_item_id); box.html("<span> </span><small> </small><p>(custom path)</p>"); box.draggable( { helper: function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv sourcePath'); box1.attr("id", "source_" + sourcecounter); var box2 = $(document.createElement('small')); box2.addClass('name'); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Input"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); box2.attr("style", "height: 19px;"); var input = $(document.createElement('input')); input.attr("style", "width: 165px;"); input.attr("type", "text"); input.val("?" + targetDataSetVar); box2.append(input); box2.append(getDeleteIcon("#source_" + sourcecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); box1.append(box2); return box1; } }); box.appendTo("#targetpaths"); /* var availablePaths = data.target.availablePaths; if (max_paths < availablePaths) { var box = $(document.createElement('div')); box.html('<a href="" class="more">&darr; more target paths... (' + availablePaths + ' in total)</a>'); box.appendTo("#paths"); } */ } }); } function getOperators() { $.ajax( { type: "GET", url: "api/project/operators", contentType: "application/json; charset=utf-8", dataType: "json", timeout: 2000, success: function (data, textStatus, XMLHttpRequest) { // alert("success: " + data + " " + textStatus + " " + XMLHttpRequest.status); if (XMLHttpRequest.status >= 200 && XMLHttpRequest.status < 300) { var list_item_id = 0; var box = $(document.createElement('div')); box.attr("style", "color: #0cc481;"); box.addClass("boxheaders"); box.html("Transformations").appendTo("#operators"); box.appendTo("#operators"); var box = $(document.createElement('div')); box.attr("id", "transformationbox"); box.addClass("scrollboxes"); box.appendTo("#operators"); var sourcepaths = data.transformations; $.each(sourcepaths, function (i, item) { transformations[item.id] = new Object(); transformations[item.id]["name"] = item.label; transformations[item.id]["description"] = item.description; transformations[item.id]["parameters"] = item.parameters; var box = $(document.createElement('div')); box.addClass('draggable tranformations'); box.attr("id", "transformation" + list_item_id); box.attr("title", item.description); box.html("<span></span><small>" + item.label + "</small><p>" + item.label + "</p>"); box.draggable( { helper: function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv transformDiv'); box1.attr("id", "transform_" + transformcounter); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode(item.id); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("TransformInput"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", item.label + " (Transformation)") var mytext = document.createTextNode(item.label + " (Transformation)"); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#transform_" + transformcounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); $.each(item.parameters, function (j, parameter) { if (j > 0) { var box4 = $(document.createElement('br')); box2.append(box4); } var mytext = document.createTextNode(parameter.name + ": "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("name", parameter.name); box5.attr("type", "text"); box5.attr("size", "10"); box2.append(box5); }); box2.append(getHelpIcon(item.description, item.parameters.length)); box1.append(box2); return box1; } }); box.appendTo("#transformationbox"); list_item_id = list_item_id + 1; }); var list_item_id = 0; var box = $(document.createElement('div')); box.attr("style", "color: #e59829;"); box.addClass("boxheaders"); box.html("Comparators").appendTo("#operators"); box.appendTo("#operators"); var box = $(document.createElement('div')); box.attr("id", "comparatorbox"); box.addClass("scrollboxes"); box.appendTo("#operators"); var sourcepaths = data.comparators; $.each(sourcepaths, function (i, item) { comparators[item.id] = new Object(); comparators[item.id]["name"] = item.label; comparators[item.id]["description"] = item.description; comparators[item.id]["parameters"] = item.parameters; var box = $(document.createElement('div')); box.addClass('draggable comparators'); box.attr("id", "comparator" + list_item_id); box.attr("title", item.description); box.html("<span></span><small>" + item.label + "</small><p>" + item.label + "</p>"); box.draggable( { helper: function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv compareDiv'); box1.attr("id", "compare_" + comparecounter); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode(item.id); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Compare"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", item.label + " (Comparator)") var mytext = document.createTextNode(item.label + " (Comparator)"); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#compare_" + comparecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); var mytext = document.createTextNode("required: "); box2.append(mytext); var box3 = $(document.createElement('input')); box3.attr("type", "checkbox"); box3.attr("name", "required"); box2.append(box3); var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode("weight: "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("name", "weight"); box5.attr("type", "text"); box5.attr("size", "2"); box5.attr("value", "1"); box2.append(box5); $.each(item.parameters, function (j, parameter) { var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode(parameter.name + ": "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("name", parameter.name); box5.attr("type", "text"); box5.attr("size", "10");; box2.append(box5); }); box2.append(getHelpIcon(item.description)); box1.append(box2); // jsPlumb.addEndpoint('compare_1', endpointOptions); return box1; } }); box.appendTo("#comparatorbox"); list_item_id = list_item_id + 1; }); var list_item_id = 0; var box = $(document.createElement('div')); box.attr("style", "color: #1484d4;"); box.addClass("boxheaders"); box.html("Aggregators").appendTo("#operators"); box.appendTo("#operators"); var box = $(document.createElement('div')); box.attr("id", "aggregatorbox"); box.addClass("scrollboxes"); box.appendTo("#operators"); var sourcepaths = data.aggregators; $.each(sourcepaths, function (i, item) { aggregators[item.id] = new Object(); aggregators[item.id]["name"] = item.label; aggregators[item.id]["description"] = item.description; aggregators[item.id]["parameters"] = item.parameters; var box = $(document.createElement('div')); box.addClass('draggable aggregators'); box.attr("title", item.description); box.attr("id", "aggregator" + list_item_id); box.html("<span></span><small>" + item.label + "</small><p>" + item.label + "</p>"); box.draggable( { helper: function () { var box1 = $(document.createElement('div')); box1.addClass('dragDiv aggregateDiv'); box1.attr("id", "aggregate_" + aggregatecounter); var box2 = $(document.createElement('small')); box2.addClass('name'); var mytext = document.createTextNode(item.id); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('small')); box2.addClass('type'); var mytext = document.createTextNode("Aggregate"); box2.append(mytext); box1.append(box2); var box2 = $(document.createElement('h5')); box2.addClass('handler'); var span = $(document.createElement('div')); span.attr("style", "width: 170px; white-space:nowrap; overflow:hidden; float: left;"); span.attr("title", item.label + " (Aggregator)") var mytext = document.createTextNode(item.label + " (Aggregator)"); span.append(mytext); box2.append(span); box2.append(getDeleteIcon("#aggregate_" + aggregatecounter)); box1.append(box2); var box2 = $(document.createElement('div')); box2.addClass('content'); var mytext = document.createTextNode("required: "); box2.append(mytext); var box3 = $(document.createElement('input')); box3.attr("name", "required"); box3.attr("type", "checkbox"); box2.append(box3); var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode("weight: "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("type", "text"); box5.attr("size", "2"); box5.attr("name", "weight"); box5.attr("value", "1"); box2.append(box5); $.each(item.parameters, function (j, parameter) { var box4 = $(document.createElement('br')); box2.append(box4); var mytext = document.createTextNode(parameter.name + ": "); box2.append(mytext); var box5 = $(document.createElement('input')); box5.attr("name", parameter.name); box5.attr("type", "text"); box5.attr("size", "10");; box2.append(box5); }); box2.append(getHelpIcon(item.description)); box1.append(box2); return box1; } }); box.appendTo("#aggregatorbox"); list_item_id = list_item_id + 1; }); load(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("Error: " + textStatus + " " + errorThrown); } }); }
fixes position of new dropped boxes
silk2/silk-workbench/silk-workbench-webapp/src/main/webapp/static/js/editor.js
fixes position of new dropped boxes
<ide><path>ilk2/silk-workbench/silk-workbench-webapp/src/main/webapp/static/js/editor.js <ide> targetcounter = targetcounter + 1; <ide> } <ide> <del> /* todo: correct box position after dropping <del> var left = 100; <del> var top = 100; <del> //$(number).attr("style","left: " + left + "px; top: " + top + "px;"); <del> jsPlumb.repaint(number); */ <add> // fix the position of the new added box <add> var offset = $(number).offset(); <add> var scrollleft = $("#droppable").scrollLeft(); <add> var scrolltop = $("#droppable").scrollTop(); <add> var top = offset.top-204+scrolltop+scrolltop; <add> var left = offset.left-502+scrollleft+scrollleft; <add> $(number).attr("style", "left: " + left + "px; top: " + top + "px; position: absolute;"); <add> jsPlumb.repaint(number); <ide> <ide> } <ide> }
Java
mit
eb679d9b75e80dbd3ddcd346524af783cedd4a2e
0
emacslisp/Java,emacslisp/Java,emacslisp/Java,emacslisp/Java
package com.dw.notepad2; import java.awt.BorderLayout; import java.awt.Color; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.*; import java.util.*; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.SwingUtilities; public class Notepad2 extends JPanel { protected static Properties properties; private static ResourceBundle resources; private final static String EXIT_AFTER_PAINT = "-exit"; private static boolean exitAfterFirstPaint; private static final String[] MENUBAR_KEYS = { "file", "edit", "debug" }; private static final String[] TOOLBAR_KEYS = { "new", "open", "save", "-", "cut", "copy", "paste" }; private static final String[] FILE_KEYS = { "new", "open", "save", "-", "exit" }; private static final String[] EDIT_KEYS = { "cut", "copy", "paste", "-", "undo", "redo" }; private static final String[] DEBUG_KEYS = { "dump", "showElementTree" }; static { try { properties = new Properties(); properties.load(Notepad2.class.getClassLoader().getResourceAsStream("resources/Notepad.properties")); resources = ResourceBundle.getBundle("resources.Notepad", Locale.getDefault()); } catch (MissingResourceException | IOException e) { System.err.println("resources/Notepad.properties " + "or resources/NotepadSystem.properties not found"); System.exit(1); } } protected static final class AppCloser extends WindowAdapter { @Override public void windowClosing(WindowEvent e) { System.out.println("AppCloser!!!"); System.exit(0); } } public static void main(String[] args) throws Exception { if (args.length > 0 && args[0].equals(EXIT_AFTER_PAINT)) { exitAfterFirstPaint = true; } SwingUtilities.invokeAndWait(new Runnable() { public void run() { JFrame frame = new JFrame(); frame.setTitle(resources.getString("Title")); frame.setBackground(Color.lightGray); frame.getContentPane().setLayout(new BorderLayout()); Notepad2 notepad = new Notepad2(); frame.getContentPane().add("Center", notepad); /*frame.setJMenuBar(notepad.createMenubar()); frame.addWindowListener(new AppCloser());*/ frame.addWindowListener(new AppCloser()); frame.pack(); frame.setSize(500, 600); frame.setVisible(true); } }); } }
JavaMain/src/com/dw/notepad2/Notepad2.java
package com.dw.notepad2; import java.awt.BorderLayout; import java.awt.Color; import java.io.*; import java.util.*; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.SwingUtilities; public class Notepad2 extends JPanel { protected static Properties properties; private static ResourceBundle resources; private final static String EXIT_AFTER_PAINT = "-exit"; private static boolean exitAfterFirstPaint; static { try { properties = new Properties(); properties.load(Notepad2.class.getClassLoader().getResourceAsStream("resources/Notepad.properties")); resources = ResourceBundle.getBundle("resources.Notepad", Locale.getDefault()); } catch (MissingResourceException | IOException e) { System.err.println("resources/Notepad.properties " + "or resources/NotepadSystem.properties not found"); System.exit(1); } } public static void main(String[] args) throws Exception { if (args.length > 0 && args[0].equals(EXIT_AFTER_PAINT)) { exitAfterFirstPaint = true; } SwingUtilities.invokeAndWait(new Runnable() { public void run() { JFrame frame = new JFrame(); frame.setTitle(resources.getString("Title")); frame.setBackground(Color.lightGray); frame.getContentPane().setLayout(new BorderLayout()); Notepad2 notepad = new Notepad2(); frame.getContentPane().add("Center", notepad); /*frame.setJMenuBar(notepad.createMenubar()); frame.addWindowListener(new AppCloser());*/ frame.pack(); frame.setSize(500, 600); frame.setVisible(true); } }); } }
add windows close listener
JavaMain/src/com/dw/notepad2/Notepad2.java
add windows close listener
<ide><path>avaMain/src/com/dw/notepad2/Notepad2.java <ide> <ide> import java.awt.BorderLayout; <ide> import java.awt.Color; <add>import java.awt.event.WindowAdapter; <add>import java.awt.event.WindowEvent; <ide> import java.io.*; <ide> import java.util.*; <ide> <ide> private static ResourceBundle resources; <ide> private final static String EXIT_AFTER_PAINT = "-exit"; <ide> private static boolean exitAfterFirstPaint; <add> <add> private static final String[] MENUBAR_KEYS = { "file", "edit", "debug" }; <add> private static final String[] TOOLBAR_KEYS = { "new", "open", "save", "-", "cut", "copy", "paste" }; <add> private static final String[] FILE_KEYS = { "new", "open", "save", "-", "exit" }; <add> private static final String[] EDIT_KEYS = { "cut", "copy", "paste", "-", "undo", "redo" }; <add> private static final String[] DEBUG_KEYS = { "dump", "showElementTree" }; <ide> <ide> static { <ide> try { <ide> } catch (MissingResourceException | IOException e) { <ide> System.err.println("resources/Notepad.properties " + "or resources/NotepadSystem.properties not found"); <ide> System.exit(1); <add> } <add> } <add> <add> protected static final class AppCloser extends WindowAdapter { <add> <add> @Override <add> public void windowClosing(WindowEvent e) <add> { <add> System.out.println("AppCloser!!!"); <add> System.exit(0); <ide> } <ide> } <ide> <ide> frame.getContentPane().add("Center", notepad); <ide> /*frame.setJMenuBar(notepad.createMenubar()); <ide> frame.addWindowListener(new AppCloser());*/ <add> frame.addWindowListener(new AppCloser()); <ide> frame.pack(); <ide> frame.setSize(500, 600); <ide> frame.setVisible(true);
Java
apache-2.0
998ad3fe676c6a9cfc10f0c38e99787664331211
0
waans11/incubator-asterixdb,kisskys/incubator-asterixdb,sjaco002/incubator-asterixdb,ty1er/incubator-asterixdb,apache/incubator-asterixdb,apache/incubator-asterixdb,sjaco002/incubator-asterixdb,heriram/incubator-asterixdb,amoudi87/asterixdb,ecarm002/incubator-asterixdb,waans11/incubator-asterixdb,kisskys/incubator-asterixdb,amoudi87/asterixdb,kisskys/incubator-asterixdb,waans11/incubator-asterixdb,sjaco002/incubator-asterixdb,ty1er/incubator-asterixdb,amoudi87/asterixdb,ty1er/incubator-asterixdb,heriram/incubator-asterixdb,ty1er/incubator-asterixdb,parshimers/incubator-asterixdb,sjaco002/incubator-asterixdb,apache/incubator-asterixdb,ecarm002/incubator-asterixdb,heriram/incubator-asterixdb,amoudi87/asterixdb,ecarm002/incubator-asterixdb,heriram/incubator-asterixdb,parshimers/incubator-asterixdb,parshimers/incubator-asterixdb,kisskys/incubator-asterixdb,kisskys/incubator-asterixdb,heriram/incubator-asterixdb,apache/incubator-asterixdb,parshimers/incubator-asterixdb,kisskys/incubator-asterixdb,ty1er/incubator-asterixdb,apache/incubator-asterixdb,waans11/incubator-asterixdb,ecarm002/incubator-asterixdb,ty1er/incubator-asterixdb,waans11/incubator-asterixdb,amoudi87/asterixdb,waans11/incubator-asterixdb,sjaco002/incubator-asterixdb,sjaco002/incubator-asterixdb,parshimers/incubator-asterixdb,amoudi87/asterixdb,ecarm002/incubator-asterixdb,waans11/incubator-asterixdb,apache/incubator-asterixdb,apache/incubator-asterixdb,ecarm002/incubator-asterixdb,parshimers/incubator-asterixdb,ecarm002/incubator-asterixdb,heriram/incubator-asterixdb,heriram/incubator-asterixdb,kisskys/incubator-asterixdb
/* * Copyright 2009-2013 by The Regents of the University of California * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * you may obtain a copy of the License from * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package edu.uci.ics.asterix.test.runtime; import java.io.File; import java.util.ArrayList; import java.util.Collection; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil; import edu.uci.ics.asterix.common.config.AsterixPropertiesAccessor; import edu.uci.ics.asterix.common.config.AsterixTransactionProperties; import edu.uci.ics.asterix.common.config.GlobalConfig; import edu.uci.ics.asterix.external.dataset.adapter.FileSystemBasedAdapter; import edu.uci.ics.asterix.external.util.IdentitiyResolverFactory; import edu.uci.ics.asterix.test.aql.TestsUtils; import edu.uci.ics.asterix.testframework.context.TestCaseContext; /** * Runs the runtime test cases under 'asterix-app/src/test/resources/runtimets'. */ @RunWith(Parameterized.class) public class ExecutionTest { private static final Logger LOGGER = Logger.getLogger(ExecutionTest.class.getName()); private static final String PATH_ACTUAL = "rttest" + File.separator; private static final String PATH_BASE = StringUtils.join(new String[] { "src", "test", "resources", "runtimets" }, File.separator); private static final String TEST_CONFIG_FILE_NAME = "asterix-build-configuration.xml"; private static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" }; private static AsterixTransactionProperties txnProperties; @BeforeClass public static void setUp() throws Exception { System.out.println("Starting setup"); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("Starting setup"); } System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, TEST_CONFIG_FILE_NAME); System.setProperty(GlobalConfig.WEB_SERVER_PORT_PROPERTY, "19002"); File outdir = new File(PATH_ACTUAL); outdir.mkdirs(); AsterixPropertiesAccessor apa = new AsterixPropertiesAccessor(); txnProperties = new AsterixTransactionProperties(apa); deleteTransactionLogs(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("initializing pseudo cluster"); } AsterixHyracksIntegrationUtil.init(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("initializing HDFS"); } HDFSCluster.getInstance().setup(); // Set the node resolver to be the identity resolver that expects node names // to be node controller ids; a valid assumption in test environment. System.setProperty(FileSystemBasedAdapter.NODE_RESOLVER_FACTORY_PROPERTY, IdentitiyResolverFactory.class.getName()); } @AfterClass public static void tearDown() throws Exception { AsterixHyracksIntegrationUtil.deinit(); File outdir = new File(PATH_ACTUAL); File[] files = outdir.listFiles(); if (files == null || files.length == 0) { outdir.delete(); } // clean up the files written by the ASTERIX storage manager for (String d : ASTERIX_DATA_DIRS) { TestsUtils.deleteRec(new File(d)); } HDFSCluster.getInstance().cleanup(); } private static void deleteTransactionLogs() throws Exception { for (String ncId : AsterixHyracksIntegrationUtil.NC_IDS) { File log = new File(txnProperties.getLogDirectory(ncId)); if (log.exists()) { FileUtils.deleteDirectory(log); } } } @Parameters public static Collection<Object[]> tests() throws Exception { Collection<Object[]> testArgs = new ArrayList<Object[]>(); TestCaseContext.Builder b = new TestCaseContext.Builder(); for (TestCaseContext ctx : b.build(new File(PATH_BASE))) { testArgs.add(new Object[] { ctx }); } return testArgs; } private TestCaseContext tcCtx; public ExecutionTest(TestCaseContext tcCtx) { this.tcCtx = tcCtx; } @Test public void test() throws Exception { TestsUtils.executeTest(PATH_ACTUAL, tcCtx); } }
asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
/* * Copyright 2009-2013 by The Regents of the University of California * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * you may obtain a copy of the License from * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package edu.uci.ics.asterix.test.runtime; import java.io.File; import java.util.ArrayList; import java.util.Collection; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil; import edu.uci.ics.asterix.common.config.AsterixPropertiesAccessor; import edu.uci.ics.asterix.common.config.AsterixTransactionProperties; import edu.uci.ics.asterix.common.config.GlobalConfig; import edu.uci.ics.asterix.external.dataset.adapter.FileSystemBasedAdapter; import edu.uci.ics.asterix.external.util.IdentitiyResolverFactory; import edu.uci.ics.asterix.test.aql.TestsUtils; import edu.uci.ics.asterix.testframework.context.TestCaseContext; /** * Runs the runtime test cases under 'asterix-app/src/test/resources/runtimets'. */ @RunWith(Parameterized.class) public class ExecutionTest { private static final Logger LOGGER = Logger.getLogger(ExecutionTest.class.getName()); private static final String PATH_ACTUAL = "rttest" + File.separator; private static final String PATH_BASE = StringUtils.join(new String[] {"src", "test", "resources", "runtimets"}, File.separator); private static final String TEST_CONFIG_FILE_NAME = "asterix-build-configuration.xml"; private static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" }; private static AsterixTransactionProperties txnProperties; @BeforeClass public static void setUp() throws Exception { System.out.println("Starting setup"); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("Starting setup"); } System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, TEST_CONFIG_FILE_NAME); System.setProperty(GlobalConfig.WEB_SERVER_PORT_PROPERTY, "19002"); File outdir = new File(PATH_ACTUAL); outdir.mkdirs(); AsterixPropertiesAccessor apa = new AsterixPropertiesAccessor(); txnProperties = new AsterixTransactionProperties(apa); deleteTransactionLogs(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("initializing pseudo cluster"); } AsterixHyracksIntegrationUtil.init(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("initializing HDFS"); } HDFSCluster.getInstance().setup(); // Set the node resolver to be the identity resolver that expects node names // to be node controller ids; a valid assumption in test environment. System.setProperty(FileSystemBasedAdapter.NODE_RESOLVER_FACTORY_PROPERTY, IdentitiyResolverFactory.class.getName()); } @AfterClass public static void tearDown() throws Exception { AsterixHyracksIntegrationUtil.deinit(); File outdir = new File(PATH_ACTUAL); File[] files = outdir.listFiles(); if (files == null || files.length == 0) { outdir.delete(); } // clean up the files written by the ASTERIX storage manager for (String d : ASTERIX_DATA_DIRS) { TestsUtils.deleteRec(new File(d)); } HDFSCluster.getInstance().cleanup(); } private static void deleteTransactionLogs() throws Exception { for (String ncId : AsterixHyracksIntegrationUtil.NC_IDS) { File log = new File(txnProperties.getLogDirectory(ncId)); if (log.exists()) { FileUtils.deleteDirectory(log); } } } @Parameters public static Collection<Object[]> tests() throws Exception { Collection<Object[]> testArgs = new ArrayList<Object[]>(); TestCaseContext.Builder b = new TestCaseContext.Builder(); for (TestCaseContext ctx : b.build(new File(PATH_BASE))) { testArgs.add(new Object[] { ctx }); } return testArgs; } private TestCaseContext tcCtx; public ExecutionTest(TestCaseContext tcCtx) { this.tcCtx = tcCtx; } @Test public void test() throws Exception { if (tcCtx.getTestCase().getCompilationUnit().get(0).getName().contains("feeds")) { TestsUtils.executeTest(PATH_ACTUAL, tcCtx); } } }
remove debugging code
asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
remove debugging code
<ide><path>sterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java <ide> private static final Logger LOGGER = Logger.getLogger(ExecutionTest.class.getName()); <ide> <ide> private static final String PATH_ACTUAL = "rttest" + File.separator; <del> private static final String PATH_BASE = StringUtils.join(new String[] {"src", "test", "resources", "runtimets"}, File.separator); <add> private static final String PATH_BASE = StringUtils.join(new String[] { "src", "test", "resources", "runtimets" }, <add> File.separator); <ide> <ide> private static final String TEST_CONFIG_FILE_NAME = "asterix-build-configuration.xml"; <ide> private static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" }; <ide> <ide> @Test <ide> public void test() throws Exception { <del> if (tcCtx.getTestCase().getCompilationUnit().get(0).getName().contains("feeds")) { <del> TestsUtils.executeTest(PATH_ACTUAL, tcCtx); <del> } <add> TestsUtils.executeTest(PATH_ACTUAL, tcCtx); <ide> } <ide> }
Java
apache-2.0
ab385b7848e89ee2bed2078ad174a10fb4fa1145
0
wwjiang007/alluxio,EvilMcJerkface/alluxio,riversand963/alluxio,aaudiber/alluxio,riversand963/alluxio,calvinjia/tachyon,PasaLab/tachyon,maboelhassan/alluxio,maobaolong/alluxio,EvilMcJerkface/alluxio,Alluxio/alluxio,maobaolong/alluxio,bf8086/alluxio,carsonwang/tachyon,Reidddddd/mo-alluxio,Reidddddd/alluxio,madanadit/alluxio,madanadit/alluxio,WilliamZapata/alluxio,maobaolong/alluxio,jsimsa/alluxio,ShailShah/alluxio,jswudi/alluxio,maobaolong/alluxio,riversand963/alluxio,maobaolong/alluxio,carsonwang/tachyon,ChangerYoung/alluxio,wwjiang007/alluxio,jswudi/alluxio,Reidddddd/alluxio,PasaLab/tachyon,maobaolong/alluxio,Alluxio/alluxio,madanadit/alluxio,PasaLab/tachyon,ooq/memory,jsimsa/alluxio,maobaolong/alluxio,ChangerYoung/alluxio,calvinjia/tachyon,EvilMcJerkface/alluxio,calvinjia/tachyon,Alluxio/alluxio,yuluo-ding/alluxio,calvinjia/tachyon,Reidddddd/alluxio,bf8086/alluxio,madanadit/alluxio,maobaolong/alluxio,madanadit/alluxio,carsonwang/tachyon,uronce-cc/alluxio,apc999/alluxio,ShailShah/alluxio,jsimsa/alluxio,ooq/memory,bf8086/alluxio,riversand963/alluxio,maboelhassan/alluxio,wwjiang007/alluxio,jsimsa/alluxio,calvinjia/tachyon,apc999/alluxio,ChangerYoung/alluxio,Alluxio/alluxio,maboelhassan/alluxio,aaudiber/alluxio,madanadit/alluxio,uronce-cc/alluxio,bf8086/alluxio,PasaLab/tachyon,riversand963/alluxio,wwjiang007/alluxio,calvinjia/tachyon,jsimsa/alluxio,wwjiang007/alluxio,yuluo-ding/alluxio,yuluo-ding/alluxio,bf8086/alluxio,maboelhassan/alluxio,carsonwang/tachyon,jswudi/alluxio,ooq/memory,wwjiang007/alluxio,ShailShah/alluxio,maobaolong/alluxio,ooq/memory,yuluo-ding/alluxio,EvilMcJerkface/alluxio,apc999/alluxio,ShailShah/alluxio,aaudiber/alluxio,ChangerYoung/alluxio,wwjiang007/alluxio,calvinjia/tachyon,ChangerYoung/alluxio,yuluo-ding/alluxio,Reidddddd/alluxio,riversand963/alluxio,Reidddddd/alluxio,wwjiang007/alluxio,maobaolong/alluxio,WilliamZapata/alluxio,Alluxio/alluxio,wwjiang007/alluxio,ShailShah/alluxio,WilliamZapata/alluxio,WilliamZapata/alluxio,PasaLab/tachyon,maboelhassan/alluxio,Reidddddd/mo-alluxio,uronce-cc/alluxio,Reidddddd/mo-alluxio,bf8086/alluxio,uronce-cc/alluxio,yuluo-ding/alluxio,WilliamZapata/alluxio,maboelhassan/alluxio,Reidddddd/alluxio,Alluxio/alluxio,maboelhassan/alluxio,wwjiang007/alluxio,Reidddddd/alluxio,Alluxio/alluxio,Alluxio/alluxio,EvilMcJerkface/alluxio,Reidddddd/mo-alluxio,aaudiber/alluxio,bf8086/alluxio,apc999/alluxio,jsimsa/alluxio,EvilMcJerkface/alluxio,calvinjia/tachyon,uronce-cc/alluxio,Reidddddd/mo-alluxio,madanadit/alluxio,apc999/alluxio,jswudi/alluxio,bf8086/alluxio,uronce-cc/alluxio,aaudiber/alluxio,apc999/alluxio,Reidddddd/mo-alluxio,jswudi/alluxio,madanadit/alluxio,WilliamZapata/alluxio,jswudi/alluxio,EvilMcJerkface/alluxio,aaudiber/alluxio,aaudiber/alluxio,Alluxio/alluxio,apc999/alluxio,ChangerYoung/alluxio,ShailShah/alluxio,PasaLab/tachyon,PasaLab/tachyon,Alluxio/alluxio,EvilMcJerkface/alluxio
/** * Autogenerated by Thrift Compiler (0.9.1) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package tachyon.thrift; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; import org.apache.thrift.scheme.TupleScheme; import org.apache.thrift.protocol.TTupleProtocol; import org.apache.thrift.protocol.TProtocolException; import org.apache.thrift.EncodingUtils; import org.apache.thrift.TException; import org.apache.thrift.async.AsyncMethodCallback; import org.apache.thrift.server.AbstractNonblockingServer.*; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class MasterService { public interface Iface { public boolean addCheckpoint(long workerId, int fileId, long length, String checkpointPath) throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException; public List<ClientWorkerInfo> getWorkersInfo() throws org.apache.thrift.TException; public List<ClientFileInfo> liststatus(String path) throws InvalidPathException, FileDoesNotExistException, org.apache.thrift.TException; /** * Worker register. * @return value rv % 100,000 is really workerId, rv / 1000,000 is master started time. * * @param workerNetAddress * @param totalBytes * @param usedBytes * @param currentBlocks */ public long worker_register(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlocks) throws BlockInfoException, org.apache.thrift.TException; public Command worker_heartbeat(long workerId, long usedBytes, List<Long> removedBlocks) throws BlockInfoException, org.apache.thrift.TException; public void worker_cacheBlock(long workerId, long workerUsedBytes, long blockId, long length) throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException; public Set<Integer> worker_getPinIdList() throws org.apache.thrift.TException; public List<Integer> worker_getPriorityDependencyList() throws org.apache.thrift.TException; public int user_createDependency(List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte) throws InvalidPathException, FileDoesNotExistException, FileAlreadyExistException, BlockInfoException, TachyonException, org.apache.thrift.TException; public ClientDependencyInfo user_getClientDependencyInfo(int dependencyId) throws DependencyDoesNotExistException, org.apache.thrift.TException; public void user_reportLostFile(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException; public void user_requestFilesInDependency(int depId) throws DependencyDoesNotExistException, org.apache.thrift.TException; public int user_createFile(String path, String ufsPath, long blockSizeByte, boolean recursive) throws FileAlreadyExistException, InvalidPathException, BlockInfoException, SuspectedFileSizeException, TachyonException, org.apache.thrift.TException; public long user_createNewBlock(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException; public void user_completeFile(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException; public long user_getUserId() throws org.apache.thrift.TException; public long user_getBlockId(int fileId, int index) throws FileDoesNotExistException, org.apache.thrift.TException; /** * Get local worker NetAddress * * @param random * @param host */ public NetAddress user_getWorker(boolean random, String host) throws NoWorkerException, org.apache.thrift.TException; public ClientFileInfo getFileStatus(int fileId, String path) throws InvalidPathException, org.apache.thrift.TException; /** * Get block's ClientBlockInfo. * * @param blockId */ public ClientBlockInfo user_getClientBlockInfo(long blockId) throws FileDoesNotExistException, BlockInfoException, org.apache.thrift.TException; /** * Get file blocks info. * * @param fileId * @param path */ public List<ClientBlockInfo> user_getFileBlocks(int fileId, String path) throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException; public boolean user_delete(int fileId, String path, boolean recursive) throws TachyonException, org.apache.thrift.TException; public boolean user_rename(int fileId, String srcPath, String dstPath) throws FileAlreadyExistException, FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException; public void user_setPinned(int fileId, boolean pinned) throws FileDoesNotExistException, org.apache.thrift.TException; public boolean user_mkdirs(String path, boolean recursive) throws FileAlreadyExistException, InvalidPathException, TachyonException, org.apache.thrift.TException; public int user_createRawTable(String path, int columns, ByteBuffer metadata) throws FileAlreadyExistException, InvalidPathException, TableColumnException, TachyonException, org.apache.thrift.TException; /** * Return 0 if does not contain the Table, return fileId if it exists. * * @param path */ public int user_getRawTableId(String path) throws InvalidPathException, org.apache.thrift.TException; /** * Get RawTable's info; Return a ClientRawTable instance with id 0 if the system does not contain * the table. path if valid iff id is -1. * * @param id * @param path */ public ClientRawTableInfo user_getClientRawTableInfo(int id, String path) throws TableDoesNotExistException, InvalidPathException, org.apache.thrift.TException; public void user_updateRawTableMetadata(int tableId, ByteBuffer metadata) throws TableDoesNotExistException, TachyonException, org.apache.thrift.TException; public String user_getUfsAddress() throws org.apache.thrift.TException; /** * Returns if the message was received. Intended to check if the client can still connect to the * master. */ public void user_heartbeat() throws org.apache.thrift.TException; public boolean user_freepath(int fileId, String path, boolean recursive) throws FileDoesNotExistException, org.apache.thrift.TException; } public interface AsyncIface { public void addCheckpoint(long workerId, int fileId, long length, String checkpointPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getWorkersInfo(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void liststatus(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void worker_register(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlocks, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void worker_heartbeat(long workerId, long usedBytes, List<Long> removedBlocks, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void worker_cacheBlock(long workerId, long workerUsedBytes, long blockId, long length, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void worker_getPinIdList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void worker_getPriorityDependencyList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_createDependency(List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getClientDependencyInfo(int dependencyId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_reportLostFile(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_requestFilesInDependency(int depId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_createFile(String path, String ufsPath, long blockSizeByte, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_createNewBlock(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_completeFile(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getUserId(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getBlockId(int fileId, int index, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getWorker(boolean random, String host, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getFileStatus(int fileId, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getClientBlockInfo(long blockId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getFileBlocks(int fileId, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_delete(int fileId, String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_rename(int fileId, String srcPath, String dstPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_setPinned(int fileId, boolean pinned, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_mkdirs(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_createRawTable(String path, int columns, ByteBuffer metadata, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getRawTableId(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getClientRawTableInfo(int id, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_updateRawTableMetadata(int tableId, ByteBuffer metadata, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getUfsAddress(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_heartbeat(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_freepath(int fileId, String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; } public static class Client extends org.apache.thrift.TServiceClient implements Iface { public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> { public Factory() {} public Client getClient(org.apache.thrift.protocol.TProtocol prot) { return new Client(prot); } public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { return new Client(iprot, oprot); } } public Client(org.apache.thrift.protocol.TProtocol prot) { super(prot, prot); } public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { super(iprot, oprot); } public boolean addCheckpoint(long workerId, int fileId, long length, String checkpointPath) throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException { send_addCheckpoint(workerId, fileId, length, checkpointPath); return recv_addCheckpoint(); } public void send_addCheckpoint(long workerId, int fileId, long length, String checkpointPath) throws org.apache.thrift.TException { addCheckpoint_args args = new addCheckpoint_args(); args.setWorkerId(workerId); args.setFileId(fileId); args.setLength(length); args.setCheckpointPath(checkpointPath); sendBase("addCheckpoint", args); } public boolean recv_addCheckpoint() throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException { addCheckpoint_result result = new addCheckpoint_result(); receiveBase(result, "addCheckpoint"); if (result.isSetSuccess()) { return result.success; } if (result.eP != null) { throw result.eP; } if (result.eS != null) { throw result.eS; } if (result.eB != null) { throw result.eB; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addCheckpoint failed: unknown result"); } public List<ClientWorkerInfo> getWorkersInfo() throws org.apache.thrift.TException { send_getWorkersInfo(); return recv_getWorkersInfo(); } public void send_getWorkersInfo() throws org.apache.thrift.TException { getWorkersInfo_args args = new getWorkersInfo_args(); sendBase("getWorkersInfo", args); } public List<ClientWorkerInfo> recv_getWorkersInfo() throws org.apache.thrift.TException { getWorkersInfo_result result = new getWorkersInfo_result(); receiveBase(result, "getWorkersInfo"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getWorkersInfo failed: unknown result"); } public List<ClientFileInfo> liststatus(String path) throws InvalidPathException, FileDoesNotExistException, org.apache.thrift.TException { send_liststatus(path); return recv_liststatus(); } public void send_liststatus(String path) throws org.apache.thrift.TException { liststatus_args args = new liststatus_args(); args.setPath(path); sendBase("liststatus", args); } public List<ClientFileInfo> recv_liststatus() throws InvalidPathException, FileDoesNotExistException, org.apache.thrift.TException { liststatus_result result = new liststatus_result(); receiveBase(result, "liststatus"); if (result.isSetSuccess()) { return result.success; } if (result.eI != null) { throw result.eI; } if (result.eF != null) { throw result.eF; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "liststatus failed: unknown result"); } public long worker_register(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlocks) throws BlockInfoException, org.apache.thrift.TException { send_worker_register(workerNetAddress, totalBytes, usedBytes, currentBlocks); return recv_worker_register(); } public void send_worker_register(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlocks) throws org.apache.thrift.TException { worker_register_args args = new worker_register_args(); args.setWorkerNetAddress(workerNetAddress); args.setTotalBytes(totalBytes); args.setUsedBytes(usedBytes); args.setCurrentBlocks(currentBlocks); sendBase("worker_register", args); } public long recv_worker_register() throws BlockInfoException, org.apache.thrift.TException { worker_register_result result = new worker_register_result(); receiveBase(result, "worker_register"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "worker_register failed: unknown result"); } public Command worker_heartbeat(long workerId, long usedBytes, List<Long> removedBlocks) throws BlockInfoException, org.apache.thrift.TException { send_worker_heartbeat(workerId, usedBytes, removedBlocks); return recv_worker_heartbeat(); } public void send_worker_heartbeat(long workerId, long usedBytes, List<Long> removedBlocks) throws org.apache.thrift.TException { worker_heartbeat_args args = new worker_heartbeat_args(); args.setWorkerId(workerId); args.setUsedBytes(usedBytes); args.setRemovedBlocks(removedBlocks); sendBase("worker_heartbeat", args); } public Command recv_worker_heartbeat() throws BlockInfoException, org.apache.thrift.TException { worker_heartbeat_result result = new worker_heartbeat_result(); receiveBase(result, "worker_heartbeat"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "worker_heartbeat failed: unknown result"); } public void worker_cacheBlock(long workerId, long workerUsedBytes, long blockId, long length) throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException { send_worker_cacheBlock(workerId, workerUsedBytes, blockId, length); recv_worker_cacheBlock(); } public void send_worker_cacheBlock(long workerId, long workerUsedBytes, long blockId, long length) throws org.apache.thrift.TException { worker_cacheBlock_args args = new worker_cacheBlock_args(); args.setWorkerId(workerId); args.setWorkerUsedBytes(workerUsedBytes); args.setBlockId(blockId); args.setLength(length); sendBase("worker_cacheBlock", args); } public void recv_worker_cacheBlock() throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException { worker_cacheBlock_result result = new worker_cacheBlock_result(); receiveBase(result, "worker_cacheBlock"); if (result.eP != null) { throw result.eP; } if (result.eS != null) { throw result.eS; } if (result.eB != null) { throw result.eB; } return; } public Set<Integer> worker_getPinIdList() throws org.apache.thrift.TException { send_worker_getPinIdList(); return recv_worker_getPinIdList(); } public void send_worker_getPinIdList() throws org.apache.thrift.TException { worker_getPinIdList_args args = new worker_getPinIdList_args(); sendBase("worker_getPinIdList", args); } public Set<Integer> recv_worker_getPinIdList() throws org.apache.thrift.TException { worker_getPinIdList_result result = new worker_getPinIdList_result(); receiveBase(result, "worker_getPinIdList"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "worker_getPinIdList failed: unknown result"); } public List<Integer> worker_getPriorityDependencyList() throws org.apache.thrift.TException { send_worker_getPriorityDependencyList(); return recv_worker_getPriorityDependencyList(); } public void send_worker_getPriorityDependencyList() throws org.apache.thrift.TException { worker_getPriorityDependencyList_args args = new worker_getPriorityDependencyList_args(); sendBase("worker_getPriorityDependencyList", args); } public List<Integer> recv_worker_getPriorityDependencyList() throws org.apache.thrift.TException { worker_getPriorityDependencyList_result result = new worker_getPriorityDependencyList_result(); receiveBase(result, "worker_getPriorityDependencyList"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "worker_getPriorityDependencyList failed: unknown result"); } public int user_createDependency(List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte) throws InvalidPathException, FileDoesNotExistException, FileAlreadyExistException, BlockInfoException, TachyonException, org.apache.thrift.TException { send_user_createDependency(parents, children, commandPrefix, data, comment, framework, frameworkVersion, dependencyType, childrenBlockSizeByte); return recv_user_createDependency(); } public void send_user_createDependency(List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte) throws org.apache.thrift.TException { user_createDependency_args args = new user_createDependency_args(); args.setParents(parents); args.setChildren(children); args.setCommandPrefix(commandPrefix); args.setData(data); args.setComment(comment); args.setFramework(framework); args.setFrameworkVersion(frameworkVersion); args.setDependencyType(dependencyType); args.setChildrenBlockSizeByte(childrenBlockSizeByte); sendBase("user_createDependency", args); } public int recv_user_createDependency() throws InvalidPathException, FileDoesNotExistException, FileAlreadyExistException, BlockInfoException, TachyonException, org.apache.thrift.TException { user_createDependency_result result = new user_createDependency_result(); receiveBase(result, "user_createDependency"); if (result.isSetSuccess()) { return result.success; } if (result.eI != null) { throw result.eI; } if (result.eF != null) { throw result.eF; } if (result.eA != null) { throw result.eA; } if (result.eB != null) { throw result.eB; } if (result.eT != null) { throw result.eT; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_createDependency failed: unknown result"); } public ClientDependencyInfo user_getClientDependencyInfo(int dependencyId) throws DependencyDoesNotExistException, org.apache.thrift.TException { send_user_getClientDependencyInfo(dependencyId); return recv_user_getClientDependencyInfo(); } public void send_user_getClientDependencyInfo(int dependencyId) throws org.apache.thrift.TException { user_getClientDependencyInfo_args args = new user_getClientDependencyInfo_args(); args.setDependencyId(dependencyId); sendBase("user_getClientDependencyInfo", args); } public ClientDependencyInfo recv_user_getClientDependencyInfo() throws DependencyDoesNotExistException, org.apache.thrift.TException { user_getClientDependencyInfo_result result = new user_getClientDependencyInfo_result(); receiveBase(result, "user_getClientDependencyInfo"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getClientDependencyInfo failed: unknown result"); } public void user_reportLostFile(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException { send_user_reportLostFile(fileId); recv_user_reportLostFile(); } public void send_user_reportLostFile(int fileId) throws org.apache.thrift.TException { user_reportLostFile_args args = new user_reportLostFile_args(); args.setFileId(fileId); sendBase("user_reportLostFile", args); } public void recv_user_reportLostFile() throws FileDoesNotExistException, org.apache.thrift.TException { user_reportLostFile_result result = new user_reportLostFile_result(); receiveBase(result, "user_reportLostFile"); if (result.e != null) { throw result.e; } return; } public void user_requestFilesInDependency(int depId) throws DependencyDoesNotExistException, org.apache.thrift.TException { send_user_requestFilesInDependency(depId); recv_user_requestFilesInDependency(); } public void send_user_requestFilesInDependency(int depId) throws org.apache.thrift.TException { user_requestFilesInDependency_args args = new user_requestFilesInDependency_args(); args.setDepId(depId); sendBase("user_requestFilesInDependency", args); } public void recv_user_requestFilesInDependency() throws DependencyDoesNotExistException, org.apache.thrift.TException { user_requestFilesInDependency_result result = new user_requestFilesInDependency_result(); receiveBase(result, "user_requestFilesInDependency"); if (result.e != null) { throw result.e; } return; } public int user_createFile(String path, String ufsPath, long blockSizeByte, boolean recursive) throws FileAlreadyExistException, InvalidPathException, BlockInfoException, SuspectedFileSizeException, TachyonException, org.apache.thrift.TException { send_user_createFile(path, ufsPath, blockSizeByte, recursive); return recv_user_createFile(); } public void send_user_createFile(String path, String ufsPath, long blockSizeByte, boolean recursive) throws org.apache.thrift.TException { user_createFile_args args = new user_createFile_args(); args.setPath(path); args.setUfsPath(ufsPath); args.setBlockSizeByte(blockSizeByte); args.setRecursive(recursive); sendBase("user_createFile", args); } public int recv_user_createFile() throws FileAlreadyExistException, InvalidPathException, BlockInfoException, SuspectedFileSizeException, TachyonException, org.apache.thrift.TException { user_createFile_result result = new user_createFile_result(); receiveBase(result, "user_createFile"); if (result.isSetSuccess()) { return result.success; } if (result.eR != null) { throw result.eR; } if (result.eI != null) { throw result.eI; } if (result.eB != null) { throw result.eB; } if (result.eS != null) { throw result.eS; } if (result.eT != null) { throw result.eT; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_createFile failed: unknown result"); } public long user_createNewBlock(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException { send_user_createNewBlock(fileId); return recv_user_createNewBlock(); } public void send_user_createNewBlock(int fileId) throws org.apache.thrift.TException { user_createNewBlock_args args = new user_createNewBlock_args(); args.setFileId(fileId); sendBase("user_createNewBlock", args); } public long recv_user_createNewBlock() throws FileDoesNotExistException, org.apache.thrift.TException { user_createNewBlock_result result = new user_createNewBlock_result(); receiveBase(result, "user_createNewBlock"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_createNewBlock failed: unknown result"); } public void user_completeFile(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException { send_user_completeFile(fileId); recv_user_completeFile(); } public void send_user_completeFile(int fileId) throws org.apache.thrift.TException { user_completeFile_args args = new user_completeFile_args(); args.setFileId(fileId); sendBase("user_completeFile", args); } public void recv_user_completeFile() throws FileDoesNotExistException, org.apache.thrift.TException { user_completeFile_result result = new user_completeFile_result(); receiveBase(result, "user_completeFile"); if (result.e != null) { throw result.e; } return; } public long user_getUserId() throws org.apache.thrift.TException { send_user_getUserId(); return recv_user_getUserId(); } public void send_user_getUserId() throws org.apache.thrift.TException { user_getUserId_args args = new user_getUserId_args(); sendBase("user_getUserId", args); } public long recv_user_getUserId() throws org.apache.thrift.TException { user_getUserId_result result = new user_getUserId_result(); receiveBase(result, "user_getUserId"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getUserId failed: unknown result"); } public long user_getBlockId(int fileId, int index) throws FileDoesNotExistException, org.apache.thrift.TException { send_user_getBlockId(fileId, index); return recv_user_getBlockId(); } public void send_user_getBlockId(int fileId, int index) throws org.apache.thrift.TException { user_getBlockId_args args = new user_getBlockId_args(); args.setFileId(fileId); args.setIndex(index); sendBase("user_getBlockId", args); } public long recv_user_getBlockId() throws FileDoesNotExistException, org.apache.thrift.TException { user_getBlockId_result result = new user_getBlockId_result(); receiveBase(result, "user_getBlockId"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getBlockId failed: unknown result"); } public NetAddress user_getWorker(boolean random, String host) throws NoWorkerException, org.apache.thrift.TException { send_user_getWorker(random, host); return recv_user_getWorker(); } public void send_user_getWorker(boolean random, String host) throws org.apache.thrift.TException { user_getWorker_args args = new user_getWorker_args(); args.setRandom(random); args.setHost(host); sendBase("user_getWorker", args); } public NetAddress recv_user_getWorker() throws NoWorkerException, org.apache.thrift.TException { user_getWorker_result result = new user_getWorker_result(); receiveBase(result, "user_getWorker"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getWorker failed: unknown result"); } public ClientFileInfo getFileStatus(int fileId, String path) throws InvalidPathException, org.apache.thrift.TException { send_getFileStatus(fileId, path); return recv_getFileStatus(); } public void send_getFileStatus(int fileId, String path) throws org.apache.thrift.TException { getFileStatus_args args = new getFileStatus_args(); args.setFileId(fileId); args.setPath(path); sendBase("getFileStatus", args); } public ClientFileInfo recv_getFileStatus() throws InvalidPathException, org.apache.thrift.TException { getFileStatus_result result = new getFileStatus_result(); receiveBase(result, "getFileStatus"); if (result.isSetSuccess()) { return result.success; } if (result.eI != null) { throw result.eI; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getFileStatus failed: unknown result"); } public ClientBlockInfo user_getClientBlockInfo(long blockId) throws FileDoesNotExistException, BlockInfoException, org.apache.thrift.TException { send_user_getClientBlockInfo(blockId); return recv_user_getClientBlockInfo(); } public void send_user_getClientBlockInfo(long blockId) throws org.apache.thrift.TException { user_getClientBlockInfo_args args = new user_getClientBlockInfo_args(); args.setBlockId(blockId); sendBase("user_getClientBlockInfo", args); } public ClientBlockInfo recv_user_getClientBlockInfo() throws FileDoesNotExistException, BlockInfoException, org.apache.thrift.TException { user_getClientBlockInfo_result result = new user_getClientBlockInfo_result(); receiveBase(result, "user_getClientBlockInfo"); if (result.isSetSuccess()) { return result.success; } if (result.eF != null) { throw result.eF; } if (result.eB != null) { throw result.eB; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getClientBlockInfo failed: unknown result"); } public List<ClientBlockInfo> user_getFileBlocks(int fileId, String path) throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { send_user_getFileBlocks(fileId, path); return recv_user_getFileBlocks(); } public void send_user_getFileBlocks(int fileId, String path) throws org.apache.thrift.TException { user_getFileBlocks_args args = new user_getFileBlocks_args(); args.setFileId(fileId); args.setPath(path); sendBase("user_getFileBlocks", args); } public List<ClientBlockInfo> recv_user_getFileBlocks() throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { user_getFileBlocks_result result = new user_getFileBlocks_result(); receiveBase(result, "user_getFileBlocks"); if (result.isSetSuccess()) { return result.success; } if (result.eF != null) { throw result.eF; } if (result.eI != null) { throw result.eI; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getFileBlocks failed: unknown result"); } public boolean user_delete(int fileId, String path, boolean recursive) throws TachyonException, org.apache.thrift.TException { send_user_delete(fileId, path, recursive); return recv_user_delete(); } public void send_user_delete(int fileId, String path, boolean recursive) throws org.apache.thrift.TException { user_delete_args args = new user_delete_args(); args.setFileId(fileId); args.setPath(path); args.setRecursive(recursive); sendBase("user_delete", args); } public boolean recv_user_delete() throws TachyonException, org.apache.thrift.TException { user_delete_result result = new user_delete_result(); receiveBase(result, "user_delete"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_delete failed: unknown result"); } public boolean user_rename(int fileId, String srcPath, String dstPath) throws FileAlreadyExistException, FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { send_user_rename(fileId, srcPath, dstPath); return recv_user_rename(); } public void send_user_rename(int fileId, String srcPath, String dstPath) throws org.apache.thrift.TException { user_rename_args args = new user_rename_args(); args.setFileId(fileId); args.setSrcPath(srcPath); args.setDstPath(dstPath); sendBase("user_rename", args); } public boolean recv_user_rename() throws FileAlreadyExistException, FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { user_rename_result result = new user_rename_result(); receiveBase(result, "user_rename"); if (result.isSetSuccess()) { return result.success; } if (result.eA != null) { throw result.eA; } if (result.eF != null) { throw result.eF; } if (result.eI != null) { throw result.eI; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_rename failed: unknown result"); } public void user_setPinned(int fileId, boolean pinned) throws FileDoesNotExistException, org.apache.thrift.TException { send_user_setPinned(fileId, pinned); recv_user_setPinned(); } public void send_user_setPinned(int fileId, boolean pinned) throws org.apache.thrift.TException { user_setPinned_args args = new user_setPinned_args(); args.setFileId(fileId); args.setPinned(pinned); sendBase("user_setPinned", args); } public void recv_user_setPinned() throws FileDoesNotExistException, org.apache.thrift.TException { user_setPinned_result result = new user_setPinned_result(); receiveBase(result, "user_setPinned"); if (result.e != null) { throw result.e; } return; } public boolean user_mkdirs(String path, boolean recursive) throws FileAlreadyExistException, InvalidPathException, TachyonException, org.apache.thrift.TException { send_user_mkdirs(path, recursive); return recv_user_mkdirs(); } public void send_user_mkdirs(String path, boolean recursive) throws org.apache.thrift.TException { user_mkdirs_args args = new user_mkdirs_args(); args.setPath(path); args.setRecursive(recursive); sendBase("user_mkdirs", args); } public boolean recv_user_mkdirs() throws FileAlreadyExistException, InvalidPathException, TachyonException, org.apache.thrift.TException { user_mkdirs_result result = new user_mkdirs_result(); receiveBase(result, "user_mkdirs"); if (result.isSetSuccess()) { return result.success; } if (result.eR != null) { throw result.eR; } if (result.eI != null) { throw result.eI; } if (result.eT != null) { throw result.eT; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_mkdirs failed: unknown result"); } public int user_createRawTable(String path, int columns, ByteBuffer metadata) throws FileAlreadyExistException, InvalidPathException, TableColumnException, TachyonException, org.apache.thrift.TException { send_user_createRawTable(path, columns, metadata); return recv_user_createRawTable(); } public void send_user_createRawTable(String path, int columns, ByteBuffer metadata) throws org.apache.thrift.TException { user_createRawTable_args args = new user_createRawTable_args(); args.setPath(path); args.setColumns(columns); args.setMetadata(metadata); sendBase("user_createRawTable", args); } public int recv_user_createRawTable() throws FileAlreadyExistException, InvalidPathException, TableColumnException, TachyonException, org.apache.thrift.TException { user_createRawTable_result result = new user_createRawTable_result(); receiveBase(result, "user_createRawTable"); if (result.isSetSuccess()) { return result.success; } if (result.eR != null) { throw result.eR; } if (result.eI != null) { throw result.eI; } if (result.eT != null) { throw result.eT; } if (result.eTa != null) { throw result.eTa; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_createRawTable failed: unknown result"); } public int user_getRawTableId(String path) throws InvalidPathException, org.apache.thrift.TException { send_user_getRawTableId(path); return recv_user_getRawTableId(); } public void send_user_getRawTableId(String path) throws org.apache.thrift.TException { user_getRawTableId_args args = new user_getRawTableId_args(); args.setPath(path); sendBase("user_getRawTableId", args); } public int recv_user_getRawTableId() throws InvalidPathException, org.apache.thrift.TException { user_getRawTableId_result result = new user_getRawTableId_result(); receiveBase(result, "user_getRawTableId"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getRawTableId failed: unknown result"); } public ClientRawTableInfo user_getClientRawTableInfo(int id, String path) throws TableDoesNotExistException, InvalidPathException, org.apache.thrift.TException { send_user_getClientRawTableInfo(id, path); return recv_user_getClientRawTableInfo(); } public void send_user_getClientRawTableInfo(int id, String path) throws org.apache.thrift.TException { user_getClientRawTableInfo_args args = new user_getClientRawTableInfo_args(); args.setId(id); args.setPath(path); sendBase("user_getClientRawTableInfo", args); } public ClientRawTableInfo recv_user_getClientRawTableInfo() throws TableDoesNotExistException, InvalidPathException, org.apache.thrift.TException { user_getClientRawTableInfo_result result = new user_getClientRawTableInfo_result(); receiveBase(result, "user_getClientRawTableInfo"); if (result.isSetSuccess()) { return result.success; } if (result.eT != null) { throw result.eT; } if (result.eI != null) { throw result.eI; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getClientRawTableInfo failed: unknown result"); } public void user_updateRawTableMetadata(int tableId, ByteBuffer metadata) throws TableDoesNotExistException, TachyonException, org.apache.thrift.TException { send_user_updateRawTableMetadata(tableId, metadata); recv_user_updateRawTableMetadata(); } public void send_user_updateRawTableMetadata(int tableId, ByteBuffer metadata) throws org.apache.thrift.TException { user_updateRawTableMetadata_args args = new user_updateRawTableMetadata_args(); args.setTableId(tableId); args.setMetadata(metadata); sendBase("user_updateRawTableMetadata", args); } public void recv_user_updateRawTableMetadata() throws TableDoesNotExistException, TachyonException, org.apache.thrift.TException { user_updateRawTableMetadata_result result = new user_updateRawTableMetadata_result(); receiveBase(result, "user_updateRawTableMetadata"); if (result.eT != null) { throw result.eT; } if (result.eTa != null) { throw result.eTa; } return; } public String user_getUfsAddress() throws org.apache.thrift.TException { send_user_getUfsAddress(); return recv_user_getUfsAddress(); } public void send_user_getUfsAddress() throws org.apache.thrift.TException { user_getUfsAddress_args args = new user_getUfsAddress_args(); sendBase("user_getUfsAddress", args); } public String recv_user_getUfsAddress() throws org.apache.thrift.TException { user_getUfsAddress_result result = new user_getUfsAddress_result(); receiveBase(result, "user_getUfsAddress"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getUfsAddress failed: unknown result"); } public void user_heartbeat() throws org.apache.thrift.TException { send_user_heartbeat(); recv_user_heartbeat(); } public void send_user_heartbeat() throws org.apache.thrift.TException { user_heartbeat_args args = new user_heartbeat_args(); sendBase("user_heartbeat", args); } public void recv_user_heartbeat() throws org.apache.thrift.TException { user_heartbeat_result result = new user_heartbeat_result(); receiveBase(result, "user_heartbeat"); return; } public boolean user_freepath(int fileId, String path, boolean recursive) throws FileDoesNotExistException, org.apache.thrift.TException { send_user_freepath(fileId, path, recursive); return recv_user_freepath(); } public void send_user_freepath(int fileId, String path, boolean recursive) throws org.apache.thrift.TException { user_freepath_args args = new user_freepath_args(); args.setFileId(fileId); args.setPath(path); args.setRecursive(recursive); sendBase("user_freepath", args); } public boolean recv_user_freepath() throws FileDoesNotExistException, org.apache.thrift.TException { user_freepath_result result = new user_freepath_result(); receiveBase(result, "user_freepath"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_freepath failed: unknown result"); } } public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> { private org.apache.thrift.async.TAsyncClientManager clientManager; private org.apache.thrift.protocol.TProtocolFactory protocolFactory; public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { this.clientManager = clientManager; this.protocolFactory = protocolFactory; } public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { return new AsyncClient(protocolFactory, clientManager, transport); } } public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { super(protocolFactory, clientManager, transport); } public void addCheckpoint(long workerId, int fileId, long length, String checkpointPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); addCheckpoint_call method_call = new addCheckpoint_call(workerId, fileId, length, checkpointPath, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class addCheckpoint_call extends org.apache.thrift.async.TAsyncMethodCall { private long workerId; private int fileId; private long length; private String checkpointPath; public addCheckpoint_call(long workerId, int fileId, long length, String checkpointPath, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.workerId = workerId; this.fileId = fileId; this.length = length; this.checkpointPath = checkpointPath; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addCheckpoint", org.apache.thrift.protocol.TMessageType.CALL, 0)); addCheckpoint_args args = new addCheckpoint_args(); args.setWorkerId(workerId); args.setFileId(fileId); args.setLength(length); args.setCheckpointPath(checkpointPath); args.write(prot); prot.writeMessageEnd(); } public boolean getResult() throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_addCheckpoint(); } } public void getWorkersInfo(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getWorkersInfo_call method_call = new getWorkersInfo_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getWorkersInfo_call extends org.apache.thrift.async.TAsyncMethodCall { public getWorkersInfo_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getWorkersInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); getWorkersInfo_args args = new getWorkersInfo_args(); args.write(prot); prot.writeMessageEnd(); } public List<ClientWorkerInfo> getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_getWorkersInfo(); } } public void liststatus(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); liststatus_call method_call = new liststatus_call(path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class liststatus_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; public liststatus_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("liststatus", org.apache.thrift.protocol.TMessageType.CALL, 0)); liststatus_args args = new liststatus_args(); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public List<ClientFileInfo> getResult() throws InvalidPathException, FileDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_liststatus(); } } public void worker_register(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlocks, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); worker_register_call method_call = new worker_register_call(workerNetAddress, totalBytes, usedBytes, currentBlocks, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class worker_register_call extends org.apache.thrift.async.TAsyncMethodCall { private NetAddress workerNetAddress; private long totalBytes; private long usedBytes; private List<Long> currentBlocks; public worker_register_call(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlocks, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.workerNetAddress = workerNetAddress; this.totalBytes = totalBytes; this.usedBytes = usedBytes; this.currentBlocks = currentBlocks; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("worker_register", org.apache.thrift.protocol.TMessageType.CALL, 0)); worker_register_args args = new worker_register_args(); args.setWorkerNetAddress(workerNetAddress); args.setTotalBytes(totalBytes); args.setUsedBytes(usedBytes); args.setCurrentBlocks(currentBlocks); args.write(prot); prot.writeMessageEnd(); } public long getResult() throws BlockInfoException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_worker_register(); } } public void worker_heartbeat(long workerId, long usedBytes, List<Long> removedBlocks, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); worker_heartbeat_call method_call = new worker_heartbeat_call(workerId, usedBytes, removedBlocks, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class worker_heartbeat_call extends org.apache.thrift.async.TAsyncMethodCall { private long workerId; private long usedBytes; private List<Long> removedBlocks; public worker_heartbeat_call(long workerId, long usedBytes, List<Long> removedBlocks, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.workerId = workerId; this.usedBytes = usedBytes; this.removedBlocks = removedBlocks; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("worker_heartbeat", org.apache.thrift.protocol.TMessageType.CALL, 0)); worker_heartbeat_args args = new worker_heartbeat_args(); args.setWorkerId(workerId); args.setUsedBytes(usedBytes); args.setRemovedBlocks(removedBlocks); args.write(prot); prot.writeMessageEnd(); } public Command getResult() throws BlockInfoException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_worker_heartbeat(); } } public void worker_cacheBlock(long workerId, long workerUsedBytes, long blockId, long length, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); worker_cacheBlock_call method_call = new worker_cacheBlock_call(workerId, workerUsedBytes, blockId, length, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class worker_cacheBlock_call extends org.apache.thrift.async.TAsyncMethodCall { private long workerId; private long workerUsedBytes; private long blockId; private long length; public worker_cacheBlock_call(long workerId, long workerUsedBytes, long blockId, long length, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.workerId = workerId; this.workerUsedBytes = workerUsedBytes; this.blockId = blockId; this.length = length; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("worker_cacheBlock", org.apache.thrift.protocol.TMessageType.CALL, 0)); worker_cacheBlock_args args = new worker_cacheBlock_args(); args.setWorkerId(workerId); args.setWorkerUsedBytes(workerUsedBytes); args.setBlockId(blockId); args.setLength(length); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_worker_cacheBlock(); } } public void worker_getPinIdList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); worker_getPinIdList_call method_call = new worker_getPinIdList_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class worker_getPinIdList_call extends org.apache.thrift.async.TAsyncMethodCall { public worker_getPinIdList_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("worker_getPinIdList", org.apache.thrift.protocol.TMessageType.CALL, 0)); worker_getPinIdList_args args = new worker_getPinIdList_args(); args.write(prot); prot.writeMessageEnd(); } public Set<Integer> getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_worker_getPinIdList(); } } public void worker_getPriorityDependencyList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); worker_getPriorityDependencyList_call method_call = new worker_getPriorityDependencyList_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class worker_getPriorityDependencyList_call extends org.apache.thrift.async.TAsyncMethodCall { public worker_getPriorityDependencyList_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("worker_getPriorityDependencyList", org.apache.thrift.protocol.TMessageType.CALL, 0)); worker_getPriorityDependencyList_args args = new worker_getPriorityDependencyList_args(); args.write(prot); prot.writeMessageEnd(); } public List<Integer> getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_worker_getPriorityDependencyList(); } } public void user_createDependency(List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_createDependency_call method_call = new user_createDependency_call(parents, children, commandPrefix, data, comment, framework, frameworkVersion, dependencyType, childrenBlockSizeByte, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_createDependency_call extends org.apache.thrift.async.TAsyncMethodCall { private List<String> parents; private List<String> children; private String commandPrefix; private List<ByteBuffer> data; private String comment; private String framework; private String frameworkVersion; private int dependencyType; private long childrenBlockSizeByte; public user_createDependency_call(List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.parents = parents; this.children = children; this.commandPrefix = commandPrefix; this.data = data; this.comment = comment; this.framework = framework; this.frameworkVersion = frameworkVersion; this.dependencyType = dependencyType; this.childrenBlockSizeByte = childrenBlockSizeByte; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_createDependency", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_createDependency_args args = new user_createDependency_args(); args.setParents(parents); args.setChildren(children); args.setCommandPrefix(commandPrefix); args.setData(data); args.setComment(comment); args.setFramework(framework); args.setFrameworkVersion(frameworkVersion); args.setDependencyType(dependencyType); args.setChildrenBlockSizeByte(childrenBlockSizeByte); args.write(prot); prot.writeMessageEnd(); } public int getResult() throws InvalidPathException, FileDoesNotExistException, FileAlreadyExistException, BlockInfoException, TachyonException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_createDependency(); } } public void user_getClientDependencyInfo(int dependencyId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getClientDependencyInfo_call method_call = new user_getClientDependencyInfo_call(dependencyId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getClientDependencyInfo_call extends org.apache.thrift.async.TAsyncMethodCall { private int dependencyId; public user_getClientDependencyInfo_call(int dependencyId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.dependencyId = dependencyId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getClientDependencyInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getClientDependencyInfo_args args = new user_getClientDependencyInfo_args(); args.setDependencyId(dependencyId); args.write(prot); prot.writeMessageEnd(); } public ClientDependencyInfo getResult() throws DependencyDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getClientDependencyInfo(); } } public void user_reportLostFile(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_reportLostFile_call method_call = new user_reportLostFile_call(fileId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_reportLostFile_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; public user_reportLostFile_call(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_reportLostFile", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_reportLostFile_args args = new user_reportLostFile_args(); args.setFileId(fileId); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws FileDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_user_reportLostFile(); } } public void user_requestFilesInDependency(int depId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_requestFilesInDependency_call method_call = new user_requestFilesInDependency_call(depId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_requestFilesInDependency_call extends org.apache.thrift.async.TAsyncMethodCall { private int depId; public user_requestFilesInDependency_call(int depId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.depId = depId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_requestFilesInDependency", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_requestFilesInDependency_args args = new user_requestFilesInDependency_args(); args.setDepId(depId); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws DependencyDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_user_requestFilesInDependency(); } } public void user_createFile(String path, String ufsPath, long blockSizeByte, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_createFile_call method_call = new user_createFile_call(path, ufsPath, blockSizeByte, recursive, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_createFile_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private String ufsPath; private long blockSizeByte; private boolean recursive; public user_createFile_call(String path, String ufsPath, long blockSizeByte, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.ufsPath = ufsPath; this.blockSizeByte = blockSizeByte; this.recursive = recursive; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_createFile", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_createFile_args args = new user_createFile_args(); args.setPath(path); args.setUfsPath(ufsPath); args.setBlockSizeByte(blockSizeByte); args.setRecursive(recursive); args.write(prot); prot.writeMessageEnd(); } public int getResult() throws FileAlreadyExistException, InvalidPathException, BlockInfoException, SuspectedFileSizeException, TachyonException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_createFile(); } } public void user_createNewBlock(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_createNewBlock_call method_call = new user_createNewBlock_call(fileId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_createNewBlock_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; public user_createNewBlock_call(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_createNewBlock", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_createNewBlock_args args = new user_createNewBlock_args(); args.setFileId(fileId); args.write(prot); prot.writeMessageEnd(); } public long getResult() throws FileDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_createNewBlock(); } } public void user_completeFile(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_completeFile_call method_call = new user_completeFile_call(fileId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_completeFile_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; public user_completeFile_call(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_completeFile", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_completeFile_args args = new user_completeFile_args(); args.setFileId(fileId); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws FileDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_user_completeFile(); } } public void user_getUserId(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getUserId_call method_call = new user_getUserId_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getUserId_call extends org.apache.thrift.async.TAsyncMethodCall { public user_getUserId_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getUserId", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getUserId_args args = new user_getUserId_args(); args.write(prot); prot.writeMessageEnd(); } public long getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getUserId(); } } public void user_getBlockId(int fileId, int index, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getBlockId_call method_call = new user_getBlockId_call(fileId, index, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getBlockId_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; private int index; public user_getBlockId_call(int fileId, int index, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; this.index = index; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getBlockId", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getBlockId_args args = new user_getBlockId_args(); args.setFileId(fileId); args.setIndex(index); args.write(prot); prot.writeMessageEnd(); } public long getResult() throws FileDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getBlockId(); } } public void user_getWorker(boolean random, String host, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getWorker_call method_call = new user_getWorker_call(random, host, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getWorker_call extends org.apache.thrift.async.TAsyncMethodCall { private boolean random; private String host; public user_getWorker_call(boolean random, String host, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.random = random; this.host = host; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getWorker", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getWorker_args args = new user_getWorker_args(); args.setRandom(random); args.setHost(host); args.write(prot); prot.writeMessageEnd(); } public NetAddress getResult() throws NoWorkerException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getWorker(); } } public void getFileStatus(int fileId, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getFileStatus_call method_call = new getFileStatus_call(fileId, path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getFileStatus_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; private String path; public getFileStatus_call(int fileId, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getFileStatus", org.apache.thrift.protocol.TMessageType.CALL, 0)); getFileStatus_args args = new getFileStatus_args(); args.setFileId(fileId); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public ClientFileInfo getResult() throws InvalidPathException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_getFileStatus(); } } public void user_getClientBlockInfo(long blockId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getClientBlockInfo_call method_call = new user_getClientBlockInfo_call(blockId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getClientBlockInfo_call extends org.apache.thrift.async.TAsyncMethodCall { private long blockId; public user_getClientBlockInfo_call(long blockId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.blockId = blockId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getClientBlockInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getClientBlockInfo_args args = new user_getClientBlockInfo_args(); args.setBlockId(blockId); args.write(prot); prot.writeMessageEnd(); } public ClientBlockInfo getResult() throws FileDoesNotExistException, BlockInfoException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getClientBlockInfo(); } } public void user_getFileBlocks(int fileId, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getFileBlocks_call method_call = new user_getFileBlocks_call(fileId, path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getFileBlocks_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; private String path; public user_getFileBlocks_call(int fileId, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getFileBlocks", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getFileBlocks_args args = new user_getFileBlocks_args(); args.setFileId(fileId); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public List<ClientBlockInfo> getResult() throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getFileBlocks(); } } public void user_delete(int fileId, String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_delete_call method_call = new user_delete_call(fileId, path, recursive, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_delete_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; private String path; private boolean recursive; public user_delete_call(int fileId, String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; this.path = path; this.recursive = recursive; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_delete", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_delete_args args = new user_delete_args(); args.setFileId(fileId); args.setPath(path); args.setRecursive(recursive); args.write(prot); prot.writeMessageEnd(); } public boolean getResult() throws TachyonException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_delete(); } } public void user_rename(int fileId, String srcPath, String dstPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_rename_call method_call = new user_rename_call(fileId, srcPath, dstPath, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_rename_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; private String srcPath; private String dstPath; public user_rename_call(int fileId, String srcPath, String dstPath, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; this.srcPath = srcPath; this.dstPath = dstPath; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_rename", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_rename_args args = new user_rename_args(); args.setFileId(fileId); args.setSrcPath(srcPath); args.setDstPath(dstPath); args.write(prot); prot.writeMessageEnd(); } public boolean getResult() throws FileAlreadyExistException, FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_rename(); } } public void user_setPinned(int fileId, boolean pinned, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_setPinned_call method_call = new user_setPinned_call(fileId, pinned, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_setPinned_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; private boolean pinned; public user_setPinned_call(int fileId, boolean pinned, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; this.pinned = pinned; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_setPinned", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_setPinned_args args = new user_setPinned_args(); args.setFileId(fileId); args.setPinned(pinned); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws FileDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_user_setPinned(); } } public void user_mkdirs(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_mkdirs_call method_call = new user_mkdirs_call(path, recursive, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_mkdirs_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private boolean recursive; public user_mkdirs_call(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.recursive = recursive; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_mkdirs", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_mkdirs_args args = new user_mkdirs_args(); args.setPath(path); args.setRecursive(recursive); args.write(prot); prot.writeMessageEnd(); } public boolean getResult() throws FileAlreadyExistException, InvalidPathException, TachyonException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_mkdirs(); } } public void user_createRawTable(String path, int columns, ByteBuffer metadata, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_createRawTable_call method_call = new user_createRawTable_call(path, columns, metadata, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_createRawTable_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private int columns; private ByteBuffer metadata; public user_createRawTable_call(String path, int columns, ByteBuffer metadata, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.columns = columns; this.metadata = metadata; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_createRawTable", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_createRawTable_args args = new user_createRawTable_args(); args.setPath(path); args.setColumns(columns); args.setMetadata(metadata); args.write(prot); prot.writeMessageEnd(); } public int getResult() throws FileAlreadyExistException, InvalidPathException, TableColumnException, TachyonException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_createRawTable(); } } public void user_getRawTableId(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getRawTableId_call method_call = new user_getRawTableId_call(path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getRawTableId_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; public user_getRawTableId_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getRawTableId", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getRawTableId_args args = new user_getRawTableId_args(); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public int getResult() throws InvalidPathException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getRawTableId(); } } public void user_getClientRawTableInfo(int id, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getClientRawTableInfo_call method_call = new user_getClientRawTableInfo_call(id, path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getClientRawTableInfo_call extends org.apache.thrift.async.TAsyncMethodCall { private int id; private String path; public user_getClientRawTableInfo_call(int id, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.id = id; this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getClientRawTableInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getClientRawTableInfo_args args = new user_getClientRawTableInfo_args(); args.setId(id); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public ClientRawTableInfo getResult() throws TableDoesNotExistException, InvalidPathException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getClientRawTableInfo(); } } public void user_updateRawTableMetadata(int tableId, ByteBuffer metadata, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_updateRawTableMetadata_call method_call = new user_updateRawTableMetadata_call(tableId, metadata, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_updateRawTableMetadata_call extends org.apache.thrift.async.TAsyncMethodCall { private int tableId; private ByteBuffer metadata; public user_updateRawTableMetadata_call(int tableId, ByteBuffer metadata, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.tableId = tableId; this.metadata = metadata; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_updateRawTableMetadata", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_updateRawTableMetadata_args args = new user_updateRawTableMetadata_args(); args.setTableId(tableId); args.setMetadata(metadata); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws TableDoesNotExistException, TachyonException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_user_updateRawTableMetadata(); } } public void user_getUfsAddress(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getUfsAddress_call method_call = new user_getUfsAddress_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getUfsAddress_call extends org.apache.thrift.async.TAsyncMethodCall { public user_getUfsAddress_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getUfsAddress", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getUfsAddress_args args = new user_getUfsAddress_args(); args.write(prot); prot.writeMessageEnd(); } public String getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getUfsAddress(); } } public void user_heartbeat(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_heartbeat_call method_call = new user_heartbeat_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_heartbeat_call extends org.apache.thrift.async.TAsyncMethodCall { public user_heartbeat_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_heartbeat", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_heartbeat_args args = new user_heartbeat_args(); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_user_heartbeat(); } } public void user_freepath(int fileId, String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_freepath_call method_call = new user_freepath_call(fileId, path, recursive, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_freepath_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; private String path; private boolean recursive; public user_freepath_call(int fileId, String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; this.path = path; this.recursive = recursive; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_freepath", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_freepath_args args = new user_freepath_args(); args.setFileId(fileId); args.setPath(path); args.setRecursive(recursive); args.write(prot); prot.writeMessageEnd(); } public boolean getResult() throws FileDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_freepath(); } } } public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); public Processor(I iface) { super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>())); } protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { processMap.put("addCheckpoint", new addCheckpoint()); processMap.put("getWorkersInfo", new getWorkersInfo()); processMap.put("liststatus", new liststatus()); processMap.put("worker_register", new worker_register()); processMap.put("worker_heartbeat", new worker_heartbeat()); processMap.put("worker_cacheBlock", new worker_cacheBlock()); processMap.put("worker_getPinIdList", new worker_getPinIdList()); processMap.put("worker_getPriorityDependencyList", new worker_getPriorityDependencyList()); processMap.put("user_createDependency", new user_createDependency()); processMap.put("user_getClientDependencyInfo", new user_getClientDependencyInfo()); processMap.put("user_reportLostFile", new user_reportLostFile()); processMap.put("user_requestFilesInDependency", new user_requestFilesInDependency()); processMap.put("user_createFile", new user_createFile()); processMap.put("user_createNewBlock", new user_createNewBlock()); processMap.put("user_completeFile", new user_completeFile()); processMap.put("user_getUserId", new user_getUserId()); processMap.put("user_getBlockId", new user_getBlockId()); processMap.put("user_getWorker", new user_getWorker()); processMap.put("getFileStatus", new getFileStatus()); processMap.put("user_getClientBlockInfo", new user_getClientBlockInfo()); processMap.put("user_getFileBlocks", new user_getFileBlocks()); processMap.put("user_delete", new user_delete()); processMap.put("user_rename", new user_rename()); processMap.put("user_setPinned", new user_setPinned()); processMap.put("user_mkdirs", new user_mkdirs()); processMap.put("user_createRawTable", new user_createRawTable()); processMap.put("user_getRawTableId", new user_getRawTableId()); processMap.put("user_getClientRawTableInfo", new user_getClientRawTableInfo()); processMap.put("user_updateRawTableMetadata", new user_updateRawTableMetadata()); processMap.put("user_getUfsAddress", new user_getUfsAddress()); processMap.put("user_heartbeat", new user_heartbeat()); processMap.put("user_freepath", new user_freepath()); return processMap; } public static class addCheckpoint<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addCheckpoint_args> { public addCheckpoint() { super("addCheckpoint"); } public addCheckpoint_args getEmptyArgsInstance() { return new addCheckpoint_args(); } protected boolean isOneway() { return false; } public addCheckpoint_result getResult(I iface, addCheckpoint_args args) throws org.apache.thrift.TException { addCheckpoint_result result = new addCheckpoint_result(); try { result.success = iface.addCheckpoint(args.workerId, args.fileId, args.length, args.checkpointPath); result.setSuccessIsSet(true); } catch (FileDoesNotExistException eP) { result.eP = eP; } catch (SuspectedFileSizeException eS) { result.eS = eS; } catch (BlockInfoException eB) { result.eB = eB; } return result; } } public static class getWorkersInfo<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getWorkersInfo_args> { public getWorkersInfo() { super("getWorkersInfo"); } public getWorkersInfo_args getEmptyArgsInstance() { return new getWorkersInfo_args(); } protected boolean isOneway() { return false; } public getWorkersInfo_result getResult(I iface, getWorkersInfo_args args) throws org.apache.thrift.TException { getWorkersInfo_result result = new getWorkersInfo_result(); result.success = iface.getWorkersInfo(); return result; } } public static class liststatus<I extends Iface> extends org.apache.thrift.ProcessFunction<I, liststatus_args> { public liststatus() { super("liststatus"); } public liststatus_args getEmptyArgsInstance() { return new liststatus_args(); } protected boolean isOneway() { return false; } public liststatus_result getResult(I iface, liststatus_args args) throws org.apache.thrift.TException { liststatus_result result = new liststatus_result(); try { result.success = iface.liststatus(args.path); } catch (InvalidPathException eI) { result.eI = eI; } catch (FileDoesNotExistException eF) { result.eF = eF; } return result; } } public static class worker_register<I extends Iface> extends org.apache.thrift.ProcessFunction<I, worker_register_args> { public worker_register() { super("worker_register"); } public worker_register_args getEmptyArgsInstance() { return new worker_register_args(); } protected boolean isOneway() { return false; } public worker_register_result getResult(I iface, worker_register_args args) throws org.apache.thrift.TException { worker_register_result result = new worker_register_result(); try { result.success = iface.worker_register(args.workerNetAddress, args.totalBytes, args.usedBytes, args.currentBlocks); result.setSuccessIsSet(true); } catch (BlockInfoException e) { result.e = e; } return result; } } public static class worker_heartbeat<I extends Iface> extends org.apache.thrift.ProcessFunction<I, worker_heartbeat_args> { public worker_heartbeat() { super("worker_heartbeat"); } public worker_heartbeat_args getEmptyArgsInstance() { return new worker_heartbeat_args(); } protected boolean isOneway() { return false; } public worker_heartbeat_result getResult(I iface, worker_heartbeat_args args) throws org.apache.thrift.TException { worker_heartbeat_result result = new worker_heartbeat_result(); try { result.success = iface.worker_heartbeat(args.workerId, args.usedBytes, args.removedBlocks); } catch (BlockInfoException e) { result.e = e; } return result; } } public static class worker_cacheBlock<I extends Iface> extends org.apache.thrift.ProcessFunction<I, worker_cacheBlock_args> { public worker_cacheBlock() { super("worker_cacheBlock"); } public worker_cacheBlock_args getEmptyArgsInstance() { return new worker_cacheBlock_args(); } protected boolean isOneway() { return false; } public worker_cacheBlock_result getResult(I iface, worker_cacheBlock_args args) throws org.apache.thrift.TException { worker_cacheBlock_result result = new worker_cacheBlock_result(); try { iface.worker_cacheBlock(args.workerId, args.workerUsedBytes, args.blockId, args.length); } catch (FileDoesNotExistException eP) { result.eP = eP; } catch (SuspectedFileSizeException eS) { result.eS = eS; } catch (BlockInfoException eB) { result.eB = eB; } return result; } } public static class worker_getPinIdList<I extends Iface> extends org.apache.thrift.ProcessFunction<I, worker_getPinIdList_args> { public worker_getPinIdList() { super("worker_getPinIdList"); } public worker_getPinIdList_args getEmptyArgsInstance() { return new worker_getPinIdList_args(); } protected boolean isOneway() { return false; } public worker_getPinIdList_result getResult(I iface, worker_getPinIdList_args args) throws org.apache.thrift.TException { worker_getPinIdList_result result = new worker_getPinIdList_result(); result.success = iface.worker_getPinIdList(); return result; } } public static class worker_getPriorityDependencyList<I extends Iface> extends org.apache.thrift.ProcessFunction<I, worker_getPriorityDependencyList_args> { public worker_getPriorityDependencyList() { super("worker_getPriorityDependencyList"); } public worker_getPriorityDependencyList_args getEmptyArgsInstance() { return new worker_getPriorityDependencyList_args(); } protected boolean isOneway() { return false; } public worker_getPriorityDependencyList_result getResult(I iface, worker_getPriorityDependencyList_args args) throws org.apache.thrift.TException { worker_getPriorityDependencyList_result result = new worker_getPriorityDependencyList_result(); result.success = iface.worker_getPriorityDependencyList(); return result; } } public static class user_createDependency<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_createDependency_args> { public user_createDependency() { super("user_createDependency"); } public user_createDependency_args getEmptyArgsInstance() { return new user_createDependency_args(); } protected boolean isOneway() { return false; } public user_createDependency_result getResult(I iface, user_createDependency_args args) throws org.apache.thrift.TException { user_createDependency_result result = new user_createDependency_result(); try { result.success = iface.user_createDependency(args.parents, args.children, args.commandPrefix, args.data, args.comment, args.framework, args.frameworkVersion, args.dependencyType, args.childrenBlockSizeByte); result.setSuccessIsSet(true); } catch (InvalidPathException eI) { result.eI = eI; } catch (FileDoesNotExistException eF) { result.eF = eF; } catch (FileAlreadyExistException eA) { result.eA = eA; } catch (BlockInfoException eB) { result.eB = eB; } catch (TachyonException eT) { result.eT = eT; } return result; } } public static class user_getClientDependencyInfo<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getClientDependencyInfo_args> { public user_getClientDependencyInfo() { super("user_getClientDependencyInfo"); } public user_getClientDependencyInfo_args getEmptyArgsInstance() { return new user_getClientDependencyInfo_args(); } protected boolean isOneway() { return false; } public user_getClientDependencyInfo_result getResult(I iface, user_getClientDependencyInfo_args args) throws org.apache.thrift.TException { user_getClientDependencyInfo_result result = new user_getClientDependencyInfo_result(); try { result.success = iface.user_getClientDependencyInfo(args.dependencyId); } catch (DependencyDoesNotExistException e) { result.e = e; } return result; } } public static class user_reportLostFile<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_reportLostFile_args> { public user_reportLostFile() { super("user_reportLostFile"); } public user_reportLostFile_args getEmptyArgsInstance() { return new user_reportLostFile_args(); } protected boolean isOneway() { return false; } public user_reportLostFile_result getResult(I iface, user_reportLostFile_args args) throws org.apache.thrift.TException { user_reportLostFile_result result = new user_reportLostFile_result(); try { iface.user_reportLostFile(args.fileId); } catch (FileDoesNotExistException e) { result.e = e; } return result; } } public static class user_requestFilesInDependency<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_requestFilesInDependency_args> { public user_requestFilesInDependency() { super("user_requestFilesInDependency"); } public user_requestFilesInDependency_args getEmptyArgsInstance() { return new user_requestFilesInDependency_args(); } protected boolean isOneway() { return false; } public user_requestFilesInDependency_result getResult(I iface, user_requestFilesInDependency_args args) throws org.apache.thrift.TException { user_requestFilesInDependency_result result = new user_requestFilesInDependency_result(); try { iface.user_requestFilesInDependency(args.depId); } catch (DependencyDoesNotExistException e) { result.e = e; } return result; } } public static class user_createFile<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_createFile_args> { public user_createFile() { super("user_createFile"); } public user_createFile_args getEmptyArgsInstance() { return new user_createFile_args(); } protected boolean isOneway() { return false; } public user_createFile_result getResult(I iface, user_createFile_args args) throws org.apache.thrift.TException { user_createFile_result result = new user_createFile_result(); try { result.success = iface.user_createFile(args.path, args.ufsPath, args.blockSizeByte, args.recursive); result.setSuccessIsSet(true); } catch (FileAlreadyExistException eR) { result.eR = eR; } catch (InvalidPathException eI) { result.eI = eI; } catch (BlockInfoException eB) { result.eB = eB; } catch (SuspectedFileSizeException eS) { result.eS = eS; } catch (TachyonException eT) { result.eT = eT; } return result; } } public static class user_createNewBlock<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_createNewBlock_args> { public user_createNewBlock() { super("user_createNewBlock"); } public user_createNewBlock_args getEmptyArgsInstance() { return new user_createNewBlock_args(); } protected boolean isOneway() { return false; } public user_createNewBlock_result getResult(I iface, user_createNewBlock_args args) throws org.apache.thrift.TException { user_createNewBlock_result result = new user_createNewBlock_result(); try { result.success = iface.user_createNewBlock(args.fileId); result.setSuccessIsSet(true); } catch (FileDoesNotExistException e) { result.e = e; } return result; } } public static class user_completeFile<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_completeFile_args> { public user_completeFile() { super("user_completeFile"); } public user_completeFile_args getEmptyArgsInstance() { return new user_completeFile_args(); } protected boolean isOneway() { return false; } public user_completeFile_result getResult(I iface, user_completeFile_args args) throws org.apache.thrift.TException { user_completeFile_result result = new user_completeFile_result(); try { iface.user_completeFile(args.fileId); } catch (FileDoesNotExistException e) { result.e = e; } return result; } } public static class user_getUserId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getUserId_args> { public user_getUserId() { super("user_getUserId"); } public user_getUserId_args getEmptyArgsInstance() { return new user_getUserId_args(); } protected boolean isOneway() { return false; } public user_getUserId_result getResult(I iface, user_getUserId_args args) throws org.apache.thrift.TException { user_getUserId_result result = new user_getUserId_result(); result.success = iface.user_getUserId(); result.setSuccessIsSet(true); return result; } } public static class user_getBlockId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getBlockId_args> { public user_getBlockId() { super("user_getBlockId"); } public user_getBlockId_args getEmptyArgsInstance() { return new user_getBlockId_args(); } protected boolean isOneway() { return false; } public user_getBlockId_result getResult(I iface, user_getBlockId_args args) throws org.apache.thrift.TException { user_getBlockId_result result = new user_getBlockId_result(); try { result.success = iface.user_getBlockId(args.fileId, args.index); result.setSuccessIsSet(true); } catch (FileDoesNotExistException e) { result.e = e; } return result; } } public static class user_getWorker<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getWorker_args> { public user_getWorker() { super("user_getWorker"); } public user_getWorker_args getEmptyArgsInstance() { return new user_getWorker_args(); } protected boolean isOneway() { return false; } public user_getWorker_result getResult(I iface, user_getWorker_args args) throws org.apache.thrift.TException { user_getWorker_result result = new user_getWorker_result(); try { result.success = iface.user_getWorker(args.random, args.host); } catch (NoWorkerException e) { result.e = e; } return result; } } public static class getFileStatus<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getFileStatus_args> { public getFileStatus() { super("getFileStatus"); } public getFileStatus_args getEmptyArgsInstance() { return new getFileStatus_args(); } protected boolean isOneway() { return false; } public getFileStatus_result getResult(I iface, getFileStatus_args args) throws org.apache.thrift.TException { getFileStatus_result result = new getFileStatus_result(); try { result.success = iface.getFileStatus(args.fileId, args.path); } catch (InvalidPathException eI) { result.eI = eI; } return result; } } public static class user_getClientBlockInfo<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getClientBlockInfo_args> { public user_getClientBlockInfo() { super("user_getClientBlockInfo"); } public user_getClientBlockInfo_args getEmptyArgsInstance() { return new user_getClientBlockInfo_args(); } protected boolean isOneway() { return false; } public user_getClientBlockInfo_result getResult(I iface, user_getClientBlockInfo_args args) throws org.apache.thrift.TException { user_getClientBlockInfo_result result = new user_getClientBlockInfo_result(); try { result.success = iface.user_getClientBlockInfo(args.blockId); } catch (FileDoesNotExistException eF) { result.eF = eF; } catch (BlockInfoException eB) { result.eB = eB; } return result; } } public static class user_getFileBlocks<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getFileBlocks_args> { public user_getFileBlocks() { super("user_getFileBlocks"); } public user_getFileBlocks_args getEmptyArgsInstance() { return new user_getFileBlocks_args(); } protected boolean isOneway() { return false; } public user_getFileBlocks_result getResult(I iface, user_getFileBlocks_args args) throws org.apache.thrift.TException { user_getFileBlocks_result result = new user_getFileBlocks_result(); try { result.success = iface.user_getFileBlocks(args.fileId, args.path); } catch (FileDoesNotExistException eF) { result.eF = eF; } catch (InvalidPathException eI) { result.eI = eI; } return result; } } public static class user_delete<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_delete_args> { public user_delete() { super("user_delete"); } public user_delete_args getEmptyArgsInstance() { return new user_delete_args(); } protected boolean isOneway() { return false; } public user_delete_result getResult(I iface, user_delete_args args) throws org.apache.thrift.TException { user_delete_result result = new user_delete_result(); try { result.success = iface.user_delete(args.fileId, args.path, args.recursive); result.setSuccessIsSet(true); } catch (TachyonException e) { result.e = e; } return result; } } public static class user_rename<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_rename_args> { public user_rename() { super("user_rename"); } public user_rename_args getEmptyArgsInstance() { return new user_rename_args(); } protected boolean isOneway() { return false; } public user_rename_result getResult(I iface, user_rename_args args) throws org.apache.thrift.TException { user_rename_result result = new user_rename_result(); try { result.success = iface.user_rename(args.fileId, args.srcPath, args.dstPath); result.setSuccessIsSet(true); } catch (FileAlreadyExistException eA) { result.eA = eA; } catch (FileDoesNotExistException eF) { result.eF = eF; } catch (InvalidPathException eI) { result.eI = eI; } return result; } } public static class user_setPinned<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_setPinned_args> { public user_setPinned() { super("user_setPinned"); } public user_setPinned_args getEmptyArgsInstance() { return new user_setPinned_args(); } protected boolean isOneway() { return false; } public user_setPinned_result getResult(I iface, user_setPinned_args args) throws org.apache.thrift.TException { user_setPinned_result result = new user_setPinned_result(); try { iface.user_setPinned(args.fileId, args.pinned); } catch (FileDoesNotExistException e) { result.e = e; } return result; } } public static class user_mkdirs<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_mkdirs_args> { public user_mkdirs() { super("user_mkdirs"); } public user_mkdirs_args getEmptyArgsInstance() { return new user_mkdirs_args(); } protected boolean isOneway() { return false; } public user_mkdirs_result getResult(I iface, user_mkdirs_args args) throws org.apache.thrift.TException { user_mkdirs_result result = new user_mkdirs_result(); try { result.success = iface.user_mkdirs(args.path, args.recursive); result.setSuccessIsSet(true); } catch (FileAlreadyExistException eR) { result.eR = eR; } catch (InvalidPathException eI) { result.eI = eI; } catch (TachyonException eT) { result.eT = eT; } return result; } } public static class user_createRawTable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_createRawTable_args> { public user_createRawTable() { super("user_createRawTable"); } public user_createRawTable_args getEmptyArgsInstance() { return new user_createRawTable_args(); } protected boolean isOneway() { return false; } public user_createRawTable_result getResult(I iface, user_createRawTable_args args) throws org.apache.thrift.TException { user_createRawTable_result result = new user_createRawTable_result(); try { result.success = iface.user_createRawTable(args.path, args.columns, args.metadata); result.setSuccessIsSet(true); } catch (FileAlreadyExistException eR) { result.eR = eR; } catch (InvalidPathException eI) { result.eI = eI; } catch (TableColumnException eT) { result.eT = eT; } catch (TachyonException eTa) { result.eTa = eTa; } return result; } } public static class user_getRawTableId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getRawTableId_args> { public user_getRawTableId() { super("user_getRawTableId"); } public user_getRawTableId_args getEmptyArgsInstance() { return new user_getRawTableId_args(); } protected boolean isOneway() { return false; } public user_getRawTableId_result getResult(I iface, user_getRawTableId_args args) throws org.apache.thrift.TException { user_getRawTableId_result result = new user_getRawTableId_result(); try { result.success = iface.user_getRawTableId(args.path); result.setSuccessIsSet(true); } catch (InvalidPathException e) { result.e = e; } return result; } } public static class user_getClientRawTableInfo<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getClientRawTableInfo_args> { public user_getClientRawTableInfo() { super("user_getClientRawTableInfo"); } public user_getClientRawTableInfo_args getEmptyArgsInstance() { return new user_getClientRawTableInfo_args(); } protected boolean isOneway() { return false; } public user_getClientRawTableInfo_result getResult(I iface, user_getClientRawTableInfo_args args) throws org.apache.thrift.TException { user_getClientRawTableInfo_result result = new user_getClientRawTableInfo_result(); try { result.success = iface.user_getClientRawTableInfo(args.id, args.path); } catch (TableDoesNotExistException eT) { result.eT = eT; } catch (InvalidPathException eI) { result.eI = eI; } return result; } } public static class user_updateRawTableMetadata<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_updateRawTableMetadata_args> { public user_updateRawTableMetadata() { super("user_updateRawTableMetadata"); } public user_updateRawTableMetadata_args getEmptyArgsInstance() { return new user_updateRawTableMetadata_args(); } protected boolean isOneway() { return false; } public user_updateRawTableMetadata_result getResult(I iface, user_updateRawTableMetadata_args args) throws org.apache.thrift.TException { user_updateRawTableMetadata_result result = new user_updateRawTableMetadata_result(); try { iface.user_updateRawTableMetadata(args.tableId, args.metadata); } catch (TableDoesNotExistException eT) { result.eT = eT; } catch (TachyonException eTa) { result.eTa = eTa; } return result; } } public static class user_getUfsAddress<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getUfsAddress_args> { public user_getUfsAddress() { super("user_getUfsAddress"); } public user_getUfsAddress_args getEmptyArgsInstance() { return new user_getUfsAddress_args(); } protected boolean isOneway() { return false; } public user_getUfsAddress_result getResult(I iface, user_getUfsAddress_args args) throws org.apache.thrift.TException { user_getUfsAddress_result result = new user_getUfsAddress_result(); result.success = iface.user_getUfsAddress(); return result; } } public static class user_heartbeat<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_heartbeat_args> { public user_heartbeat() { super("user_heartbeat"); } public user_heartbeat_args getEmptyArgsInstance() { return new user_heartbeat_args(); } protected boolean isOneway() { return false; } public user_heartbeat_result getResult(I iface, user_heartbeat_args args) throws org.apache.thrift.TException { user_heartbeat_result result = new user_heartbeat_result(); iface.user_heartbeat(); return result; } } public static class user_freepath<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_freepath_args> { public user_freepath() { super("user_freepath"); } public user_freepath_args getEmptyArgsInstance() { return new user_freepath_args(); } protected boolean isOneway() { return false; } public user_freepath_result getResult(I iface, user_freepath_args args) throws org.apache.thrift.TException { user_freepath_result result = new user_freepath_result(); try { result.success = iface.user_freepath(args.fileId, args.path, args.recursive); result.setSuccessIsSet(true); } catch (FileDoesNotExistException e) { result.e = e; } return result; } } } public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> { private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); public AsyncProcessor(I iface) { super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>())); } protected AsyncProcessor(I iface, Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { processMap.put("addCheckpoint", new addCheckpoint()); processMap.put("getWorkersInfo", new getWorkersInfo()); processMap.put("liststatus", new liststatus()); processMap.put("worker_register", new worker_register()); processMap.put("worker_heartbeat", new worker_heartbeat()); processMap.put("worker_cacheBlock", new worker_cacheBlock()); processMap.put("worker_getPinIdList", new worker_getPinIdList()); processMap.put("worker_getPriorityDependencyList", new worker_getPriorityDependencyList()); processMap.put("user_createDependency", new user_createDependency()); processMap.put("user_getClientDependencyInfo", new user_getClientDependencyInfo()); processMap.put("user_reportLostFile", new user_reportLostFile()); processMap.put("user_requestFilesInDependency", new user_requestFilesInDependency()); processMap.put("user_createFile", new user_createFile()); processMap.put("user_createNewBlock", new user_createNewBlock()); processMap.put("user_completeFile", new user_completeFile()); processMap.put("user_getUserId", new user_getUserId()); processMap.put("user_getBlockId", new user_getBlockId()); processMap.put("user_getWorker", new user_getWorker()); processMap.put("getFileStatus", new getFileStatus()); processMap.put("user_getClientBlockInfo", new user_getClientBlockInfo()); processMap.put("user_getFileBlocks", new user_getFileBlocks()); processMap.put("user_delete", new user_delete()); processMap.put("user_rename", new user_rename()); processMap.put("user_setPinned", new user_setPinned()); processMap.put("user_mkdirs", new user_mkdirs()); processMap.put("user_createRawTable", new user_createRawTable()); processMap.put("user_getRawTableId", new user_getRawTableId()); processMap.put("user_getClientRawTableInfo", new user_getClientRawTableInfo()); processMap.put("user_updateRawTableMetadata", new user_updateRawTableMetadata()); processMap.put("user_getUfsAddress", new user_getUfsAddress()); processMap.put("user_heartbeat", new user_heartbeat()); processMap.put("user_freepath", new user_freepath()); return processMap; } public static class addCheckpoint<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addCheckpoint_args, Boolean> { public addCheckpoint() { super("addCheckpoint"); } public addCheckpoint_args getEmptyArgsInstance() { return new addCheckpoint_args(); } public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Boolean>() { public void onComplete(Boolean o) { addCheckpoint_result result = new addCheckpoint_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; addCheckpoint_result result = new addCheckpoint_result(); if (e instanceof FileDoesNotExistException) { result.eP = (FileDoesNotExistException) e; result.setEPIsSet(true); msg = result; } else if (e instanceof SuspectedFileSizeException) { result.eS = (SuspectedFileSizeException) e; result.setESIsSet(true); msg = result; } else if (e instanceof BlockInfoException) { result.eB = (BlockInfoException) e; result.setEBIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, addCheckpoint_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { iface.addCheckpoint(args.workerId, args.fileId, args.length, args.checkpointPath,resultHandler); } } public static class getWorkersInfo<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getWorkersInfo_args, List<ClientWorkerInfo>> { public getWorkersInfo() { super("getWorkersInfo"); } public getWorkersInfo_args getEmptyArgsInstance() { return new getWorkersInfo_args(); } public AsyncMethodCallback<List<ClientWorkerInfo>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<List<ClientWorkerInfo>>() { public void onComplete(List<ClientWorkerInfo> o) { getWorkersInfo_result result = new getWorkersInfo_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; getWorkersInfo_result result = new getWorkersInfo_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, getWorkersInfo_args args, org.apache.thrift.async.AsyncMethodCallback<List<ClientWorkerInfo>> resultHandler) throws TException { iface.getWorkersInfo(resultHandler); } } public static class liststatus<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, liststatus_args, List<ClientFileInfo>> { public liststatus() { super("liststatus"); } public liststatus_args getEmptyArgsInstance() { return new liststatus_args(); } public AsyncMethodCallback<List<ClientFileInfo>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<List<ClientFileInfo>>() { public void onComplete(List<ClientFileInfo> o) { liststatus_result result = new liststatus_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; liststatus_result result = new liststatus_result(); if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else if (e instanceof FileDoesNotExistException) { result.eF = (FileDoesNotExistException) e; result.setEFIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, liststatus_args args, org.apache.thrift.async.AsyncMethodCallback<List<ClientFileInfo>> resultHandler) throws TException { iface.liststatus(args.path,resultHandler); } } public static class worker_register<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, worker_register_args, Long> { public worker_register() { super("worker_register"); } public worker_register_args getEmptyArgsInstance() { return new worker_register_args(); } public AsyncMethodCallback<Long> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Long>() { public void onComplete(Long o) { worker_register_result result = new worker_register_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; worker_register_result result = new worker_register_result(); if (e instanceof BlockInfoException) { result.e = (BlockInfoException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, worker_register_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException { iface.worker_register(args.workerNetAddress, args.totalBytes, args.usedBytes, args.currentBlocks,resultHandler); } } public static class worker_heartbeat<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, worker_heartbeat_args, Command> { public worker_heartbeat() { super("worker_heartbeat"); } public worker_heartbeat_args getEmptyArgsInstance() { return new worker_heartbeat_args(); } public AsyncMethodCallback<Command> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Command>() { public void onComplete(Command o) { worker_heartbeat_result result = new worker_heartbeat_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; worker_heartbeat_result result = new worker_heartbeat_result(); if (e instanceof BlockInfoException) { result.e = (BlockInfoException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, worker_heartbeat_args args, org.apache.thrift.async.AsyncMethodCallback<Command> resultHandler) throws TException { iface.worker_heartbeat(args.workerId, args.usedBytes, args.removedBlocks,resultHandler); } } public static class worker_cacheBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, worker_cacheBlock_args, Void> { public worker_cacheBlock() { super("worker_cacheBlock"); } public worker_cacheBlock_args getEmptyArgsInstance() { return new worker_cacheBlock_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { worker_cacheBlock_result result = new worker_cacheBlock_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; worker_cacheBlock_result result = new worker_cacheBlock_result(); if (e instanceof FileDoesNotExistException) { result.eP = (FileDoesNotExistException) e; result.setEPIsSet(true); msg = result; } else if (e instanceof SuspectedFileSizeException) { result.eS = (SuspectedFileSizeException) e; result.setESIsSet(true); msg = result; } else if (e instanceof BlockInfoException) { result.eB = (BlockInfoException) e; result.setEBIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, worker_cacheBlock_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.worker_cacheBlock(args.workerId, args.workerUsedBytes, args.blockId, args.length,resultHandler); } } public static class worker_getPinIdList<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, worker_getPinIdList_args, Set<Integer>> { public worker_getPinIdList() { super("worker_getPinIdList"); } public worker_getPinIdList_args getEmptyArgsInstance() { return new worker_getPinIdList_args(); } public AsyncMethodCallback<Set<Integer>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Set<Integer>>() { public void onComplete(Set<Integer> o) { worker_getPinIdList_result result = new worker_getPinIdList_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; worker_getPinIdList_result result = new worker_getPinIdList_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, worker_getPinIdList_args args, org.apache.thrift.async.AsyncMethodCallback<Set<Integer>> resultHandler) throws TException { iface.worker_getPinIdList(resultHandler); } } public static class worker_getPriorityDependencyList<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, worker_getPriorityDependencyList_args, List<Integer>> { public worker_getPriorityDependencyList() { super("worker_getPriorityDependencyList"); } public worker_getPriorityDependencyList_args getEmptyArgsInstance() { return new worker_getPriorityDependencyList_args(); } public AsyncMethodCallback<List<Integer>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<List<Integer>>() { public void onComplete(List<Integer> o) { worker_getPriorityDependencyList_result result = new worker_getPriorityDependencyList_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; worker_getPriorityDependencyList_result result = new worker_getPriorityDependencyList_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, worker_getPriorityDependencyList_args args, org.apache.thrift.async.AsyncMethodCallback<List<Integer>> resultHandler) throws TException { iface.worker_getPriorityDependencyList(resultHandler); } } public static class user_createDependency<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_createDependency_args, Integer> { public user_createDependency() { super("user_createDependency"); } public user_createDependency_args getEmptyArgsInstance() { return new user_createDependency_args(); } public AsyncMethodCallback<Integer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Integer>() { public void onComplete(Integer o) { user_createDependency_result result = new user_createDependency_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_createDependency_result result = new user_createDependency_result(); if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else if (e instanceof FileDoesNotExistException) { result.eF = (FileDoesNotExistException) e; result.setEFIsSet(true); msg = result; } else if (e instanceof FileAlreadyExistException) { result.eA = (FileAlreadyExistException) e; result.setEAIsSet(true); msg = result; } else if (e instanceof BlockInfoException) { result.eB = (BlockInfoException) e; result.setEBIsSet(true); msg = result; } else if (e instanceof TachyonException) { result.eT = (TachyonException) e; result.setETIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_createDependency_args args, org.apache.thrift.async.AsyncMethodCallback<Integer> resultHandler) throws TException { iface.user_createDependency(args.parents, args.children, args.commandPrefix, args.data, args.comment, args.framework, args.frameworkVersion, args.dependencyType, args.childrenBlockSizeByte,resultHandler); } } public static class user_getClientDependencyInfo<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getClientDependencyInfo_args, ClientDependencyInfo> { public user_getClientDependencyInfo() { super("user_getClientDependencyInfo"); } public user_getClientDependencyInfo_args getEmptyArgsInstance() { return new user_getClientDependencyInfo_args(); } public AsyncMethodCallback<ClientDependencyInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<ClientDependencyInfo>() { public void onComplete(ClientDependencyInfo o) { user_getClientDependencyInfo_result result = new user_getClientDependencyInfo_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getClientDependencyInfo_result result = new user_getClientDependencyInfo_result(); if (e instanceof DependencyDoesNotExistException) { result.e = (DependencyDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getClientDependencyInfo_args args, org.apache.thrift.async.AsyncMethodCallback<ClientDependencyInfo> resultHandler) throws TException { iface.user_getClientDependencyInfo(args.dependencyId,resultHandler); } } public static class user_reportLostFile<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_reportLostFile_args, Void> { public user_reportLostFile() { super("user_reportLostFile"); } public user_reportLostFile_args getEmptyArgsInstance() { return new user_reportLostFile_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { user_reportLostFile_result result = new user_reportLostFile_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_reportLostFile_result result = new user_reportLostFile_result(); if (e instanceof FileDoesNotExistException) { result.e = (FileDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_reportLostFile_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.user_reportLostFile(args.fileId,resultHandler); } } public static class user_requestFilesInDependency<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_requestFilesInDependency_args, Void> { public user_requestFilesInDependency() { super("user_requestFilesInDependency"); } public user_requestFilesInDependency_args getEmptyArgsInstance() { return new user_requestFilesInDependency_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { user_requestFilesInDependency_result result = new user_requestFilesInDependency_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_requestFilesInDependency_result result = new user_requestFilesInDependency_result(); if (e instanceof DependencyDoesNotExistException) { result.e = (DependencyDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_requestFilesInDependency_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.user_requestFilesInDependency(args.depId,resultHandler); } } public static class user_createFile<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_createFile_args, Integer> { public user_createFile() { super("user_createFile"); } public user_createFile_args getEmptyArgsInstance() { return new user_createFile_args(); } public AsyncMethodCallback<Integer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Integer>() { public void onComplete(Integer o) { user_createFile_result result = new user_createFile_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_createFile_result result = new user_createFile_result(); if (e instanceof FileAlreadyExistException) { result.eR = (FileAlreadyExistException) e; result.setERIsSet(true); msg = result; } else if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else if (e instanceof BlockInfoException) { result.eB = (BlockInfoException) e; result.setEBIsSet(true); msg = result; } else if (e instanceof SuspectedFileSizeException) { result.eS = (SuspectedFileSizeException) e; result.setESIsSet(true); msg = result; } else if (e instanceof TachyonException) { result.eT = (TachyonException) e; result.setETIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_createFile_args args, org.apache.thrift.async.AsyncMethodCallback<Integer> resultHandler) throws TException { iface.user_createFile(args.path, args.ufsPath, args.blockSizeByte, args.recursive,resultHandler); } } public static class user_createNewBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_createNewBlock_args, Long> { public user_createNewBlock() { super("user_createNewBlock"); } public user_createNewBlock_args getEmptyArgsInstance() { return new user_createNewBlock_args(); } public AsyncMethodCallback<Long> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Long>() { public void onComplete(Long o) { user_createNewBlock_result result = new user_createNewBlock_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_createNewBlock_result result = new user_createNewBlock_result(); if (e instanceof FileDoesNotExistException) { result.e = (FileDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_createNewBlock_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException { iface.user_createNewBlock(args.fileId,resultHandler); } } public static class user_completeFile<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_completeFile_args, Void> { public user_completeFile() { super("user_completeFile"); } public user_completeFile_args getEmptyArgsInstance() { return new user_completeFile_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { user_completeFile_result result = new user_completeFile_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_completeFile_result result = new user_completeFile_result(); if (e instanceof FileDoesNotExistException) { result.e = (FileDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_completeFile_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.user_completeFile(args.fileId,resultHandler); } } public static class user_getUserId<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getUserId_args, Long> { public user_getUserId() { super("user_getUserId"); } public user_getUserId_args getEmptyArgsInstance() { return new user_getUserId_args(); } public AsyncMethodCallback<Long> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Long>() { public void onComplete(Long o) { user_getUserId_result result = new user_getUserId_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getUserId_result result = new user_getUserId_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getUserId_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException { iface.user_getUserId(resultHandler); } } public static class user_getBlockId<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getBlockId_args, Long> { public user_getBlockId() { super("user_getBlockId"); } public user_getBlockId_args getEmptyArgsInstance() { return new user_getBlockId_args(); } public AsyncMethodCallback<Long> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Long>() { public void onComplete(Long o) { user_getBlockId_result result = new user_getBlockId_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getBlockId_result result = new user_getBlockId_result(); if (e instanceof FileDoesNotExistException) { result.e = (FileDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getBlockId_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException { iface.user_getBlockId(args.fileId, args.index,resultHandler); } } public static class user_getWorker<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getWorker_args, NetAddress> { public user_getWorker() { super("user_getWorker"); } public user_getWorker_args getEmptyArgsInstance() { return new user_getWorker_args(); } public AsyncMethodCallback<NetAddress> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<NetAddress>() { public void onComplete(NetAddress o) { user_getWorker_result result = new user_getWorker_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getWorker_result result = new user_getWorker_result(); if (e instanceof NoWorkerException) { result.e = (NoWorkerException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getWorker_args args, org.apache.thrift.async.AsyncMethodCallback<NetAddress> resultHandler) throws TException { iface.user_getWorker(args.random, args.host,resultHandler); } } public static class getFileStatus<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getFileStatus_args, ClientFileInfo> { public getFileStatus() { super("getFileStatus"); } public getFileStatus_args getEmptyArgsInstance() { return new getFileStatus_args(); } public AsyncMethodCallback<ClientFileInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<ClientFileInfo>() { public void onComplete(ClientFileInfo o) { getFileStatus_result result = new getFileStatus_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; getFileStatus_result result = new getFileStatus_result(); if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, getFileStatus_args args, org.apache.thrift.async.AsyncMethodCallback<ClientFileInfo> resultHandler) throws TException { iface.getFileStatus(args.fileId, args.path,resultHandler); } } public static class user_getClientBlockInfo<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getClientBlockInfo_args, ClientBlockInfo> { public user_getClientBlockInfo() { super("user_getClientBlockInfo"); } public user_getClientBlockInfo_args getEmptyArgsInstance() { return new user_getClientBlockInfo_args(); } public AsyncMethodCallback<ClientBlockInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<ClientBlockInfo>() { public void onComplete(ClientBlockInfo o) { user_getClientBlockInfo_result result = new user_getClientBlockInfo_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getClientBlockInfo_result result = new user_getClientBlockInfo_result(); if (e instanceof FileDoesNotExistException) { result.eF = (FileDoesNotExistException) e; result.setEFIsSet(true); msg = result; } else if (e instanceof BlockInfoException) { result.eB = (BlockInfoException) e; result.setEBIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getClientBlockInfo_args args, org.apache.thrift.async.AsyncMethodCallback<ClientBlockInfo> resultHandler) throws TException { iface.user_getClientBlockInfo(args.blockId,resultHandler); } } public static class user_getFileBlocks<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getFileBlocks_args, List<ClientBlockInfo>> { public user_getFileBlocks() { super("user_getFileBlocks"); } public user_getFileBlocks_args getEmptyArgsInstance() { return new user_getFileBlocks_args(); } public AsyncMethodCallback<List<ClientBlockInfo>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<List<ClientBlockInfo>>() { public void onComplete(List<ClientBlockInfo> o) { user_getFileBlocks_result result = new user_getFileBlocks_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getFileBlocks_result result = new user_getFileBlocks_result(); if (e instanceof FileDoesNotExistException) { result.eF = (FileDoesNotExistException) e; result.setEFIsSet(true); msg = result; } else if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getFileBlocks_args args, org.apache.thrift.async.AsyncMethodCallback<List<ClientBlockInfo>> resultHandler) throws TException { iface.user_getFileBlocks(args.fileId, args.path,resultHandler); } } public static class user_delete<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_delete_args, Boolean> { public user_delete() { super("user_delete"); } public user_delete_args getEmptyArgsInstance() { return new user_delete_args(); } public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Boolean>() { public void onComplete(Boolean o) { user_delete_result result = new user_delete_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_delete_result result = new user_delete_result(); if (e instanceof TachyonException) { result.e = (TachyonException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_delete_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { iface.user_delete(args.fileId, args.path, args.recursive,resultHandler); } } public static class user_rename<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_rename_args, Boolean> { public user_rename() { super("user_rename"); } public user_rename_args getEmptyArgsInstance() { return new user_rename_args(); } public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Boolean>() { public void onComplete(Boolean o) { user_rename_result result = new user_rename_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_rename_result result = new user_rename_result(); if (e instanceof FileAlreadyExistException) { result.eA = (FileAlreadyExistException) e; result.setEAIsSet(true); msg = result; } else if (e instanceof FileDoesNotExistException) { result.eF = (FileDoesNotExistException) e; result.setEFIsSet(true); msg = result; } else if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_rename_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { iface.user_rename(args.fileId, args.srcPath, args.dstPath,resultHandler); } } public static class user_setPinned<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_setPinned_args, Void> { public user_setPinned() { super("user_setPinned"); } public user_setPinned_args getEmptyArgsInstance() { return new user_setPinned_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { user_setPinned_result result = new user_setPinned_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_setPinned_result result = new user_setPinned_result(); if (e instanceof FileDoesNotExistException) { result.e = (FileDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_setPinned_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.user_setPinned(args.fileId, args.pinned,resultHandler); } } public static class user_mkdirs<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_mkdirs_args, Boolean> { public user_mkdirs() { super("user_mkdirs"); } public user_mkdirs_args getEmptyArgsInstance() { return new user_mkdirs_args(); } public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Boolean>() { public void onComplete(Boolean o) { user_mkdirs_result result = new user_mkdirs_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_mkdirs_result result = new user_mkdirs_result(); if (e instanceof FileAlreadyExistException) { result.eR = (FileAlreadyExistException) e; result.setERIsSet(true); msg = result; } else if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else if (e instanceof TachyonException) { result.eT = (TachyonException) e; result.setETIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_mkdirs_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { iface.user_mkdirs(args.path, args.recursive,resultHandler); } } public static class user_createRawTable<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_createRawTable_args, Integer> { public user_createRawTable() { super("user_createRawTable"); } public user_createRawTable_args getEmptyArgsInstance() { return new user_createRawTable_args(); } public AsyncMethodCallback<Integer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Integer>() { public void onComplete(Integer o) { user_createRawTable_result result = new user_createRawTable_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_createRawTable_result result = new user_createRawTable_result(); if (e instanceof FileAlreadyExistException) { result.eR = (FileAlreadyExistException) e; result.setERIsSet(true); msg = result; } else if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else if (e instanceof TableColumnException) { result.eT = (TableColumnException) e; result.setETIsSet(true); msg = result; } else if (e instanceof TachyonException) { result.eTa = (TachyonException) e; result.setETaIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_createRawTable_args args, org.apache.thrift.async.AsyncMethodCallback<Integer> resultHandler) throws TException { iface.user_createRawTable(args.path, args.columns, args.metadata,resultHandler); } } public static class user_getRawTableId<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getRawTableId_args, Integer> { public user_getRawTableId() { super("user_getRawTableId"); } public user_getRawTableId_args getEmptyArgsInstance() { return new user_getRawTableId_args(); } public AsyncMethodCallback<Integer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Integer>() { public void onComplete(Integer o) { user_getRawTableId_result result = new user_getRawTableId_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getRawTableId_result result = new user_getRawTableId_result(); if (e instanceof InvalidPathException) { result.e = (InvalidPathException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getRawTableId_args args, org.apache.thrift.async.AsyncMethodCallback<Integer> resultHandler) throws TException { iface.user_getRawTableId(args.path,resultHandler); } } public static class user_getClientRawTableInfo<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getClientRawTableInfo_args, ClientRawTableInfo> { public user_getClientRawTableInfo() { super("user_getClientRawTableInfo"); } public user_getClientRawTableInfo_args getEmptyArgsInstance() { return new user_getClientRawTableInfo_args(); } public AsyncMethodCallback<ClientRawTableInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<ClientRawTableInfo>() { public void onComplete(ClientRawTableInfo o) { user_getClientRawTableInfo_result result = new user_getClientRawTableInfo_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getClientRawTableInfo_result result = new user_getClientRawTableInfo_result(); if (e instanceof TableDoesNotExistException) { result.eT = (TableDoesNotExistException) e; result.setETIsSet(true); msg = result; } else if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getClientRawTableInfo_args args, org.apache.thrift.async.AsyncMethodCallback<ClientRawTableInfo> resultHandler) throws TException { iface.user_getClientRawTableInfo(args.id, args.path,resultHandler); } } public static class user_updateRawTableMetadata<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_updateRawTableMetadata_args, Void> { public user_updateRawTableMetadata() { super("user_updateRawTableMetadata"); } public user_updateRawTableMetadata_args getEmptyArgsInstance() { return new user_updateRawTableMetadata_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { user_updateRawTableMetadata_result result = new user_updateRawTableMetadata_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_updateRawTableMetadata_result result = new user_updateRawTableMetadata_result(); if (e instanceof TableDoesNotExistException) { result.eT = (TableDoesNotExistException) e; result.setETIsSet(true); msg = result; } else if (e instanceof TachyonException) { result.eTa = (TachyonException) e; result.setETaIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_updateRawTableMetadata_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.user_updateRawTableMetadata(args.tableId, args.metadata,resultHandler); } } public static class user_getUfsAddress<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getUfsAddress_args, String> { public user_getUfsAddress() { super("user_getUfsAddress"); } public user_getUfsAddress_args getEmptyArgsInstance() { return new user_getUfsAddress_args(); } public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<String>() { public void onComplete(String o) { user_getUfsAddress_result result = new user_getUfsAddress_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getUfsAddress_result result = new user_getUfsAddress_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getUfsAddress_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException { iface.user_getUfsAddress(resultHandler); } } public static class user_heartbeat<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_heartbeat_args, Void> { public user_heartbeat() { super("user_heartbeat"); } public user_heartbeat_args getEmptyArgsInstance() { return new user_heartbeat_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { user_heartbeat_result result = new user_heartbeat_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_heartbeat_result result = new user_heartbeat_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_heartbeat_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.user_heartbeat(resultHandler); } } public static class user_freepath<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_freepath_args, Boolean> { public user_freepath() { super("user_freepath"); } public user_freepath_args getEmptyArgsInstance() { return new user_freepath_args(); } public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Boolean>() { public void onComplete(Boolean o) { user_freepath_result result = new user_freepath_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_freepath_result result = new user_freepath_result(); if (e instanceof FileDoesNotExistException) { result.e = (FileDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_freepath_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { iface.user_freepath(args.fileId, args.path, args.recursive,resultHandler); } } } public static class addCheckpoint_args implements org.apache.thrift.TBase<addCheckpoint_args, addCheckpoint_args._Fields>, java.io.Serializable, Cloneable, Comparable<addCheckpoint_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addCheckpoint_args"); private static final org.apache.thrift.protocol.TField WORKER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("workerId", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField LENGTH_FIELD_DESC = new org.apache.thrift.protocol.TField("length", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField CHECKPOINT_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("checkpointPath", org.apache.thrift.protocol.TType.STRING, (short)4); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new addCheckpoint_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new addCheckpoint_argsTupleSchemeFactory()); } public long workerId; // required public int fileId; // required public long length; // required public String checkpointPath; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { WORKER_ID((short)1, "workerId"), FILE_ID((short)2, "fileId"), LENGTH((short)3, "length"), CHECKPOINT_PATH((short)4, "checkpointPath"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // WORKER_ID return WORKER_ID; case 2: // FILE_ID return FILE_ID; case 3: // LENGTH return LENGTH; case 4: // CHECKPOINT_PATH return CHECKPOINT_PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __WORKERID_ISSET_ID = 0; private static final int __FILEID_ISSET_ID = 1; private static final int __LENGTH_ISSET_ID = 2; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.WORKER_ID, new org.apache.thrift.meta_data.FieldMetaData("workerId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.LENGTH, new org.apache.thrift.meta_data.FieldMetaData("length", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.CHECKPOINT_PATH, new org.apache.thrift.meta_data.FieldMetaData("checkpointPath", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addCheckpoint_args.class, metaDataMap); } public addCheckpoint_args() { } public addCheckpoint_args( long workerId, int fileId, long length, String checkpointPath) { this(); this.workerId = workerId; setWorkerIdIsSet(true); this.fileId = fileId; setFileIdIsSet(true); this.length = length; setLengthIsSet(true); this.checkpointPath = checkpointPath; } /** * Performs a deep copy on <i>other</i>. */ public addCheckpoint_args(addCheckpoint_args other) { __isset_bitfield = other.__isset_bitfield; this.workerId = other.workerId; this.fileId = other.fileId; this.length = other.length; if (other.isSetCheckpointPath()) { this.checkpointPath = other.checkpointPath; } } public addCheckpoint_args deepCopy() { return new addCheckpoint_args(this); } @Override public void clear() { setWorkerIdIsSet(false); this.workerId = 0; setFileIdIsSet(false); this.fileId = 0; setLengthIsSet(false); this.length = 0; this.checkpointPath = null; } public long getWorkerId() { return this.workerId; } public addCheckpoint_args setWorkerId(long workerId) { this.workerId = workerId; setWorkerIdIsSet(true); return this; } public void unsetWorkerId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WORKERID_ISSET_ID); } /** Returns true if field workerId is set (has been assigned a value) and false otherwise */ public boolean isSetWorkerId() { return EncodingUtils.testBit(__isset_bitfield, __WORKERID_ISSET_ID); } public void setWorkerIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WORKERID_ISSET_ID, value); } public int getFileId() { return this.fileId; } public addCheckpoint_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public long getLength() { return this.length; } public addCheckpoint_args setLength(long length) { this.length = length; setLengthIsSet(true); return this; } public void unsetLength() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LENGTH_ISSET_ID); } /** Returns true if field length is set (has been assigned a value) and false otherwise */ public boolean isSetLength() { return EncodingUtils.testBit(__isset_bitfield, __LENGTH_ISSET_ID); } public void setLengthIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LENGTH_ISSET_ID, value); } public String getCheckpointPath() { return this.checkpointPath; } public addCheckpoint_args setCheckpointPath(String checkpointPath) { this.checkpointPath = checkpointPath; return this; } public void unsetCheckpointPath() { this.checkpointPath = null; } /** Returns true if field checkpointPath is set (has been assigned a value) and false otherwise */ public boolean isSetCheckpointPath() { return this.checkpointPath != null; } public void setCheckpointPathIsSet(boolean value) { if (!value) { this.checkpointPath = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case WORKER_ID: if (value == null) { unsetWorkerId(); } else { setWorkerId((Long)value); } break; case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case LENGTH: if (value == null) { unsetLength(); } else { setLength((Long)value); } break; case CHECKPOINT_PATH: if (value == null) { unsetCheckpointPath(); } else { setCheckpointPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case WORKER_ID: return Long.valueOf(getWorkerId()); case FILE_ID: return Integer.valueOf(getFileId()); case LENGTH: return Long.valueOf(getLength()); case CHECKPOINT_PATH: return getCheckpointPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case WORKER_ID: return isSetWorkerId(); case FILE_ID: return isSetFileId(); case LENGTH: return isSetLength(); case CHECKPOINT_PATH: return isSetCheckpointPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof addCheckpoint_args) return this.equals((addCheckpoint_args)that); return false; } public boolean equals(addCheckpoint_args that) { if (that == null) return false; boolean this_present_workerId = true; boolean that_present_workerId = true; if (this_present_workerId || that_present_workerId) { if (!(this_present_workerId && that_present_workerId)) return false; if (this.workerId != that.workerId) return false; } boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_length = true; boolean that_present_length = true; if (this_present_length || that_present_length) { if (!(this_present_length && that_present_length)) return false; if (this.length != that.length) return false; } boolean this_present_checkpointPath = true && this.isSetCheckpointPath(); boolean that_present_checkpointPath = true && that.isSetCheckpointPath(); if (this_present_checkpointPath || that_present_checkpointPath) { if (!(this_present_checkpointPath && that_present_checkpointPath)) return false; if (!this.checkpointPath.equals(that.checkpointPath)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(addCheckpoint_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetWorkerId()).compareTo(other.isSetWorkerId()); if (lastComparison != 0) { return lastComparison; } if (isSetWorkerId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workerId, other.workerId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetLength()).compareTo(other.isSetLength()); if (lastComparison != 0) { return lastComparison; } if (isSetLength()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.length, other.length); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetCheckpointPath()).compareTo(other.isSetCheckpointPath()); if (lastComparison != 0) { return lastComparison; } if (isSetCheckpointPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.checkpointPath, other.checkpointPath); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("addCheckpoint_args("); boolean first = true; sb.append("workerId:"); sb.append(this.workerId); first = false; if (!first) sb.append(", "); sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("length:"); sb.append(this.length); first = false; if (!first) sb.append(", "); sb.append("checkpointPath:"); if (this.checkpointPath == null) { sb.append("null"); } else { sb.append(this.checkpointPath); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class addCheckpoint_argsStandardSchemeFactory implements SchemeFactory { public addCheckpoint_argsStandardScheme getScheme() { return new addCheckpoint_argsStandardScheme(); } } private static class addCheckpoint_argsStandardScheme extends StandardScheme<addCheckpoint_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, addCheckpoint_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // WORKER_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.workerId = iprot.readI64(); struct.setWorkerIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // LENGTH if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.length = iprot.readI64(); struct.setLengthIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // CHECKPOINT_PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.checkpointPath = iprot.readString(); struct.setCheckpointPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, addCheckpoint_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(WORKER_ID_FIELD_DESC); oprot.writeI64(struct.workerId); oprot.writeFieldEnd(); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); oprot.writeFieldBegin(LENGTH_FIELD_DESC); oprot.writeI64(struct.length); oprot.writeFieldEnd(); if (struct.checkpointPath != null) { oprot.writeFieldBegin(CHECKPOINT_PATH_FIELD_DESC); oprot.writeString(struct.checkpointPath); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class addCheckpoint_argsTupleSchemeFactory implements SchemeFactory { public addCheckpoint_argsTupleScheme getScheme() { return new addCheckpoint_argsTupleScheme(); } } private static class addCheckpoint_argsTupleScheme extends TupleScheme<addCheckpoint_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetWorkerId()) { optionals.set(0); } if (struct.isSetFileId()) { optionals.set(1); } if (struct.isSetLength()) { optionals.set(2); } if (struct.isSetCheckpointPath()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetWorkerId()) { oprot.writeI64(struct.workerId); } if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetLength()) { oprot.writeI64(struct.length); } if (struct.isSetCheckpointPath()) { oprot.writeString(struct.checkpointPath); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.workerId = iprot.readI64(); struct.setWorkerIdIsSet(true); } if (incoming.get(1)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(2)) { struct.length = iprot.readI64(); struct.setLengthIsSet(true); } if (incoming.get(3)) { struct.checkpointPath = iprot.readString(); struct.setCheckpointPathIsSet(true); } } } } public static class addCheckpoint_result implements org.apache.thrift.TBase<addCheckpoint_result, addCheckpoint_result._Fields>, java.io.Serializable, Cloneable, Comparable<addCheckpoint_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addCheckpoint_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); private static final org.apache.thrift.protocol.TField E_P_FIELD_DESC = new org.apache.thrift.protocol.TField("eP", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_S_FIELD_DESC = new org.apache.thrift.protocol.TField("eS", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField E_B_FIELD_DESC = new org.apache.thrift.protocol.TField("eB", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new addCheckpoint_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new addCheckpoint_resultTupleSchemeFactory()); } public boolean success; // required public FileDoesNotExistException eP; // required public SuspectedFileSizeException eS; // required public BlockInfoException eB; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_P((short)1, "eP"), E_S((short)2, "eS"), E_B((short)3, "eB"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_P return E_P; case 2: // E_S return E_S; case 3: // E_B return E_B; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.E_P, new org.apache.thrift.meta_data.FieldMetaData("eP", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_S, new org.apache.thrift.meta_data.FieldMetaData("eS", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_B, new org.apache.thrift.meta_data.FieldMetaData("eB", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addCheckpoint_result.class, metaDataMap); } public addCheckpoint_result() { } public addCheckpoint_result( boolean success, FileDoesNotExistException eP, SuspectedFileSizeException eS, BlockInfoException eB) { this(); this.success = success; setSuccessIsSet(true); this.eP = eP; this.eS = eS; this.eB = eB; } /** * Performs a deep copy on <i>other</i>. */ public addCheckpoint_result(addCheckpoint_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetEP()) { this.eP = new FileDoesNotExistException(other.eP); } if (other.isSetES()) { this.eS = new SuspectedFileSizeException(other.eS); } if (other.isSetEB()) { this.eB = new BlockInfoException(other.eB); } } public addCheckpoint_result deepCopy() { return new addCheckpoint_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = false; this.eP = null; this.eS = null; this.eB = null; } public boolean isSuccess() { return this.success; } public addCheckpoint_result setSuccess(boolean success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileDoesNotExistException getEP() { return this.eP; } public addCheckpoint_result setEP(FileDoesNotExistException eP) { this.eP = eP; return this; } public void unsetEP() { this.eP = null; } /** Returns true if field eP is set (has been assigned a value) and false otherwise */ public boolean isSetEP() { return this.eP != null; } public void setEPIsSet(boolean value) { if (!value) { this.eP = null; } } public SuspectedFileSizeException getES() { return this.eS; } public addCheckpoint_result setES(SuspectedFileSizeException eS) { this.eS = eS; return this; } public void unsetES() { this.eS = null; } /** Returns true if field eS is set (has been assigned a value) and false otherwise */ public boolean isSetES() { return this.eS != null; } public void setESIsSet(boolean value) { if (!value) { this.eS = null; } } public BlockInfoException getEB() { return this.eB; } public addCheckpoint_result setEB(BlockInfoException eB) { this.eB = eB; return this; } public void unsetEB() { this.eB = null; } /** Returns true if field eB is set (has been assigned a value) and false otherwise */ public boolean isSetEB() { return this.eB != null; } public void setEBIsSet(boolean value) { if (!value) { this.eB = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Boolean)value); } break; case E_P: if (value == null) { unsetEP(); } else { setEP((FileDoesNotExistException)value); } break; case E_S: if (value == null) { unsetES(); } else { setES((SuspectedFileSizeException)value); } break; case E_B: if (value == null) { unsetEB(); } else { setEB((BlockInfoException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Boolean.valueOf(isSuccess()); case E_P: return getEP(); case E_S: return getES(); case E_B: return getEB(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_P: return isSetEP(); case E_S: return isSetES(); case E_B: return isSetEB(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof addCheckpoint_result) return this.equals((addCheckpoint_result)that); return false; } public boolean equals(addCheckpoint_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_eP = true && this.isSetEP(); boolean that_present_eP = true && that.isSetEP(); if (this_present_eP || that_present_eP) { if (!(this_present_eP && that_present_eP)) return false; if (!this.eP.equals(that.eP)) return false; } boolean this_present_eS = true && this.isSetES(); boolean that_present_eS = true && that.isSetES(); if (this_present_eS || that_present_eS) { if (!(this_present_eS && that_present_eS)) return false; if (!this.eS.equals(that.eS)) return false; } boolean this_present_eB = true && this.isSetEB(); boolean that_present_eB = true && that.isSetEB(); if (this_present_eB || that_present_eB) { if (!(this_present_eB && that_present_eB)) return false; if (!this.eB.equals(that.eB)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(addCheckpoint_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEP()).compareTo(other.isSetEP()); if (lastComparison != 0) { return lastComparison; } if (isSetEP()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eP, other.eP); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetES()).compareTo(other.isSetES()); if (lastComparison != 0) { return lastComparison; } if (isSetES()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eS, other.eS); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEB()).compareTo(other.isSetEB()); if (lastComparison != 0) { return lastComparison; } if (isSetEB()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eB, other.eB); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("addCheckpoint_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("eP:"); if (this.eP == null) { sb.append("null"); } else { sb.append(this.eP); } first = false; if (!first) sb.append(", "); sb.append("eS:"); if (this.eS == null) { sb.append("null"); } else { sb.append(this.eS); } first = false; if (!first) sb.append(", "); sb.append("eB:"); if (this.eB == null) { sb.append("null"); } else { sb.append(this.eB); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class addCheckpoint_resultStandardSchemeFactory implements SchemeFactory { public addCheckpoint_resultStandardScheme getScheme() { return new addCheckpoint_resultStandardScheme(); } } private static class addCheckpoint_resultStandardScheme extends StandardScheme<addCheckpoint_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, addCheckpoint_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_P if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eP = new FileDoesNotExistException(); struct.eP.read(iprot); struct.setEPIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_S if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eS = new SuspectedFileSizeException(); struct.eS.read(iprot); struct.setESIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // E_B if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, addCheckpoint_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeBool(struct.success); oprot.writeFieldEnd(); } if (struct.eP != null) { oprot.writeFieldBegin(E_P_FIELD_DESC); struct.eP.write(oprot); oprot.writeFieldEnd(); } if (struct.eS != null) { oprot.writeFieldBegin(E_S_FIELD_DESC); struct.eS.write(oprot); oprot.writeFieldEnd(); } if (struct.eB != null) { oprot.writeFieldBegin(E_B_FIELD_DESC); struct.eB.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class addCheckpoint_resultTupleSchemeFactory implements SchemeFactory { public addCheckpoint_resultTupleScheme getScheme() { return new addCheckpoint_resultTupleScheme(); } } private static class addCheckpoint_resultTupleScheme extends TupleScheme<addCheckpoint_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetEP()) { optionals.set(1); } if (struct.isSetES()) { optionals.set(2); } if (struct.isSetEB()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { oprot.writeBool(struct.success); } if (struct.isSetEP()) { struct.eP.write(oprot); } if (struct.isSetES()) { struct.eS.write(oprot); } if (struct.isSetEB()) { struct.eB.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eP = new FileDoesNotExistException(); struct.eP.read(iprot); struct.setEPIsSet(true); } if (incoming.get(2)) { struct.eS = new SuspectedFileSizeException(); struct.eS.read(iprot); struct.setESIsSet(true); } if (incoming.get(3)) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } } } } public static class getWorkersInfo_args implements org.apache.thrift.TBase<getWorkersInfo_args, getWorkersInfo_args._Fields>, java.io.Serializable, Cloneable, Comparable<getWorkersInfo_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getWorkersInfo_args"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getWorkersInfo_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getWorkersInfo_argsTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getWorkersInfo_args.class, metaDataMap); } public getWorkersInfo_args() { } /** * Performs a deep copy on <i>other</i>. */ public getWorkersInfo_args(getWorkersInfo_args other) { } public getWorkersInfo_args deepCopy() { return new getWorkersInfo_args(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getWorkersInfo_args) return this.equals((getWorkersInfo_args)that); return false; } public boolean equals(getWorkersInfo_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(getWorkersInfo_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getWorkersInfo_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getWorkersInfo_argsStandardSchemeFactory implements SchemeFactory { public getWorkersInfo_argsStandardScheme getScheme() { return new getWorkersInfo_argsStandardScheme(); } } private static class getWorkersInfo_argsStandardScheme extends StandardScheme<getWorkersInfo_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getWorkersInfo_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getWorkersInfo_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getWorkersInfo_argsTupleSchemeFactory implements SchemeFactory { public getWorkersInfo_argsTupleScheme getScheme() { return new getWorkersInfo_argsTupleScheme(); } } private static class getWorkersInfo_argsTupleScheme extends TupleScheme<getWorkersInfo_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getWorkersInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getWorkersInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class getWorkersInfo_result implements org.apache.thrift.TBase<getWorkersInfo_result, getWorkersInfo_result._Fields>, java.io.Serializable, Cloneable, Comparable<getWorkersInfo_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getWorkersInfo_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getWorkersInfo_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getWorkersInfo_resultTupleSchemeFactory()); } public List<ClientWorkerInfo> success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientWorkerInfo.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getWorkersInfo_result.class, metaDataMap); } public getWorkersInfo_result() { } public getWorkersInfo_result( List<ClientWorkerInfo> success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public getWorkersInfo_result(getWorkersInfo_result other) { if (other.isSetSuccess()) { List<ClientWorkerInfo> __this__success = new ArrayList<ClientWorkerInfo>(other.success.size()); for (ClientWorkerInfo other_element : other.success) { __this__success.add(new ClientWorkerInfo(other_element)); } this.success = __this__success; } } public getWorkersInfo_result deepCopy() { return new getWorkersInfo_result(this); } @Override public void clear() { this.success = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<ClientWorkerInfo> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(ClientWorkerInfo elem) { if (this.success == null) { this.success = new ArrayList<ClientWorkerInfo>(); } this.success.add(elem); } public List<ClientWorkerInfo> getSuccess() { return this.success; } public getWorkersInfo_result setSuccess(List<ClientWorkerInfo> success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<ClientWorkerInfo>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getWorkersInfo_result) return this.equals((getWorkersInfo_result)that); return false; } public boolean equals(getWorkersInfo_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(getWorkersInfo_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getWorkersInfo_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getWorkersInfo_resultStandardSchemeFactory implements SchemeFactory { public getWorkersInfo_resultStandardScheme getScheme() { return new getWorkersInfo_resultStandardScheme(); } } private static class getWorkersInfo_resultStandardScheme extends StandardScheme<getWorkersInfo_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getWorkersInfo_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list48 = iprot.readListBegin(); struct.success = new ArrayList<ClientWorkerInfo>(_list48.size); for (int _i49 = 0; _i49 < _list48.size; ++_i49) { ClientWorkerInfo _elem50; _elem50 = new ClientWorkerInfo(); _elem50.read(iprot); struct.success.add(_elem50); } iprot.readListEnd(); } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getWorkersInfo_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); for (ClientWorkerInfo _iter51 : struct.success) { _iter51.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getWorkersInfo_resultTupleSchemeFactory implements SchemeFactory { public getWorkersInfo_resultTupleScheme getScheme() { return new getWorkersInfo_resultTupleScheme(); } } private static class getWorkersInfo_resultTupleScheme extends TupleScheme<getWorkersInfo_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getWorkersInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (ClientWorkerInfo _iter52 : struct.success) { _iter52.write(oprot); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getWorkersInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list53 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.success = new ArrayList<ClientWorkerInfo>(_list53.size); for (int _i54 = 0; _i54 < _list53.size; ++_i54) { ClientWorkerInfo _elem55; _elem55 = new ClientWorkerInfo(); _elem55.read(iprot); struct.success.add(_elem55); } } struct.setSuccessIsSet(true); } } } } public static class liststatus_args implements org.apache.thrift.TBase<liststatus_args, liststatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<liststatus_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("liststatus_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new liststatus_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new liststatus_argsTupleSchemeFactory()); } public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PATH((short)1, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(liststatus_args.class, metaDataMap); } public liststatus_args() { } public liststatus_args( String path) { this(); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public liststatus_args(liststatus_args other) { if (other.isSetPath()) { this.path = other.path; } } public liststatus_args deepCopy() { return new liststatus_args(this); } @Override public void clear() { this.path = null; } public String getPath() { return this.path; } public liststatus_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof liststatus_args) return this.equals((liststatus_args)that); return false; } public boolean equals(liststatus_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(liststatus_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("liststatus_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class liststatus_argsStandardSchemeFactory implements SchemeFactory { public liststatus_argsStandardScheme getScheme() { return new liststatus_argsStandardScheme(); } } private static class liststatus_argsStandardScheme extends StandardScheme<liststatus_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, liststatus_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, liststatus_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class liststatus_argsTupleSchemeFactory implements SchemeFactory { public liststatus_argsTupleScheme getScheme() { return new liststatus_argsTupleScheme(); } } private static class liststatus_argsTupleScheme extends TupleScheme<liststatus_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, liststatus_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, liststatus_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class liststatus_result implements org.apache.thrift.TBase<liststatus_result, liststatus_result._Fields>, java.io.Serializable, Cloneable, Comparable<liststatus_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("liststatus_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new liststatus_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new liststatus_resultTupleSchemeFactory()); } public List<ClientFileInfo> success; // required public InvalidPathException eI; // required public FileDoesNotExistException eF; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_I((short)1, "eI"), E_F((short)2, "eF"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_I return E_I; case 2: // E_F return E_F; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientFileInfo.class)))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_F, new org.apache.thrift.meta_data.FieldMetaData("eF", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(liststatus_result.class, metaDataMap); } public liststatus_result() { } public liststatus_result( List<ClientFileInfo> success, InvalidPathException eI, FileDoesNotExistException eF) { this(); this.success = success; this.eI = eI; this.eF = eF; } /** * Performs a deep copy on <i>other</i>. */ public liststatus_result(liststatus_result other) { if (other.isSetSuccess()) { List<ClientFileInfo> __this__success = new ArrayList<ClientFileInfo>(other.success.size()); for (ClientFileInfo other_element : other.success) { __this__success.add(new ClientFileInfo(other_element)); } this.success = __this__success; } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } if (other.isSetEF()) { this.eF = new FileDoesNotExistException(other.eF); } } public liststatus_result deepCopy() { return new liststatus_result(this); } @Override public void clear() { this.success = null; this.eI = null; this.eF = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<ClientFileInfo> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(ClientFileInfo elem) { if (this.success == null) { this.success = new ArrayList<ClientFileInfo>(); } this.success.add(elem); } public List<ClientFileInfo> getSuccess() { return this.success; } public liststatus_result setSuccess(List<ClientFileInfo> success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public InvalidPathException getEI() { return this.eI; } public liststatus_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public FileDoesNotExistException getEF() { return this.eF; } public liststatus_result setEF(FileDoesNotExistException eF) { this.eF = eF; return this; } public void unsetEF() { this.eF = null; } /** Returns true if field eF is set (has been assigned a value) and false otherwise */ public boolean isSetEF() { return this.eF != null; } public void setEFIsSet(boolean value) { if (!value) { this.eF = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<ClientFileInfo>)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; case E_F: if (value == null) { unsetEF(); } else { setEF((FileDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E_I: return getEI(); case E_F: return getEF(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_I: return isSetEI(); case E_F: return isSetEF(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof liststatus_result) return this.equals((liststatus_result)that); return false; } public boolean equals(liststatus_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } boolean this_present_eF = true && this.isSetEF(); boolean that_present_eF = true && that.isSetEF(); if (this_present_eF || that_present_eF) { if (!(this_present_eF && that_present_eF)) return false; if (!this.eF.equals(that.eF)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(liststatus_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEF()).compareTo(other.isSetEF()); if (lastComparison != 0) { return lastComparison; } if (isSetEF()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eF, other.eF); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("liststatus_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; if (!first) sb.append(", "); sb.append("eF:"); if (this.eF == null) { sb.append("null"); } else { sb.append(this.eF); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class liststatus_resultStandardSchemeFactory implements SchemeFactory { public liststatus_resultStandardScheme getScheme() { return new liststatus_resultStandardScheme(); } } private static class liststatus_resultStandardScheme extends StandardScheme<liststatus_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, liststatus_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list56 = iprot.readListBegin(); struct.success = new ArrayList<ClientFileInfo>(_list56.size); for (int _i57 = 0; _i57 < _list56.size; ++_i57) { ClientFileInfo _elem58; _elem58 = new ClientFileInfo(); _elem58.read(iprot); struct.success.add(_elem58); } iprot.readListEnd(); } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_F if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, liststatus_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); for (ClientFileInfo _iter59 : struct.success) { _iter59.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } if (struct.eF != null) { oprot.writeFieldBegin(E_F_FIELD_DESC); struct.eF.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class liststatus_resultTupleSchemeFactory implements SchemeFactory { public liststatus_resultTupleScheme getScheme() { return new liststatus_resultTupleScheme(); } } private static class liststatus_resultTupleScheme extends TupleScheme<liststatus_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, liststatus_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetEI()) { optionals.set(1); } if (struct.isSetEF()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (ClientFileInfo _iter60 : struct.success) { _iter60.write(oprot); } } } if (struct.isSetEI()) { struct.eI.write(oprot); } if (struct.isSetEF()) { struct.eF.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, liststatus_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list61 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.success = new ArrayList<ClientFileInfo>(_list61.size); for (int _i62 = 0; _i62 < _list61.size; ++_i62) { ClientFileInfo _elem63; _elem63 = new ClientFileInfo(); _elem63.read(iprot); struct.success.add(_elem63); } } struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } if (incoming.get(2)) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } } } } public static class worker_register_args implements org.apache.thrift.TBase<worker_register_args, worker_register_args._Fields>, java.io.Serializable, Cloneable, Comparable<worker_register_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_register_args"); private static final org.apache.thrift.protocol.TField WORKER_NET_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("workerNetAddress", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField TOTAL_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("totalBytes", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField USED_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("usedBytes", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField CURRENT_BLOCKS_FIELD_DESC = new org.apache.thrift.protocol.TField("currentBlocks", org.apache.thrift.protocol.TType.LIST, (short)4); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_register_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_register_argsTupleSchemeFactory()); } public NetAddress workerNetAddress; // required public long totalBytes; // required public long usedBytes; // required public List<Long> currentBlocks; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { WORKER_NET_ADDRESS((short)1, "workerNetAddress"), TOTAL_BYTES((short)2, "totalBytes"), USED_BYTES((short)3, "usedBytes"), CURRENT_BLOCKS((short)4, "currentBlocks"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // WORKER_NET_ADDRESS return WORKER_NET_ADDRESS; case 2: // TOTAL_BYTES return TOTAL_BYTES; case 3: // USED_BYTES return USED_BYTES; case 4: // CURRENT_BLOCKS return CURRENT_BLOCKS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __TOTALBYTES_ISSET_ID = 0; private static final int __USEDBYTES_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.WORKER_NET_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("workerNetAddress", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NetAddress.class))); tmpMap.put(_Fields.TOTAL_BYTES, new org.apache.thrift.meta_data.FieldMetaData("totalBytes", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.USED_BYTES, new org.apache.thrift.meta_data.FieldMetaData("usedBytes", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.CURRENT_BLOCKS, new org.apache.thrift.meta_data.FieldMetaData("currentBlocks", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_register_args.class, metaDataMap); } public worker_register_args() { } public worker_register_args( NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlocks) { this(); this.workerNetAddress = workerNetAddress; this.totalBytes = totalBytes; setTotalBytesIsSet(true); this.usedBytes = usedBytes; setUsedBytesIsSet(true); this.currentBlocks = currentBlocks; } /** * Performs a deep copy on <i>other</i>. */ public worker_register_args(worker_register_args other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetWorkerNetAddress()) { this.workerNetAddress = new NetAddress(other.workerNetAddress); } this.totalBytes = other.totalBytes; this.usedBytes = other.usedBytes; if (other.isSetCurrentBlocks()) { List<Long> __this__currentBlocks = new ArrayList<Long>(other.currentBlocks); this.currentBlocks = __this__currentBlocks; } } public worker_register_args deepCopy() { return new worker_register_args(this); } @Override public void clear() { this.workerNetAddress = null; setTotalBytesIsSet(false); this.totalBytes = 0; setUsedBytesIsSet(false); this.usedBytes = 0; this.currentBlocks = null; } public NetAddress getWorkerNetAddress() { return this.workerNetAddress; } public worker_register_args setWorkerNetAddress(NetAddress workerNetAddress) { this.workerNetAddress = workerNetAddress; return this; } public void unsetWorkerNetAddress() { this.workerNetAddress = null; } /** Returns true if field workerNetAddress is set (has been assigned a value) and false otherwise */ public boolean isSetWorkerNetAddress() { return this.workerNetAddress != null; } public void setWorkerNetAddressIsSet(boolean value) { if (!value) { this.workerNetAddress = null; } } public long getTotalBytes() { return this.totalBytes; } public worker_register_args setTotalBytes(long totalBytes) { this.totalBytes = totalBytes; setTotalBytesIsSet(true); return this; } public void unsetTotalBytes() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TOTALBYTES_ISSET_ID); } /** Returns true if field totalBytes is set (has been assigned a value) and false otherwise */ public boolean isSetTotalBytes() { return EncodingUtils.testBit(__isset_bitfield, __TOTALBYTES_ISSET_ID); } public void setTotalBytesIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TOTALBYTES_ISSET_ID, value); } public long getUsedBytes() { return this.usedBytes; } public worker_register_args setUsedBytes(long usedBytes) { this.usedBytes = usedBytes; setUsedBytesIsSet(true); return this; } public void unsetUsedBytes() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USEDBYTES_ISSET_ID); } /** Returns true if field usedBytes is set (has been assigned a value) and false otherwise */ public boolean isSetUsedBytes() { return EncodingUtils.testBit(__isset_bitfield, __USEDBYTES_ISSET_ID); } public void setUsedBytesIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USEDBYTES_ISSET_ID, value); } public int getCurrentBlocksSize() { return (this.currentBlocks == null) ? 0 : this.currentBlocks.size(); } public java.util.Iterator<Long> getCurrentBlocksIterator() { return (this.currentBlocks == null) ? null : this.currentBlocks.iterator(); } public void addToCurrentBlocks(long elem) { if (this.currentBlocks == null) { this.currentBlocks = new ArrayList<Long>(); } this.currentBlocks.add(elem); } public List<Long> getCurrentBlocks() { return this.currentBlocks; } public worker_register_args setCurrentBlocks(List<Long> currentBlocks) { this.currentBlocks = currentBlocks; return this; } public void unsetCurrentBlocks() { this.currentBlocks = null; } /** Returns true if field currentBlocks is set (has been assigned a value) and false otherwise */ public boolean isSetCurrentBlocks() { return this.currentBlocks != null; } public void setCurrentBlocksIsSet(boolean value) { if (!value) { this.currentBlocks = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case WORKER_NET_ADDRESS: if (value == null) { unsetWorkerNetAddress(); } else { setWorkerNetAddress((NetAddress)value); } break; case TOTAL_BYTES: if (value == null) { unsetTotalBytes(); } else { setTotalBytes((Long)value); } break; case USED_BYTES: if (value == null) { unsetUsedBytes(); } else { setUsedBytes((Long)value); } break; case CURRENT_BLOCKS: if (value == null) { unsetCurrentBlocks(); } else { setCurrentBlocks((List<Long>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case WORKER_NET_ADDRESS: return getWorkerNetAddress(); case TOTAL_BYTES: return Long.valueOf(getTotalBytes()); case USED_BYTES: return Long.valueOf(getUsedBytes()); case CURRENT_BLOCKS: return getCurrentBlocks(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case WORKER_NET_ADDRESS: return isSetWorkerNetAddress(); case TOTAL_BYTES: return isSetTotalBytes(); case USED_BYTES: return isSetUsedBytes(); case CURRENT_BLOCKS: return isSetCurrentBlocks(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_register_args) return this.equals((worker_register_args)that); return false; } public boolean equals(worker_register_args that) { if (that == null) return false; boolean this_present_workerNetAddress = true && this.isSetWorkerNetAddress(); boolean that_present_workerNetAddress = true && that.isSetWorkerNetAddress(); if (this_present_workerNetAddress || that_present_workerNetAddress) { if (!(this_present_workerNetAddress && that_present_workerNetAddress)) return false; if (!this.workerNetAddress.equals(that.workerNetAddress)) return false; } boolean this_present_totalBytes = true; boolean that_present_totalBytes = true; if (this_present_totalBytes || that_present_totalBytes) { if (!(this_present_totalBytes && that_present_totalBytes)) return false; if (this.totalBytes != that.totalBytes) return false; } boolean this_present_usedBytes = true; boolean that_present_usedBytes = true; if (this_present_usedBytes || that_present_usedBytes) { if (!(this_present_usedBytes && that_present_usedBytes)) return false; if (this.usedBytes != that.usedBytes) return false; } boolean this_present_currentBlocks = true && this.isSetCurrentBlocks(); boolean that_present_currentBlocks = true && that.isSetCurrentBlocks(); if (this_present_currentBlocks || that_present_currentBlocks) { if (!(this_present_currentBlocks && that_present_currentBlocks)) return false; if (!this.currentBlocks.equals(that.currentBlocks)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_register_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetWorkerNetAddress()).compareTo(other.isSetWorkerNetAddress()); if (lastComparison != 0) { return lastComparison; } if (isSetWorkerNetAddress()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workerNetAddress, other.workerNetAddress); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetTotalBytes()).compareTo(other.isSetTotalBytes()); if (lastComparison != 0) { return lastComparison; } if (isSetTotalBytes()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalBytes, other.totalBytes); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetUsedBytes()).compareTo(other.isSetUsedBytes()); if (lastComparison != 0) { return lastComparison; } if (isSetUsedBytes()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.usedBytes, other.usedBytes); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetCurrentBlocks()).compareTo(other.isSetCurrentBlocks()); if (lastComparison != 0) { return lastComparison; } if (isSetCurrentBlocks()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.currentBlocks, other.currentBlocks); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_register_args("); boolean first = true; sb.append("workerNetAddress:"); if (this.workerNetAddress == null) { sb.append("null"); } else { sb.append(this.workerNetAddress); } first = false; if (!first) sb.append(", "); sb.append("totalBytes:"); sb.append(this.totalBytes); first = false; if (!first) sb.append(", "); sb.append("usedBytes:"); sb.append(this.usedBytes); first = false; if (!first) sb.append(", "); sb.append("currentBlocks:"); if (this.currentBlocks == null) { sb.append("null"); } else { sb.append(this.currentBlocks); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (workerNetAddress != null) { workerNetAddress.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_register_argsStandardSchemeFactory implements SchemeFactory { public worker_register_argsStandardScheme getScheme() { return new worker_register_argsStandardScheme(); } } private static class worker_register_argsStandardScheme extends StandardScheme<worker_register_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_register_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // WORKER_NET_ADDRESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.workerNetAddress = new NetAddress(); struct.workerNetAddress.read(iprot); struct.setWorkerNetAddressIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // TOTAL_BYTES if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.totalBytes = iprot.readI64(); struct.setTotalBytesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // USED_BYTES if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.usedBytes = iprot.readI64(); struct.setUsedBytesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // CURRENT_BLOCKS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list64 = iprot.readListBegin(); struct.currentBlocks = new ArrayList<Long>(_list64.size); for (int _i65 = 0; _i65 < _list64.size; ++_i65) { long _elem66; _elem66 = iprot.readI64(); struct.currentBlocks.add(_elem66); } iprot.readListEnd(); } struct.setCurrentBlocksIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_register_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.workerNetAddress != null) { oprot.writeFieldBegin(WORKER_NET_ADDRESS_FIELD_DESC); struct.workerNetAddress.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldBegin(TOTAL_BYTES_FIELD_DESC); oprot.writeI64(struct.totalBytes); oprot.writeFieldEnd(); oprot.writeFieldBegin(USED_BYTES_FIELD_DESC); oprot.writeI64(struct.usedBytes); oprot.writeFieldEnd(); if (struct.currentBlocks != null) { oprot.writeFieldBegin(CURRENT_BLOCKS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.currentBlocks.size())); for (long _iter67 : struct.currentBlocks) { oprot.writeI64(_iter67); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_register_argsTupleSchemeFactory implements SchemeFactory { public worker_register_argsTupleScheme getScheme() { return new worker_register_argsTupleScheme(); } } private static class worker_register_argsTupleScheme extends TupleScheme<worker_register_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_register_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetWorkerNetAddress()) { optionals.set(0); } if (struct.isSetTotalBytes()) { optionals.set(1); } if (struct.isSetUsedBytes()) { optionals.set(2); } if (struct.isSetCurrentBlocks()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetWorkerNetAddress()) { struct.workerNetAddress.write(oprot); } if (struct.isSetTotalBytes()) { oprot.writeI64(struct.totalBytes); } if (struct.isSetUsedBytes()) { oprot.writeI64(struct.usedBytes); } if (struct.isSetCurrentBlocks()) { { oprot.writeI32(struct.currentBlocks.size()); for (long _iter68 : struct.currentBlocks) { oprot.writeI64(_iter68); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_register_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.workerNetAddress = new NetAddress(); struct.workerNetAddress.read(iprot); struct.setWorkerNetAddressIsSet(true); } if (incoming.get(1)) { struct.totalBytes = iprot.readI64(); struct.setTotalBytesIsSet(true); } if (incoming.get(2)) { struct.usedBytes = iprot.readI64(); struct.setUsedBytesIsSet(true); } if (incoming.get(3)) { { org.apache.thrift.protocol.TList _list69 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); struct.currentBlocks = new ArrayList<Long>(_list69.size); for (int _i70 = 0; _i70 < _list69.size; ++_i70) { long _elem71; _elem71 = iprot.readI64(); struct.currentBlocks.add(_elem71); } } struct.setCurrentBlocksIsSet(true); } } } } public static class worker_register_result implements org.apache.thrift.TBase<worker_register_result, worker_register_result._Fields>, java.io.Serializable, Cloneable, Comparable<worker_register_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_register_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_register_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_register_resultTupleSchemeFactory()); } public long success; // required public BlockInfoException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_register_result.class, metaDataMap); } public worker_register_result() { } public worker_register_result( long success, BlockInfoException e) { this(); this.success = success; setSuccessIsSet(true); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public worker_register_result(worker_register_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new BlockInfoException(other.e); } } public worker_register_result deepCopy() { return new worker_register_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.e = null; } public long getSuccess() { return this.success; } public worker_register_result setSuccess(long success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public BlockInfoException getE() { return this.e; } public worker_register_result setE(BlockInfoException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Long)value); } break; case E: if (value == null) { unsetE(); } else { setE((BlockInfoException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Long.valueOf(getSuccess()); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_register_result) return this.equals((worker_register_result)that); return false; } public boolean equals(worker_register_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_register_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_register_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_register_resultStandardSchemeFactory implements SchemeFactory { public worker_register_resultStandardScheme getScheme() { return new worker_register_resultStandardScheme(); } } private static class worker_register_resultStandardScheme extends StandardScheme<worker_register_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_register_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new BlockInfoException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_register_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI64(struct.success); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_register_resultTupleSchemeFactory implements SchemeFactory { public worker_register_resultTupleScheme getScheme() { return new worker_register_resultTupleScheme(); } } private static class worker_register_resultTupleScheme extends TupleScheme<worker_register_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_register_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeI64(struct.success); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_register_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new BlockInfoException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class worker_heartbeat_args implements org.apache.thrift.TBase<worker_heartbeat_args, worker_heartbeat_args._Fields>, java.io.Serializable, Cloneable, Comparable<worker_heartbeat_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_heartbeat_args"); private static final org.apache.thrift.protocol.TField WORKER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("workerId", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.protocol.TField USED_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("usedBytes", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField REMOVED_BLOCKS_FIELD_DESC = new org.apache.thrift.protocol.TField("removedBlocks", org.apache.thrift.protocol.TType.LIST, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_heartbeat_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_heartbeat_argsTupleSchemeFactory()); } public long workerId; // required public long usedBytes; // required public List<Long> removedBlocks; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { WORKER_ID((short)1, "workerId"), USED_BYTES((short)2, "usedBytes"), REMOVED_BLOCKS((short)3, "removedBlocks"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // WORKER_ID return WORKER_ID; case 2: // USED_BYTES return USED_BYTES; case 3: // REMOVED_BLOCKS return REMOVED_BLOCKS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __WORKERID_ISSET_ID = 0; private static final int __USEDBYTES_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.WORKER_ID, new org.apache.thrift.meta_data.FieldMetaData("workerId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.USED_BYTES, new org.apache.thrift.meta_data.FieldMetaData("usedBytes", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.REMOVED_BLOCKS, new org.apache.thrift.meta_data.FieldMetaData("removedBlocks", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_heartbeat_args.class, metaDataMap); } public worker_heartbeat_args() { } public worker_heartbeat_args( long workerId, long usedBytes, List<Long> removedBlocks) { this(); this.workerId = workerId; setWorkerIdIsSet(true); this.usedBytes = usedBytes; setUsedBytesIsSet(true); this.removedBlocks = removedBlocks; } /** * Performs a deep copy on <i>other</i>. */ public worker_heartbeat_args(worker_heartbeat_args other) { __isset_bitfield = other.__isset_bitfield; this.workerId = other.workerId; this.usedBytes = other.usedBytes; if (other.isSetRemovedBlocks()) { List<Long> __this__removedBlocks = new ArrayList<Long>(other.removedBlocks); this.removedBlocks = __this__removedBlocks; } } public worker_heartbeat_args deepCopy() { return new worker_heartbeat_args(this); } @Override public void clear() { setWorkerIdIsSet(false); this.workerId = 0; setUsedBytesIsSet(false); this.usedBytes = 0; this.removedBlocks = null; } public long getWorkerId() { return this.workerId; } public worker_heartbeat_args setWorkerId(long workerId) { this.workerId = workerId; setWorkerIdIsSet(true); return this; } public void unsetWorkerId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WORKERID_ISSET_ID); } /** Returns true if field workerId is set (has been assigned a value) and false otherwise */ public boolean isSetWorkerId() { return EncodingUtils.testBit(__isset_bitfield, __WORKERID_ISSET_ID); } public void setWorkerIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WORKERID_ISSET_ID, value); } public long getUsedBytes() { return this.usedBytes; } public worker_heartbeat_args setUsedBytes(long usedBytes) { this.usedBytes = usedBytes; setUsedBytesIsSet(true); return this; } public void unsetUsedBytes() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USEDBYTES_ISSET_ID); } /** Returns true if field usedBytes is set (has been assigned a value) and false otherwise */ public boolean isSetUsedBytes() { return EncodingUtils.testBit(__isset_bitfield, __USEDBYTES_ISSET_ID); } public void setUsedBytesIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USEDBYTES_ISSET_ID, value); } public int getRemovedBlocksSize() { return (this.removedBlocks == null) ? 0 : this.removedBlocks.size(); } public java.util.Iterator<Long> getRemovedBlocksIterator() { return (this.removedBlocks == null) ? null : this.removedBlocks.iterator(); } public void addToRemovedBlocks(long elem) { if (this.removedBlocks == null) { this.removedBlocks = new ArrayList<Long>(); } this.removedBlocks.add(elem); } public List<Long> getRemovedBlocks() { return this.removedBlocks; } public worker_heartbeat_args setRemovedBlocks(List<Long> removedBlocks) { this.removedBlocks = removedBlocks; return this; } public void unsetRemovedBlocks() { this.removedBlocks = null; } /** Returns true if field removedBlocks is set (has been assigned a value) and false otherwise */ public boolean isSetRemovedBlocks() { return this.removedBlocks != null; } public void setRemovedBlocksIsSet(boolean value) { if (!value) { this.removedBlocks = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case WORKER_ID: if (value == null) { unsetWorkerId(); } else { setWorkerId((Long)value); } break; case USED_BYTES: if (value == null) { unsetUsedBytes(); } else { setUsedBytes((Long)value); } break; case REMOVED_BLOCKS: if (value == null) { unsetRemovedBlocks(); } else { setRemovedBlocks((List<Long>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case WORKER_ID: return Long.valueOf(getWorkerId()); case USED_BYTES: return Long.valueOf(getUsedBytes()); case REMOVED_BLOCKS: return getRemovedBlocks(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case WORKER_ID: return isSetWorkerId(); case USED_BYTES: return isSetUsedBytes(); case REMOVED_BLOCKS: return isSetRemovedBlocks(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_heartbeat_args) return this.equals((worker_heartbeat_args)that); return false; } public boolean equals(worker_heartbeat_args that) { if (that == null) return false; boolean this_present_workerId = true; boolean that_present_workerId = true; if (this_present_workerId || that_present_workerId) { if (!(this_present_workerId && that_present_workerId)) return false; if (this.workerId != that.workerId) return false; } boolean this_present_usedBytes = true; boolean that_present_usedBytes = true; if (this_present_usedBytes || that_present_usedBytes) { if (!(this_present_usedBytes && that_present_usedBytes)) return false; if (this.usedBytes != that.usedBytes) return false; } boolean this_present_removedBlocks = true && this.isSetRemovedBlocks(); boolean that_present_removedBlocks = true && that.isSetRemovedBlocks(); if (this_present_removedBlocks || that_present_removedBlocks) { if (!(this_present_removedBlocks && that_present_removedBlocks)) return false; if (!this.removedBlocks.equals(that.removedBlocks)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_heartbeat_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetWorkerId()).compareTo(other.isSetWorkerId()); if (lastComparison != 0) { return lastComparison; } if (isSetWorkerId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workerId, other.workerId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetUsedBytes()).compareTo(other.isSetUsedBytes()); if (lastComparison != 0) { return lastComparison; } if (isSetUsedBytes()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.usedBytes, other.usedBytes); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRemovedBlocks()).compareTo(other.isSetRemovedBlocks()); if (lastComparison != 0) { return lastComparison; } if (isSetRemovedBlocks()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.removedBlocks, other.removedBlocks); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_heartbeat_args("); boolean first = true; sb.append("workerId:"); sb.append(this.workerId); first = false; if (!first) sb.append(", "); sb.append("usedBytes:"); sb.append(this.usedBytes); first = false; if (!first) sb.append(", "); sb.append("removedBlocks:"); if (this.removedBlocks == null) { sb.append("null"); } else { sb.append(this.removedBlocks); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_heartbeat_argsStandardSchemeFactory implements SchemeFactory { public worker_heartbeat_argsStandardScheme getScheme() { return new worker_heartbeat_argsStandardScheme(); } } private static class worker_heartbeat_argsStandardScheme extends StandardScheme<worker_heartbeat_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_heartbeat_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // WORKER_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.workerId = iprot.readI64(); struct.setWorkerIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // USED_BYTES if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.usedBytes = iprot.readI64(); struct.setUsedBytesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // REMOVED_BLOCKS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list72 = iprot.readListBegin(); struct.removedBlocks = new ArrayList<Long>(_list72.size); for (int _i73 = 0; _i73 < _list72.size; ++_i73) { long _elem74; _elem74 = iprot.readI64(); struct.removedBlocks.add(_elem74); } iprot.readListEnd(); } struct.setRemovedBlocksIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_heartbeat_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(WORKER_ID_FIELD_DESC); oprot.writeI64(struct.workerId); oprot.writeFieldEnd(); oprot.writeFieldBegin(USED_BYTES_FIELD_DESC); oprot.writeI64(struct.usedBytes); oprot.writeFieldEnd(); if (struct.removedBlocks != null) { oprot.writeFieldBegin(REMOVED_BLOCKS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.removedBlocks.size())); for (long _iter75 : struct.removedBlocks) { oprot.writeI64(_iter75); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_heartbeat_argsTupleSchemeFactory implements SchemeFactory { public worker_heartbeat_argsTupleScheme getScheme() { return new worker_heartbeat_argsTupleScheme(); } } private static class worker_heartbeat_argsTupleScheme extends TupleScheme<worker_heartbeat_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_heartbeat_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetWorkerId()) { optionals.set(0); } if (struct.isSetUsedBytes()) { optionals.set(1); } if (struct.isSetRemovedBlocks()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetWorkerId()) { oprot.writeI64(struct.workerId); } if (struct.isSetUsedBytes()) { oprot.writeI64(struct.usedBytes); } if (struct.isSetRemovedBlocks()) { { oprot.writeI32(struct.removedBlocks.size()); for (long _iter76 : struct.removedBlocks) { oprot.writeI64(_iter76); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_heartbeat_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.workerId = iprot.readI64(); struct.setWorkerIdIsSet(true); } if (incoming.get(1)) { struct.usedBytes = iprot.readI64(); struct.setUsedBytesIsSet(true); } if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list77 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); struct.removedBlocks = new ArrayList<Long>(_list77.size); for (int _i78 = 0; _i78 < _list77.size; ++_i78) { long _elem79; _elem79 = iprot.readI64(); struct.removedBlocks.add(_elem79); } } struct.setRemovedBlocksIsSet(true); } } } } public static class worker_heartbeat_result implements org.apache.thrift.TBase<worker_heartbeat_result, worker_heartbeat_result._Fields>, java.io.Serializable, Cloneable, Comparable<worker_heartbeat_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_heartbeat_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_heartbeat_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_heartbeat_resultTupleSchemeFactory()); } public Command success; // required public BlockInfoException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Command.class))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_heartbeat_result.class, metaDataMap); } public worker_heartbeat_result() { } public worker_heartbeat_result( Command success, BlockInfoException e) { this(); this.success = success; this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public worker_heartbeat_result(worker_heartbeat_result other) { if (other.isSetSuccess()) { this.success = new Command(other.success); } if (other.isSetE()) { this.e = new BlockInfoException(other.e); } } public worker_heartbeat_result deepCopy() { return new worker_heartbeat_result(this); } @Override public void clear() { this.success = null; this.e = null; } public Command getSuccess() { return this.success; } public worker_heartbeat_result setSuccess(Command success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public BlockInfoException getE() { return this.e; } public worker_heartbeat_result setE(BlockInfoException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Command)value); } break; case E: if (value == null) { unsetE(); } else { setE((BlockInfoException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_heartbeat_result) return this.equals((worker_heartbeat_result)that); return false; } public boolean equals(worker_heartbeat_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_heartbeat_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_heartbeat_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_heartbeat_resultStandardSchemeFactory implements SchemeFactory { public worker_heartbeat_resultStandardScheme getScheme() { return new worker_heartbeat_resultStandardScheme(); } } private static class worker_heartbeat_resultStandardScheme extends StandardScheme<worker_heartbeat_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_heartbeat_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new Command(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new BlockInfoException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_heartbeat_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_heartbeat_resultTupleSchemeFactory implements SchemeFactory { public worker_heartbeat_resultTupleScheme getScheme() { return new worker_heartbeat_resultTupleScheme(); } } private static class worker_heartbeat_resultTupleScheme extends TupleScheme<worker_heartbeat_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_heartbeat_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_heartbeat_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new Command(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new BlockInfoException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class worker_cacheBlock_args implements org.apache.thrift.TBase<worker_cacheBlock_args, worker_cacheBlock_args._Fields>, java.io.Serializable, Cloneable, Comparable<worker_cacheBlock_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_cacheBlock_args"); private static final org.apache.thrift.protocol.TField WORKER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("workerId", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.protocol.TField WORKER_USED_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("workerUsedBytes", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField LENGTH_FIELD_DESC = new org.apache.thrift.protocol.TField("length", org.apache.thrift.protocol.TType.I64, (short)4); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_cacheBlock_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_cacheBlock_argsTupleSchemeFactory()); } public long workerId; // required public long workerUsedBytes; // required public long blockId; // required public long length; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { WORKER_ID((short)1, "workerId"), WORKER_USED_BYTES((short)2, "workerUsedBytes"), BLOCK_ID((short)3, "blockId"), LENGTH((short)4, "length"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // WORKER_ID return WORKER_ID; case 2: // WORKER_USED_BYTES return WORKER_USED_BYTES; case 3: // BLOCK_ID return BLOCK_ID; case 4: // LENGTH return LENGTH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __WORKERID_ISSET_ID = 0; private static final int __WORKERUSEDBYTES_ISSET_ID = 1; private static final int __BLOCKID_ISSET_ID = 2; private static final int __LENGTH_ISSET_ID = 3; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.WORKER_ID, new org.apache.thrift.meta_data.FieldMetaData("workerId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.WORKER_USED_BYTES, new org.apache.thrift.meta_data.FieldMetaData("workerUsedBytes", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.BLOCK_ID, new org.apache.thrift.meta_data.FieldMetaData("blockId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.LENGTH, new org.apache.thrift.meta_data.FieldMetaData("length", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_cacheBlock_args.class, metaDataMap); } public worker_cacheBlock_args() { } public worker_cacheBlock_args( long workerId, long workerUsedBytes, long blockId, long length) { this(); this.workerId = workerId; setWorkerIdIsSet(true); this.workerUsedBytes = workerUsedBytes; setWorkerUsedBytesIsSet(true); this.blockId = blockId; setBlockIdIsSet(true); this.length = length; setLengthIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public worker_cacheBlock_args(worker_cacheBlock_args other) { __isset_bitfield = other.__isset_bitfield; this.workerId = other.workerId; this.workerUsedBytes = other.workerUsedBytes; this.blockId = other.blockId; this.length = other.length; } public worker_cacheBlock_args deepCopy() { return new worker_cacheBlock_args(this); } @Override public void clear() { setWorkerIdIsSet(false); this.workerId = 0; setWorkerUsedBytesIsSet(false); this.workerUsedBytes = 0; setBlockIdIsSet(false); this.blockId = 0; setLengthIsSet(false); this.length = 0; } public long getWorkerId() { return this.workerId; } public worker_cacheBlock_args setWorkerId(long workerId) { this.workerId = workerId; setWorkerIdIsSet(true); return this; } public void unsetWorkerId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WORKERID_ISSET_ID); } /** Returns true if field workerId is set (has been assigned a value) and false otherwise */ public boolean isSetWorkerId() { return EncodingUtils.testBit(__isset_bitfield, __WORKERID_ISSET_ID); } public void setWorkerIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WORKERID_ISSET_ID, value); } public long getWorkerUsedBytes() { return this.workerUsedBytes; } public worker_cacheBlock_args setWorkerUsedBytes(long workerUsedBytes) { this.workerUsedBytes = workerUsedBytes; setWorkerUsedBytesIsSet(true); return this; } public void unsetWorkerUsedBytes() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WORKERUSEDBYTES_ISSET_ID); } /** Returns true if field workerUsedBytes is set (has been assigned a value) and false otherwise */ public boolean isSetWorkerUsedBytes() { return EncodingUtils.testBit(__isset_bitfield, __WORKERUSEDBYTES_ISSET_ID); } public void setWorkerUsedBytesIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WORKERUSEDBYTES_ISSET_ID, value); } public long getBlockId() { return this.blockId; } public worker_cacheBlock_args setBlockId(long blockId) { this.blockId = blockId; setBlockIdIsSet(true); return this; } public void unsetBlockId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID); } /** Returns true if field blockId is set (has been assigned a value) and false otherwise */ public boolean isSetBlockId() { return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID); } public void setBlockIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value); } public long getLength() { return this.length; } public worker_cacheBlock_args setLength(long length) { this.length = length; setLengthIsSet(true); return this; } public void unsetLength() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LENGTH_ISSET_ID); } /** Returns true if field length is set (has been assigned a value) and false otherwise */ public boolean isSetLength() { return EncodingUtils.testBit(__isset_bitfield, __LENGTH_ISSET_ID); } public void setLengthIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LENGTH_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case WORKER_ID: if (value == null) { unsetWorkerId(); } else { setWorkerId((Long)value); } break; case WORKER_USED_BYTES: if (value == null) { unsetWorkerUsedBytes(); } else { setWorkerUsedBytes((Long)value); } break; case BLOCK_ID: if (value == null) { unsetBlockId(); } else { setBlockId((Long)value); } break; case LENGTH: if (value == null) { unsetLength(); } else { setLength((Long)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case WORKER_ID: return Long.valueOf(getWorkerId()); case WORKER_USED_BYTES: return Long.valueOf(getWorkerUsedBytes()); case BLOCK_ID: return Long.valueOf(getBlockId()); case LENGTH: return Long.valueOf(getLength()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case WORKER_ID: return isSetWorkerId(); case WORKER_USED_BYTES: return isSetWorkerUsedBytes(); case BLOCK_ID: return isSetBlockId(); case LENGTH: return isSetLength(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_cacheBlock_args) return this.equals((worker_cacheBlock_args)that); return false; } public boolean equals(worker_cacheBlock_args that) { if (that == null) return false; boolean this_present_workerId = true; boolean that_present_workerId = true; if (this_present_workerId || that_present_workerId) { if (!(this_present_workerId && that_present_workerId)) return false; if (this.workerId != that.workerId) return false; } boolean this_present_workerUsedBytes = true; boolean that_present_workerUsedBytes = true; if (this_present_workerUsedBytes || that_present_workerUsedBytes) { if (!(this_present_workerUsedBytes && that_present_workerUsedBytes)) return false; if (this.workerUsedBytes != that.workerUsedBytes) return false; } boolean this_present_blockId = true; boolean that_present_blockId = true; if (this_present_blockId || that_present_blockId) { if (!(this_present_blockId && that_present_blockId)) return false; if (this.blockId != that.blockId) return false; } boolean this_present_length = true; boolean that_present_length = true; if (this_present_length || that_present_length) { if (!(this_present_length && that_present_length)) return false; if (this.length != that.length) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_cacheBlock_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetWorkerId()).compareTo(other.isSetWorkerId()); if (lastComparison != 0) { return lastComparison; } if (isSetWorkerId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workerId, other.workerId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetWorkerUsedBytes()).compareTo(other.isSetWorkerUsedBytes()); if (lastComparison != 0) { return lastComparison; } if (isSetWorkerUsedBytes()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workerUsedBytes, other.workerUsedBytes); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetBlockId()).compareTo(other.isSetBlockId()); if (lastComparison != 0) { return lastComparison; } if (isSetBlockId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockId, other.blockId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetLength()).compareTo(other.isSetLength()); if (lastComparison != 0) { return lastComparison; } if (isSetLength()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.length, other.length); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_cacheBlock_args("); boolean first = true; sb.append("workerId:"); sb.append(this.workerId); first = false; if (!first) sb.append(", "); sb.append("workerUsedBytes:"); sb.append(this.workerUsedBytes); first = false; if (!first) sb.append(", "); sb.append("blockId:"); sb.append(this.blockId); first = false; if (!first) sb.append(", "); sb.append("length:"); sb.append(this.length); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_cacheBlock_argsStandardSchemeFactory implements SchemeFactory { public worker_cacheBlock_argsStandardScheme getScheme() { return new worker_cacheBlock_argsStandardScheme(); } } private static class worker_cacheBlock_argsStandardScheme extends StandardScheme<worker_cacheBlock_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_cacheBlock_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // WORKER_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.workerId = iprot.readI64(); struct.setWorkerIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // WORKER_USED_BYTES if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.workerUsedBytes = iprot.readI64(); struct.setWorkerUsedBytesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // BLOCK_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.blockId = iprot.readI64(); struct.setBlockIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // LENGTH if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.length = iprot.readI64(); struct.setLengthIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_cacheBlock_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(WORKER_ID_FIELD_DESC); oprot.writeI64(struct.workerId); oprot.writeFieldEnd(); oprot.writeFieldBegin(WORKER_USED_BYTES_FIELD_DESC); oprot.writeI64(struct.workerUsedBytes); oprot.writeFieldEnd(); oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); oprot.writeI64(struct.blockId); oprot.writeFieldEnd(); oprot.writeFieldBegin(LENGTH_FIELD_DESC); oprot.writeI64(struct.length); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_cacheBlock_argsTupleSchemeFactory implements SchemeFactory { public worker_cacheBlock_argsTupleScheme getScheme() { return new worker_cacheBlock_argsTupleScheme(); } } private static class worker_cacheBlock_argsTupleScheme extends TupleScheme<worker_cacheBlock_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_cacheBlock_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetWorkerId()) { optionals.set(0); } if (struct.isSetWorkerUsedBytes()) { optionals.set(1); } if (struct.isSetBlockId()) { optionals.set(2); } if (struct.isSetLength()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetWorkerId()) { oprot.writeI64(struct.workerId); } if (struct.isSetWorkerUsedBytes()) { oprot.writeI64(struct.workerUsedBytes); } if (struct.isSetBlockId()) { oprot.writeI64(struct.blockId); } if (struct.isSetLength()) { oprot.writeI64(struct.length); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_cacheBlock_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.workerId = iprot.readI64(); struct.setWorkerIdIsSet(true); } if (incoming.get(1)) { struct.workerUsedBytes = iprot.readI64(); struct.setWorkerUsedBytesIsSet(true); } if (incoming.get(2)) { struct.blockId = iprot.readI64(); struct.setBlockIdIsSet(true); } if (incoming.get(3)) { struct.length = iprot.readI64(); struct.setLengthIsSet(true); } } } } public static class worker_cacheBlock_result implements org.apache.thrift.TBase<worker_cacheBlock_result, worker_cacheBlock_result._Fields>, java.io.Serializable, Cloneable, Comparable<worker_cacheBlock_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_cacheBlock_result"); private static final org.apache.thrift.protocol.TField E_P_FIELD_DESC = new org.apache.thrift.protocol.TField("eP", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_S_FIELD_DESC = new org.apache.thrift.protocol.TField("eS", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField E_B_FIELD_DESC = new org.apache.thrift.protocol.TField("eB", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_cacheBlock_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_cacheBlock_resultTupleSchemeFactory()); } public FileDoesNotExistException eP; // required public SuspectedFileSizeException eS; // required public BlockInfoException eB; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E_P((short)1, "eP"), E_S((short)2, "eS"), E_B((short)3, "eB"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E_P return E_P; case 2: // E_S return E_S; case 3: // E_B return E_B; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E_P, new org.apache.thrift.meta_data.FieldMetaData("eP", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_S, new org.apache.thrift.meta_data.FieldMetaData("eS", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_B, new org.apache.thrift.meta_data.FieldMetaData("eB", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_cacheBlock_result.class, metaDataMap); } public worker_cacheBlock_result() { } public worker_cacheBlock_result( FileDoesNotExistException eP, SuspectedFileSizeException eS, BlockInfoException eB) { this(); this.eP = eP; this.eS = eS; this.eB = eB; } /** * Performs a deep copy on <i>other</i>. */ public worker_cacheBlock_result(worker_cacheBlock_result other) { if (other.isSetEP()) { this.eP = new FileDoesNotExistException(other.eP); } if (other.isSetES()) { this.eS = new SuspectedFileSizeException(other.eS); } if (other.isSetEB()) { this.eB = new BlockInfoException(other.eB); } } public worker_cacheBlock_result deepCopy() { return new worker_cacheBlock_result(this); } @Override public void clear() { this.eP = null; this.eS = null; this.eB = null; } public FileDoesNotExistException getEP() { return this.eP; } public worker_cacheBlock_result setEP(FileDoesNotExistException eP) { this.eP = eP; return this; } public void unsetEP() { this.eP = null; } /** Returns true if field eP is set (has been assigned a value) and false otherwise */ public boolean isSetEP() { return this.eP != null; } public void setEPIsSet(boolean value) { if (!value) { this.eP = null; } } public SuspectedFileSizeException getES() { return this.eS; } public worker_cacheBlock_result setES(SuspectedFileSizeException eS) { this.eS = eS; return this; } public void unsetES() { this.eS = null; } /** Returns true if field eS is set (has been assigned a value) and false otherwise */ public boolean isSetES() { return this.eS != null; } public void setESIsSet(boolean value) { if (!value) { this.eS = null; } } public BlockInfoException getEB() { return this.eB; } public worker_cacheBlock_result setEB(BlockInfoException eB) { this.eB = eB; return this; } public void unsetEB() { this.eB = null; } /** Returns true if field eB is set (has been assigned a value) and false otherwise */ public boolean isSetEB() { return this.eB != null; } public void setEBIsSet(boolean value) { if (!value) { this.eB = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E_P: if (value == null) { unsetEP(); } else { setEP((FileDoesNotExistException)value); } break; case E_S: if (value == null) { unsetES(); } else { setES((SuspectedFileSizeException)value); } break; case E_B: if (value == null) { unsetEB(); } else { setEB((BlockInfoException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E_P: return getEP(); case E_S: return getES(); case E_B: return getEB(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E_P: return isSetEP(); case E_S: return isSetES(); case E_B: return isSetEB(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_cacheBlock_result) return this.equals((worker_cacheBlock_result)that); return false; } public boolean equals(worker_cacheBlock_result that) { if (that == null) return false; boolean this_present_eP = true && this.isSetEP(); boolean that_present_eP = true && that.isSetEP(); if (this_present_eP || that_present_eP) { if (!(this_present_eP && that_present_eP)) return false; if (!this.eP.equals(that.eP)) return false; } boolean this_present_eS = true && this.isSetES(); boolean that_present_eS = true && that.isSetES(); if (this_present_eS || that_present_eS) { if (!(this_present_eS && that_present_eS)) return false; if (!this.eS.equals(that.eS)) return false; } boolean this_present_eB = true && this.isSetEB(); boolean that_present_eB = true && that.isSetEB(); if (this_present_eB || that_present_eB) { if (!(this_present_eB && that_present_eB)) return false; if (!this.eB.equals(that.eB)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_cacheBlock_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetEP()).compareTo(other.isSetEP()); if (lastComparison != 0) { return lastComparison; } if (isSetEP()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eP, other.eP); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetES()).compareTo(other.isSetES()); if (lastComparison != 0) { return lastComparison; } if (isSetES()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eS, other.eS); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEB()).compareTo(other.isSetEB()); if (lastComparison != 0) { return lastComparison; } if (isSetEB()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eB, other.eB); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_cacheBlock_result("); boolean first = true; sb.append("eP:"); if (this.eP == null) { sb.append("null"); } else { sb.append(this.eP); } first = false; if (!first) sb.append(", "); sb.append("eS:"); if (this.eS == null) { sb.append("null"); } else { sb.append(this.eS); } first = false; if (!first) sb.append(", "); sb.append("eB:"); if (this.eB == null) { sb.append("null"); } else { sb.append(this.eB); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_cacheBlock_resultStandardSchemeFactory implements SchemeFactory { public worker_cacheBlock_resultStandardScheme getScheme() { return new worker_cacheBlock_resultStandardScheme(); } } private static class worker_cacheBlock_resultStandardScheme extends StandardScheme<worker_cacheBlock_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_cacheBlock_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E_P if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eP = new FileDoesNotExistException(); struct.eP.read(iprot); struct.setEPIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_S if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eS = new SuspectedFileSizeException(); struct.eS.read(iprot); struct.setESIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // E_B if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_cacheBlock_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.eP != null) { oprot.writeFieldBegin(E_P_FIELD_DESC); struct.eP.write(oprot); oprot.writeFieldEnd(); } if (struct.eS != null) { oprot.writeFieldBegin(E_S_FIELD_DESC); struct.eS.write(oprot); oprot.writeFieldEnd(); } if (struct.eB != null) { oprot.writeFieldBegin(E_B_FIELD_DESC); struct.eB.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_cacheBlock_resultTupleSchemeFactory implements SchemeFactory { public worker_cacheBlock_resultTupleScheme getScheme() { return new worker_cacheBlock_resultTupleScheme(); } } private static class worker_cacheBlock_resultTupleScheme extends TupleScheme<worker_cacheBlock_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_cacheBlock_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetEP()) { optionals.set(0); } if (struct.isSetES()) { optionals.set(1); } if (struct.isSetEB()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetEP()) { struct.eP.write(oprot); } if (struct.isSetES()) { struct.eS.write(oprot); } if (struct.isSetEB()) { struct.eB.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_cacheBlock_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.eP = new FileDoesNotExistException(); struct.eP.read(iprot); struct.setEPIsSet(true); } if (incoming.get(1)) { struct.eS = new SuspectedFileSizeException(); struct.eS.read(iprot); struct.setESIsSet(true); } if (incoming.get(2)) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } } } } public static class worker_getPinIdList_args implements org.apache.thrift.TBase<worker_getPinIdList_args, worker_getPinIdList_args._Fields>, java.io.Serializable, Cloneable, Comparable<worker_getPinIdList_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_getPinIdList_args"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_getPinIdList_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_getPinIdList_argsTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_getPinIdList_args.class, metaDataMap); } public worker_getPinIdList_args() { } /** * Performs a deep copy on <i>other</i>. */ public worker_getPinIdList_args(worker_getPinIdList_args other) { } public worker_getPinIdList_args deepCopy() { return new worker_getPinIdList_args(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_getPinIdList_args) return this.equals((worker_getPinIdList_args)that); return false; } public boolean equals(worker_getPinIdList_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_getPinIdList_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_getPinIdList_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_getPinIdList_argsStandardSchemeFactory implements SchemeFactory { public worker_getPinIdList_argsStandardScheme getScheme() { return new worker_getPinIdList_argsStandardScheme(); } } private static class worker_getPinIdList_argsStandardScheme extends StandardScheme<worker_getPinIdList_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_getPinIdList_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_getPinIdList_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_getPinIdList_argsTupleSchemeFactory implements SchemeFactory { public worker_getPinIdList_argsTupleScheme getScheme() { return new worker_getPinIdList_argsTupleScheme(); } } private static class worker_getPinIdList_argsTupleScheme extends TupleScheme<worker_getPinIdList_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_getPinIdList_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_getPinIdList_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class worker_getPinIdList_result implements org.apache.thrift.TBase<worker_getPinIdList_result, worker_getPinIdList_result._Fields>, java.io.Serializable, Cloneable, Comparable<worker_getPinIdList_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_getPinIdList_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.SET, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_getPinIdList_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_getPinIdList_resultTupleSchemeFactory()); } public Set<Integer> success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_getPinIdList_result.class, metaDataMap); } public worker_getPinIdList_result() { } public worker_getPinIdList_result( Set<Integer> success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public worker_getPinIdList_result(worker_getPinIdList_result other) { if (other.isSetSuccess()) { Set<Integer> __this__success = new HashSet<Integer>(other.success); this.success = __this__success; } } public worker_getPinIdList_result deepCopy() { return new worker_getPinIdList_result(this); } @Override public void clear() { this.success = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<Integer> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(int elem) { if (this.success == null) { this.success = new HashSet<Integer>(); } this.success.add(elem); } public Set<Integer> getSuccess() { return this.success; } public worker_getPinIdList_result setSuccess(Set<Integer> success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Set<Integer>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_getPinIdList_result) return this.equals((worker_getPinIdList_result)that); return false; } public boolean equals(worker_getPinIdList_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_getPinIdList_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_getPinIdList_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_getPinIdList_resultStandardSchemeFactory implements SchemeFactory { public worker_getPinIdList_resultStandardScheme getScheme() { return new worker_getPinIdList_resultStandardScheme(); } } private static class worker_getPinIdList_resultStandardScheme extends StandardScheme<worker_getPinIdList_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_getPinIdList_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.SET) { { org.apache.thrift.protocol.TSet _set80 = iprot.readSetBegin(); struct.success = new HashSet<Integer>(2*_set80.size); for (int _i81 = 0; _i81 < _set80.size; ++_i81) { int _elem82; _elem82 = iprot.readI32(); struct.success.add(_elem82); } iprot.readSetEnd(); } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_getPinIdList_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.success.size())); for (int _iter83 : struct.success) { oprot.writeI32(_iter83); } oprot.writeSetEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_getPinIdList_resultTupleSchemeFactory implements SchemeFactory { public worker_getPinIdList_resultTupleScheme getScheme() { return new worker_getPinIdList_resultTupleScheme(); } } private static class worker_getPinIdList_resultTupleScheme extends TupleScheme<worker_getPinIdList_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_getPinIdList_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (int _iter84 : struct.success) { oprot.writeI32(_iter84); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_getPinIdList_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TSet _set85 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32()); struct.success = new HashSet<Integer>(2*_set85.size); for (int _i86 = 0; _i86 < _set85.size; ++_i86) { int _elem87; _elem87 = iprot.readI32(); struct.success.add(_elem87); } } struct.setSuccessIsSet(true); } } } } public static class worker_getPriorityDependencyList_args implements org.apache.thrift.TBase<worker_getPriorityDependencyList_args, worker_getPriorityDependencyList_args._Fields>, java.io.Serializable, Cloneable, Comparable<worker_getPriorityDependencyList_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_getPriorityDependencyList_args"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_getPriorityDependencyList_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_getPriorityDependencyList_argsTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_getPriorityDependencyList_args.class, metaDataMap); } public worker_getPriorityDependencyList_args() { } /** * Performs a deep copy on <i>other</i>. */ public worker_getPriorityDependencyList_args(worker_getPriorityDependencyList_args other) { } public worker_getPriorityDependencyList_args deepCopy() { return new worker_getPriorityDependencyList_args(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_getPriorityDependencyList_args) return this.equals((worker_getPriorityDependencyList_args)that); return false; } public boolean equals(worker_getPriorityDependencyList_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_getPriorityDependencyList_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_getPriorityDependencyList_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_getPriorityDependencyList_argsStandardSchemeFactory implements SchemeFactory { public worker_getPriorityDependencyList_argsStandardScheme getScheme() { return new worker_getPriorityDependencyList_argsStandardScheme(); } } private static class worker_getPriorityDependencyList_argsStandardScheme extends StandardScheme<worker_getPriorityDependencyList_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_getPriorityDependencyList_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_getPriorityDependencyList_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_getPriorityDependencyList_argsTupleSchemeFactory implements SchemeFactory { public worker_getPriorityDependencyList_argsTupleScheme getScheme() { return new worker_getPriorityDependencyList_argsTupleScheme(); } } private static class worker_getPriorityDependencyList_argsTupleScheme extends TupleScheme<worker_getPriorityDependencyList_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_getPriorityDependencyList_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_getPriorityDependencyList_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class worker_getPriorityDependencyList_result implements org.apache.thrift.TBase<worker_getPriorityDependencyList_result, worker_getPriorityDependencyList_result._Fields>, java.io.Serializable, Cloneable, Comparable<worker_getPriorityDependencyList_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_getPriorityDependencyList_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_getPriorityDependencyList_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_getPriorityDependencyList_resultTupleSchemeFactory()); } public List<Integer> success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_getPriorityDependencyList_result.class, metaDataMap); } public worker_getPriorityDependencyList_result() { } public worker_getPriorityDependencyList_result( List<Integer> success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public worker_getPriorityDependencyList_result(worker_getPriorityDependencyList_result other) { if (other.isSetSuccess()) { List<Integer> __this__success = new ArrayList<Integer>(other.success); this.success = __this__success; } } public worker_getPriorityDependencyList_result deepCopy() { return new worker_getPriorityDependencyList_result(this); } @Override public void clear() { this.success = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<Integer> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(int elem) { if (this.success == null) { this.success = new ArrayList<Integer>(); } this.success.add(elem); } public List<Integer> getSuccess() { return this.success; } public worker_getPriorityDependencyList_result setSuccess(List<Integer> success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<Integer>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_getPriorityDependencyList_result) return this.equals((worker_getPriorityDependencyList_result)that); return false; } public boolean equals(worker_getPriorityDependencyList_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_getPriorityDependencyList_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_getPriorityDependencyList_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_getPriorityDependencyList_resultStandardSchemeFactory implements SchemeFactory { public worker_getPriorityDependencyList_resultStandardScheme getScheme() { return new worker_getPriorityDependencyList_resultStandardScheme(); } } private static class worker_getPriorityDependencyList_resultStandardScheme extends StandardScheme<worker_getPriorityDependencyList_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_getPriorityDependencyList_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list88 = iprot.readListBegin(); struct.success = new ArrayList<Integer>(_list88.size); for (int _i89 = 0; _i89 < _list88.size; ++_i89) { int _elem90; _elem90 = iprot.readI32(); struct.success.add(_elem90); } iprot.readListEnd(); } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_getPriorityDependencyList_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.success.size())); for (int _iter91 : struct.success) { oprot.writeI32(_iter91); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_getPriorityDependencyList_resultTupleSchemeFactory implements SchemeFactory { public worker_getPriorityDependencyList_resultTupleScheme getScheme() { return new worker_getPriorityDependencyList_resultTupleScheme(); } } private static class worker_getPriorityDependencyList_resultTupleScheme extends TupleScheme<worker_getPriorityDependencyList_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_getPriorityDependencyList_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (int _iter92 : struct.success) { oprot.writeI32(_iter92); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_getPriorityDependencyList_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list93 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); struct.success = new ArrayList<Integer>(_list93.size); for (int _i94 = 0; _i94 < _list93.size; ++_i94) { int _elem95; _elem95 = iprot.readI32(); struct.success.add(_elem95); } } struct.setSuccessIsSet(true); } } } } public static class user_createDependency_args implements org.apache.thrift.TBase<user_createDependency_args, user_createDependency_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_createDependency_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createDependency_args"); private static final org.apache.thrift.protocol.TField PARENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("parents", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField CHILDREN_FIELD_DESC = new org.apache.thrift.protocol.TField("children", org.apache.thrift.protocol.TType.LIST, (short)2); private static final org.apache.thrift.protocol.TField COMMAND_PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("commandPrefix", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.LIST, (short)4); private static final org.apache.thrift.protocol.TField COMMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("comment", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.protocol.TField FRAMEWORK_FIELD_DESC = new org.apache.thrift.protocol.TField("framework", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.protocol.TField FRAMEWORK_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("frameworkVersion", org.apache.thrift.protocol.TType.STRING, (short)7); private static final org.apache.thrift.protocol.TField DEPENDENCY_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("dependencyType", org.apache.thrift.protocol.TType.I32, (short)8); private static final org.apache.thrift.protocol.TField CHILDREN_BLOCK_SIZE_BYTE_FIELD_DESC = new org.apache.thrift.protocol.TField("childrenBlockSizeByte", org.apache.thrift.protocol.TType.I64, (short)9); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createDependency_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createDependency_argsTupleSchemeFactory()); } public List<String> parents; // required public List<String> children; // required public String commandPrefix; // required public List<ByteBuffer> data; // required public String comment; // required public String framework; // required public String frameworkVersion; // required public int dependencyType; // required public long childrenBlockSizeByte; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PARENTS((short)1, "parents"), CHILDREN((short)2, "children"), COMMAND_PREFIX((short)3, "commandPrefix"), DATA((short)4, "data"), COMMENT((short)5, "comment"), FRAMEWORK((short)6, "framework"), FRAMEWORK_VERSION((short)7, "frameworkVersion"), DEPENDENCY_TYPE((short)8, "dependencyType"), CHILDREN_BLOCK_SIZE_BYTE((short)9, "childrenBlockSizeByte"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PARENTS return PARENTS; case 2: // CHILDREN return CHILDREN; case 3: // COMMAND_PREFIX return COMMAND_PREFIX; case 4: // DATA return DATA; case 5: // COMMENT return COMMENT; case 6: // FRAMEWORK return FRAMEWORK; case 7: // FRAMEWORK_VERSION return FRAMEWORK_VERSION; case 8: // DEPENDENCY_TYPE return DEPENDENCY_TYPE; case 9: // CHILDREN_BLOCK_SIZE_BYTE return CHILDREN_BLOCK_SIZE_BYTE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __DEPENDENCYTYPE_ISSET_ID = 0; private static final int __CHILDRENBLOCKSIZEBYTE_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PARENTS, new org.apache.thrift.meta_data.FieldMetaData("parents", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); tmpMap.put(_Fields.CHILDREN, new org.apache.thrift.meta_data.FieldMetaData("children", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); tmpMap.put(_Fields.COMMAND_PREFIX, new org.apache.thrift.meta_data.FieldMetaData("commandPrefix", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); tmpMap.put(_Fields.COMMENT, new org.apache.thrift.meta_data.FieldMetaData("comment", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.FRAMEWORK, new org.apache.thrift.meta_data.FieldMetaData("framework", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.FRAMEWORK_VERSION, new org.apache.thrift.meta_data.FieldMetaData("frameworkVersion", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DEPENDENCY_TYPE, new org.apache.thrift.meta_data.FieldMetaData("dependencyType", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.CHILDREN_BLOCK_SIZE_BYTE, new org.apache.thrift.meta_data.FieldMetaData("childrenBlockSizeByte", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createDependency_args.class, metaDataMap); } public user_createDependency_args() { } public user_createDependency_args( List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte) { this(); this.parents = parents; this.children = children; this.commandPrefix = commandPrefix; this.data = data; this.comment = comment; this.framework = framework; this.frameworkVersion = frameworkVersion; this.dependencyType = dependencyType; setDependencyTypeIsSet(true); this.childrenBlockSizeByte = childrenBlockSizeByte; setChildrenBlockSizeByteIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_createDependency_args(user_createDependency_args other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetParents()) { List<String> __this__parents = new ArrayList<String>(other.parents); this.parents = __this__parents; } if (other.isSetChildren()) { List<String> __this__children = new ArrayList<String>(other.children); this.children = __this__children; } if (other.isSetCommandPrefix()) { this.commandPrefix = other.commandPrefix; } if (other.isSetData()) { List<ByteBuffer> __this__data = new ArrayList<ByteBuffer>(other.data); this.data = __this__data; } if (other.isSetComment()) { this.comment = other.comment; } if (other.isSetFramework()) { this.framework = other.framework; } if (other.isSetFrameworkVersion()) { this.frameworkVersion = other.frameworkVersion; } this.dependencyType = other.dependencyType; this.childrenBlockSizeByte = other.childrenBlockSizeByte; } public user_createDependency_args deepCopy() { return new user_createDependency_args(this); } @Override public void clear() { this.parents = null; this.children = null; this.commandPrefix = null; this.data = null; this.comment = null; this.framework = null; this.frameworkVersion = null; setDependencyTypeIsSet(false); this.dependencyType = 0; setChildrenBlockSizeByteIsSet(false); this.childrenBlockSizeByte = 0; } public int getParentsSize() { return (this.parents == null) ? 0 : this.parents.size(); } public java.util.Iterator<String> getParentsIterator() { return (this.parents == null) ? null : this.parents.iterator(); } public void addToParents(String elem) { if (this.parents == null) { this.parents = new ArrayList<String>(); } this.parents.add(elem); } public List<String> getParents() { return this.parents; } public user_createDependency_args setParents(List<String> parents) { this.parents = parents; return this; } public void unsetParents() { this.parents = null; } /** Returns true if field parents is set (has been assigned a value) and false otherwise */ public boolean isSetParents() { return this.parents != null; } public void setParentsIsSet(boolean value) { if (!value) { this.parents = null; } } public int getChildrenSize() { return (this.children == null) ? 0 : this.children.size(); } public java.util.Iterator<String> getChildrenIterator() { return (this.children == null) ? null : this.children.iterator(); } public void addToChildren(String elem) { if (this.children == null) { this.children = new ArrayList<String>(); } this.children.add(elem); } public List<String> getChildren() { return this.children; } public user_createDependency_args setChildren(List<String> children) { this.children = children; return this; } public void unsetChildren() { this.children = null; } /** Returns true if field children is set (has been assigned a value) and false otherwise */ public boolean isSetChildren() { return this.children != null; } public void setChildrenIsSet(boolean value) { if (!value) { this.children = null; } } public String getCommandPrefix() { return this.commandPrefix; } public user_createDependency_args setCommandPrefix(String commandPrefix) { this.commandPrefix = commandPrefix; return this; } public void unsetCommandPrefix() { this.commandPrefix = null; } /** Returns true if field commandPrefix is set (has been assigned a value) and false otherwise */ public boolean isSetCommandPrefix() { return this.commandPrefix != null; } public void setCommandPrefixIsSet(boolean value) { if (!value) { this.commandPrefix = null; } } public int getDataSize() { return (this.data == null) ? 0 : this.data.size(); } public java.util.Iterator<ByteBuffer> getDataIterator() { return (this.data == null) ? null : this.data.iterator(); } public void addToData(ByteBuffer elem) { if (this.data == null) { this.data = new ArrayList<ByteBuffer>(); } this.data.add(elem); } public List<ByteBuffer> getData() { return this.data; } public user_createDependency_args setData(List<ByteBuffer> data) { this.data = data; return this; } public void unsetData() { this.data = null; } /** Returns true if field data is set (has been assigned a value) and false otherwise */ public boolean isSetData() { return this.data != null; } public void setDataIsSet(boolean value) { if (!value) { this.data = null; } } public String getComment() { return this.comment; } public user_createDependency_args setComment(String comment) { this.comment = comment; return this; } public void unsetComment() { this.comment = null; } /** Returns true if field comment is set (has been assigned a value) and false otherwise */ public boolean isSetComment() { return this.comment != null; } public void setCommentIsSet(boolean value) { if (!value) { this.comment = null; } } public String getFramework() { return this.framework; } public user_createDependency_args setFramework(String framework) { this.framework = framework; return this; } public void unsetFramework() { this.framework = null; } /** Returns true if field framework is set (has been assigned a value) and false otherwise */ public boolean isSetFramework() { return this.framework != null; } public void setFrameworkIsSet(boolean value) { if (!value) { this.framework = null; } } public String getFrameworkVersion() { return this.frameworkVersion; } public user_createDependency_args setFrameworkVersion(String frameworkVersion) { this.frameworkVersion = frameworkVersion; return this; } public void unsetFrameworkVersion() { this.frameworkVersion = null; } /** Returns true if field frameworkVersion is set (has been assigned a value) and false otherwise */ public boolean isSetFrameworkVersion() { return this.frameworkVersion != null; } public void setFrameworkVersionIsSet(boolean value) { if (!value) { this.frameworkVersion = null; } } public int getDependencyType() { return this.dependencyType; } public user_createDependency_args setDependencyType(int dependencyType) { this.dependencyType = dependencyType; setDependencyTypeIsSet(true); return this; } public void unsetDependencyType() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DEPENDENCYTYPE_ISSET_ID); } /** Returns true if field dependencyType is set (has been assigned a value) and false otherwise */ public boolean isSetDependencyType() { return EncodingUtils.testBit(__isset_bitfield, __DEPENDENCYTYPE_ISSET_ID); } public void setDependencyTypeIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DEPENDENCYTYPE_ISSET_ID, value); } public long getChildrenBlockSizeByte() { return this.childrenBlockSizeByte; } public user_createDependency_args setChildrenBlockSizeByte(long childrenBlockSizeByte) { this.childrenBlockSizeByte = childrenBlockSizeByte; setChildrenBlockSizeByteIsSet(true); return this; } public void unsetChildrenBlockSizeByte() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CHILDRENBLOCKSIZEBYTE_ISSET_ID); } /** Returns true if field childrenBlockSizeByte is set (has been assigned a value) and false otherwise */ public boolean isSetChildrenBlockSizeByte() { return EncodingUtils.testBit(__isset_bitfield, __CHILDRENBLOCKSIZEBYTE_ISSET_ID); } public void setChildrenBlockSizeByteIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CHILDRENBLOCKSIZEBYTE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case PARENTS: if (value == null) { unsetParents(); } else { setParents((List<String>)value); } break; case CHILDREN: if (value == null) { unsetChildren(); } else { setChildren((List<String>)value); } break; case COMMAND_PREFIX: if (value == null) { unsetCommandPrefix(); } else { setCommandPrefix((String)value); } break; case DATA: if (value == null) { unsetData(); } else { setData((List<ByteBuffer>)value); } break; case COMMENT: if (value == null) { unsetComment(); } else { setComment((String)value); } break; case FRAMEWORK: if (value == null) { unsetFramework(); } else { setFramework((String)value); } break; case FRAMEWORK_VERSION: if (value == null) { unsetFrameworkVersion(); } else { setFrameworkVersion((String)value); } break; case DEPENDENCY_TYPE: if (value == null) { unsetDependencyType(); } else { setDependencyType((Integer)value); } break; case CHILDREN_BLOCK_SIZE_BYTE: if (value == null) { unsetChildrenBlockSizeByte(); } else { setChildrenBlockSizeByte((Long)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PARENTS: return getParents(); case CHILDREN: return getChildren(); case COMMAND_PREFIX: return getCommandPrefix(); case DATA: return getData(); case COMMENT: return getComment(); case FRAMEWORK: return getFramework(); case FRAMEWORK_VERSION: return getFrameworkVersion(); case DEPENDENCY_TYPE: return Integer.valueOf(getDependencyType()); case CHILDREN_BLOCK_SIZE_BYTE: return Long.valueOf(getChildrenBlockSizeByte()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PARENTS: return isSetParents(); case CHILDREN: return isSetChildren(); case COMMAND_PREFIX: return isSetCommandPrefix(); case DATA: return isSetData(); case COMMENT: return isSetComment(); case FRAMEWORK: return isSetFramework(); case FRAMEWORK_VERSION: return isSetFrameworkVersion(); case DEPENDENCY_TYPE: return isSetDependencyType(); case CHILDREN_BLOCK_SIZE_BYTE: return isSetChildrenBlockSizeByte(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createDependency_args) return this.equals((user_createDependency_args)that); return false; } public boolean equals(user_createDependency_args that) { if (that == null) return false; boolean this_present_parents = true && this.isSetParents(); boolean that_present_parents = true && that.isSetParents(); if (this_present_parents || that_present_parents) { if (!(this_present_parents && that_present_parents)) return false; if (!this.parents.equals(that.parents)) return false; } boolean this_present_children = true && this.isSetChildren(); boolean that_present_children = true && that.isSetChildren(); if (this_present_children || that_present_children) { if (!(this_present_children && that_present_children)) return false; if (!this.children.equals(that.children)) return false; } boolean this_present_commandPrefix = true && this.isSetCommandPrefix(); boolean that_present_commandPrefix = true && that.isSetCommandPrefix(); if (this_present_commandPrefix || that_present_commandPrefix) { if (!(this_present_commandPrefix && that_present_commandPrefix)) return false; if (!this.commandPrefix.equals(that.commandPrefix)) return false; } boolean this_present_data = true && this.isSetData(); boolean that_present_data = true && that.isSetData(); if (this_present_data || that_present_data) { if (!(this_present_data && that_present_data)) return false; if (!this.data.equals(that.data)) return false; } boolean this_present_comment = true && this.isSetComment(); boolean that_present_comment = true && that.isSetComment(); if (this_present_comment || that_present_comment) { if (!(this_present_comment && that_present_comment)) return false; if (!this.comment.equals(that.comment)) return false; } boolean this_present_framework = true && this.isSetFramework(); boolean that_present_framework = true && that.isSetFramework(); if (this_present_framework || that_present_framework) { if (!(this_present_framework && that_present_framework)) return false; if (!this.framework.equals(that.framework)) return false; } boolean this_present_frameworkVersion = true && this.isSetFrameworkVersion(); boolean that_present_frameworkVersion = true && that.isSetFrameworkVersion(); if (this_present_frameworkVersion || that_present_frameworkVersion) { if (!(this_present_frameworkVersion && that_present_frameworkVersion)) return false; if (!this.frameworkVersion.equals(that.frameworkVersion)) return false; } boolean this_present_dependencyType = true; boolean that_present_dependencyType = true; if (this_present_dependencyType || that_present_dependencyType) { if (!(this_present_dependencyType && that_present_dependencyType)) return false; if (this.dependencyType != that.dependencyType) return false; } boolean this_present_childrenBlockSizeByte = true; boolean that_present_childrenBlockSizeByte = true; if (this_present_childrenBlockSizeByte || that_present_childrenBlockSizeByte) { if (!(this_present_childrenBlockSizeByte && that_present_childrenBlockSizeByte)) return false; if (this.childrenBlockSizeByte != that.childrenBlockSizeByte) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createDependency_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetParents()).compareTo(other.isSetParents()); if (lastComparison != 0) { return lastComparison; } if (isSetParents()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parents, other.parents); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetChildren()).compareTo(other.isSetChildren()); if (lastComparison != 0) { return lastComparison; } if (isSetChildren()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.children, other.children); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetCommandPrefix()).compareTo(other.isSetCommandPrefix()); if (lastComparison != 0) { return lastComparison; } if (isSetCommandPrefix()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.commandPrefix, other.commandPrefix); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetData()).compareTo(other.isSetData()); if (lastComparison != 0) { return lastComparison; } if (isSetData()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, other.data); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetComment()).compareTo(other.isSetComment()); if (lastComparison != 0) { return lastComparison; } if (isSetComment()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.comment, other.comment); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetFramework()).compareTo(other.isSetFramework()); if (lastComparison != 0) { return lastComparison; } if (isSetFramework()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.framework, other.framework); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetFrameworkVersion()).compareTo(other.isSetFrameworkVersion()); if (lastComparison != 0) { return lastComparison; } if (isSetFrameworkVersion()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.frameworkVersion, other.frameworkVersion); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDependencyType()).compareTo(other.isSetDependencyType()); if (lastComparison != 0) { return lastComparison; } if (isSetDependencyType()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dependencyType, other.dependencyType); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetChildrenBlockSizeByte()).compareTo(other.isSetChildrenBlockSizeByte()); if (lastComparison != 0) { return lastComparison; } if (isSetChildrenBlockSizeByte()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.childrenBlockSizeByte, other.childrenBlockSizeByte); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createDependency_args("); boolean first = true; sb.append("parents:"); if (this.parents == null) { sb.append("null"); } else { sb.append(this.parents); } first = false; if (!first) sb.append(", "); sb.append("children:"); if (this.children == null) { sb.append("null"); } else { sb.append(this.children); } first = false; if (!first) sb.append(", "); sb.append("commandPrefix:"); if (this.commandPrefix == null) { sb.append("null"); } else { sb.append(this.commandPrefix); } first = false; if (!first) sb.append(", "); sb.append("data:"); if (this.data == null) { sb.append("null"); } else { sb.append(this.data); } first = false; if (!first) sb.append(", "); sb.append("comment:"); if (this.comment == null) { sb.append("null"); } else { sb.append(this.comment); } first = false; if (!first) sb.append(", "); sb.append("framework:"); if (this.framework == null) { sb.append("null"); } else { sb.append(this.framework); } first = false; if (!first) sb.append(", "); sb.append("frameworkVersion:"); if (this.frameworkVersion == null) { sb.append("null"); } else { sb.append(this.frameworkVersion); } first = false; if (!first) sb.append(", "); sb.append("dependencyType:"); sb.append(this.dependencyType); first = false; if (!first) sb.append(", "); sb.append("childrenBlockSizeByte:"); sb.append(this.childrenBlockSizeByte); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createDependency_argsStandardSchemeFactory implements SchemeFactory { public user_createDependency_argsStandardScheme getScheme() { return new user_createDependency_argsStandardScheme(); } } private static class user_createDependency_argsStandardScheme extends StandardScheme<user_createDependency_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createDependency_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PARENTS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list96 = iprot.readListBegin(); struct.parents = new ArrayList<String>(_list96.size); for (int _i97 = 0; _i97 < _list96.size; ++_i97) { String _elem98; _elem98 = iprot.readString(); struct.parents.add(_elem98); } iprot.readListEnd(); } struct.setParentsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // CHILDREN if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list99 = iprot.readListBegin(); struct.children = new ArrayList<String>(_list99.size); for (int _i100 = 0; _i100 < _list99.size; ++_i100) { String _elem101; _elem101 = iprot.readString(); struct.children.add(_elem101); } iprot.readListEnd(); } struct.setChildrenIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // COMMAND_PREFIX if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.commandPrefix = iprot.readString(); struct.setCommandPrefixIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // DATA if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list102 = iprot.readListBegin(); struct.data = new ArrayList<ByteBuffer>(_list102.size); for (int _i103 = 0; _i103 < _list102.size; ++_i103) { ByteBuffer _elem104; _elem104 = iprot.readBinary(); struct.data.add(_elem104); } iprot.readListEnd(); } struct.setDataIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // COMMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.comment = iprot.readString(); struct.setCommentIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // FRAMEWORK if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.framework = iprot.readString(); struct.setFrameworkIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // FRAMEWORK_VERSION if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.frameworkVersion = iprot.readString(); struct.setFrameworkVersionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // DEPENDENCY_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.dependencyType = iprot.readI32(); struct.setDependencyTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 9: // CHILDREN_BLOCK_SIZE_BYTE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.childrenBlockSizeByte = iprot.readI64(); struct.setChildrenBlockSizeByteIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createDependency_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.parents != null) { oprot.writeFieldBegin(PARENTS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.parents.size())); for (String _iter105 : struct.parents) { oprot.writeString(_iter105); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.children != null) { oprot.writeFieldBegin(CHILDREN_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.children.size())); for (String _iter106 : struct.children) { oprot.writeString(_iter106); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.commandPrefix != null) { oprot.writeFieldBegin(COMMAND_PREFIX_FIELD_DESC); oprot.writeString(struct.commandPrefix); oprot.writeFieldEnd(); } if (struct.data != null) { oprot.writeFieldBegin(DATA_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.data.size())); for (ByteBuffer _iter107 : struct.data) { oprot.writeBinary(_iter107); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.comment != null) { oprot.writeFieldBegin(COMMENT_FIELD_DESC); oprot.writeString(struct.comment); oprot.writeFieldEnd(); } if (struct.framework != null) { oprot.writeFieldBegin(FRAMEWORK_FIELD_DESC); oprot.writeString(struct.framework); oprot.writeFieldEnd(); } if (struct.frameworkVersion != null) { oprot.writeFieldBegin(FRAMEWORK_VERSION_FIELD_DESC); oprot.writeString(struct.frameworkVersion); oprot.writeFieldEnd(); } oprot.writeFieldBegin(DEPENDENCY_TYPE_FIELD_DESC); oprot.writeI32(struct.dependencyType); oprot.writeFieldEnd(); oprot.writeFieldBegin(CHILDREN_BLOCK_SIZE_BYTE_FIELD_DESC); oprot.writeI64(struct.childrenBlockSizeByte); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createDependency_argsTupleSchemeFactory implements SchemeFactory { public user_createDependency_argsTupleScheme getScheme() { return new user_createDependency_argsTupleScheme(); } } private static class user_createDependency_argsTupleScheme extends TupleScheme<user_createDependency_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createDependency_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetParents()) { optionals.set(0); } if (struct.isSetChildren()) { optionals.set(1); } if (struct.isSetCommandPrefix()) { optionals.set(2); } if (struct.isSetData()) { optionals.set(3); } if (struct.isSetComment()) { optionals.set(4); } if (struct.isSetFramework()) { optionals.set(5); } if (struct.isSetFrameworkVersion()) { optionals.set(6); } if (struct.isSetDependencyType()) { optionals.set(7); } if (struct.isSetChildrenBlockSizeByte()) { optionals.set(8); } oprot.writeBitSet(optionals, 9); if (struct.isSetParents()) { { oprot.writeI32(struct.parents.size()); for (String _iter108 : struct.parents) { oprot.writeString(_iter108); } } } if (struct.isSetChildren()) { { oprot.writeI32(struct.children.size()); for (String _iter109 : struct.children) { oprot.writeString(_iter109); } } } if (struct.isSetCommandPrefix()) { oprot.writeString(struct.commandPrefix); } if (struct.isSetData()) { { oprot.writeI32(struct.data.size()); for (ByteBuffer _iter110 : struct.data) { oprot.writeBinary(_iter110); } } } if (struct.isSetComment()) { oprot.writeString(struct.comment); } if (struct.isSetFramework()) { oprot.writeString(struct.framework); } if (struct.isSetFrameworkVersion()) { oprot.writeString(struct.frameworkVersion); } if (struct.isSetDependencyType()) { oprot.writeI32(struct.dependencyType); } if (struct.isSetChildrenBlockSizeByte()) { oprot.writeI64(struct.childrenBlockSizeByte); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createDependency_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(9); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list111 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.parents = new ArrayList<String>(_list111.size); for (int _i112 = 0; _i112 < _list111.size; ++_i112) { String _elem113; _elem113 = iprot.readString(); struct.parents.add(_elem113); } } struct.setParentsIsSet(true); } if (incoming.get(1)) { { org.apache.thrift.protocol.TList _list114 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.children = new ArrayList<String>(_list114.size); for (int _i115 = 0; _i115 < _list114.size; ++_i115) { String _elem116; _elem116 = iprot.readString(); struct.children.add(_elem116); } } struct.setChildrenIsSet(true); } if (incoming.get(2)) { struct.commandPrefix = iprot.readString(); struct.setCommandPrefixIsSet(true); } if (incoming.get(3)) { { org.apache.thrift.protocol.TList _list117 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.data = new ArrayList<ByteBuffer>(_list117.size); for (int _i118 = 0; _i118 < _list117.size; ++_i118) { ByteBuffer _elem119; _elem119 = iprot.readBinary(); struct.data.add(_elem119); } } struct.setDataIsSet(true); } if (incoming.get(4)) { struct.comment = iprot.readString(); struct.setCommentIsSet(true); } if (incoming.get(5)) { struct.framework = iprot.readString(); struct.setFrameworkIsSet(true); } if (incoming.get(6)) { struct.frameworkVersion = iprot.readString(); struct.setFrameworkVersionIsSet(true); } if (incoming.get(7)) { struct.dependencyType = iprot.readI32(); struct.setDependencyTypeIsSet(true); } if (incoming.get(8)) { struct.childrenBlockSizeByte = iprot.readI64(); struct.setChildrenBlockSizeByteIsSet(true); } } } } public static class user_createDependency_result implements org.apache.thrift.TBase<user_createDependency_result, user_createDependency_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_createDependency_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createDependency_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField E_A_FIELD_DESC = new org.apache.thrift.protocol.TField("eA", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField E_B_FIELD_DESC = new org.apache.thrift.protocol.TField("eB", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)5); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createDependency_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createDependency_resultTupleSchemeFactory()); } public int success; // required public InvalidPathException eI; // required public FileDoesNotExistException eF; // required public FileAlreadyExistException eA; // required public BlockInfoException eB; // required public TachyonException eT; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_I((short)1, "eI"), E_F((short)2, "eF"), E_A((short)3, "eA"), E_B((short)4, "eB"), E_T((short)5, "eT"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_I return E_I; case 2: // E_F return E_F; case 3: // E_A return E_A; case 4: // E_B return E_B; case 5: // E_T return E_T; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_F, new org.apache.thrift.meta_data.FieldMetaData("eF", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_A, new org.apache.thrift.meta_data.FieldMetaData("eA", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_B, new org.apache.thrift.meta_data.FieldMetaData("eB", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_T, new org.apache.thrift.meta_data.FieldMetaData("eT", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createDependency_result.class, metaDataMap); } public user_createDependency_result() { } public user_createDependency_result( int success, InvalidPathException eI, FileDoesNotExistException eF, FileAlreadyExistException eA, BlockInfoException eB, TachyonException eT) { this(); this.success = success; setSuccessIsSet(true); this.eI = eI; this.eF = eF; this.eA = eA; this.eB = eB; this.eT = eT; } /** * Performs a deep copy on <i>other</i>. */ public user_createDependency_result(user_createDependency_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } if (other.isSetEF()) { this.eF = new FileDoesNotExistException(other.eF); } if (other.isSetEA()) { this.eA = new FileAlreadyExistException(other.eA); } if (other.isSetEB()) { this.eB = new BlockInfoException(other.eB); } if (other.isSetET()) { this.eT = new TachyonException(other.eT); } } public user_createDependency_result deepCopy() { return new user_createDependency_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.eI = null; this.eF = null; this.eA = null; this.eB = null; this.eT = null; } public int getSuccess() { return this.success; } public user_createDependency_result setSuccess(int success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public InvalidPathException getEI() { return this.eI; } public user_createDependency_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public FileDoesNotExistException getEF() { return this.eF; } public user_createDependency_result setEF(FileDoesNotExistException eF) { this.eF = eF; return this; } public void unsetEF() { this.eF = null; } /** Returns true if field eF is set (has been assigned a value) and false otherwise */ public boolean isSetEF() { return this.eF != null; } public void setEFIsSet(boolean value) { if (!value) { this.eF = null; } } public FileAlreadyExistException getEA() { return this.eA; } public user_createDependency_result setEA(FileAlreadyExistException eA) { this.eA = eA; return this; } public void unsetEA() { this.eA = null; } /** Returns true if field eA is set (has been assigned a value) and false otherwise */ public boolean isSetEA() { return this.eA != null; } public void setEAIsSet(boolean value) { if (!value) { this.eA = null; } } public BlockInfoException getEB() { return this.eB; } public user_createDependency_result setEB(BlockInfoException eB) { this.eB = eB; return this; } public void unsetEB() { this.eB = null; } /** Returns true if field eB is set (has been assigned a value) and false otherwise */ public boolean isSetEB() { return this.eB != null; } public void setEBIsSet(boolean value) { if (!value) { this.eB = null; } } public TachyonException getET() { return this.eT; } public user_createDependency_result setET(TachyonException eT) { this.eT = eT; return this; } public void unsetET() { this.eT = null; } /** Returns true if field eT is set (has been assigned a value) and false otherwise */ public boolean isSetET() { return this.eT != null; } public void setETIsSet(boolean value) { if (!value) { this.eT = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Integer)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; case E_F: if (value == null) { unsetEF(); } else { setEF((FileDoesNotExistException)value); } break; case E_A: if (value == null) { unsetEA(); } else { setEA((FileAlreadyExistException)value); } break; case E_B: if (value == null) { unsetEB(); } else { setEB((BlockInfoException)value); } break; case E_T: if (value == null) { unsetET(); } else { setET((TachyonException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Integer.valueOf(getSuccess()); case E_I: return getEI(); case E_F: return getEF(); case E_A: return getEA(); case E_B: return getEB(); case E_T: return getET(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_I: return isSetEI(); case E_F: return isSetEF(); case E_A: return isSetEA(); case E_B: return isSetEB(); case E_T: return isSetET(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createDependency_result) return this.equals((user_createDependency_result)that); return false; } public boolean equals(user_createDependency_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } boolean this_present_eF = true && this.isSetEF(); boolean that_present_eF = true && that.isSetEF(); if (this_present_eF || that_present_eF) { if (!(this_present_eF && that_present_eF)) return false; if (!this.eF.equals(that.eF)) return false; } boolean this_present_eA = true && this.isSetEA(); boolean that_present_eA = true && that.isSetEA(); if (this_present_eA || that_present_eA) { if (!(this_present_eA && that_present_eA)) return false; if (!this.eA.equals(that.eA)) return false; } boolean this_present_eB = true && this.isSetEB(); boolean that_present_eB = true && that.isSetEB(); if (this_present_eB || that_present_eB) { if (!(this_present_eB && that_present_eB)) return false; if (!this.eB.equals(that.eB)) return false; } boolean this_present_eT = true && this.isSetET(); boolean that_present_eT = true && that.isSetET(); if (this_present_eT || that_present_eT) { if (!(this_present_eT && that_present_eT)) return false; if (!this.eT.equals(that.eT)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createDependency_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEF()).compareTo(other.isSetEF()); if (lastComparison != 0) { return lastComparison; } if (isSetEF()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eF, other.eF); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEA()).compareTo(other.isSetEA()); if (lastComparison != 0) { return lastComparison; } if (isSetEA()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eA, other.eA); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEB()).compareTo(other.isSetEB()); if (lastComparison != 0) { return lastComparison; } if (isSetEB()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eB, other.eB); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetET()).compareTo(other.isSetET()); if (lastComparison != 0) { return lastComparison; } if (isSetET()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eT, other.eT); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createDependency_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; if (!first) sb.append(", "); sb.append("eF:"); if (this.eF == null) { sb.append("null"); } else { sb.append(this.eF); } first = false; if (!first) sb.append(", "); sb.append("eA:"); if (this.eA == null) { sb.append("null"); } else { sb.append(this.eA); } first = false; if (!first) sb.append(", "); sb.append("eB:"); if (this.eB == null) { sb.append("null"); } else { sb.append(this.eB); } first = false; if (!first) sb.append(", "); sb.append("eT:"); if (this.eT == null) { sb.append("null"); } else { sb.append(this.eT); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createDependency_resultStandardSchemeFactory implements SchemeFactory { public user_createDependency_resultStandardScheme getScheme() { return new user_createDependency_resultStandardScheme(); } } private static class user_createDependency_resultStandardScheme extends StandardScheme<user_createDependency_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createDependency_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_F if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // E_A if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eA = new FileAlreadyExistException(); struct.eA.read(iprot); struct.setEAIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // E_B if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // E_T if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eT = new TachyonException(); struct.eT.read(iprot); struct.setETIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createDependency_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI32(struct.success); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } if (struct.eF != null) { oprot.writeFieldBegin(E_F_FIELD_DESC); struct.eF.write(oprot); oprot.writeFieldEnd(); } if (struct.eA != null) { oprot.writeFieldBegin(E_A_FIELD_DESC); struct.eA.write(oprot); oprot.writeFieldEnd(); } if (struct.eB != null) { oprot.writeFieldBegin(E_B_FIELD_DESC); struct.eB.write(oprot); oprot.writeFieldEnd(); } if (struct.eT != null) { oprot.writeFieldBegin(E_T_FIELD_DESC); struct.eT.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createDependency_resultTupleSchemeFactory implements SchemeFactory { public user_createDependency_resultTupleScheme getScheme() { return new user_createDependency_resultTupleScheme(); } } private static class user_createDependency_resultTupleScheme extends TupleScheme<user_createDependency_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createDependency_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetEI()) { optionals.set(1); } if (struct.isSetEF()) { optionals.set(2); } if (struct.isSetEA()) { optionals.set(3); } if (struct.isSetEB()) { optionals.set(4); } if (struct.isSetET()) { optionals.set(5); } oprot.writeBitSet(optionals, 6); if (struct.isSetSuccess()) { oprot.writeI32(struct.success); } if (struct.isSetEI()) { struct.eI.write(oprot); } if (struct.isSetEF()) { struct.eF.write(oprot); } if (struct.isSetEA()) { struct.eA.write(oprot); } if (struct.isSetEB()) { struct.eB.write(oprot); } if (struct.isSetET()) { struct.eT.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createDependency_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } if (incoming.get(2)) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } if (incoming.get(3)) { struct.eA = new FileAlreadyExistException(); struct.eA.read(iprot); struct.setEAIsSet(true); } if (incoming.get(4)) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } if (incoming.get(5)) { struct.eT = new TachyonException(); struct.eT.read(iprot); struct.setETIsSet(true); } } } } public static class user_getClientDependencyInfo_args implements org.apache.thrift.TBase<user_getClientDependencyInfo_args, user_getClientDependencyInfo_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getClientDependencyInfo_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientDependencyInfo_args"); private static final org.apache.thrift.protocol.TField DEPENDENCY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("dependencyId", org.apache.thrift.protocol.TType.I32, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getClientDependencyInfo_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getClientDependencyInfo_argsTupleSchemeFactory()); } public int dependencyId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { DEPENDENCY_ID((short)1, "dependencyId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // DEPENDENCY_ID return DEPENDENCY_ID; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __DEPENDENCYID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.DEPENDENCY_ID, new org.apache.thrift.meta_data.FieldMetaData("dependencyId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientDependencyInfo_args.class, metaDataMap); } public user_getClientDependencyInfo_args() { } public user_getClientDependencyInfo_args( int dependencyId) { this(); this.dependencyId = dependencyId; setDependencyIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_getClientDependencyInfo_args(user_getClientDependencyInfo_args other) { __isset_bitfield = other.__isset_bitfield; this.dependencyId = other.dependencyId; } public user_getClientDependencyInfo_args deepCopy() { return new user_getClientDependencyInfo_args(this); } @Override public void clear() { setDependencyIdIsSet(false); this.dependencyId = 0; } public int getDependencyId() { return this.dependencyId; } public user_getClientDependencyInfo_args setDependencyId(int dependencyId) { this.dependencyId = dependencyId; setDependencyIdIsSet(true); return this; } public void unsetDependencyId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DEPENDENCYID_ISSET_ID); } /** Returns true if field dependencyId is set (has been assigned a value) and false otherwise */ public boolean isSetDependencyId() { return EncodingUtils.testBit(__isset_bitfield, __DEPENDENCYID_ISSET_ID); } public void setDependencyIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DEPENDENCYID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case DEPENDENCY_ID: if (value == null) { unsetDependencyId(); } else { setDependencyId((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case DEPENDENCY_ID: return Integer.valueOf(getDependencyId()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case DEPENDENCY_ID: return isSetDependencyId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getClientDependencyInfo_args) return this.equals((user_getClientDependencyInfo_args)that); return false; } public boolean equals(user_getClientDependencyInfo_args that) { if (that == null) return false; boolean this_present_dependencyId = true; boolean that_present_dependencyId = true; if (this_present_dependencyId || that_present_dependencyId) { if (!(this_present_dependencyId && that_present_dependencyId)) return false; if (this.dependencyId != that.dependencyId) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getClientDependencyInfo_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetDependencyId()).compareTo(other.isSetDependencyId()); if (lastComparison != 0) { return lastComparison; } if (isSetDependencyId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dependencyId, other.dependencyId); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getClientDependencyInfo_args("); boolean first = true; sb.append("dependencyId:"); sb.append(this.dependencyId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getClientDependencyInfo_argsStandardSchemeFactory implements SchemeFactory { public user_getClientDependencyInfo_argsStandardScheme getScheme() { return new user_getClientDependencyInfo_argsStandardScheme(); } } private static class user_getClientDependencyInfo_argsStandardScheme extends StandardScheme<user_getClientDependencyInfo_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientDependencyInfo_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // DEPENDENCY_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.dependencyId = iprot.readI32(); struct.setDependencyIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientDependencyInfo_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(DEPENDENCY_ID_FIELD_DESC); oprot.writeI32(struct.dependencyId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getClientDependencyInfo_argsTupleSchemeFactory implements SchemeFactory { public user_getClientDependencyInfo_argsTupleScheme getScheme() { return new user_getClientDependencyInfo_argsTupleScheme(); } } private static class user_getClientDependencyInfo_argsTupleScheme extends TupleScheme<user_getClientDependencyInfo_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientDependencyInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetDependencyId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetDependencyId()) { oprot.writeI32(struct.dependencyId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientDependencyInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.dependencyId = iprot.readI32(); struct.setDependencyIdIsSet(true); } } } } public static class user_getClientDependencyInfo_result implements org.apache.thrift.TBase<user_getClientDependencyInfo_result, user_getClientDependencyInfo_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getClientDependencyInfo_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientDependencyInfo_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getClientDependencyInfo_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getClientDependencyInfo_resultTupleSchemeFactory()); } public ClientDependencyInfo success; // required public DependencyDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientDependencyInfo.class))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientDependencyInfo_result.class, metaDataMap); } public user_getClientDependencyInfo_result() { } public user_getClientDependencyInfo_result( ClientDependencyInfo success, DependencyDoesNotExistException e) { this(); this.success = success; this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_getClientDependencyInfo_result(user_getClientDependencyInfo_result other) { if (other.isSetSuccess()) { this.success = new ClientDependencyInfo(other.success); } if (other.isSetE()) { this.e = new DependencyDoesNotExistException(other.e); } } public user_getClientDependencyInfo_result deepCopy() { return new user_getClientDependencyInfo_result(this); } @Override public void clear() { this.success = null; this.e = null; } public ClientDependencyInfo getSuccess() { return this.success; } public user_getClientDependencyInfo_result setSuccess(ClientDependencyInfo success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public DependencyDoesNotExistException getE() { return this.e; } public user_getClientDependencyInfo_result setE(DependencyDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((ClientDependencyInfo)value); } break; case E: if (value == null) { unsetE(); } else { setE((DependencyDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getClientDependencyInfo_result) return this.equals((user_getClientDependencyInfo_result)that); return false; } public boolean equals(user_getClientDependencyInfo_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getClientDependencyInfo_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getClientDependencyInfo_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getClientDependencyInfo_resultStandardSchemeFactory implements SchemeFactory { public user_getClientDependencyInfo_resultStandardScheme getScheme() { return new user_getClientDependencyInfo_resultStandardScheme(); } } private static class user_getClientDependencyInfo_resultStandardScheme extends StandardScheme<user_getClientDependencyInfo_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientDependencyInfo_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new ClientDependencyInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new DependencyDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientDependencyInfo_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getClientDependencyInfo_resultTupleSchemeFactory implements SchemeFactory { public user_getClientDependencyInfo_resultTupleScheme getScheme() { return new user_getClientDependencyInfo_resultTupleScheme(); } } private static class user_getClientDependencyInfo_resultTupleScheme extends TupleScheme<user_getClientDependencyInfo_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientDependencyInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientDependencyInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new ClientDependencyInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new DependencyDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_reportLostFile_args implements org.apache.thrift.TBase<user_reportLostFile_args, user_reportLostFile_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_reportLostFile_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_reportLostFile_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_reportLostFile_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_reportLostFile_argsTupleSchemeFactory()); } public int fileId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_reportLostFile_args.class, metaDataMap); } public user_reportLostFile_args() { } public user_reportLostFile_args( int fileId) { this(); this.fileId = fileId; setFileIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_reportLostFile_args(user_reportLostFile_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; } public user_reportLostFile_args deepCopy() { return new user_reportLostFile_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; } public int getFileId() { return this.fileId; } public user_reportLostFile_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_reportLostFile_args) return this.equals((user_reportLostFile_args)that); return false; } public boolean equals(user_reportLostFile_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_reportLostFile_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_reportLostFile_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_reportLostFile_argsStandardSchemeFactory implements SchemeFactory { public user_reportLostFile_argsStandardScheme getScheme() { return new user_reportLostFile_argsStandardScheme(); } } private static class user_reportLostFile_argsStandardScheme extends StandardScheme<user_reportLostFile_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_reportLostFile_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_reportLostFile_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_reportLostFile_argsTupleSchemeFactory implements SchemeFactory { public user_reportLostFile_argsTupleScheme getScheme() { return new user_reportLostFile_argsTupleScheme(); } } private static class user_reportLostFile_argsTupleScheme extends TupleScheme<user_reportLostFile_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_reportLostFile_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_reportLostFile_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } } } } public static class user_reportLostFile_result implements org.apache.thrift.TBase<user_reportLostFile_result, user_reportLostFile_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_reportLostFile_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_reportLostFile_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_reportLostFile_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_reportLostFile_resultTupleSchemeFactory()); } public FileDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_reportLostFile_result.class, metaDataMap); } public user_reportLostFile_result() { } public user_reportLostFile_result( FileDoesNotExistException e) { this(); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_reportLostFile_result(user_reportLostFile_result other) { if (other.isSetE()) { this.e = new FileDoesNotExistException(other.e); } } public user_reportLostFile_result deepCopy() { return new user_reportLostFile_result(this); } @Override public void clear() { this.e = null; } public FileDoesNotExistException getE() { return this.e; } public user_reportLostFile_result setE(FileDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((FileDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_reportLostFile_result) return this.equals((user_reportLostFile_result)that); return false; } public boolean equals(user_reportLostFile_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_reportLostFile_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_reportLostFile_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_reportLostFile_resultStandardSchemeFactory implements SchemeFactory { public user_reportLostFile_resultStandardScheme getScheme() { return new user_reportLostFile_resultStandardScheme(); } } private static class user_reportLostFile_resultStandardScheme extends StandardScheme<user_reportLostFile_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_reportLostFile_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_reportLostFile_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_reportLostFile_resultTupleSchemeFactory implements SchemeFactory { public user_reportLostFile_resultTupleScheme getScheme() { return new user_reportLostFile_resultTupleScheme(); } } private static class user_reportLostFile_resultTupleScheme extends TupleScheme<user_reportLostFile_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_reportLostFile_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_reportLostFile_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_requestFilesInDependency_args implements org.apache.thrift.TBase<user_requestFilesInDependency_args, user_requestFilesInDependency_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_requestFilesInDependency_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_requestFilesInDependency_args"); private static final org.apache.thrift.protocol.TField DEP_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("depId", org.apache.thrift.protocol.TType.I32, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_requestFilesInDependency_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_requestFilesInDependency_argsTupleSchemeFactory()); } public int depId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { DEP_ID((short)1, "depId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // DEP_ID return DEP_ID; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __DEPID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.DEP_ID, new org.apache.thrift.meta_data.FieldMetaData("depId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_requestFilesInDependency_args.class, metaDataMap); } public user_requestFilesInDependency_args() { } public user_requestFilesInDependency_args( int depId) { this(); this.depId = depId; setDepIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_requestFilesInDependency_args(user_requestFilesInDependency_args other) { __isset_bitfield = other.__isset_bitfield; this.depId = other.depId; } public user_requestFilesInDependency_args deepCopy() { return new user_requestFilesInDependency_args(this); } @Override public void clear() { setDepIdIsSet(false); this.depId = 0; } public int getDepId() { return this.depId; } public user_requestFilesInDependency_args setDepId(int depId) { this.depId = depId; setDepIdIsSet(true); return this; } public void unsetDepId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DEPID_ISSET_ID); } /** Returns true if field depId is set (has been assigned a value) and false otherwise */ public boolean isSetDepId() { return EncodingUtils.testBit(__isset_bitfield, __DEPID_ISSET_ID); } public void setDepIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DEPID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case DEP_ID: if (value == null) { unsetDepId(); } else { setDepId((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case DEP_ID: return Integer.valueOf(getDepId()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case DEP_ID: return isSetDepId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_requestFilesInDependency_args) return this.equals((user_requestFilesInDependency_args)that); return false; } public boolean equals(user_requestFilesInDependency_args that) { if (that == null) return false; boolean this_present_depId = true; boolean that_present_depId = true; if (this_present_depId || that_present_depId) { if (!(this_present_depId && that_present_depId)) return false; if (this.depId != that.depId) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_requestFilesInDependency_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetDepId()).compareTo(other.isSetDepId()); if (lastComparison != 0) { return lastComparison; } if (isSetDepId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.depId, other.depId); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_requestFilesInDependency_args("); boolean first = true; sb.append("depId:"); sb.append(this.depId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_requestFilesInDependency_argsStandardSchemeFactory implements SchemeFactory { public user_requestFilesInDependency_argsStandardScheme getScheme() { return new user_requestFilesInDependency_argsStandardScheme(); } } private static class user_requestFilesInDependency_argsStandardScheme extends StandardScheme<user_requestFilesInDependency_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_requestFilesInDependency_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // DEP_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.depId = iprot.readI32(); struct.setDepIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_requestFilesInDependency_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(DEP_ID_FIELD_DESC); oprot.writeI32(struct.depId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_requestFilesInDependency_argsTupleSchemeFactory implements SchemeFactory { public user_requestFilesInDependency_argsTupleScheme getScheme() { return new user_requestFilesInDependency_argsTupleScheme(); } } private static class user_requestFilesInDependency_argsTupleScheme extends TupleScheme<user_requestFilesInDependency_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_requestFilesInDependency_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetDepId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetDepId()) { oprot.writeI32(struct.depId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_requestFilesInDependency_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.depId = iprot.readI32(); struct.setDepIdIsSet(true); } } } } public static class user_requestFilesInDependency_result implements org.apache.thrift.TBase<user_requestFilesInDependency_result, user_requestFilesInDependency_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_requestFilesInDependency_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_requestFilesInDependency_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_requestFilesInDependency_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_requestFilesInDependency_resultTupleSchemeFactory()); } public DependencyDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_requestFilesInDependency_result.class, metaDataMap); } public user_requestFilesInDependency_result() { } public user_requestFilesInDependency_result( DependencyDoesNotExistException e) { this(); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_requestFilesInDependency_result(user_requestFilesInDependency_result other) { if (other.isSetE()) { this.e = new DependencyDoesNotExistException(other.e); } } public user_requestFilesInDependency_result deepCopy() { return new user_requestFilesInDependency_result(this); } @Override public void clear() { this.e = null; } public DependencyDoesNotExistException getE() { return this.e; } public user_requestFilesInDependency_result setE(DependencyDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((DependencyDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_requestFilesInDependency_result) return this.equals((user_requestFilesInDependency_result)that); return false; } public boolean equals(user_requestFilesInDependency_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_requestFilesInDependency_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_requestFilesInDependency_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_requestFilesInDependency_resultStandardSchemeFactory implements SchemeFactory { public user_requestFilesInDependency_resultStandardScheme getScheme() { return new user_requestFilesInDependency_resultStandardScheme(); } } private static class user_requestFilesInDependency_resultStandardScheme extends StandardScheme<user_requestFilesInDependency_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_requestFilesInDependency_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new DependencyDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_requestFilesInDependency_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_requestFilesInDependency_resultTupleSchemeFactory implements SchemeFactory { public user_requestFilesInDependency_resultTupleScheme getScheme() { return new user_requestFilesInDependency_resultTupleScheme(); } } private static class user_requestFilesInDependency_resultTupleScheme extends TupleScheme<user_requestFilesInDependency_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_requestFilesInDependency_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_requestFilesInDependency_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.e = new DependencyDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_createFile_args implements org.apache.thrift.TBase<user_createFile_args, user_createFile_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_createFile_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createFile_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField UFS_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("ufsPath", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField BLOCK_SIZE_BYTE_FIELD_DESC = new org.apache.thrift.protocol.TField("blockSizeByte", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField RECURSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("recursive", org.apache.thrift.protocol.TType.BOOL, (short)4); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createFile_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createFile_argsTupleSchemeFactory()); } public String path; // required public String ufsPath; // required public long blockSizeByte; // required public boolean recursive; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PATH((short)1, "path"), UFS_PATH((short)2, "ufsPath"), BLOCK_SIZE_BYTE((short)3, "blockSizeByte"), RECURSIVE((short)4, "recursive"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // UFS_PATH return UFS_PATH; case 3: // BLOCK_SIZE_BYTE return BLOCK_SIZE_BYTE; case 4: // RECURSIVE return RECURSIVE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __BLOCKSIZEBYTE_ISSET_ID = 0; private static final int __RECURSIVE_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.UFS_PATH, new org.apache.thrift.meta_data.FieldMetaData("ufsPath", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.BLOCK_SIZE_BYTE, new org.apache.thrift.meta_data.FieldMetaData("blockSizeByte", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.RECURSIVE, new org.apache.thrift.meta_data.FieldMetaData("recursive", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createFile_args.class, metaDataMap); } public user_createFile_args() { } public user_createFile_args( String path, String ufsPath, long blockSizeByte, boolean recursive) { this(); this.path = path; this.ufsPath = ufsPath; this.blockSizeByte = blockSizeByte; setBlockSizeByteIsSet(true); this.recursive = recursive; setRecursiveIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_createFile_args(user_createFile_args other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetPath()) { this.path = other.path; } if (other.isSetUfsPath()) { this.ufsPath = other.ufsPath; } this.blockSizeByte = other.blockSizeByte; this.recursive = other.recursive; } public user_createFile_args deepCopy() { return new user_createFile_args(this); } @Override public void clear() { this.path = null; this.ufsPath = null; setBlockSizeByteIsSet(false); this.blockSizeByte = 0; setRecursiveIsSet(false); this.recursive = false; } public String getPath() { return this.path; } public user_createFile_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public String getUfsPath() { return this.ufsPath; } public user_createFile_args setUfsPath(String ufsPath) { this.ufsPath = ufsPath; return this; } public void unsetUfsPath() { this.ufsPath = null; } /** Returns true if field ufsPath is set (has been assigned a value) and false otherwise */ public boolean isSetUfsPath() { return this.ufsPath != null; } public void setUfsPathIsSet(boolean value) { if (!value) { this.ufsPath = null; } } public long getBlockSizeByte() { return this.blockSizeByte; } public user_createFile_args setBlockSizeByte(long blockSizeByte) { this.blockSizeByte = blockSizeByte; setBlockSizeByteIsSet(true); return this; } public void unsetBlockSizeByte() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKSIZEBYTE_ISSET_ID); } /** Returns true if field blockSizeByte is set (has been assigned a value) and false otherwise */ public boolean isSetBlockSizeByte() { return EncodingUtils.testBit(__isset_bitfield, __BLOCKSIZEBYTE_ISSET_ID); } public void setBlockSizeByteIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKSIZEBYTE_ISSET_ID, value); } public boolean isRecursive() { return this.recursive; } public user_createFile_args setRecursive(boolean recursive) { this.recursive = recursive; setRecursiveIsSet(true); return this; } public void unsetRecursive() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ public boolean isSetRecursive() { return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } public void setRecursiveIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case UFS_PATH: if (value == null) { unsetUfsPath(); } else { setUfsPath((String)value); } break; case BLOCK_SIZE_BYTE: if (value == null) { unsetBlockSizeByte(); } else { setBlockSizeByte((Long)value); } break; case RECURSIVE: if (value == null) { unsetRecursive(); } else { setRecursive((Boolean)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case UFS_PATH: return getUfsPath(); case BLOCK_SIZE_BYTE: return Long.valueOf(getBlockSizeByte()); case RECURSIVE: return Boolean.valueOf(isRecursive()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case UFS_PATH: return isSetUfsPath(); case BLOCK_SIZE_BYTE: return isSetBlockSizeByte(); case RECURSIVE: return isSetRecursive(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createFile_args) return this.equals((user_createFile_args)that); return false; } public boolean equals(user_createFile_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_ufsPath = true && this.isSetUfsPath(); boolean that_present_ufsPath = true && that.isSetUfsPath(); if (this_present_ufsPath || that_present_ufsPath) { if (!(this_present_ufsPath && that_present_ufsPath)) return false; if (!this.ufsPath.equals(that.ufsPath)) return false; } boolean this_present_blockSizeByte = true; boolean that_present_blockSizeByte = true; if (this_present_blockSizeByte || that_present_blockSizeByte) { if (!(this_present_blockSizeByte && that_present_blockSizeByte)) return false; if (this.blockSizeByte != that.blockSizeByte) return false; } boolean this_present_recursive = true; boolean that_present_recursive = true; if (this_present_recursive || that_present_recursive) { if (!(this_present_recursive && that_present_recursive)) return false; if (this.recursive != that.recursive) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createFile_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetUfsPath()).compareTo(other.isSetUfsPath()); if (lastComparison != 0) { return lastComparison; } if (isSetUfsPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ufsPath, other.ufsPath); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetBlockSizeByte()).compareTo(other.isSetBlockSizeByte()); if (lastComparison != 0) { return lastComparison; } if (isSetBlockSizeByte()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockSizeByte, other.blockSizeByte); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRecursive()).compareTo(other.isSetRecursive()); if (lastComparison != 0) { return lastComparison; } if (isSetRecursive()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recursive, other.recursive); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createFile_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("ufsPath:"); if (this.ufsPath == null) { sb.append("null"); } else { sb.append(this.ufsPath); } first = false; if (!first) sb.append(", "); sb.append("blockSizeByte:"); sb.append(this.blockSizeByte); first = false; if (!first) sb.append(", "); sb.append("recursive:"); sb.append(this.recursive); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createFile_argsStandardSchemeFactory implements SchemeFactory { public user_createFile_argsStandardScheme getScheme() { return new user_createFile_argsStandardScheme(); } } private static class user_createFile_argsStandardScheme extends StandardScheme<user_createFile_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createFile_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // UFS_PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.ufsPath = iprot.readString(); struct.setUfsPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // BLOCK_SIZE_BYTE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.blockSizeByte = iprot.readI64(); struct.setBlockSizeByteIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // RECURSIVE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createFile_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } if (struct.ufsPath != null) { oprot.writeFieldBegin(UFS_PATH_FIELD_DESC); oprot.writeString(struct.ufsPath); oprot.writeFieldEnd(); } oprot.writeFieldBegin(BLOCK_SIZE_BYTE_FIELD_DESC); oprot.writeI64(struct.blockSizeByte); oprot.writeFieldEnd(); oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); oprot.writeBool(struct.recursive); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createFile_argsTupleSchemeFactory implements SchemeFactory { public user_createFile_argsTupleScheme getScheme() { return new user_createFile_argsTupleScheme(); } } private static class user_createFile_argsTupleScheme extends TupleScheme<user_createFile_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createFile_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetUfsPath()) { optionals.set(1); } if (struct.isSetBlockSizeByte()) { optionals.set(2); } if (struct.isSetRecursive()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetUfsPath()) { oprot.writeString(struct.ufsPath); } if (struct.isSetBlockSizeByte()) { oprot.writeI64(struct.blockSizeByte); } if (struct.isSetRecursive()) { oprot.writeBool(struct.recursive); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createFile_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.ufsPath = iprot.readString(); struct.setUfsPathIsSet(true); } if (incoming.get(2)) { struct.blockSizeByte = iprot.readI64(); struct.setBlockSizeByteIsSet(true); } if (incoming.get(3)) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } } } } public static class user_createFile_result implements org.apache.thrift.TBase<user_createFile_result, user_createFile_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_createFile_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createFile_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); private static final org.apache.thrift.protocol.TField E_R_FIELD_DESC = new org.apache.thrift.protocol.TField("eR", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField E_B_FIELD_DESC = new org.apache.thrift.protocol.TField("eB", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField E_S_FIELD_DESC = new org.apache.thrift.protocol.TField("eS", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)5); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createFile_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createFile_resultTupleSchemeFactory()); } public int success; // required public FileAlreadyExistException eR; // required public InvalidPathException eI; // required public BlockInfoException eB; // required public SuspectedFileSizeException eS; // required public TachyonException eT; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_R((short)1, "eR"), E_I((short)2, "eI"), E_B((short)3, "eB"), E_S((short)4, "eS"), E_T((short)5, "eT"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_R return E_R; case 2: // E_I return E_I; case 3: // E_B return E_B; case 4: // E_S return E_S; case 5: // E_T return E_T; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.E_R, new org.apache.thrift.meta_data.FieldMetaData("eR", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_B, new org.apache.thrift.meta_data.FieldMetaData("eB", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_S, new org.apache.thrift.meta_data.FieldMetaData("eS", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_T, new org.apache.thrift.meta_data.FieldMetaData("eT", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createFile_result.class, metaDataMap); } public user_createFile_result() { } public user_createFile_result( int success, FileAlreadyExistException eR, InvalidPathException eI, BlockInfoException eB, SuspectedFileSizeException eS, TachyonException eT) { this(); this.success = success; setSuccessIsSet(true); this.eR = eR; this.eI = eI; this.eB = eB; this.eS = eS; this.eT = eT; } /** * Performs a deep copy on <i>other</i>. */ public user_createFile_result(user_createFile_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetER()) { this.eR = new FileAlreadyExistException(other.eR); } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } if (other.isSetEB()) { this.eB = new BlockInfoException(other.eB); } if (other.isSetES()) { this.eS = new SuspectedFileSizeException(other.eS); } if (other.isSetET()) { this.eT = new TachyonException(other.eT); } } public user_createFile_result deepCopy() { return new user_createFile_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.eR = null; this.eI = null; this.eB = null; this.eS = null; this.eT = null; } public int getSuccess() { return this.success; } public user_createFile_result setSuccess(int success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileAlreadyExistException getER() { return this.eR; } public user_createFile_result setER(FileAlreadyExistException eR) { this.eR = eR; return this; } public void unsetER() { this.eR = null; } /** Returns true if field eR is set (has been assigned a value) and false otherwise */ public boolean isSetER() { return this.eR != null; } public void setERIsSet(boolean value) { if (!value) { this.eR = null; } } public InvalidPathException getEI() { return this.eI; } public user_createFile_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public BlockInfoException getEB() { return this.eB; } public user_createFile_result setEB(BlockInfoException eB) { this.eB = eB; return this; } public void unsetEB() { this.eB = null; } /** Returns true if field eB is set (has been assigned a value) and false otherwise */ public boolean isSetEB() { return this.eB != null; } public void setEBIsSet(boolean value) { if (!value) { this.eB = null; } } public SuspectedFileSizeException getES() { return this.eS; } public user_createFile_result setES(SuspectedFileSizeException eS) { this.eS = eS; return this; } public void unsetES() { this.eS = null; } /** Returns true if field eS is set (has been assigned a value) and false otherwise */ public boolean isSetES() { return this.eS != null; } public void setESIsSet(boolean value) { if (!value) { this.eS = null; } } public TachyonException getET() { return this.eT; } public user_createFile_result setET(TachyonException eT) { this.eT = eT; return this; } public void unsetET() { this.eT = null; } /** Returns true if field eT is set (has been assigned a value) and false otherwise */ public boolean isSetET() { return this.eT != null; } public void setETIsSet(boolean value) { if (!value) { this.eT = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Integer)value); } break; case E_R: if (value == null) { unsetER(); } else { setER((FileAlreadyExistException)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; case E_B: if (value == null) { unsetEB(); } else { setEB((BlockInfoException)value); } break; case E_S: if (value == null) { unsetES(); } else { setES((SuspectedFileSizeException)value); } break; case E_T: if (value == null) { unsetET(); } else { setET((TachyonException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Integer.valueOf(getSuccess()); case E_R: return getER(); case E_I: return getEI(); case E_B: return getEB(); case E_S: return getES(); case E_T: return getET(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_R: return isSetER(); case E_I: return isSetEI(); case E_B: return isSetEB(); case E_S: return isSetES(); case E_T: return isSetET(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createFile_result) return this.equals((user_createFile_result)that); return false; } public boolean equals(user_createFile_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_eR = true && this.isSetER(); boolean that_present_eR = true && that.isSetER(); if (this_present_eR || that_present_eR) { if (!(this_present_eR && that_present_eR)) return false; if (!this.eR.equals(that.eR)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } boolean this_present_eB = true && this.isSetEB(); boolean that_present_eB = true && that.isSetEB(); if (this_present_eB || that_present_eB) { if (!(this_present_eB && that_present_eB)) return false; if (!this.eB.equals(that.eB)) return false; } boolean this_present_eS = true && this.isSetES(); boolean that_present_eS = true && that.isSetES(); if (this_present_eS || that_present_eS) { if (!(this_present_eS && that_present_eS)) return false; if (!this.eS.equals(that.eS)) return false; } boolean this_present_eT = true && this.isSetET(); boolean that_present_eT = true && that.isSetET(); if (this_present_eT || that_present_eT) { if (!(this_present_eT && that_present_eT)) return false; if (!this.eT.equals(that.eT)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createFile_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetER()).compareTo(other.isSetER()); if (lastComparison != 0) { return lastComparison; } if (isSetER()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eR, other.eR); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEB()).compareTo(other.isSetEB()); if (lastComparison != 0) { return lastComparison; } if (isSetEB()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eB, other.eB); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetES()).compareTo(other.isSetES()); if (lastComparison != 0) { return lastComparison; } if (isSetES()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eS, other.eS); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetET()).compareTo(other.isSetET()); if (lastComparison != 0) { return lastComparison; } if (isSetET()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eT, other.eT); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createFile_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("eR:"); if (this.eR == null) { sb.append("null"); } else { sb.append(this.eR); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; if (!first) sb.append(", "); sb.append("eB:"); if (this.eB == null) { sb.append("null"); } else { sb.append(this.eB); } first = false; if (!first) sb.append(", "); sb.append("eS:"); if (this.eS == null) { sb.append("null"); } else { sb.append(this.eS); } first = false; if (!first) sb.append(", "); sb.append("eT:"); if (this.eT == null) { sb.append("null"); } else { sb.append(this.eT); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createFile_resultStandardSchemeFactory implements SchemeFactory { public user_createFile_resultStandardScheme getScheme() { return new user_createFile_resultStandardScheme(); } } private static class user_createFile_resultStandardScheme extends StandardScheme<user_createFile_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createFile_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_R if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eR = new FileAlreadyExistException(); struct.eR.read(iprot); struct.setERIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // E_B if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // E_S if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eS = new SuspectedFileSizeException(); struct.eS.read(iprot); struct.setESIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // E_T if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eT = new TachyonException(); struct.eT.read(iprot); struct.setETIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createFile_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI32(struct.success); oprot.writeFieldEnd(); } if (struct.eR != null) { oprot.writeFieldBegin(E_R_FIELD_DESC); struct.eR.write(oprot); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } if (struct.eB != null) { oprot.writeFieldBegin(E_B_FIELD_DESC); struct.eB.write(oprot); oprot.writeFieldEnd(); } if (struct.eS != null) { oprot.writeFieldBegin(E_S_FIELD_DESC); struct.eS.write(oprot); oprot.writeFieldEnd(); } if (struct.eT != null) { oprot.writeFieldBegin(E_T_FIELD_DESC); struct.eT.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createFile_resultTupleSchemeFactory implements SchemeFactory { public user_createFile_resultTupleScheme getScheme() { return new user_createFile_resultTupleScheme(); } } private static class user_createFile_resultTupleScheme extends TupleScheme<user_createFile_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createFile_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetER()) { optionals.set(1); } if (struct.isSetEI()) { optionals.set(2); } if (struct.isSetEB()) { optionals.set(3); } if (struct.isSetES()) { optionals.set(4); } if (struct.isSetET()) { optionals.set(5); } oprot.writeBitSet(optionals, 6); if (struct.isSetSuccess()) { oprot.writeI32(struct.success); } if (struct.isSetER()) { struct.eR.write(oprot); } if (struct.isSetEI()) { struct.eI.write(oprot); } if (struct.isSetEB()) { struct.eB.write(oprot); } if (struct.isSetES()) { struct.eS.write(oprot); } if (struct.isSetET()) { struct.eT.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createFile_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eR = new FileAlreadyExistException(); struct.eR.read(iprot); struct.setERIsSet(true); } if (incoming.get(2)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } if (incoming.get(3)) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } if (incoming.get(4)) { struct.eS = new SuspectedFileSizeException(); struct.eS.read(iprot); struct.setESIsSet(true); } if (incoming.get(5)) { struct.eT = new TachyonException(); struct.eT.read(iprot); struct.setETIsSet(true); } } } } public static class user_createNewBlock_args implements org.apache.thrift.TBase<user_createNewBlock_args, user_createNewBlock_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_createNewBlock_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createNewBlock_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createNewBlock_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createNewBlock_argsTupleSchemeFactory()); } public int fileId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createNewBlock_args.class, metaDataMap); } public user_createNewBlock_args() { } public user_createNewBlock_args( int fileId) { this(); this.fileId = fileId; setFileIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_createNewBlock_args(user_createNewBlock_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; } public user_createNewBlock_args deepCopy() { return new user_createNewBlock_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; } public int getFileId() { return this.fileId; } public user_createNewBlock_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createNewBlock_args) return this.equals((user_createNewBlock_args)that); return false; } public boolean equals(user_createNewBlock_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createNewBlock_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createNewBlock_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createNewBlock_argsStandardSchemeFactory implements SchemeFactory { public user_createNewBlock_argsStandardScheme getScheme() { return new user_createNewBlock_argsStandardScheme(); } } private static class user_createNewBlock_argsStandardScheme extends StandardScheme<user_createNewBlock_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createNewBlock_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createNewBlock_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createNewBlock_argsTupleSchemeFactory implements SchemeFactory { public user_createNewBlock_argsTupleScheme getScheme() { return new user_createNewBlock_argsTupleScheme(); } } private static class user_createNewBlock_argsTupleScheme extends TupleScheme<user_createNewBlock_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createNewBlock_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createNewBlock_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } } } } public static class user_createNewBlock_result implements org.apache.thrift.TBase<user_createNewBlock_result, user_createNewBlock_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_createNewBlock_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createNewBlock_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createNewBlock_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createNewBlock_resultTupleSchemeFactory()); } public long success; // required public FileDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createNewBlock_result.class, metaDataMap); } public user_createNewBlock_result() { } public user_createNewBlock_result( long success, FileDoesNotExistException e) { this(); this.success = success; setSuccessIsSet(true); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_createNewBlock_result(user_createNewBlock_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new FileDoesNotExistException(other.e); } } public user_createNewBlock_result deepCopy() { return new user_createNewBlock_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.e = null; } public long getSuccess() { return this.success; } public user_createNewBlock_result setSuccess(long success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileDoesNotExistException getE() { return this.e; } public user_createNewBlock_result setE(FileDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Long)value); } break; case E: if (value == null) { unsetE(); } else { setE((FileDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Long.valueOf(getSuccess()); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createNewBlock_result) return this.equals((user_createNewBlock_result)that); return false; } public boolean equals(user_createNewBlock_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createNewBlock_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createNewBlock_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createNewBlock_resultStandardSchemeFactory implements SchemeFactory { public user_createNewBlock_resultStandardScheme getScheme() { return new user_createNewBlock_resultStandardScheme(); } } private static class user_createNewBlock_resultStandardScheme extends StandardScheme<user_createNewBlock_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createNewBlock_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createNewBlock_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI64(struct.success); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createNewBlock_resultTupleSchemeFactory implements SchemeFactory { public user_createNewBlock_resultTupleScheme getScheme() { return new user_createNewBlock_resultTupleScheme(); } } private static class user_createNewBlock_resultTupleScheme extends TupleScheme<user_createNewBlock_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createNewBlock_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeI64(struct.success); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createNewBlock_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_completeFile_args implements org.apache.thrift.TBase<user_completeFile_args, user_completeFile_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_completeFile_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_completeFile_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_completeFile_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_completeFile_argsTupleSchemeFactory()); } public int fileId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_completeFile_args.class, metaDataMap); } public user_completeFile_args() { } public user_completeFile_args( int fileId) { this(); this.fileId = fileId; setFileIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_completeFile_args(user_completeFile_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; } public user_completeFile_args deepCopy() { return new user_completeFile_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; } public int getFileId() { return this.fileId; } public user_completeFile_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_completeFile_args) return this.equals((user_completeFile_args)that); return false; } public boolean equals(user_completeFile_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_completeFile_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_completeFile_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_completeFile_argsStandardSchemeFactory implements SchemeFactory { public user_completeFile_argsStandardScheme getScheme() { return new user_completeFile_argsStandardScheme(); } } private static class user_completeFile_argsStandardScheme extends StandardScheme<user_completeFile_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_completeFile_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_completeFile_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_completeFile_argsTupleSchemeFactory implements SchemeFactory { public user_completeFile_argsTupleScheme getScheme() { return new user_completeFile_argsTupleScheme(); } } private static class user_completeFile_argsTupleScheme extends TupleScheme<user_completeFile_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_completeFile_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_completeFile_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } } } } public static class user_completeFile_result implements org.apache.thrift.TBase<user_completeFile_result, user_completeFile_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_completeFile_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_completeFile_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_completeFile_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_completeFile_resultTupleSchemeFactory()); } public FileDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_completeFile_result.class, metaDataMap); } public user_completeFile_result() { } public user_completeFile_result( FileDoesNotExistException e) { this(); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_completeFile_result(user_completeFile_result other) { if (other.isSetE()) { this.e = new FileDoesNotExistException(other.e); } } public user_completeFile_result deepCopy() { return new user_completeFile_result(this); } @Override public void clear() { this.e = null; } public FileDoesNotExistException getE() { return this.e; } public user_completeFile_result setE(FileDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((FileDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_completeFile_result) return this.equals((user_completeFile_result)that); return false; } public boolean equals(user_completeFile_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_completeFile_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_completeFile_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_completeFile_resultStandardSchemeFactory implements SchemeFactory { public user_completeFile_resultStandardScheme getScheme() { return new user_completeFile_resultStandardScheme(); } } private static class user_completeFile_resultStandardScheme extends StandardScheme<user_completeFile_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_completeFile_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_completeFile_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_completeFile_resultTupleSchemeFactory implements SchemeFactory { public user_completeFile_resultTupleScheme getScheme() { return new user_completeFile_resultTupleScheme(); } } private static class user_completeFile_resultTupleScheme extends TupleScheme<user_completeFile_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_completeFile_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_completeFile_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_getUserId_args implements org.apache.thrift.TBase<user_getUserId_args, user_getUserId_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getUserId_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getUserId_args"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getUserId_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getUserId_argsTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getUserId_args.class, metaDataMap); } public user_getUserId_args() { } /** * Performs a deep copy on <i>other</i>. */ public user_getUserId_args(user_getUserId_args other) { } public user_getUserId_args deepCopy() { return new user_getUserId_args(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getUserId_args) return this.equals((user_getUserId_args)that); return false; } public boolean equals(user_getUserId_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getUserId_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getUserId_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getUserId_argsStandardSchemeFactory implements SchemeFactory { public user_getUserId_argsStandardScheme getScheme() { return new user_getUserId_argsStandardScheme(); } } private static class user_getUserId_argsStandardScheme extends StandardScheme<user_getUserId_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getUserId_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getUserId_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getUserId_argsTupleSchemeFactory implements SchemeFactory { public user_getUserId_argsTupleScheme getScheme() { return new user_getUserId_argsTupleScheme(); } } private static class user_getUserId_argsTupleScheme extends TupleScheme<user_getUserId_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getUserId_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getUserId_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class user_getUserId_result implements org.apache.thrift.TBase<user_getUserId_result, user_getUserId_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getUserId_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getUserId_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getUserId_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getUserId_resultTupleSchemeFactory()); } public long success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getUserId_result.class, metaDataMap); } public user_getUserId_result() { } public user_getUserId_result( long success) { this(); this.success = success; setSuccessIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_getUserId_result(user_getUserId_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; } public user_getUserId_result deepCopy() { return new user_getUserId_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; } public long getSuccess() { return this.success; } public user_getUserId_result setSuccess(long success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Long)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Long.valueOf(getSuccess()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getUserId_result) return this.equals((user_getUserId_result)that); return false; } public boolean equals(user_getUserId_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getUserId_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getUserId_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getUserId_resultStandardSchemeFactory implements SchemeFactory { public user_getUserId_resultStandardScheme getScheme() { return new user_getUserId_resultStandardScheme(); } } private static class user_getUserId_resultStandardScheme extends StandardScheme<user_getUserId_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getUserId_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getUserId_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI64(struct.success); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getUserId_resultTupleSchemeFactory implements SchemeFactory { public user_getUserId_resultTupleScheme getScheme() { return new user_getUserId_resultTupleScheme(); } } private static class user_getUserId_resultTupleScheme extends TupleScheme<user_getUserId_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getUserId_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { oprot.writeI64(struct.success); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getUserId_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } } } } public static class user_getBlockId_args implements org.apache.thrift.TBase<user_getBlockId_args, user_getBlockId_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getBlockId_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getBlockId_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField INDEX_FIELD_DESC = new org.apache.thrift.protocol.TField("index", org.apache.thrift.protocol.TType.I32, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getBlockId_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getBlockId_argsTupleSchemeFactory()); } public int fileId; // required public int index; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"), INDEX((short)2, "index"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; case 2: // INDEX return INDEX; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private static final int __INDEX_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.INDEX, new org.apache.thrift.meta_data.FieldMetaData("index", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getBlockId_args.class, metaDataMap); } public user_getBlockId_args() { } public user_getBlockId_args( int fileId, int index) { this(); this.fileId = fileId; setFileIdIsSet(true); this.index = index; setIndexIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_getBlockId_args(user_getBlockId_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; this.index = other.index; } public user_getBlockId_args deepCopy() { return new user_getBlockId_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; setIndexIsSet(false); this.index = 0; } public int getFileId() { return this.fileId; } public user_getBlockId_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public int getIndex() { return this.index; } public user_getBlockId_args setIndex(int index) { this.index = index; setIndexIsSet(true); return this; } public void unsetIndex() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INDEX_ISSET_ID); } /** Returns true if field index is set (has been assigned a value) and false otherwise */ public boolean isSetIndex() { return EncodingUtils.testBit(__isset_bitfield, __INDEX_ISSET_ID); } public void setIndexIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INDEX_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case INDEX: if (value == null) { unsetIndex(); } else { setIndex((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); case INDEX: return Integer.valueOf(getIndex()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); case INDEX: return isSetIndex(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getBlockId_args) return this.equals((user_getBlockId_args)that); return false; } public boolean equals(user_getBlockId_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_index = true; boolean that_present_index = true; if (this_present_index || that_present_index) { if (!(this_present_index && that_present_index)) return false; if (this.index != that.index) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getBlockId_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetIndex()).compareTo(other.isSetIndex()); if (lastComparison != 0) { return lastComparison; } if (isSetIndex()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.index, other.index); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getBlockId_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("index:"); sb.append(this.index); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getBlockId_argsStandardSchemeFactory implements SchemeFactory { public user_getBlockId_argsStandardScheme getScheme() { return new user_getBlockId_argsStandardScheme(); } } private static class user_getBlockId_argsStandardScheme extends StandardScheme<user_getBlockId_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getBlockId_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // INDEX if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.index = iprot.readI32(); struct.setIndexIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getBlockId_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); oprot.writeFieldBegin(INDEX_FIELD_DESC); oprot.writeI32(struct.index); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getBlockId_argsTupleSchemeFactory implements SchemeFactory { public user_getBlockId_argsTupleScheme getScheme() { return new user_getBlockId_argsTupleScheme(); } } private static class user_getBlockId_argsTupleScheme extends TupleScheme<user_getBlockId_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getBlockId_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } if (struct.isSetIndex()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetIndex()) { oprot.writeI32(struct.index); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getBlockId_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(1)) { struct.index = iprot.readI32(); struct.setIndexIsSet(true); } } } } public static class user_getBlockId_result implements org.apache.thrift.TBase<user_getBlockId_result, user_getBlockId_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getBlockId_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getBlockId_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getBlockId_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getBlockId_resultTupleSchemeFactory()); } public long success; // required public FileDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getBlockId_result.class, metaDataMap); } public user_getBlockId_result() { } public user_getBlockId_result( long success, FileDoesNotExistException e) { this(); this.success = success; setSuccessIsSet(true); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_getBlockId_result(user_getBlockId_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new FileDoesNotExistException(other.e); } } public user_getBlockId_result deepCopy() { return new user_getBlockId_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.e = null; } public long getSuccess() { return this.success; } public user_getBlockId_result setSuccess(long success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileDoesNotExistException getE() { return this.e; } public user_getBlockId_result setE(FileDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Long)value); } break; case E: if (value == null) { unsetE(); } else { setE((FileDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Long.valueOf(getSuccess()); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getBlockId_result) return this.equals((user_getBlockId_result)that); return false; } public boolean equals(user_getBlockId_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getBlockId_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getBlockId_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getBlockId_resultStandardSchemeFactory implements SchemeFactory { public user_getBlockId_resultStandardScheme getScheme() { return new user_getBlockId_resultStandardScheme(); } } private static class user_getBlockId_resultStandardScheme extends StandardScheme<user_getBlockId_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getBlockId_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getBlockId_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI64(struct.success); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getBlockId_resultTupleSchemeFactory implements SchemeFactory { public user_getBlockId_resultTupleScheme getScheme() { return new user_getBlockId_resultTupleScheme(); } } private static class user_getBlockId_resultTupleScheme extends TupleScheme<user_getBlockId_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getBlockId_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeI64(struct.success); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getBlockId_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_getWorker_args implements org.apache.thrift.TBase<user_getWorker_args, user_getWorker_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getWorker_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getWorker_args"); private static final org.apache.thrift.protocol.TField RANDOM_FIELD_DESC = new org.apache.thrift.protocol.TField("random", org.apache.thrift.protocol.TType.BOOL, (short)1); private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getWorker_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getWorker_argsTupleSchemeFactory()); } public boolean random; // required public String host; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { RANDOM((short)1, "random"), HOST((short)2, "host"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // RANDOM return RANDOM; case 2: // HOST return HOST; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __RANDOM_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.RANDOM, new org.apache.thrift.meta_data.FieldMetaData("random", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getWorker_args.class, metaDataMap); } public user_getWorker_args() { } public user_getWorker_args( boolean random, String host) { this(); this.random = random; setRandomIsSet(true); this.host = host; } /** * Performs a deep copy on <i>other</i>. */ public user_getWorker_args(user_getWorker_args other) { __isset_bitfield = other.__isset_bitfield; this.random = other.random; if (other.isSetHost()) { this.host = other.host; } } public user_getWorker_args deepCopy() { return new user_getWorker_args(this); } @Override public void clear() { setRandomIsSet(false); this.random = false; this.host = null; } public boolean isRandom() { return this.random; } public user_getWorker_args setRandom(boolean random) { this.random = random; setRandomIsSet(true); return this; } public void unsetRandom() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RANDOM_ISSET_ID); } /** Returns true if field random is set (has been assigned a value) and false otherwise */ public boolean isSetRandom() { return EncodingUtils.testBit(__isset_bitfield, __RANDOM_ISSET_ID); } public void setRandomIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RANDOM_ISSET_ID, value); } public String getHost() { return this.host; } public user_getWorker_args setHost(String host) { this.host = host; return this; } public void unsetHost() { this.host = null; } /** Returns true if field host is set (has been assigned a value) and false otherwise */ public boolean isSetHost() { return this.host != null; } public void setHostIsSet(boolean value) { if (!value) { this.host = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case RANDOM: if (value == null) { unsetRandom(); } else { setRandom((Boolean)value); } break; case HOST: if (value == null) { unsetHost(); } else { setHost((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case RANDOM: return Boolean.valueOf(isRandom()); case HOST: return getHost(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case RANDOM: return isSetRandom(); case HOST: return isSetHost(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getWorker_args) return this.equals((user_getWorker_args)that); return false; } public boolean equals(user_getWorker_args that) { if (that == null) return false; boolean this_present_random = true; boolean that_present_random = true; if (this_present_random || that_present_random) { if (!(this_present_random && that_present_random)) return false; if (this.random != that.random) return false; } boolean this_present_host = true && this.isSetHost(); boolean that_present_host = true && that.isSetHost(); if (this_present_host || that_present_host) { if (!(this_present_host && that_present_host)) return false; if (!this.host.equals(that.host)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getWorker_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetRandom()).compareTo(other.isSetRandom()); if (lastComparison != 0) { return lastComparison; } if (isSetRandom()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.random, other.random); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetHost()).compareTo(other.isSetHost()); if (lastComparison != 0) { return lastComparison; } if (isSetHost()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, other.host); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getWorker_args("); boolean first = true; sb.append("random:"); sb.append(this.random); first = false; if (!first) sb.append(", "); sb.append("host:"); if (this.host == null) { sb.append("null"); } else { sb.append(this.host); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getWorker_argsStandardSchemeFactory implements SchemeFactory { public user_getWorker_argsStandardScheme getScheme() { return new user_getWorker_argsStandardScheme(); } } private static class user_getWorker_argsStandardScheme extends StandardScheme<user_getWorker_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getWorker_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // RANDOM if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.random = iprot.readBool(); struct.setRandomIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // HOST if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.host = iprot.readString(); struct.setHostIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getWorker_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(RANDOM_FIELD_DESC); oprot.writeBool(struct.random); oprot.writeFieldEnd(); if (struct.host != null) { oprot.writeFieldBegin(HOST_FIELD_DESC); oprot.writeString(struct.host); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getWorker_argsTupleSchemeFactory implements SchemeFactory { public user_getWorker_argsTupleScheme getScheme() { return new user_getWorker_argsTupleScheme(); } } private static class user_getWorker_argsTupleScheme extends TupleScheme<user_getWorker_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getWorker_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetRandom()) { optionals.set(0); } if (struct.isSetHost()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetRandom()) { oprot.writeBool(struct.random); } if (struct.isSetHost()) { oprot.writeString(struct.host); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getWorker_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.random = iprot.readBool(); struct.setRandomIsSet(true); } if (incoming.get(1)) { struct.host = iprot.readString(); struct.setHostIsSet(true); } } } } public static class user_getWorker_result implements org.apache.thrift.TBase<user_getWorker_result, user_getWorker_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getWorker_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getWorker_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getWorker_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getWorker_resultTupleSchemeFactory()); } public NetAddress success; // required public NoWorkerException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NetAddress.class))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getWorker_result.class, metaDataMap); } public user_getWorker_result() { } public user_getWorker_result( NetAddress success, NoWorkerException e) { this(); this.success = success; this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_getWorker_result(user_getWorker_result other) { if (other.isSetSuccess()) { this.success = new NetAddress(other.success); } if (other.isSetE()) { this.e = new NoWorkerException(other.e); } } public user_getWorker_result deepCopy() { return new user_getWorker_result(this); } @Override public void clear() { this.success = null; this.e = null; } public NetAddress getSuccess() { return this.success; } public user_getWorker_result setSuccess(NetAddress success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public NoWorkerException getE() { return this.e; } public user_getWorker_result setE(NoWorkerException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((NetAddress)value); } break; case E: if (value == null) { unsetE(); } else { setE((NoWorkerException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getWorker_result) return this.equals((user_getWorker_result)that); return false; } public boolean equals(user_getWorker_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getWorker_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getWorker_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getWorker_resultStandardSchemeFactory implements SchemeFactory { public user_getWorker_resultStandardScheme getScheme() { return new user_getWorker_resultStandardScheme(); } } private static class user_getWorker_resultStandardScheme extends StandardScheme<user_getWorker_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getWorker_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new NetAddress(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new NoWorkerException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getWorker_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getWorker_resultTupleSchemeFactory implements SchemeFactory { public user_getWorker_resultTupleScheme getScheme() { return new user_getWorker_resultTupleScheme(); } } private static class user_getWorker_resultTupleScheme extends TupleScheme<user_getWorker_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getWorker_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getWorker_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new NetAddress(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new NoWorkerException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class getFileStatus_args implements org.apache.thrift.TBase<getFileStatus_args, getFileStatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<getFileStatus_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getFileStatus_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getFileStatus_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getFileStatus_argsTupleSchemeFactory()); } public int fileId; // required public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"), PATH((short)2, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; case 2: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getFileStatus_args.class, metaDataMap); } public getFileStatus_args() { } public getFileStatus_args( int fileId, String path) { this(); this.fileId = fileId; setFileIdIsSet(true); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public getFileStatus_args(getFileStatus_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; if (other.isSetPath()) { this.path = other.path; } } public getFileStatus_args deepCopy() { return new getFileStatus_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; this.path = null; } public int getFileId() { return this.fileId; } public getFileStatus_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public String getPath() { return this.path; } public getFileStatus_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getFileStatus_args) return this.equals((getFileStatus_args)that); return false; } public boolean equals(getFileStatus_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(getFileStatus_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getFileStatus_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getFileStatus_argsStandardSchemeFactory implements SchemeFactory { public getFileStatus_argsStandardScheme getScheme() { return new getFileStatus_argsStandardScheme(); } } private static class getFileStatus_argsStandardScheme extends StandardScheme<getFileStatus_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getFileStatus_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getFileStatus_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getFileStatus_argsTupleSchemeFactory implements SchemeFactory { public getFileStatus_argsTupleScheme getScheme() { return new getFileStatus_argsTupleScheme(); } } private static class getFileStatus_argsTupleScheme extends TupleScheme<getFileStatus_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getFileStatus_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } if (struct.isSetPath()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getFileStatus_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(1)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class getFileStatus_result implements org.apache.thrift.TBase<getFileStatus_result, getFileStatus_result._Fields>, java.io.Serializable, Cloneable, Comparable<getFileStatus_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getFileStatus_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getFileStatus_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getFileStatus_resultTupleSchemeFactory()); } public ClientFileInfo success; // required public InvalidPathException eI; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_I((short)1, "eI"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_I return E_I; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientFileInfo.class))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getFileStatus_result.class, metaDataMap); } public getFileStatus_result() { } public getFileStatus_result( ClientFileInfo success, InvalidPathException eI) { this(); this.success = success; this.eI = eI; } /** * Performs a deep copy on <i>other</i>. */ public getFileStatus_result(getFileStatus_result other) { if (other.isSetSuccess()) { this.success = new ClientFileInfo(other.success); } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } } public getFileStatus_result deepCopy() { return new getFileStatus_result(this); } @Override public void clear() { this.success = null; this.eI = null; } public ClientFileInfo getSuccess() { return this.success; } public getFileStatus_result setSuccess(ClientFileInfo success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public InvalidPathException getEI() { return this.eI; } public getFileStatus_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((ClientFileInfo)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E_I: return getEI(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_I: return isSetEI(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getFileStatus_result) return this.equals((getFileStatus_result)that); return false; } public boolean equals(getFileStatus_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(getFileStatus_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getFileStatus_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getFileStatus_resultStandardSchemeFactory implements SchemeFactory { public getFileStatus_resultStandardScheme getScheme() { return new getFileStatus_resultStandardScheme(); } } private static class getFileStatus_resultStandardScheme extends StandardScheme<getFileStatus_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getFileStatus_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new ClientFileInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getFileStatus_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getFileStatus_resultTupleSchemeFactory implements SchemeFactory { public getFileStatus_resultTupleScheme getScheme() { return new getFileStatus_resultTupleScheme(); } } private static class getFileStatus_resultTupleScheme extends TupleScheme<getFileStatus_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getFileStatus_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetEI()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetEI()) { struct.eI.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getFileStatus_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new ClientFileInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } } } } public static class user_getClientBlockInfo_args implements org.apache.thrift.TBase<user_getClientBlockInfo_args, user_getClientBlockInfo_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getClientBlockInfo_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientBlockInfo_args"); private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getClientBlockInfo_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getClientBlockInfo_argsTupleSchemeFactory()); } public long blockId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { BLOCK_ID((short)1, "blockId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // BLOCK_ID return BLOCK_ID; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __BLOCKID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.BLOCK_ID, new org.apache.thrift.meta_data.FieldMetaData("blockId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientBlockInfo_args.class, metaDataMap); } public user_getClientBlockInfo_args() { } public user_getClientBlockInfo_args( long blockId) { this(); this.blockId = blockId; setBlockIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_getClientBlockInfo_args(user_getClientBlockInfo_args other) { __isset_bitfield = other.__isset_bitfield; this.blockId = other.blockId; } public user_getClientBlockInfo_args deepCopy() { return new user_getClientBlockInfo_args(this); } @Override public void clear() { setBlockIdIsSet(false); this.blockId = 0; } public long getBlockId() { return this.blockId; } public user_getClientBlockInfo_args setBlockId(long blockId) { this.blockId = blockId; setBlockIdIsSet(true); return this; } public void unsetBlockId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID); } /** Returns true if field blockId is set (has been assigned a value) and false otherwise */ public boolean isSetBlockId() { return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID); } public void setBlockIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case BLOCK_ID: if (value == null) { unsetBlockId(); } else { setBlockId((Long)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case BLOCK_ID: return Long.valueOf(getBlockId()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case BLOCK_ID: return isSetBlockId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getClientBlockInfo_args) return this.equals((user_getClientBlockInfo_args)that); return false; } public boolean equals(user_getClientBlockInfo_args that) { if (that == null) return false; boolean this_present_blockId = true; boolean that_present_blockId = true; if (this_present_blockId || that_present_blockId) { if (!(this_present_blockId && that_present_blockId)) return false; if (this.blockId != that.blockId) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getClientBlockInfo_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetBlockId()).compareTo(other.isSetBlockId()); if (lastComparison != 0) { return lastComparison; } if (isSetBlockId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockId, other.blockId); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getClientBlockInfo_args("); boolean first = true; sb.append("blockId:"); sb.append(this.blockId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getClientBlockInfo_argsStandardSchemeFactory implements SchemeFactory { public user_getClientBlockInfo_argsStandardScheme getScheme() { return new user_getClientBlockInfo_argsStandardScheme(); } } private static class user_getClientBlockInfo_argsStandardScheme extends StandardScheme<user_getClientBlockInfo_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientBlockInfo_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // BLOCK_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.blockId = iprot.readI64(); struct.setBlockIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientBlockInfo_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); oprot.writeI64(struct.blockId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getClientBlockInfo_argsTupleSchemeFactory implements SchemeFactory { public user_getClientBlockInfo_argsTupleScheme getScheme() { return new user_getClientBlockInfo_argsTupleScheme(); } } private static class user_getClientBlockInfo_argsTupleScheme extends TupleScheme<user_getClientBlockInfo_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientBlockInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetBlockId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetBlockId()) { oprot.writeI64(struct.blockId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientBlockInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.blockId = iprot.readI64(); struct.setBlockIdIsSet(true); } } } } public static class user_getClientBlockInfo_result implements org.apache.thrift.TBase<user_getClientBlockInfo_result, user_getClientBlockInfo_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getClientBlockInfo_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientBlockInfo_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_B_FIELD_DESC = new org.apache.thrift.protocol.TField("eB", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getClientBlockInfo_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getClientBlockInfo_resultTupleSchemeFactory()); } public ClientBlockInfo success; // required public FileDoesNotExistException eF; // required public BlockInfoException eB; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_F((short)1, "eF"), E_B((short)2, "eB"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_F return E_F; case 2: // E_B return E_B; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientBlockInfo.class))); tmpMap.put(_Fields.E_F, new org.apache.thrift.meta_data.FieldMetaData("eF", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_B, new org.apache.thrift.meta_data.FieldMetaData("eB", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientBlockInfo_result.class, metaDataMap); } public user_getClientBlockInfo_result() { } public user_getClientBlockInfo_result( ClientBlockInfo success, FileDoesNotExistException eF, BlockInfoException eB) { this(); this.success = success; this.eF = eF; this.eB = eB; } /** * Performs a deep copy on <i>other</i>. */ public user_getClientBlockInfo_result(user_getClientBlockInfo_result other) { if (other.isSetSuccess()) { this.success = new ClientBlockInfo(other.success); } if (other.isSetEF()) { this.eF = new FileDoesNotExistException(other.eF); } if (other.isSetEB()) { this.eB = new BlockInfoException(other.eB); } } public user_getClientBlockInfo_result deepCopy() { return new user_getClientBlockInfo_result(this); } @Override public void clear() { this.success = null; this.eF = null; this.eB = null; } public ClientBlockInfo getSuccess() { return this.success; } public user_getClientBlockInfo_result setSuccess(ClientBlockInfo success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public FileDoesNotExistException getEF() { return this.eF; } public user_getClientBlockInfo_result setEF(FileDoesNotExistException eF) { this.eF = eF; return this; } public void unsetEF() { this.eF = null; } /** Returns true if field eF is set (has been assigned a value) and false otherwise */ public boolean isSetEF() { return this.eF != null; } public void setEFIsSet(boolean value) { if (!value) { this.eF = null; } } public BlockInfoException getEB() { return this.eB; } public user_getClientBlockInfo_result setEB(BlockInfoException eB) { this.eB = eB; return this; } public void unsetEB() { this.eB = null; } /** Returns true if field eB is set (has been assigned a value) and false otherwise */ public boolean isSetEB() { return this.eB != null; } public void setEBIsSet(boolean value) { if (!value) { this.eB = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((ClientBlockInfo)value); } break; case E_F: if (value == null) { unsetEF(); } else { setEF((FileDoesNotExistException)value); } break; case E_B: if (value == null) { unsetEB(); } else { setEB((BlockInfoException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E_F: return getEF(); case E_B: return getEB(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_F: return isSetEF(); case E_B: return isSetEB(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getClientBlockInfo_result) return this.equals((user_getClientBlockInfo_result)that); return false; } public boolean equals(user_getClientBlockInfo_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_eF = true && this.isSetEF(); boolean that_present_eF = true && that.isSetEF(); if (this_present_eF || that_present_eF) { if (!(this_present_eF && that_present_eF)) return false; if (!this.eF.equals(that.eF)) return false; } boolean this_present_eB = true && this.isSetEB(); boolean that_present_eB = true && that.isSetEB(); if (this_present_eB || that_present_eB) { if (!(this_present_eB && that_present_eB)) return false; if (!this.eB.equals(that.eB)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getClientBlockInfo_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEF()).compareTo(other.isSetEF()); if (lastComparison != 0) { return lastComparison; } if (isSetEF()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eF, other.eF); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEB()).compareTo(other.isSetEB()); if (lastComparison != 0) { return lastComparison; } if (isSetEB()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eB, other.eB); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getClientBlockInfo_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("eF:"); if (this.eF == null) { sb.append("null"); } else { sb.append(this.eF); } first = false; if (!first) sb.append(", "); sb.append("eB:"); if (this.eB == null) { sb.append("null"); } else { sb.append(this.eB); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getClientBlockInfo_resultStandardSchemeFactory implements SchemeFactory { public user_getClientBlockInfo_resultStandardScheme getScheme() { return new user_getClientBlockInfo_resultStandardScheme(); } } private static class user_getClientBlockInfo_resultStandardScheme extends StandardScheme<user_getClientBlockInfo_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientBlockInfo_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new ClientBlockInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_F if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_B if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientBlockInfo_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.eF != null) { oprot.writeFieldBegin(E_F_FIELD_DESC); struct.eF.write(oprot); oprot.writeFieldEnd(); } if (struct.eB != null) { oprot.writeFieldBegin(E_B_FIELD_DESC); struct.eB.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getClientBlockInfo_resultTupleSchemeFactory implements SchemeFactory { public user_getClientBlockInfo_resultTupleScheme getScheme() { return new user_getClientBlockInfo_resultTupleScheme(); } } private static class user_getClientBlockInfo_resultTupleScheme extends TupleScheme<user_getClientBlockInfo_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientBlockInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetEF()) { optionals.set(1); } if (struct.isSetEB()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetEF()) { struct.eF.write(oprot); } if (struct.isSetEB()) { struct.eB.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientBlockInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.success = new ClientBlockInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } if (incoming.get(2)) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } } } } public static class user_getFileBlocks_args implements org.apache.thrift.TBase<user_getFileBlocks_args, user_getFileBlocks_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getFileBlocks_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getFileBlocks_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getFileBlocks_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getFileBlocks_argsTupleSchemeFactory()); } public int fileId; // required public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"), PATH((short)2, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; case 2: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getFileBlocks_args.class, metaDataMap); } public user_getFileBlocks_args() { } public user_getFileBlocks_args( int fileId, String path) { this(); this.fileId = fileId; setFileIdIsSet(true); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public user_getFileBlocks_args(user_getFileBlocks_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; if (other.isSetPath()) { this.path = other.path; } } public user_getFileBlocks_args deepCopy() { return new user_getFileBlocks_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; this.path = null; } public int getFileId() { return this.fileId; } public user_getFileBlocks_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public String getPath() { return this.path; } public user_getFileBlocks_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getFileBlocks_args) return this.equals((user_getFileBlocks_args)that); return false; } public boolean equals(user_getFileBlocks_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getFileBlocks_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getFileBlocks_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getFileBlocks_argsStandardSchemeFactory implements SchemeFactory { public user_getFileBlocks_argsStandardScheme getScheme() { return new user_getFileBlocks_argsStandardScheme(); } } private static class user_getFileBlocks_argsStandardScheme extends StandardScheme<user_getFileBlocks_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getFileBlocks_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getFileBlocks_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getFileBlocks_argsTupleSchemeFactory implements SchemeFactory { public user_getFileBlocks_argsTupleScheme getScheme() { return new user_getFileBlocks_argsTupleScheme(); } } private static class user_getFileBlocks_argsTupleScheme extends TupleScheme<user_getFileBlocks_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocks_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } if (struct.isSetPath()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocks_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(1)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class user_getFileBlocks_result implements org.apache.thrift.TBase<user_getFileBlocks_result, user_getFileBlocks_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getFileBlocks_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getFileBlocks_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getFileBlocks_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getFileBlocks_resultTupleSchemeFactory()); } public List<ClientBlockInfo> success; // required public FileDoesNotExistException eF; // required public InvalidPathException eI; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_F((short)1, "eF"), E_I((short)2, "eI"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_F return E_F; case 2: // E_I return E_I; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientBlockInfo.class)))); tmpMap.put(_Fields.E_F, new org.apache.thrift.meta_data.FieldMetaData("eF", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getFileBlocks_result.class, metaDataMap); } public user_getFileBlocks_result() { } public user_getFileBlocks_result( List<ClientBlockInfo> success, FileDoesNotExistException eF, InvalidPathException eI) { this(); this.success = success; this.eF = eF; this.eI = eI; } /** * Performs a deep copy on <i>other</i>. */ public user_getFileBlocks_result(user_getFileBlocks_result other) { if (other.isSetSuccess()) { List<ClientBlockInfo> __this__success = new ArrayList<ClientBlockInfo>(other.success.size()); for (ClientBlockInfo other_element : other.success) { __this__success.add(new ClientBlockInfo(other_element)); } this.success = __this__success; } if (other.isSetEF()) { this.eF = new FileDoesNotExistException(other.eF); } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } } public user_getFileBlocks_result deepCopy() { return new user_getFileBlocks_result(this); } @Override public void clear() { this.success = null; this.eF = null; this.eI = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<ClientBlockInfo> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(ClientBlockInfo elem) { if (this.success == null) { this.success = new ArrayList<ClientBlockInfo>(); } this.success.add(elem); } public List<ClientBlockInfo> getSuccess() { return this.success; } public user_getFileBlocks_result setSuccess(List<ClientBlockInfo> success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public FileDoesNotExistException getEF() { return this.eF; } public user_getFileBlocks_result setEF(FileDoesNotExistException eF) { this.eF = eF; return this; } public void unsetEF() { this.eF = null; } /** Returns true if field eF is set (has been assigned a value) and false otherwise */ public boolean isSetEF() { return this.eF != null; } public void setEFIsSet(boolean value) { if (!value) { this.eF = null; } } public InvalidPathException getEI() { return this.eI; } public user_getFileBlocks_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<ClientBlockInfo>)value); } break; case E_F: if (value == null) { unsetEF(); } else { setEF((FileDoesNotExistException)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E_F: return getEF(); case E_I: return getEI(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_F: return isSetEF(); case E_I: return isSetEI(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getFileBlocks_result) return this.equals((user_getFileBlocks_result)that); return false; } public boolean equals(user_getFileBlocks_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_eF = true && this.isSetEF(); boolean that_present_eF = true && that.isSetEF(); if (this_present_eF || that_present_eF) { if (!(this_present_eF && that_present_eF)) return false; if (!this.eF.equals(that.eF)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getFileBlocks_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEF()).compareTo(other.isSetEF()); if (lastComparison != 0) { return lastComparison; } if (isSetEF()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eF, other.eF); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getFileBlocks_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("eF:"); if (this.eF == null) { sb.append("null"); } else { sb.append(this.eF); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getFileBlocks_resultStandardSchemeFactory implements SchemeFactory { public user_getFileBlocks_resultStandardScheme getScheme() { return new user_getFileBlocks_resultStandardScheme(); } } private static class user_getFileBlocks_resultStandardScheme extends StandardScheme<user_getFileBlocks_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getFileBlocks_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list120 = iprot.readListBegin(); struct.success = new ArrayList<ClientBlockInfo>(_list120.size); for (int _i121 = 0; _i121 < _list120.size; ++_i121) { ClientBlockInfo _elem122; _elem122 = new ClientBlockInfo(); _elem122.read(iprot); struct.success.add(_elem122); } iprot.readListEnd(); } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_F if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getFileBlocks_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); for (ClientBlockInfo _iter123 : struct.success) { _iter123.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.eF != null) { oprot.writeFieldBegin(E_F_FIELD_DESC); struct.eF.write(oprot); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getFileBlocks_resultTupleSchemeFactory implements SchemeFactory { public user_getFileBlocks_resultTupleScheme getScheme() { return new user_getFileBlocks_resultTupleScheme(); } } private static class user_getFileBlocks_resultTupleScheme extends TupleScheme<user_getFileBlocks_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocks_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetEF()) { optionals.set(1); } if (struct.isSetEI()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (ClientBlockInfo _iter124 : struct.success) { _iter124.write(oprot); } } } if (struct.isSetEF()) { struct.eF.write(oprot); } if (struct.isSetEI()) { struct.eI.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocks_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list125 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.success = new ArrayList<ClientBlockInfo>(_list125.size); for (int _i126 = 0; _i126 < _list125.size; ++_i126) { ClientBlockInfo _elem127; _elem127 = new ClientBlockInfo(); _elem127.read(iprot); struct.success.add(_elem127); } } struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } if (incoming.get(2)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } } } } public static class user_delete_args implements org.apache.thrift.TBase<user_delete_args, user_delete_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_delete_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_delete_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField RECURSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("recursive", org.apache.thrift.protocol.TType.BOOL, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_delete_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_delete_argsTupleSchemeFactory()); } public int fileId; // required public String path; // required public boolean recursive; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"), PATH((short)2, "path"), RECURSIVE((short)3, "recursive"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; case 2: // PATH return PATH; case 3: // RECURSIVE return RECURSIVE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private static final int __RECURSIVE_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RECURSIVE, new org.apache.thrift.meta_data.FieldMetaData("recursive", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_delete_args.class, metaDataMap); } public user_delete_args() { } public user_delete_args( int fileId, String path, boolean recursive) { this(); this.fileId = fileId; setFileIdIsSet(true); this.path = path; this.recursive = recursive; setRecursiveIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_delete_args(user_delete_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; if (other.isSetPath()) { this.path = other.path; } this.recursive = other.recursive; } public user_delete_args deepCopy() { return new user_delete_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; this.path = null; setRecursiveIsSet(false); this.recursive = false; } public int getFileId() { return this.fileId; } public user_delete_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public String getPath() { return this.path; } public user_delete_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public boolean isRecursive() { return this.recursive; } public user_delete_args setRecursive(boolean recursive) { this.recursive = recursive; setRecursiveIsSet(true); return this; } public void unsetRecursive() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ public boolean isSetRecursive() { return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } public void setRecursiveIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case RECURSIVE: if (value == null) { unsetRecursive(); } else { setRecursive((Boolean)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); case PATH: return getPath(); case RECURSIVE: return Boolean.valueOf(isRecursive()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); case PATH: return isSetPath(); case RECURSIVE: return isSetRecursive(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_delete_args) return this.equals((user_delete_args)that); return false; } public boolean equals(user_delete_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_recursive = true; boolean that_present_recursive = true; if (this_present_recursive || that_present_recursive) { if (!(this_present_recursive && that_present_recursive)) return false; if (this.recursive != that.recursive) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_delete_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRecursive()).compareTo(other.isSetRecursive()); if (lastComparison != 0) { return lastComparison; } if (isSetRecursive()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recursive, other.recursive); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_delete_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("recursive:"); sb.append(this.recursive); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_delete_argsStandardSchemeFactory implements SchemeFactory { public user_delete_argsStandardScheme getScheme() { return new user_delete_argsStandardScheme(); } } private static class user_delete_argsStandardScheme extends StandardScheme<user_delete_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_delete_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // RECURSIVE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_delete_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); oprot.writeBool(struct.recursive); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_delete_argsTupleSchemeFactory implements SchemeFactory { public user_delete_argsTupleScheme getScheme() { return new user_delete_argsTupleScheme(); } } private static class user_delete_argsTupleScheme extends TupleScheme<user_delete_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_delete_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } if (struct.isSetPath()) { optionals.set(1); } if (struct.isSetRecursive()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetRecursive()) { oprot.writeBool(struct.recursive); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_delete_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(1)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(2)) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } } } } public static class user_delete_result implements org.apache.thrift.TBase<user_delete_result, user_delete_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_delete_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_delete_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_delete_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_delete_resultTupleSchemeFactory()); } public boolean success; // required public TachyonException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_delete_result.class, metaDataMap); } public user_delete_result() { } public user_delete_result( boolean success, TachyonException e) { this(); this.success = success; setSuccessIsSet(true); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_delete_result(user_delete_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new TachyonException(other.e); } } public user_delete_result deepCopy() { return new user_delete_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = false; this.e = null; } public boolean isSuccess() { return this.success; } public user_delete_result setSuccess(boolean success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public TachyonException getE() { return this.e; } public user_delete_result setE(TachyonException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Boolean)value); } break; case E: if (value == null) { unsetE(); } else { setE((TachyonException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Boolean.valueOf(isSuccess()); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_delete_result) return this.equals((user_delete_result)that); return false; } public boolean equals(user_delete_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_delete_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_delete_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_delete_resultStandardSchemeFactory implements SchemeFactory { public user_delete_resultStandardScheme getScheme() { return new user_delete_resultStandardScheme(); } } private static class user_delete_resultStandardScheme extends StandardScheme<user_delete_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_delete_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new TachyonException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_delete_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeBool(struct.success); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_delete_resultTupleSchemeFactory implements SchemeFactory { public user_delete_resultTupleScheme getScheme() { return new user_delete_resultTupleScheme(); } } private static class user_delete_resultTupleScheme extends TupleScheme<user_delete_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_delete_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeBool(struct.success); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_delete_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new TachyonException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_rename_args implements org.apache.thrift.TBase<user_rename_args, user_rename_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_rename_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_rename_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField SRC_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("srcPath", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField DST_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("dstPath", org.apache.thrift.protocol.TType.STRING, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_rename_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_rename_argsTupleSchemeFactory()); } public int fileId; // required public String srcPath; // required public String dstPath; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"), SRC_PATH((short)2, "srcPath"), DST_PATH((short)3, "dstPath"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; case 2: // SRC_PATH return SRC_PATH; case 3: // DST_PATH return DST_PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.SRC_PATH, new org.apache.thrift.meta_data.FieldMetaData("srcPath", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DST_PATH, new org.apache.thrift.meta_data.FieldMetaData("dstPath", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_rename_args.class, metaDataMap); } public user_rename_args() { } public user_rename_args( int fileId, String srcPath, String dstPath) { this(); this.fileId = fileId; setFileIdIsSet(true); this.srcPath = srcPath; this.dstPath = dstPath; } /** * Performs a deep copy on <i>other</i>. */ public user_rename_args(user_rename_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; if (other.isSetSrcPath()) { this.srcPath = other.srcPath; } if (other.isSetDstPath()) { this.dstPath = other.dstPath; } } public user_rename_args deepCopy() { return new user_rename_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; this.srcPath = null; this.dstPath = null; } public int getFileId() { return this.fileId; } public user_rename_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public String getSrcPath() { return this.srcPath; } public user_rename_args setSrcPath(String srcPath) { this.srcPath = srcPath; return this; } public void unsetSrcPath() { this.srcPath = null; } /** Returns true if field srcPath is set (has been assigned a value) and false otherwise */ public boolean isSetSrcPath() { return this.srcPath != null; } public void setSrcPathIsSet(boolean value) { if (!value) { this.srcPath = null; } } public String getDstPath() { return this.dstPath; } public user_rename_args setDstPath(String dstPath) { this.dstPath = dstPath; return this; } public void unsetDstPath() { this.dstPath = null; } /** Returns true if field dstPath is set (has been assigned a value) and false otherwise */ public boolean isSetDstPath() { return this.dstPath != null; } public void setDstPathIsSet(boolean value) { if (!value) { this.dstPath = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case SRC_PATH: if (value == null) { unsetSrcPath(); } else { setSrcPath((String)value); } break; case DST_PATH: if (value == null) { unsetDstPath(); } else { setDstPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); case SRC_PATH: return getSrcPath(); case DST_PATH: return getDstPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); case SRC_PATH: return isSetSrcPath(); case DST_PATH: return isSetDstPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_rename_args) return this.equals((user_rename_args)that); return false; } public boolean equals(user_rename_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_srcPath = true && this.isSetSrcPath(); boolean that_present_srcPath = true && that.isSetSrcPath(); if (this_present_srcPath || that_present_srcPath) { if (!(this_present_srcPath && that_present_srcPath)) return false; if (!this.srcPath.equals(that.srcPath)) return false; } boolean this_present_dstPath = true && this.isSetDstPath(); boolean that_present_dstPath = true && that.isSetDstPath(); if (this_present_dstPath || that_present_dstPath) { if (!(this_present_dstPath && that_present_dstPath)) return false; if (!this.dstPath.equals(that.dstPath)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_rename_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSrcPath()).compareTo(other.isSetSrcPath()); if (lastComparison != 0) { return lastComparison; } if (isSetSrcPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.srcPath, other.srcPath); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDstPath()).compareTo(other.isSetDstPath()); if (lastComparison != 0) { return lastComparison; } if (isSetDstPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dstPath, other.dstPath); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_rename_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("srcPath:"); if (this.srcPath == null) { sb.append("null"); } else { sb.append(this.srcPath); } first = false; if (!first) sb.append(", "); sb.append("dstPath:"); if (this.dstPath == null) { sb.append("null"); } else { sb.append(this.dstPath); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_rename_argsStandardSchemeFactory implements SchemeFactory { public user_rename_argsStandardScheme getScheme() { return new user_rename_argsStandardScheme(); } } private static class user_rename_argsStandardScheme extends StandardScheme<user_rename_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_rename_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // SRC_PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.srcPath = iprot.readString(); struct.setSrcPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // DST_PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.dstPath = iprot.readString(); struct.setDstPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_rename_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); if (struct.srcPath != null) { oprot.writeFieldBegin(SRC_PATH_FIELD_DESC); oprot.writeString(struct.srcPath); oprot.writeFieldEnd(); } if (struct.dstPath != null) { oprot.writeFieldBegin(DST_PATH_FIELD_DESC); oprot.writeString(struct.dstPath); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_rename_argsTupleSchemeFactory implements SchemeFactory { public user_rename_argsTupleScheme getScheme() { return new user_rename_argsTupleScheme(); } } private static class user_rename_argsTupleScheme extends TupleScheme<user_rename_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_rename_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } if (struct.isSetSrcPath()) { optionals.set(1); } if (struct.isSetDstPath()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetSrcPath()) { oprot.writeString(struct.srcPath); } if (struct.isSetDstPath()) { oprot.writeString(struct.dstPath); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_rename_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(1)) { struct.srcPath = iprot.readString(); struct.setSrcPathIsSet(true); } if (incoming.get(2)) { struct.dstPath = iprot.readString(); struct.setDstPathIsSet(true); } } } } public static class user_rename_result implements org.apache.thrift.TBase<user_rename_result, user_rename_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_rename_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_rename_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); private static final org.apache.thrift.protocol.TField E_A_FIELD_DESC = new org.apache.thrift.protocol.TField("eA", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_rename_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_rename_resultTupleSchemeFactory()); } public boolean success; // required public FileAlreadyExistException eA; // required public FileDoesNotExistException eF; // required public InvalidPathException eI; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_A((short)1, "eA"), E_F((short)2, "eF"), E_I((short)3, "eI"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_A return E_A; case 2: // E_F return E_F; case 3: // E_I return E_I; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.E_A, new org.apache.thrift.meta_data.FieldMetaData("eA", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_F, new org.apache.thrift.meta_data.FieldMetaData("eF", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_rename_result.class, metaDataMap); } public user_rename_result() { } public user_rename_result( boolean success, FileAlreadyExistException eA, FileDoesNotExistException eF, InvalidPathException eI) { this(); this.success = success; setSuccessIsSet(true); this.eA = eA; this.eF = eF; this.eI = eI; } /** * Performs a deep copy on <i>other</i>. */ public user_rename_result(user_rename_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetEA()) { this.eA = new FileAlreadyExistException(other.eA); } if (other.isSetEF()) { this.eF = new FileDoesNotExistException(other.eF); } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } } public user_rename_result deepCopy() { return new user_rename_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = false; this.eA = null; this.eF = null; this.eI = null; } public boolean isSuccess() { return this.success; } public user_rename_result setSuccess(boolean success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileAlreadyExistException getEA() { return this.eA; } public user_rename_result setEA(FileAlreadyExistException eA) { this.eA = eA; return this; } public void unsetEA() { this.eA = null; } /** Returns true if field eA is set (has been assigned a value) and false otherwise */ public boolean isSetEA() { return this.eA != null; } public void setEAIsSet(boolean value) { if (!value) { this.eA = null; } } public FileDoesNotExistException getEF() { return this.eF; } public user_rename_result setEF(FileDoesNotExistException eF) { this.eF = eF; return this; } public void unsetEF() { this.eF = null; } /** Returns true if field eF is set (has been assigned a value) and false otherwise */ public boolean isSetEF() { return this.eF != null; } public void setEFIsSet(boolean value) { if (!value) { this.eF = null; } } public InvalidPathException getEI() { return this.eI; } public user_rename_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Boolean)value); } break; case E_A: if (value == null) { unsetEA(); } else { setEA((FileAlreadyExistException)value); } break; case E_F: if (value == null) { unsetEF(); } else { setEF((FileDoesNotExistException)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Boolean.valueOf(isSuccess()); case E_A: return getEA(); case E_F: return getEF(); case E_I: return getEI(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_A: return isSetEA(); case E_F: return isSetEF(); case E_I: return isSetEI(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_rename_result) return this.equals((user_rename_result)that); return false; } public boolean equals(user_rename_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_eA = true && this.isSetEA(); boolean that_present_eA = true && that.isSetEA(); if (this_present_eA || that_present_eA) { if (!(this_present_eA && that_present_eA)) return false; if (!this.eA.equals(that.eA)) return false; } boolean this_present_eF = true && this.isSetEF(); boolean that_present_eF = true && that.isSetEF(); if (this_present_eF || that_present_eF) { if (!(this_present_eF && that_present_eF)) return false; if (!this.eF.equals(that.eF)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_rename_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEA()).compareTo(other.isSetEA()); if (lastComparison != 0) { return lastComparison; } if (isSetEA()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eA, other.eA); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEF()).compareTo(other.isSetEF()); if (lastComparison != 0) { return lastComparison; } if (isSetEF()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eF, other.eF); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_rename_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("eA:"); if (this.eA == null) { sb.append("null"); } else { sb.append(this.eA); } first = false; if (!first) sb.append(", "); sb.append("eF:"); if (this.eF == null) { sb.append("null"); } else { sb.append(this.eF); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_rename_resultStandardSchemeFactory implements SchemeFactory { public user_rename_resultStandardScheme getScheme() { return new user_rename_resultStandardScheme(); } } private static class user_rename_resultStandardScheme extends StandardScheme<user_rename_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_rename_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_A if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eA = new FileAlreadyExistException(); struct.eA.read(iprot); struct.setEAIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_F if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_rename_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeBool(struct.success); oprot.writeFieldEnd(); } if (struct.eA != null) { oprot.writeFieldBegin(E_A_FIELD_DESC); struct.eA.write(oprot); oprot.writeFieldEnd(); } if (struct.eF != null) { oprot.writeFieldBegin(E_F_FIELD_DESC); struct.eF.write(oprot); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_rename_resultTupleSchemeFactory implements SchemeFactory { public user_rename_resultTupleScheme getScheme() { return new user_rename_resultTupleScheme(); } } private static class user_rename_resultTupleScheme extends TupleScheme<user_rename_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_rename_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetEA()) { optionals.set(1); } if (struct.isSetEF()) { optionals.set(2); } if (struct.isSetEI()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { oprot.writeBool(struct.success); } if (struct.isSetEA()) { struct.eA.write(oprot); } if (struct.isSetEF()) { struct.eF.write(oprot); } if (struct.isSetEI()) { struct.eI.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_rename_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eA = new FileAlreadyExistException(); struct.eA.read(iprot); struct.setEAIsSet(true); } if (incoming.get(2)) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } if (incoming.get(3)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } } } } public static class user_setPinned_args implements org.apache.thrift.TBase<user_setPinned_args, user_setPinned_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_setPinned_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_setPinned_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField PINNED_FIELD_DESC = new org.apache.thrift.protocol.TField("pinned", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_setPinned_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_setPinned_argsTupleSchemeFactory()); } public int fileId; // required public boolean pinned; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"), PINNED((short)2, "pinned"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; case 2: // PINNED return PINNED; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private static final int __PINNED_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.PINNED, new org.apache.thrift.meta_data.FieldMetaData("pinned", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_setPinned_args.class, metaDataMap); } public user_setPinned_args() { } public user_setPinned_args( int fileId, boolean pinned) { this(); this.fileId = fileId; setFileIdIsSet(true); this.pinned = pinned; setPinnedIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_setPinned_args(user_setPinned_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; this.pinned = other.pinned; } public user_setPinned_args deepCopy() { return new user_setPinned_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; setPinnedIsSet(false); this.pinned = false; } public int getFileId() { return this.fileId; } public user_setPinned_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public boolean isPinned() { return this.pinned; } public user_setPinned_args setPinned(boolean pinned) { this.pinned = pinned; setPinnedIsSet(true); return this; } public void unsetPinned() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PINNED_ISSET_ID); } /** Returns true if field pinned is set (has been assigned a value) and false otherwise */ public boolean isSetPinned() { return EncodingUtils.testBit(__isset_bitfield, __PINNED_ISSET_ID); } public void setPinnedIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PINNED_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case PINNED: if (value == null) { unsetPinned(); } else { setPinned((Boolean)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); case PINNED: return Boolean.valueOf(isPinned()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); case PINNED: return isSetPinned(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_setPinned_args) return this.equals((user_setPinned_args)that); return false; } public boolean equals(user_setPinned_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_pinned = true; boolean that_present_pinned = true; if (this_present_pinned || that_present_pinned) { if (!(this_present_pinned && that_present_pinned)) return false; if (this.pinned != that.pinned) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_setPinned_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPinned()).compareTo(other.isSetPinned()); if (lastComparison != 0) { return lastComparison; } if (isSetPinned()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pinned, other.pinned); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_setPinned_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("pinned:"); sb.append(this.pinned); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_setPinned_argsStandardSchemeFactory implements SchemeFactory { public user_setPinned_argsStandardScheme getScheme() { return new user_setPinned_argsStandardScheme(); } } private static class user_setPinned_argsStandardScheme extends StandardScheme<user_setPinned_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_setPinned_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PINNED if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.pinned = iprot.readBool(); struct.setPinnedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_setPinned_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); oprot.writeFieldBegin(PINNED_FIELD_DESC); oprot.writeBool(struct.pinned); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_setPinned_argsTupleSchemeFactory implements SchemeFactory { public user_setPinned_argsTupleScheme getScheme() { return new user_setPinned_argsTupleScheme(); } } private static class user_setPinned_argsTupleScheme extends TupleScheme<user_setPinned_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_setPinned_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } if (struct.isSetPinned()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetPinned()) { oprot.writeBool(struct.pinned); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_setPinned_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(1)) { struct.pinned = iprot.readBool(); struct.setPinnedIsSet(true); } } } } public static class user_setPinned_result implements org.apache.thrift.TBase<user_setPinned_result, user_setPinned_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_setPinned_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_setPinned_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_setPinned_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_setPinned_resultTupleSchemeFactory()); } public FileDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_setPinned_result.class, metaDataMap); } public user_setPinned_result() { } public user_setPinned_result( FileDoesNotExistException e) { this(); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_setPinned_result(user_setPinned_result other) { if (other.isSetE()) { this.e = new FileDoesNotExistException(other.e); } } public user_setPinned_result deepCopy() { return new user_setPinned_result(this); } @Override public void clear() { this.e = null; } public FileDoesNotExistException getE() { return this.e; } public user_setPinned_result setE(FileDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((FileDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_setPinned_result) return this.equals((user_setPinned_result)that); return false; } public boolean equals(user_setPinned_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_setPinned_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_setPinned_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_setPinned_resultStandardSchemeFactory implements SchemeFactory { public user_setPinned_resultStandardScheme getScheme() { return new user_setPinned_resultStandardScheme(); } } private static class user_setPinned_resultStandardScheme extends StandardScheme<user_setPinned_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_setPinned_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_setPinned_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_setPinned_resultTupleSchemeFactory implements SchemeFactory { public user_setPinned_resultTupleScheme getScheme() { return new user_setPinned_resultTupleScheme(); } } private static class user_setPinned_resultTupleScheme extends TupleScheme<user_setPinned_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_setPinned_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_setPinned_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_mkdirs_args implements org.apache.thrift.TBase<user_mkdirs_args, user_mkdirs_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_mkdirs_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_mkdirs_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField RECURSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("recursive", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_mkdirs_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_mkdirs_argsTupleSchemeFactory()); } public String path; // required public boolean recursive; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PATH((short)1, "path"), RECURSIVE((short)2, "recursive"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // RECURSIVE return RECURSIVE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __RECURSIVE_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RECURSIVE, new org.apache.thrift.meta_data.FieldMetaData("recursive", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_mkdirs_args.class, metaDataMap); } public user_mkdirs_args() { } public user_mkdirs_args( String path, boolean recursive) { this(); this.path = path; this.recursive = recursive; setRecursiveIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_mkdirs_args(user_mkdirs_args other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetPath()) { this.path = other.path; } this.recursive = other.recursive; } public user_mkdirs_args deepCopy() { return new user_mkdirs_args(this); } @Override public void clear() { this.path = null; setRecursiveIsSet(false); this.recursive = false; } public String getPath() { return this.path; } public user_mkdirs_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public boolean isRecursive() { return this.recursive; } public user_mkdirs_args setRecursive(boolean recursive) { this.recursive = recursive; setRecursiveIsSet(true); return this; } public void unsetRecursive() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ public boolean isSetRecursive() { return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } public void setRecursiveIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case RECURSIVE: if (value == null) { unsetRecursive(); } else { setRecursive((Boolean)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case RECURSIVE: return Boolean.valueOf(isRecursive()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case RECURSIVE: return isSetRecursive(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_mkdirs_args) return this.equals((user_mkdirs_args)that); return false; } public boolean equals(user_mkdirs_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_recursive = true; boolean that_present_recursive = true; if (this_present_recursive || that_present_recursive) { if (!(this_present_recursive && that_present_recursive)) return false; if (this.recursive != that.recursive) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_mkdirs_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRecursive()).compareTo(other.isSetRecursive()); if (lastComparison != 0) { return lastComparison; } if (isSetRecursive()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recursive, other.recursive); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_mkdirs_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("recursive:"); sb.append(this.recursive); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_mkdirs_argsStandardSchemeFactory implements SchemeFactory { public user_mkdirs_argsStandardScheme getScheme() { return new user_mkdirs_argsStandardScheme(); } } private static class user_mkdirs_argsStandardScheme extends StandardScheme<user_mkdirs_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_mkdirs_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // RECURSIVE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_mkdirs_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); oprot.writeBool(struct.recursive); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_mkdirs_argsTupleSchemeFactory implements SchemeFactory { public user_mkdirs_argsTupleScheme getScheme() { return new user_mkdirs_argsTupleScheme(); } } private static class user_mkdirs_argsTupleScheme extends TupleScheme<user_mkdirs_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_mkdirs_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetRecursive()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetRecursive()) { oprot.writeBool(struct.recursive); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_mkdirs_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } } } } public static class user_mkdirs_result implements org.apache.thrift.TBase<user_mkdirs_result, user_mkdirs_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_mkdirs_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_mkdirs_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); private static final org.apache.thrift.protocol.TField E_R_FIELD_DESC = new org.apache.thrift.protocol.TField("eR", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_mkdirs_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_mkdirs_resultTupleSchemeFactory()); } public boolean success; // required public FileAlreadyExistException eR; // required public InvalidPathException eI; // required public TachyonException eT; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_R((short)1, "eR"), E_I((short)2, "eI"), E_T((short)3, "eT"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_R return E_R; case 2: // E_I return E_I; case 3: // E_T return E_T; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.E_R, new org.apache.thrift.meta_data.FieldMetaData("eR", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_T, new org.apache.thrift.meta_data.FieldMetaData("eT", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_mkdirs_result.class, metaDataMap); } public user_mkdirs_result() { } public user_mkdirs_result( boolean success, FileAlreadyExistException eR, InvalidPathException eI, TachyonException eT) { this(); this.success = success; setSuccessIsSet(true); this.eR = eR; this.eI = eI; this.eT = eT; } /** * Performs a deep copy on <i>other</i>. */ public user_mkdirs_result(user_mkdirs_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetER()) { this.eR = new FileAlreadyExistException(other.eR); } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } if (other.isSetET()) { this.eT = new TachyonException(other.eT); } } public user_mkdirs_result deepCopy() { return new user_mkdirs_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = false; this.eR = null; this.eI = null; this.eT = null; } public boolean isSuccess() { return this.success; } public user_mkdirs_result setSuccess(boolean success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileAlreadyExistException getER() { return this.eR; } public user_mkdirs_result setER(FileAlreadyExistException eR) { this.eR = eR; return this; } public void unsetER() { this.eR = null; } /** Returns true if field eR is set (has been assigned a value) and false otherwise */ public boolean isSetER() { return this.eR != null; } public void setERIsSet(boolean value) { if (!value) { this.eR = null; } } public InvalidPathException getEI() { return this.eI; } public user_mkdirs_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public TachyonException getET() { return this.eT; } public user_mkdirs_result setET(TachyonException eT) { this.eT = eT; return this; } public void unsetET() { this.eT = null; } /** Returns true if field eT is set (has been assigned a value) and false otherwise */ public boolean isSetET() { return this.eT != null; } public void setETIsSet(boolean value) { if (!value) { this.eT = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Boolean)value); } break; case E_R: if (value == null) { unsetER(); } else { setER((FileAlreadyExistException)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; case E_T: if (value == null) { unsetET(); } else { setET((TachyonException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Boolean.valueOf(isSuccess()); case E_R: return getER(); case E_I: return getEI(); case E_T: return getET(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_R: return isSetER(); case E_I: return isSetEI(); case E_T: return isSetET(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_mkdirs_result) return this.equals((user_mkdirs_result)that); return false; } public boolean equals(user_mkdirs_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_eR = true && this.isSetER(); boolean that_present_eR = true && that.isSetER(); if (this_present_eR || that_present_eR) { if (!(this_present_eR && that_present_eR)) return false; if (!this.eR.equals(that.eR)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } boolean this_present_eT = true && this.isSetET(); boolean that_present_eT = true && that.isSetET(); if (this_present_eT || that_present_eT) { if (!(this_present_eT && that_present_eT)) return false; if (!this.eT.equals(that.eT)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_mkdirs_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetER()).compareTo(other.isSetER()); if (lastComparison != 0) { return lastComparison; } if (isSetER()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eR, other.eR); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetET()).compareTo(other.isSetET()); if (lastComparison != 0) { return lastComparison; } if (isSetET()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eT, other.eT); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_mkdirs_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("eR:"); if (this.eR == null) { sb.append("null"); } else { sb.append(this.eR); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; if (!first) sb.append(", "); sb.append("eT:"); if (this.eT == null) { sb.append("null"); } else { sb.append(this.eT); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_mkdirs_resultStandardSchemeFactory implements SchemeFactory { public user_mkdirs_resultStandardScheme getScheme() { return new user_mkdirs_resultStandardScheme(); } } private static class user_mkdirs_resultStandardScheme extends StandardScheme<user_mkdirs_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_mkdirs_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_R if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eR = new FileAlreadyExistException(); struct.eR.read(iprot); struct.setERIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // E_T if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eT = new TachyonException(); struct.eT.read(iprot); struct.setETIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_mkdirs_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeBool(struct.success); oprot.writeFieldEnd(); } if (struct.eR != null) { oprot.writeFieldBegin(E_R_FIELD_DESC); struct.eR.write(oprot); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } if (struct.eT != null) { oprot.writeFieldBegin(E_T_FIELD_DESC); struct.eT.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_mkdirs_resultTupleSchemeFactory implements SchemeFactory { public user_mkdirs_resultTupleScheme getScheme() { return new user_mkdirs_resultTupleScheme(); } } private static class user_mkdirs_resultTupleScheme extends TupleScheme<user_mkdirs_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_mkdirs_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetER()) { optionals.set(1); } if (struct.isSetEI()) { optionals.set(2); } if (struct.isSetET()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { oprot.writeBool(struct.success); } if (struct.isSetER()) { struct.eR.write(oprot); } if (struct.isSetEI()) { struct.eI.write(oprot); } if (struct.isSetET()) { struct.eT.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_mkdirs_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eR = new FileAlreadyExistException(); struct.eR.read(iprot); struct.setERIsSet(true); } if (incoming.get(2)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } if (incoming.get(3)) { struct.eT = new TachyonException(); struct.eT.read(iprot); struct.setETIsSet(true); } } } } public static class user_createRawTable_args implements org.apache.thrift.TBase<user_createRawTable_args, user_createRawTable_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_createRawTable_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createRawTable_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("metadata", org.apache.thrift.protocol.TType.STRING, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createRawTable_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createRawTable_argsTupleSchemeFactory()); } public String path; // required public int columns; // required public ByteBuffer metadata; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PATH((short)1, "path"), COLUMNS((short)2, "columns"), METADATA((short)3, "metadata"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // COLUMNS return COLUMNS; case 3: // METADATA return METADATA; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __COLUMNS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.METADATA, new org.apache.thrift.meta_data.FieldMetaData("metadata", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createRawTable_args.class, metaDataMap); } public user_createRawTable_args() { } public user_createRawTable_args( String path, int columns, ByteBuffer metadata) { this(); this.path = path; this.columns = columns; setColumnsIsSet(true); this.metadata = metadata; } /** * Performs a deep copy on <i>other</i>. */ public user_createRawTable_args(user_createRawTable_args other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetPath()) { this.path = other.path; } this.columns = other.columns; if (other.isSetMetadata()) { this.metadata = org.apache.thrift.TBaseHelper.copyBinary(other.metadata); ; } } public user_createRawTable_args deepCopy() { return new user_createRawTable_args(this); } @Override public void clear() { this.path = null; setColumnsIsSet(false); this.columns = 0; this.metadata = null; } public String getPath() { return this.path; } public user_createRawTable_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public int getColumns() { return this.columns; } public user_createRawTable_args setColumns(int columns) { this.columns = columns; setColumnsIsSet(true); return this; } public void unsetColumns() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COLUMNS_ISSET_ID); } /** Returns true if field columns is set (has been assigned a value) and false otherwise */ public boolean isSetColumns() { return EncodingUtils.testBit(__isset_bitfield, __COLUMNS_ISSET_ID); } public void setColumnsIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COLUMNS_ISSET_ID, value); } public byte[] getMetadata() { setMetadata(org.apache.thrift.TBaseHelper.rightSize(metadata)); return metadata == null ? null : metadata.array(); } public ByteBuffer bufferForMetadata() { return metadata; } public user_createRawTable_args setMetadata(byte[] metadata) { setMetadata(metadata == null ? (ByteBuffer)null : ByteBuffer.wrap(metadata)); return this; } public user_createRawTable_args setMetadata(ByteBuffer metadata) { this.metadata = metadata; return this; } public void unsetMetadata() { this.metadata = null; } /** Returns true if field metadata is set (has been assigned a value) and false otherwise */ public boolean isSetMetadata() { return this.metadata != null; } public void setMetadataIsSet(boolean value) { if (!value) { this.metadata = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case COLUMNS: if (value == null) { unsetColumns(); } else { setColumns((Integer)value); } break; case METADATA: if (value == null) { unsetMetadata(); } else { setMetadata((ByteBuffer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case COLUMNS: return Integer.valueOf(getColumns()); case METADATA: return getMetadata(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case COLUMNS: return isSetColumns(); case METADATA: return isSetMetadata(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createRawTable_args) return this.equals((user_createRawTable_args)that); return false; } public boolean equals(user_createRawTable_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_columns = true; boolean that_present_columns = true; if (this_present_columns || that_present_columns) { if (!(this_present_columns && that_present_columns)) return false; if (this.columns != that.columns) return false; } boolean this_present_metadata = true && this.isSetMetadata(); boolean that_present_metadata = true && that.isSetMetadata(); if (this_present_metadata || that_present_metadata) { if (!(this_present_metadata && that_present_metadata)) return false; if (!this.metadata.equals(that.metadata)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createRawTable_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); if (lastComparison != 0) { return lastComparison; } if (isSetColumns()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetMetadata()).compareTo(other.isSetMetadata()); if (lastComparison != 0) { return lastComparison; } if (isSetMetadata()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadata, other.metadata); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createRawTable_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("columns:"); sb.append(this.columns); first = false; if (!first) sb.append(", "); sb.append("metadata:"); if (this.metadata == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.metadata, sb); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createRawTable_argsStandardSchemeFactory implements SchemeFactory { public user_createRawTable_argsStandardScheme getScheme() { return new user_createRawTable_argsStandardScheme(); } } private static class user_createRawTable_argsStandardScheme extends StandardScheme<user_createRawTable_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createRawTable_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // COLUMNS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.columns = iprot.readI32(); struct.setColumnsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // METADATA if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.metadata = iprot.readBinary(); struct.setMetadataIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createRawTable_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldBegin(COLUMNS_FIELD_DESC); oprot.writeI32(struct.columns); oprot.writeFieldEnd(); if (struct.metadata != null) { oprot.writeFieldBegin(METADATA_FIELD_DESC); oprot.writeBinary(struct.metadata); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createRawTable_argsTupleSchemeFactory implements SchemeFactory { public user_createRawTable_argsTupleScheme getScheme() { return new user_createRawTable_argsTupleScheme(); } } private static class user_createRawTable_argsTupleScheme extends TupleScheme<user_createRawTable_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createRawTable_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetColumns()) { optionals.set(1); } if (struct.isSetMetadata()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetColumns()) { oprot.writeI32(struct.columns); } if (struct.isSetMetadata()) { oprot.writeBinary(struct.metadata); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createRawTable_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.columns = iprot.readI32(); struct.setColumnsIsSet(true); } if (incoming.get(2)) { struct.metadata = iprot.readBinary(); struct.setMetadataIsSet(true); } } } } public static class user_createRawTable_result implements org.apache.thrift.TBase<user_createRawTable_result, user_createRawTable_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_createRawTable_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createRawTable_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); private static final org.apache.thrift.protocol.TField E_R_FIELD_DESC = new org.apache.thrift.protocol.TField("eR", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField E_TA_FIELD_DESC = new org.apache.thrift.protocol.TField("eTa", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createRawTable_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createRawTable_resultTupleSchemeFactory()); } public int success; // required public FileAlreadyExistException eR; // required public InvalidPathException eI; // required public TableColumnException eT; // required public TachyonException eTa; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_R((short)1, "eR"), E_I((short)2, "eI"), E_T((short)3, "eT"), E_TA((short)4, "eTa"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_R return E_R; case 2: // E_I return E_I; case 3: // E_T return E_T; case 4: // E_TA return E_TA; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.E_R, new org.apache.thrift.meta_data.FieldMetaData("eR", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_T, new org.apache.thrift.meta_data.FieldMetaData("eT", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_TA, new org.apache.thrift.meta_data.FieldMetaData("eTa", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createRawTable_result.class, metaDataMap); } public user_createRawTable_result() { } public user_createRawTable_result( int success, FileAlreadyExistException eR, InvalidPathException eI, TableColumnException eT, TachyonException eTa) { this(); this.success = success; setSuccessIsSet(true); this.eR = eR; this.eI = eI; this.eT = eT; this.eTa = eTa; } /** * Performs a deep copy on <i>other</i>. */ public user_createRawTable_result(user_createRawTable_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetER()) { this.eR = new FileAlreadyExistException(other.eR); } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } if (other.isSetET()) { this.eT = new TableColumnException(other.eT); } if (other.isSetETa()) { this.eTa = new TachyonException(other.eTa); } } public user_createRawTable_result deepCopy() { return new user_createRawTable_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.eR = null; this.eI = null; this.eT = null; this.eTa = null; } public int getSuccess() { return this.success; } public user_createRawTable_result setSuccess(int success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileAlreadyExistException getER() { return this.eR; } public user_createRawTable_result setER(FileAlreadyExistException eR) { this.eR = eR; return this; } public void unsetER() { this.eR = null; } /** Returns true if field eR is set (has been assigned a value) and false otherwise */ public boolean isSetER() { return this.eR != null; } public void setERIsSet(boolean value) { if (!value) { this.eR = null; } } public InvalidPathException getEI() { return this.eI; } public user_createRawTable_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public TableColumnException getET() { return this.eT; } public user_createRawTable_result setET(TableColumnException eT) { this.eT = eT; return this; } public void unsetET() { this.eT = null; } /** Returns true if field eT is set (has been assigned a value) and false otherwise */ public boolean isSetET() { return this.eT != null; } public void setETIsSet(boolean value) { if (!value) { this.eT = null; } } public TachyonException getETa() { return this.eTa; } public user_createRawTable_result setETa(TachyonException eTa) { this.eTa = eTa; return this; } public void unsetETa() { this.eTa = null; } /** Returns true if field eTa is set (has been assigned a value) and false otherwise */ public boolean isSetETa() { return this.eTa != null; } public void setETaIsSet(boolean value) { if (!value) { this.eTa = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Integer)value); } break; case E_R: if (value == null) { unsetER(); } else { setER((FileAlreadyExistException)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; case E_T: if (value == null) { unsetET(); } else { setET((TableColumnException)value); } break; case E_TA: if (value == null) { unsetETa(); } else { setETa((TachyonException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Integer.valueOf(getSuccess()); case E_R: return getER(); case E_I: return getEI(); case E_T: return getET(); case E_TA: return getETa(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_R: return isSetER(); case E_I: return isSetEI(); case E_T: return isSetET(); case E_TA: return isSetETa(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createRawTable_result) return this.equals((user_createRawTable_result)that); return false; } public boolean equals(user_createRawTable_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_eR = true && this.isSetER(); boolean that_present_eR = true && that.isSetER(); if (this_present_eR || that_present_eR) { if (!(this_present_eR && that_present_eR)) return false; if (!this.eR.equals(that.eR)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } boolean this_present_eT = true && this.isSetET(); boolean that_present_eT = true && that.isSetET(); if (this_present_eT || that_present_eT) { if (!(this_present_eT && that_present_eT)) return false; if (!this.eT.equals(that.eT)) return false; } boolean this_present_eTa = true && this.isSetETa(); boolean that_present_eTa = true && that.isSetETa(); if (this_present_eTa || that_present_eTa) { if (!(this_present_eTa && that_present_eTa)) return false; if (!this.eTa.equals(that.eTa)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createRawTable_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetER()).compareTo(other.isSetER()); if (lastComparison != 0) { return lastComparison; } if (isSetER()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eR, other.eR); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetET()).compareTo(other.isSetET()); if (lastComparison != 0) { return lastComparison; } if (isSetET()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eT, other.eT); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetETa()).compareTo(other.isSetETa()); if (lastComparison != 0) { return lastComparison; } if (isSetETa()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eTa, other.eTa); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createRawTable_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("eR:"); if (this.eR == null) { sb.append("null"); } else { sb.append(this.eR); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; if (!first) sb.append(", "); sb.append("eT:"); if (this.eT == null) { sb.append("null"); } else { sb.append(this.eT); } first = false; if (!first) sb.append(", "); sb.append("eTa:"); if (this.eTa == null) { sb.append("null"); } else { sb.append(this.eTa); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createRawTable_resultStandardSchemeFactory implements SchemeFactory { public user_createRawTable_resultStandardScheme getScheme() { return new user_createRawTable_resultStandardScheme(); } } private static class user_createRawTable_resultStandardScheme extends StandardScheme<user_createRawTable_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createRawTable_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_R if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eR = new FileAlreadyExistException(); struct.eR.read(iprot); struct.setERIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // E_T if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eT = new TableColumnException(); struct.eT.read(iprot); struct.setETIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // E_TA if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eTa = new TachyonException(); struct.eTa.read(iprot); struct.setETaIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createRawTable_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI32(struct.success); oprot.writeFieldEnd(); } if (struct.eR != null) { oprot.writeFieldBegin(E_R_FIELD_DESC); struct.eR.write(oprot); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } if (struct.eT != null) { oprot.writeFieldBegin(E_T_FIELD_DESC); struct.eT.write(oprot); oprot.writeFieldEnd(); } if (struct.eTa != null) { oprot.writeFieldBegin(E_TA_FIELD_DESC); struct.eTa.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createRawTable_resultTupleSchemeFactory implements SchemeFactory { public user_createRawTable_resultTupleScheme getScheme() { return new user_createRawTable_resultTupleScheme(); } } private static class user_createRawTable_resultTupleScheme extends TupleScheme<user_createRawTable_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createRawTable_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetER()) { optionals.set(1); } if (struct.isSetEI()) { optionals.set(2); } if (struct.isSetET()) { optionals.set(3); } if (struct.isSetETa()) { optionals.set(4); } oprot.writeBitSet(optionals, 5); if (struct.isSetSuccess()) { oprot.writeI32(struct.success); } if (struct.isSetER()) { struct.eR.write(oprot); } if (struct.isSetEI()) { struct.eI.write(oprot); } if (struct.isSetET()) { struct.eT.write(oprot); } if (struct.isSetETa()) { struct.eTa.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createRawTable_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eR = new FileAlreadyExistException(); struct.eR.read(iprot); struct.setERIsSet(true); } if (incoming.get(2)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } if (incoming.get(3)) { struct.eT = new TableColumnException(); struct.eT.read(iprot); struct.setETIsSet(true); } if (incoming.get(4)) { struct.eTa = new TachyonException(); struct.eTa.read(iprot); struct.setETaIsSet(true); } } } } public static class user_getRawTableId_args implements org.apache.thrift.TBase<user_getRawTableId_args, user_getRawTableId_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getRawTableId_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getRawTableId_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getRawTableId_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getRawTableId_argsTupleSchemeFactory()); } public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PATH((short)1, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getRawTableId_args.class, metaDataMap); } public user_getRawTableId_args() { } public user_getRawTableId_args( String path) { this(); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public user_getRawTableId_args(user_getRawTableId_args other) { if (other.isSetPath()) { this.path = other.path; } } public user_getRawTableId_args deepCopy() { return new user_getRawTableId_args(this); } @Override public void clear() { this.path = null; } public String getPath() { return this.path; } public user_getRawTableId_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getRawTableId_args) return this.equals((user_getRawTableId_args)that); return false; } public boolean equals(user_getRawTableId_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getRawTableId_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getRawTableId_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getRawTableId_argsStandardSchemeFactory implements SchemeFactory { public user_getRawTableId_argsStandardScheme getScheme() { return new user_getRawTableId_argsStandardScheme(); } } private static class user_getRawTableId_argsStandardScheme extends StandardScheme<user_getRawTableId_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getRawTableId_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getRawTableId_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getRawTableId_argsTupleSchemeFactory implements SchemeFactory { public user_getRawTableId_argsTupleScheme getScheme() { return new user_getRawTableId_argsTupleScheme(); } } private static class user_getRawTableId_argsTupleScheme extends TupleScheme<user_getRawTableId_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getRawTableId_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getRawTableId_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class user_getRawTableId_result implements org.apache.thrift.TBase<user_getRawTableId_result, user_getRawTableId_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getRawTableId_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getRawTableId_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getRawTableId_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getRawTableId_resultTupleSchemeFactory()); } public int success; // required public InvalidPathException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getRawTableId_result.class, metaDataMap); } public user_getRawTableId_result() { } public user_getRawTableId_result( int success, InvalidPathException e) { this(); this.success = success; setSuccessIsSet(true); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_getRawTableId_result(user_getRawTableId_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new InvalidPathException(other.e); } } public user_getRawTableId_result deepCopy() { return new user_getRawTableId_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.e = null; } public int getSuccess() { return this.success; } public user_getRawTableId_result setSuccess(int success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public InvalidPathException getE() { return this.e; } public user_getRawTableId_result setE(InvalidPathException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Integer)value); } break; case E: if (value == null) { unsetE(); } else { setE((InvalidPathException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Integer.valueOf(getSuccess()); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getRawTableId_result) return this.equals((user_getRawTableId_result)that); return false; } public boolean equals(user_getRawTableId_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getRawTableId_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getRawTableId_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getRawTableId_resultStandardSchemeFactory implements SchemeFactory { public user_getRawTableId_resultStandardScheme getScheme() { return new user_getRawTableId_resultStandardScheme(); } } private static class user_getRawTableId_resultStandardScheme extends StandardScheme<user_getRawTableId_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getRawTableId_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new InvalidPathException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getRawTableId_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI32(struct.success); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getRawTableId_resultTupleSchemeFactory implements SchemeFactory { public user_getRawTableId_resultTupleScheme getScheme() { return new user_getRawTableId_resultTupleScheme(); } } private static class user_getRawTableId_resultTupleScheme extends TupleScheme<user_getRawTableId_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getRawTableId_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeI32(struct.success); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getRawTableId_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new InvalidPathException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_getClientRawTableInfo_args implements org.apache.thrift.TBase<user_getClientRawTableInfo_args, user_getClientRawTableInfo_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getClientRawTableInfo_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientRawTableInfo_args"); private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getClientRawTableInfo_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getClientRawTableInfo_argsTupleSchemeFactory()); } public int id; // required public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ID((short)1, "id"), PATH((short)2, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // ID return ID; case 2: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __ID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientRawTableInfo_args.class, metaDataMap); } public user_getClientRawTableInfo_args() { } public user_getClientRawTableInfo_args( int id, String path) { this(); this.id = id; setIdIsSet(true); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public user_getClientRawTableInfo_args(user_getClientRawTableInfo_args other) { __isset_bitfield = other.__isset_bitfield; this.id = other.id; if (other.isSetPath()) { this.path = other.path; } } public user_getClientRawTableInfo_args deepCopy() { return new user_getClientRawTableInfo_args(this); } @Override public void clear() { setIdIsSet(false); this.id = 0; this.path = null; } public int getId() { return this.id; } public user_getClientRawTableInfo_args setId(int id) { this.id = id; setIdIsSet(true); return this; } public void unsetId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); } /** Returns true if field id is set (has been assigned a value) and false otherwise */ public boolean isSetId() { return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); } public void setIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); } public String getPath() { return this.path; } public user_getClientRawTableInfo_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case ID: if (value == null) { unsetId(); } else { setId((Integer)value); } break; case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case ID: return Integer.valueOf(getId()); case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case ID: return isSetId(); case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getClientRawTableInfo_args) return this.equals((user_getClientRawTableInfo_args)that); return false; } public boolean equals(user_getClientRawTableInfo_args that) { if (that == null) return false; boolean this_present_id = true; boolean that_present_id = true; if (this_present_id || that_present_id) { if (!(this_present_id && that_present_id)) return false; if (this.id != that.id) return false; } boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getClientRawTableInfo_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); if (lastComparison != 0) { return lastComparison; } if (isSetId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getClientRawTableInfo_args("); boolean first = true; sb.append("id:"); sb.append(this.id); first = false; if (!first) sb.append(", "); sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getClientRawTableInfo_argsStandardSchemeFactory implements SchemeFactory { public user_getClientRawTableInfo_argsStandardScheme getScheme() { return new user_getClientRawTableInfo_argsStandardScheme(); } } private static class user_getClientRawTableInfo_argsStandardScheme extends StandardScheme<user_getClientRawTableInfo_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientRawTableInfo_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.id = iprot.readI32(); struct.setIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientRawTableInfo_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(ID_FIELD_DESC); oprot.writeI32(struct.id); oprot.writeFieldEnd(); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getClientRawTableInfo_argsTupleSchemeFactory implements SchemeFactory { public user_getClientRawTableInfo_argsTupleScheme getScheme() { return new user_getClientRawTableInfo_argsTupleScheme(); } } private static class user_getClientRawTableInfo_argsTupleScheme extends TupleScheme<user_getClientRawTableInfo_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetId()) { optionals.set(0); } if (struct.isSetPath()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetId()) { oprot.writeI32(struct.id); } if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.id = iprot.readI32(); struct.setIdIsSet(true); } if (incoming.get(1)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class user_getClientRawTableInfo_result implements org.apache.thrift.TBase<user_getClientRawTableInfo_result, user_getClientRawTableInfo_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getClientRawTableInfo_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientRawTableInfo_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getClientRawTableInfo_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getClientRawTableInfo_resultTupleSchemeFactory()); } public ClientRawTableInfo success; // required public TableDoesNotExistException eT; // required public InvalidPathException eI; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_T((short)1, "eT"), E_I((short)2, "eI"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_T return E_T; case 2: // E_I return E_I; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientRawTableInfo.class))); tmpMap.put(_Fields.E_T, new org.apache.thrift.meta_data.FieldMetaData("eT", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientRawTableInfo_result.class, metaDataMap); } public user_getClientRawTableInfo_result() { } public user_getClientRawTableInfo_result( ClientRawTableInfo success, TableDoesNotExistException eT, InvalidPathException eI) { this(); this.success = success; this.eT = eT; this.eI = eI; } /** * Performs a deep copy on <i>other</i>. */ public user_getClientRawTableInfo_result(user_getClientRawTableInfo_result other) { if (other.isSetSuccess()) { this.success = new ClientRawTableInfo(other.success); } if (other.isSetET()) { this.eT = new TableDoesNotExistException(other.eT); } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } } public user_getClientRawTableInfo_result deepCopy() { return new user_getClientRawTableInfo_result(this); } @Override public void clear() { this.success = null; this.eT = null; this.eI = null; } public ClientRawTableInfo getSuccess() { return this.success; } public user_getClientRawTableInfo_result setSuccess(ClientRawTableInfo success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public TableDoesNotExistException getET() { return this.eT; } public user_getClientRawTableInfo_result setET(TableDoesNotExistException eT) { this.eT = eT; return this; } public void unsetET() { this.eT = null; } /** Returns true if field eT is set (has been assigned a value) and false otherwise */ public boolean isSetET() { return this.eT != null; } public void setETIsSet(boolean value) { if (!value) { this.eT = null; } } public InvalidPathException getEI() { return this.eI; } public user_getClientRawTableInfo_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((ClientRawTableInfo)value); } break; case E_T: if (value == null) { unsetET(); } else { setET((TableDoesNotExistException)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E_T: return getET(); case E_I: return getEI(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_T: return isSetET(); case E_I: return isSetEI(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getClientRawTableInfo_result) return this.equals((user_getClientRawTableInfo_result)that); return false; } public boolean equals(user_getClientRawTableInfo_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_eT = true && this.isSetET(); boolean that_present_eT = true && that.isSetET(); if (this_present_eT || that_present_eT) { if (!(this_present_eT && that_present_eT)) return false; if (!this.eT.equals(that.eT)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getClientRawTableInfo_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetET()).compareTo(other.isSetET()); if (lastComparison != 0) { return lastComparison; } if (isSetET()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eT, other.eT); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getClientRawTableInfo_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("eT:"); if (this.eT == null) { sb.append("null"); } else { sb.append(this.eT); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getClientRawTableInfo_resultStandardSchemeFactory implements SchemeFactory { public user_getClientRawTableInfo_resultStandardScheme getScheme() { return new user_getClientRawTableInfo_resultStandardScheme(); } } private static class user_getClientRawTableInfo_resultStandardScheme extends StandardScheme<user_getClientRawTableInfo_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientRawTableInfo_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new ClientRawTableInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_T if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eT = new TableDoesNotExistException(); struct.eT.read(iprot); struct.setETIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientRawTableInfo_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.eT != null) { oprot.writeFieldBegin(E_T_FIELD_DESC); struct.eT.write(oprot); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getClientRawTableInfo_resultTupleSchemeFactory implements SchemeFactory { public user_getClientRawTableInfo_resultTupleScheme getScheme() { return new user_getClientRawTableInfo_resultTupleScheme(); } } private static class user_getClientRawTableInfo_resultTupleScheme extends TupleScheme<user_getClientRawTableInfo_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetET()) { optionals.set(1); } if (struct.isSetEI()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetET()) { struct.eT.write(oprot); } if (struct.isSetEI()) { struct.eI.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.success = new ClientRawTableInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eT = new TableDoesNotExistException(); struct.eT.read(iprot); struct.setETIsSet(true); } if (incoming.get(2)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } } } } public static class user_updateRawTableMetadata_args implements org.apache.thrift.TBase<user_updateRawTableMetadata_args, user_updateRawTableMetadata_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_updateRawTableMetadata_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_updateRawTableMetadata_args"); private static final org.apache.thrift.protocol.TField TABLE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tableId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("metadata", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_updateRawTableMetadata_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_updateRawTableMetadata_argsTupleSchemeFactory()); } public int tableId; // required public ByteBuffer metadata; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { TABLE_ID((short)1, "tableId"), METADATA((short)2, "metadata"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // TABLE_ID return TABLE_ID; case 2: // METADATA return METADATA; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __TABLEID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.TABLE_ID, new org.apache.thrift.meta_data.FieldMetaData("tableId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.METADATA, new org.apache.thrift.meta_data.FieldMetaData("metadata", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_updateRawTableMetadata_args.class, metaDataMap); } public user_updateRawTableMetadata_args() { } public user_updateRawTableMetadata_args( int tableId, ByteBuffer metadata) { this(); this.tableId = tableId; setTableIdIsSet(true); this.metadata = metadata; } /** * Performs a deep copy on <i>other</i>. */ public user_updateRawTableMetadata_args(user_updateRawTableMetadata_args other) { __isset_bitfield = other.__isset_bitfield; this.tableId = other.tableId; if (other.isSetMetadata()) { this.metadata = org.apache.thrift.TBaseHelper.copyBinary(other.metadata); ; } } public user_updateRawTableMetadata_args deepCopy() { return new user_updateRawTableMetadata_args(this); } @Override public void clear() { setTableIdIsSet(false); this.tableId = 0; this.metadata = null; } public int getTableId() { return this.tableId; } public user_updateRawTableMetadata_args setTableId(int tableId) { this.tableId = tableId; setTableIdIsSet(true); return this; } public void unsetTableId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TABLEID_ISSET_ID); } /** Returns true if field tableId is set (has been assigned a value) and false otherwise */ public boolean isSetTableId() { return EncodingUtils.testBit(__isset_bitfield, __TABLEID_ISSET_ID); } public void setTableIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TABLEID_ISSET_ID, value); } public byte[] getMetadata() { setMetadata(org.apache.thrift.TBaseHelper.rightSize(metadata)); return metadata == null ? null : metadata.array(); } public ByteBuffer bufferForMetadata() { return metadata; } public user_updateRawTableMetadata_args setMetadata(byte[] metadata) { setMetadata(metadata == null ? (ByteBuffer)null : ByteBuffer.wrap(metadata)); return this; } public user_updateRawTableMetadata_args setMetadata(ByteBuffer metadata) { this.metadata = metadata; return this; } public void unsetMetadata() { this.metadata = null; } /** Returns true if field metadata is set (has been assigned a value) and false otherwise */ public boolean isSetMetadata() { return this.metadata != null; } public void setMetadataIsSet(boolean value) { if (!value) { this.metadata = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case TABLE_ID: if (value == null) { unsetTableId(); } else { setTableId((Integer)value); } break; case METADATA: if (value == null) { unsetMetadata(); } else { setMetadata((ByteBuffer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case TABLE_ID: return Integer.valueOf(getTableId()); case METADATA: return getMetadata(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case TABLE_ID: return isSetTableId(); case METADATA: return isSetMetadata(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_updateRawTableMetadata_args) return this.equals((user_updateRawTableMetadata_args)that); return false; } public boolean equals(user_updateRawTableMetadata_args that) { if (that == null) return false; boolean this_present_tableId = true; boolean that_present_tableId = true; if (this_present_tableId || that_present_tableId) { if (!(this_present_tableId && that_present_tableId)) return false; if (this.tableId != that.tableId) return false; } boolean this_present_metadata = true && this.isSetMetadata(); boolean that_present_metadata = true && that.isSetMetadata(); if (this_present_metadata || that_present_metadata) { if (!(this_present_metadata && that_present_metadata)) return false; if (!this.metadata.equals(that.metadata)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_updateRawTableMetadata_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetTableId()).compareTo(other.isSetTableId()); if (lastComparison != 0) { return lastComparison; } if (isSetTableId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableId, other.tableId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetMetadata()).compareTo(other.isSetMetadata()); if (lastComparison != 0) { return lastComparison; } if (isSetMetadata()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadata, other.metadata); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_updateRawTableMetadata_args("); boolean first = true; sb.append("tableId:"); sb.append(this.tableId); first = false; if (!first) sb.append(", "); sb.append("metadata:"); if (this.metadata == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.metadata, sb); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_updateRawTableMetadata_argsStandardSchemeFactory implements SchemeFactory { public user_updateRawTableMetadata_argsStandardScheme getScheme() { return new user_updateRawTableMetadata_argsStandardScheme(); } } private static class user_updateRawTableMetadata_argsStandardScheme extends StandardScheme<user_updateRawTableMetadata_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_updateRawTableMetadata_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // TABLE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.tableId = iprot.readI32(); struct.setTableIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // METADATA if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.metadata = iprot.readBinary(); struct.setMetadataIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_updateRawTableMetadata_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(TABLE_ID_FIELD_DESC); oprot.writeI32(struct.tableId); oprot.writeFieldEnd(); if (struct.metadata != null) { oprot.writeFieldBegin(METADATA_FIELD_DESC); oprot.writeBinary(struct.metadata); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_updateRawTableMetadata_argsTupleSchemeFactory implements SchemeFactory { public user_updateRawTableMetadata_argsTupleScheme getScheme() { return new user_updateRawTableMetadata_argsTupleScheme(); } } private static class user_updateRawTableMetadata_argsTupleScheme extends TupleScheme<user_updateRawTableMetadata_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_updateRawTableMetadata_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetTableId()) { optionals.set(0); } if (struct.isSetMetadata()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetTableId()) { oprot.writeI32(struct.tableId); } if (struct.isSetMetadata()) { oprot.writeBinary(struct.metadata); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_updateRawTableMetadata_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.tableId = iprot.readI32(); struct.setTableIdIsSet(true); } if (incoming.get(1)) { struct.metadata = iprot.readBinary(); struct.setMetadataIsSet(true); } } } } public static class user_updateRawTableMetadata_result implements org.apache.thrift.TBase<user_updateRawTableMetadata_result, user_updateRawTableMetadata_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_updateRawTableMetadata_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_updateRawTableMetadata_result"); private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_TA_FIELD_DESC = new org.apache.thrift.protocol.TField("eTa", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_updateRawTableMetadata_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_updateRawTableMetadata_resultTupleSchemeFactory()); } public TableDoesNotExistException eT; // required public TachyonException eTa; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E_T((short)1, "eT"), E_TA((short)2, "eTa"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E_T return E_T; case 2: // E_TA return E_TA; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E_T, new org.apache.thrift.meta_data.FieldMetaData("eT", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_TA, new org.apache.thrift.meta_data.FieldMetaData("eTa", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_updateRawTableMetadata_result.class, metaDataMap); } public user_updateRawTableMetadata_result() { } public user_updateRawTableMetadata_result( TableDoesNotExistException eT, TachyonException eTa) { this(); this.eT = eT; this.eTa = eTa; } /** * Performs a deep copy on <i>other</i>. */ public user_updateRawTableMetadata_result(user_updateRawTableMetadata_result other) { if (other.isSetET()) { this.eT = new TableDoesNotExistException(other.eT); } if (other.isSetETa()) { this.eTa = new TachyonException(other.eTa); } } public user_updateRawTableMetadata_result deepCopy() { return new user_updateRawTableMetadata_result(this); } @Override public void clear() { this.eT = null; this.eTa = null; } public TableDoesNotExistException getET() { return this.eT; } public user_updateRawTableMetadata_result setET(TableDoesNotExistException eT) { this.eT = eT; return this; } public void unsetET() { this.eT = null; } /** Returns true if field eT is set (has been assigned a value) and false otherwise */ public boolean isSetET() { return this.eT != null; } public void setETIsSet(boolean value) { if (!value) { this.eT = null; } } public TachyonException getETa() { return this.eTa; } public user_updateRawTableMetadata_result setETa(TachyonException eTa) { this.eTa = eTa; return this; } public void unsetETa() { this.eTa = null; } /** Returns true if field eTa is set (has been assigned a value) and false otherwise */ public boolean isSetETa() { return this.eTa != null; } public void setETaIsSet(boolean value) { if (!value) { this.eTa = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E_T: if (value == null) { unsetET(); } else { setET((TableDoesNotExistException)value); } break; case E_TA: if (value == null) { unsetETa(); } else { setETa((TachyonException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E_T: return getET(); case E_TA: return getETa(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E_T: return isSetET(); case E_TA: return isSetETa(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_updateRawTableMetadata_result) return this.equals((user_updateRawTableMetadata_result)that); return false; } public boolean equals(user_updateRawTableMetadata_result that) { if (that == null) return false; boolean this_present_eT = true && this.isSetET(); boolean that_present_eT = true && that.isSetET(); if (this_present_eT || that_present_eT) { if (!(this_present_eT && that_present_eT)) return false; if (!this.eT.equals(that.eT)) return false; } boolean this_present_eTa = true && this.isSetETa(); boolean that_present_eTa = true && that.isSetETa(); if (this_present_eTa || that_present_eTa) { if (!(this_present_eTa && that_present_eTa)) return false; if (!this.eTa.equals(that.eTa)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_updateRawTableMetadata_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetET()).compareTo(other.isSetET()); if (lastComparison != 0) { return lastComparison; } if (isSetET()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eT, other.eT); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetETa()).compareTo(other.isSetETa()); if (lastComparison != 0) { return lastComparison; } if (isSetETa()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eTa, other.eTa); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_updateRawTableMetadata_result("); boolean first = true; sb.append("eT:"); if (this.eT == null) { sb.append("null"); } else { sb.append(this.eT); } first = false; if (!first) sb.append(", "); sb.append("eTa:"); if (this.eTa == null) { sb.append("null"); } else { sb.append(this.eTa); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_updateRawTableMetadata_resultStandardSchemeFactory implements SchemeFactory { public user_updateRawTableMetadata_resultStandardScheme getScheme() { return new user_updateRawTableMetadata_resultStandardScheme(); } } private static class user_updateRawTableMetadata_resultStandardScheme extends StandardScheme<user_updateRawTableMetadata_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_updateRawTableMetadata_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E_T if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eT = new TableDoesNotExistException(); struct.eT.read(iprot); struct.setETIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_TA if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eTa = new TachyonException(); struct.eTa.read(iprot); struct.setETaIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_updateRawTableMetadata_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.eT != null) { oprot.writeFieldBegin(E_T_FIELD_DESC); struct.eT.write(oprot); oprot.writeFieldEnd(); } if (struct.eTa != null) { oprot.writeFieldBegin(E_TA_FIELD_DESC); struct.eTa.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_updateRawTableMetadata_resultTupleSchemeFactory implements SchemeFactory { public user_updateRawTableMetadata_resultTupleScheme getScheme() { return new user_updateRawTableMetadata_resultTupleScheme(); } } private static class user_updateRawTableMetadata_resultTupleScheme extends TupleScheme<user_updateRawTableMetadata_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_updateRawTableMetadata_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetET()) { optionals.set(0); } if (struct.isSetETa()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetET()) { struct.eT.write(oprot); } if (struct.isSetETa()) { struct.eTa.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_updateRawTableMetadata_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.eT = new TableDoesNotExistException(); struct.eT.read(iprot); struct.setETIsSet(true); } if (incoming.get(1)) { struct.eTa = new TachyonException(); struct.eTa.read(iprot); struct.setETaIsSet(true); } } } } public static class user_getUfsAddress_args implements org.apache.thrift.TBase<user_getUfsAddress_args, user_getUfsAddress_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getUfsAddress_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getUfsAddress_args"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getUfsAddress_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getUfsAddress_argsTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getUfsAddress_args.class, metaDataMap); } public user_getUfsAddress_args() { } /** * Performs a deep copy on <i>other</i>. */ public user_getUfsAddress_args(user_getUfsAddress_args other) { } public user_getUfsAddress_args deepCopy() { return new user_getUfsAddress_args(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getUfsAddress_args) return this.equals((user_getUfsAddress_args)that); return false; } public boolean equals(user_getUfsAddress_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getUfsAddress_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getUfsAddress_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getUfsAddress_argsStandardSchemeFactory implements SchemeFactory { public user_getUfsAddress_argsStandardScheme getScheme() { return new user_getUfsAddress_argsStandardScheme(); } } private static class user_getUfsAddress_argsStandardScheme extends StandardScheme<user_getUfsAddress_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getUfsAddress_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getUfsAddress_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getUfsAddress_argsTupleSchemeFactory implements SchemeFactory { public user_getUfsAddress_argsTupleScheme getScheme() { return new user_getUfsAddress_argsTupleScheme(); } } private static class user_getUfsAddress_argsTupleScheme extends TupleScheme<user_getUfsAddress_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getUfsAddress_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getUfsAddress_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class user_getUfsAddress_result implements org.apache.thrift.TBase<user_getUfsAddress_result, user_getUfsAddress_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getUfsAddress_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getUfsAddress_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getUfsAddress_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getUfsAddress_resultTupleSchemeFactory()); } public String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getUfsAddress_result.class, metaDataMap); } public user_getUfsAddress_result() { } public user_getUfsAddress_result( String success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public user_getUfsAddress_result(user_getUfsAddress_result other) { if (other.isSetSuccess()) { this.success = other.success; } } public user_getUfsAddress_result deepCopy() { return new user_getUfsAddress_result(this); } @Override public void clear() { this.success = null; } public String getSuccess() { return this.success; } public user_getUfsAddress_result setSuccess(String success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getUfsAddress_result) return this.equals((user_getUfsAddress_result)that); return false; } public boolean equals(user_getUfsAddress_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getUfsAddress_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getUfsAddress_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getUfsAddress_resultStandardSchemeFactory implements SchemeFactory { public user_getUfsAddress_resultStandardScheme getScheme() { return new user_getUfsAddress_resultStandardScheme(); } } private static class user_getUfsAddress_resultStandardScheme extends StandardScheme<user_getUfsAddress_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getUfsAddress_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getUfsAddress_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeString(struct.success); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getUfsAddress_resultTupleSchemeFactory implements SchemeFactory { public user_getUfsAddress_resultTupleScheme getScheme() { return new user_getUfsAddress_resultTupleScheme(); } } private static class user_getUfsAddress_resultTupleScheme extends TupleScheme<user_getUfsAddress_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getUfsAddress_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { oprot.writeString(struct.success); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getUfsAddress_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } } } } public static class user_heartbeat_args implements org.apache.thrift.TBase<user_heartbeat_args, user_heartbeat_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_heartbeat_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_heartbeat_args"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_heartbeat_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_heartbeat_argsTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_heartbeat_args.class, metaDataMap); } public user_heartbeat_args() { } /** * Performs a deep copy on <i>other</i>. */ public user_heartbeat_args(user_heartbeat_args other) { } public user_heartbeat_args deepCopy() { return new user_heartbeat_args(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_heartbeat_args) return this.equals((user_heartbeat_args)that); return false; } public boolean equals(user_heartbeat_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_heartbeat_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_heartbeat_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_heartbeat_argsStandardSchemeFactory implements SchemeFactory { public user_heartbeat_argsStandardScheme getScheme() { return new user_heartbeat_argsStandardScheme(); } } private static class user_heartbeat_argsStandardScheme extends StandardScheme<user_heartbeat_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_heartbeat_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_heartbeat_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_heartbeat_argsTupleSchemeFactory implements SchemeFactory { public user_heartbeat_argsTupleScheme getScheme() { return new user_heartbeat_argsTupleScheme(); } } private static class user_heartbeat_argsTupleScheme extends TupleScheme<user_heartbeat_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_heartbeat_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_heartbeat_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class user_heartbeat_result implements org.apache.thrift.TBase<user_heartbeat_result, user_heartbeat_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_heartbeat_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_heartbeat_result"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_heartbeat_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_heartbeat_resultTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_heartbeat_result.class, metaDataMap); } public user_heartbeat_result() { } /** * Performs a deep copy on <i>other</i>. */ public user_heartbeat_result(user_heartbeat_result other) { } public user_heartbeat_result deepCopy() { return new user_heartbeat_result(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_heartbeat_result) return this.equals((user_heartbeat_result)that); return false; } public boolean equals(user_heartbeat_result that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_heartbeat_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_heartbeat_result("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_heartbeat_resultStandardSchemeFactory implements SchemeFactory { public user_heartbeat_resultStandardScheme getScheme() { return new user_heartbeat_resultStandardScheme(); } } private static class user_heartbeat_resultStandardScheme extends StandardScheme<user_heartbeat_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_heartbeat_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_heartbeat_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_heartbeat_resultTupleSchemeFactory implements SchemeFactory { public user_heartbeat_resultTupleScheme getScheme() { return new user_heartbeat_resultTupleScheme(); } } private static class user_heartbeat_resultTupleScheme extends TupleScheme<user_heartbeat_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_heartbeat_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_heartbeat_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class user_freepath_args implements org.apache.thrift.TBase<user_freepath_args, user_freepath_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_freepath_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_freepath_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField RECURSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("recursive", org.apache.thrift.protocol.TType.BOOL, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_freepath_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_freepath_argsTupleSchemeFactory()); } public int fileId; // required public String path; // required public boolean recursive; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"), PATH((short)2, "path"), RECURSIVE((short)3, "recursive"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; case 2: // PATH return PATH; case 3: // RECURSIVE return RECURSIVE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private static final int __RECURSIVE_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RECURSIVE, new org.apache.thrift.meta_data.FieldMetaData("recursive", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_freepath_args.class, metaDataMap); } public user_freepath_args() { } public user_freepath_args( int fileId, String path, boolean recursive) { this(); this.fileId = fileId; setFileIdIsSet(true); this.path = path; this.recursive = recursive; setRecursiveIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_freepath_args(user_freepath_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; if (other.isSetPath()) { this.path = other.path; } this.recursive = other.recursive; } public user_freepath_args deepCopy() { return new user_freepath_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; this.path = null; setRecursiveIsSet(false); this.recursive = false; } public int getFileId() { return this.fileId; } public user_freepath_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public String getPath() { return this.path; } public user_freepath_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public boolean isRecursive() { return this.recursive; } public user_freepath_args setRecursive(boolean recursive) { this.recursive = recursive; setRecursiveIsSet(true); return this; } public void unsetRecursive() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ public boolean isSetRecursive() { return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } public void setRecursiveIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case RECURSIVE: if (value == null) { unsetRecursive(); } else { setRecursive((Boolean)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); case PATH: return getPath(); case RECURSIVE: return Boolean.valueOf(isRecursive()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); case PATH: return isSetPath(); case RECURSIVE: return isSetRecursive(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_freepath_args) return this.equals((user_freepath_args)that); return false; } public boolean equals(user_freepath_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_recursive = true; boolean that_present_recursive = true; if (this_present_recursive || that_present_recursive) { if (!(this_present_recursive && that_present_recursive)) return false; if (this.recursive != that.recursive) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_freepath_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRecursive()).compareTo(other.isSetRecursive()); if (lastComparison != 0) { return lastComparison; } if (isSetRecursive()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recursive, other.recursive); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_freepath_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("recursive:"); sb.append(this.recursive); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_freepath_argsStandardSchemeFactory implements SchemeFactory { public user_freepath_argsStandardScheme getScheme() { return new user_freepath_argsStandardScheme(); } } private static class user_freepath_argsStandardScheme extends StandardScheme<user_freepath_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_freepath_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // RECURSIVE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_freepath_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); oprot.writeBool(struct.recursive); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_freepath_argsTupleSchemeFactory implements SchemeFactory { public user_freepath_argsTupleScheme getScheme() { return new user_freepath_argsTupleScheme(); } } private static class user_freepath_argsTupleScheme extends TupleScheme<user_freepath_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_freepath_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } if (struct.isSetPath()) { optionals.set(1); } if (struct.isSetRecursive()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetRecursive()) { oprot.writeBool(struct.recursive); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_freepath_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(1)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(2)) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } } } } public static class user_freepath_result implements org.apache.thrift.TBase<user_freepath_result, user_freepath_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_freepath_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_freepath_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_freepath_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_freepath_resultTupleSchemeFactory()); } public boolean success; // required public FileDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_freepath_result.class, metaDataMap); } public user_freepath_result() { } public user_freepath_result( boolean success, FileDoesNotExistException e) { this(); this.success = success; setSuccessIsSet(true); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_freepath_result(user_freepath_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new FileDoesNotExistException(other.e); } } public user_freepath_result deepCopy() { return new user_freepath_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = false; this.e = null; } public boolean isSuccess() { return this.success; } public user_freepath_result setSuccess(boolean success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileDoesNotExistException getE() { return this.e; } public user_freepath_result setE(FileDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Boolean)value); } break; case E: if (value == null) { unsetE(); } else { setE((FileDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Boolean.valueOf(isSuccess()); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_freepath_result) return this.equals((user_freepath_result)that); return false; } public boolean equals(user_freepath_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_freepath_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_freepath_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_freepath_resultStandardSchemeFactory implements SchemeFactory { public user_freepath_resultStandardScheme getScheme() { return new user_freepath_resultStandardScheme(); } } private static class user_freepath_resultStandardScheme extends StandardScheme<user_freepath_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_freepath_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_freepath_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeBool(struct.success); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_freepath_resultTupleSchemeFactory implements SchemeFactory { public user_freepath_resultTupleScheme getScheme() { return new user_freepath_resultTupleScheme(); } } private static class user_freepath_resultTupleScheme extends TupleScheme<user_freepath_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_freepath_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeBool(struct.success); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_freepath_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } }
core/src/main/java/tachyon/thrift/MasterService.java
/** * Autogenerated by Thrift Compiler (0.9.1) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package tachyon.thrift; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; import org.apache.thrift.scheme.TupleScheme; import org.apache.thrift.protocol.TTupleProtocol; import org.apache.thrift.protocol.TProtocolException; import org.apache.thrift.EncodingUtils; import org.apache.thrift.TException; import org.apache.thrift.async.AsyncMethodCallback; import org.apache.thrift.server.AbstractNonblockingServer.*; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class MasterService { public interface Iface { public boolean addCheckpoint(long workerId, int fileId, long length, String checkpointPath) throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException; public List<ClientWorkerInfo> getWorkersInfo() throws org.apache.thrift.TException; public List<ClientFileInfo> liststatus(String path) throws InvalidPathException, FileDoesNotExistException, org.apache.thrift.TException; /** * Worker register. * @return value rv % 100,000 is really workerId, rv / 1000,000 is master started time. * * @param workerNetAddress * @param totalBytes * @param usedBytes * @param currentBlocks */ public long worker_register(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlocks) throws BlockInfoException, org.apache.thrift.TException; public Command worker_heartbeat(long workerId, long usedBytes, List<Long> removedBlocks) throws BlockInfoException, org.apache.thrift.TException; public void worker_cacheBlock(long workerId, long workerUsedBytes, long blockId, long length) throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException; public Set<Integer> worker_getPinIdList() throws org.apache.thrift.TException; public List<Integer> worker_getPriorityDependencyList() throws org.apache.thrift.TException; public int user_createDependency(List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte) throws InvalidPathException, FileDoesNotExistException, FileAlreadyExistException, BlockInfoException, TachyonException, org.apache.thrift.TException; public ClientDependencyInfo user_getClientDependencyInfo(int dependencyId) throws DependencyDoesNotExistException, org.apache.thrift.TException; public void user_reportLostFile(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException; public void user_requestFilesInDependency(int depId) throws DependencyDoesNotExistException, org.apache.thrift.TException; public int user_createFile(String path, String ufsPath, long blockSizeByte, boolean recursive) throws FileAlreadyExistException, InvalidPathException, BlockInfoException, SuspectedFileSizeException, TachyonException, org.apache.thrift.TException; public long user_createNewBlock(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException; public void user_completeFile(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException; public long user_getUserId() throws org.apache.thrift.TException; public long user_getBlockId(int fileId, int index) throws FileDoesNotExistException, org.apache.thrift.TException; /** * Get local worker NetAddress * * @param random * @param host */ public NetAddress user_getWorker(boolean random, String host) throws NoWorkerException, org.apache.thrift.TException; public ClientFileInfo getFileStatus(int fileId, String path) throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException; /** * Get block's ClientBlockInfo. * * @param blockId */ public ClientBlockInfo user_getClientBlockInfo(long blockId) throws FileDoesNotExistException, BlockInfoException, org.apache.thrift.TException; /** * Get file blocks info. * * @param fileId * @param path */ public List<ClientBlockInfo> user_getFileBlocks(int fileId, String path) throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException; public boolean user_delete(int fileId, String path, boolean recursive) throws TachyonException, org.apache.thrift.TException; public boolean user_rename(int fileId, String srcPath, String dstPath) throws FileAlreadyExistException, FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException; public void user_setPinned(int fileId, boolean pinned) throws FileDoesNotExistException, org.apache.thrift.TException; public boolean user_mkdirs(String path, boolean recursive) throws FileAlreadyExistException, InvalidPathException, TachyonException, org.apache.thrift.TException; public int user_createRawTable(String path, int columns, ByteBuffer metadata) throws FileAlreadyExistException, InvalidPathException, TableColumnException, TachyonException, org.apache.thrift.TException; /** * Return 0 if does not contain the Table, return fileId if it exists. * * @param path */ public int user_getRawTableId(String path) throws InvalidPathException, org.apache.thrift.TException; /** * Get RawTable's info; Return a ClientRawTable instance with id 0 if the system does not contain * the table. path if valid iff id is -1. * * @param id * @param path */ public ClientRawTableInfo user_getClientRawTableInfo(int id, String path) throws TableDoesNotExistException, InvalidPathException, org.apache.thrift.TException; public void user_updateRawTableMetadata(int tableId, ByteBuffer metadata) throws TableDoesNotExistException, TachyonException, org.apache.thrift.TException; public String user_getUfsAddress() throws org.apache.thrift.TException; /** * Returns if the message was received. Intended to check if the client can still connect to the * master. */ public void user_heartbeat() throws org.apache.thrift.TException; public boolean user_freepath(int fileId, String path, boolean recursive) throws FileDoesNotExistException, org.apache.thrift.TException; } public interface AsyncIface { public void addCheckpoint(long workerId, int fileId, long length, String checkpointPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getWorkersInfo(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void liststatus(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void worker_register(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlocks, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void worker_heartbeat(long workerId, long usedBytes, List<Long> removedBlocks, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void worker_cacheBlock(long workerId, long workerUsedBytes, long blockId, long length, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void worker_getPinIdList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void worker_getPriorityDependencyList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_createDependency(List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getClientDependencyInfo(int dependencyId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_reportLostFile(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_requestFilesInDependency(int depId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_createFile(String path, String ufsPath, long blockSizeByte, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_createNewBlock(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_completeFile(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getUserId(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getBlockId(int fileId, int index, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getWorker(boolean random, String host, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getFileStatus(int fileId, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getClientBlockInfo(long blockId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getFileBlocks(int fileId, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_delete(int fileId, String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_rename(int fileId, String srcPath, String dstPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_setPinned(int fileId, boolean pinned, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_mkdirs(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_createRawTable(String path, int columns, ByteBuffer metadata, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getRawTableId(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getClientRawTableInfo(int id, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_updateRawTableMetadata(int tableId, ByteBuffer metadata, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getUfsAddress(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_heartbeat(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_freepath(int fileId, String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; } public static class Client extends org.apache.thrift.TServiceClient implements Iface { public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> { public Factory() {} public Client getClient(org.apache.thrift.protocol.TProtocol prot) { return new Client(prot); } public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { return new Client(iprot, oprot); } } public Client(org.apache.thrift.protocol.TProtocol prot) { super(prot, prot); } public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { super(iprot, oprot); } public boolean addCheckpoint(long workerId, int fileId, long length, String checkpointPath) throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException { send_addCheckpoint(workerId, fileId, length, checkpointPath); return recv_addCheckpoint(); } public void send_addCheckpoint(long workerId, int fileId, long length, String checkpointPath) throws org.apache.thrift.TException { addCheckpoint_args args = new addCheckpoint_args(); args.setWorkerId(workerId); args.setFileId(fileId); args.setLength(length); args.setCheckpointPath(checkpointPath); sendBase("addCheckpoint", args); } public boolean recv_addCheckpoint() throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException { addCheckpoint_result result = new addCheckpoint_result(); receiveBase(result, "addCheckpoint"); if (result.isSetSuccess()) { return result.success; } if (result.eP != null) { throw result.eP; } if (result.eS != null) { throw result.eS; } if (result.eB != null) { throw result.eB; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addCheckpoint failed: unknown result"); } public List<ClientWorkerInfo> getWorkersInfo() throws org.apache.thrift.TException { send_getWorkersInfo(); return recv_getWorkersInfo(); } public void send_getWorkersInfo() throws org.apache.thrift.TException { getWorkersInfo_args args = new getWorkersInfo_args(); sendBase("getWorkersInfo", args); } public List<ClientWorkerInfo> recv_getWorkersInfo() throws org.apache.thrift.TException { getWorkersInfo_result result = new getWorkersInfo_result(); receiveBase(result, "getWorkersInfo"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getWorkersInfo failed: unknown result"); } public List<ClientFileInfo> liststatus(String path) throws InvalidPathException, FileDoesNotExistException, org.apache.thrift.TException { send_liststatus(path); return recv_liststatus(); } public void send_liststatus(String path) throws org.apache.thrift.TException { liststatus_args args = new liststatus_args(); args.setPath(path); sendBase("liststatus", args); } public List<ClientFileInfo> recv_liststatus() throws InvalidPathException, FileDoesNotExistException, org.apache.thrift.TException { liststatus_result result = new liststatus_result(); receiveBase(result, "liststatus"); if (result.isSetSuccess()) { return result.success; } if (result.eI != null) { throw result.eI; } if (result.eF != null) { throw result.eF; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "liststatus failed: unknown result"); } public long worker_register(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlocks) throws BlockInfoException, org.apache.thrift.TException { send_worker_register(workerNetAddress, totalBytes, usedBytes, currentBlocks); return recv_worker_register(); } public void send_worker_register(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlocks) throws org.apache.thrift.TException { worker_register_args args = new worker_register_args(); args.setWorkerNetAddress(workerNetAddress); args.setTotalBytes(totalBytes); args.setUsedBytes(usedBytes); args.setCurrentBlocks(currentBlocks); sendBase("worker_register", args); } public long recv_worker_register() throws BlockInfoException, org.apache.thrift.TException { worker_register_result result = new worker_register_result(); receiveBase(result, "worker_register"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "worker_register failed: unknown result"); } public Command worker_heartbeat(long workerId, long usedBytes, List<Long> removedBlocks) throws BlockInfoException, org.apache.thrift.TException { send_worker_heartbeat(workerId, usedBytes, removedBlocks); return recv_worker_heartbeat(); } public void send_worker_heartbeat(long workerId, long usedBytes, List<Long> removedBlocks) throws org.apache.thrift.TException { worker_heartbeat_args args = new worker_heartbeat_args(); args.setWorkerId(workerId); args.setUsedBytes(usedBytes); args.setRemovedBlocks(removedBlocks); sendBase("worker_heartbeat", args); } public Command recv_worker_heartbeat() throws BlockInfoException, org.apache.thrift.TException { worker_heartbeat_result result = new worker_heartbeat_result(); receiveBase(result, "worker_heartbeat"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "worker_heartbeat failed: unknown result"); } public void worker_cacheBlock(long workerId, long workerUsedBytes, long blockId, long length) throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException { send_worker_cacheBlock(workerId, workerUsedBytes, blockId, length); recv_worker_cacheBlock(); } public void send_worker_cacheBlock(long workerId, long workerUsedBytes, long blockId, long length) throws org.apache.thrift.TException { worker_cacheBlock_args args = new worker_cacheBlock_args(); args.setWorkerId(workerId); args.setWorkerUsedBytes(workerUsedBytes); args.setBlockId(blockId); args.setLength(length); sendBase("worker_cacheBlock", args); } public void recv_worker_cacheBlock() throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException { worker_cacheBlock_result result = new worker_cacheBlock_result(); receiveBase(result, "worker_cacheBlock"); if (result.eP != null) { throw result.eP; } if (result.eS != null) { throw result.eS; } if (result.eB != null) { throw result.eB; } return; } public Set<Integer> worker_getPinIdList() throws org.apache.thrift.TException { send_worker_getPinIdList(); return recv_worker_getPinIdList(); } public void send_worker_getPinIdList() throws org.apache.thrift.TException { worker_getPinIdList_args args = new worker_getPinIdList_args(); sendBase("worker_getPinIdList", args); } public Set<Integer> recv_worker_getPinIdList() throws org.apache.thrift.TException { worker_getPinIdList_result result = new worker_getPinIdList_result(); receiveBase(result, "worker_getPinIdList"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "worker_getPinIdList failed: unknown result"); } public List<Integer> worker_getPriorityDependencyList() throws org.apache.thrift.TException { send_worker_getPriorityDependencyList(); return recv_worker_getPriorityDependencyList(); } public void send_worker_getPriorityDependencyList() throws org.apache.thrift.TException { worker_getPriorityDependencyList_args args = new worker_getPriorityDependencyList_args(); sendBase("worker_getPriorityDependencyList", args); } public List<Integer> recv_worker_getPriorityDependencyList() throws org.apache.thrift.TException { worker_getPriorityDependencyList_result result = new worker_getPriorityDependencyList_result(); receiveBase(result, "worker_getPriorityDependencyList"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "worker_getPriorityDependencyList failed: unknown result"); } public int user_createDependency(List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte) throws InvalidPathException, FileDoesNotExistException, FileAlreadyExistException, BlockInfoException, TachyonException, org.apache.thrift.TException { send_user_createDependency(parents, children, commandPrefix, data, comment, framework, frameworkVersion, dependencyType, childrenBlockSizeByte); return recv_user_createDependency(); } public void send_user_createDependency(List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte) throws org.apache.thrift.TException { user_createDependency_args args = new user_createDependency_args(); args.setParents(parents); args.setChildren(children); args.setCommandPrefix(commandPrefix); args.setData(data); args.setComment(comment); args.setFramework(framework); args.setFrameworkVersion(frameworkVersion); args.setDependencyType(dependencyType); args.setChildrenBlockSizeByte(childrenBlockSizeByte); sendBase("user_createDependency", args); } public int recv_user_createDependency() throws InvalidPathException, FileDoesNotExistException, FileAlreadyExistException, BlockInfoException, TachyonException, org.apache.thrift.TException { user_createDependency_result result = new user_createDependency_result(); receiveBase(result, "user_createDependency"); if (result.isSetSuccess()) { return result.success; } if (result.eI != null) { throw result.eI; } if (result.eF != null) { throw result.eF; } if (result.eA != null) { throw result.eA; } if (result.eB != null) { throw result.eB; } if (result.eT != null) { throw result.eT; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_createDependency failed: unknown result"); } public ClientDependencyInfo user_getClientDependencyInfo(int dependencyId) throws DependencyDoesNotExistException, org.apache.thrift.TException { send_user_getClientDependencyInfo(dependencyId); return recv_user_getClientDependencyInfo(); } public void send_user_getClientDependencyInfo(int dependencyId) throws org.apache.thrift.TException { user_getClientDependencyInfo_args args = new user_getClientDependencyInfo_args(); args.setDependencyId(dependencyId); sendBase("user_getClientDependencyInfo", args); } public ClientDependencyInfo recv_user_getClientDependencyInfo() throws DependencyDoesNotExistException, org.apache.thrift.TException { user_getClientDependencyInfo_result result = new user_getClientDependencyInfo_result(); receiveBase(result, "user_getClientDependencyInfo"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getClientDependencyInfo failed: unknown result"); } public void user_reportLostFile(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException { send_user_reportLostFile(fileId); recv_user_reportLostFile(); } public void send_user_reportLostFile(int fileId) throws org.apache.thrift.TException { user_reportLostFile_args args = new user_reportLostFile_args(); args.setFileId(fileId); sendBase("user_reportLostFile", args); } public void recv_user_reportLostFile() throws FileDoesNotExistException, org.apache.thrift.TException { user_reportLostFile_result result = new user_reportLostFile_result(); receiveBase(result, "user_reportLostFile"); if (result.e != null) { throw result.e; } return; } public void user_requestFilesInDependency(int depId) throws DependencyDoesNotExistException, org.apache.thrift.TException { send_user_requestFilesInDependency(depId); recv_user_requestFilesInDependency(); } public void send_user_requestFilesInDependency(int depId) throws org.apache.thrift.TException { user_requestFilesInDependency_args args = new user_requestFilesInDependency_args(); args.setDepId(depId); sendBase("user_requestFilesInDependency", args); } public void recv_user_requestFilesInDependency() throws DependencyDoesNotExistException, org.apache.thrift.TException { user_requestFilesInDependency_result result = new user_requestFilesInDependency_result(); receiveBase(result, "user_requestFilesInDependency"); if (result.e != null) { throw result.e; } return; } public int user_createFile(String path, String ufsPath, long blockSizeByte, boolean recursive) throws FileAlreadyExistException, InvalidPathException, BlockInfoException, SuspectedFileSizeException, TachyonException, org.apache.thrift.TException { send_user_createFile(path, ufsPath, blockSizeByte, recursive); return recv_user_createFile(); } public void send_user_createFile(String path, String ufsPath, long blockSizeByte, boolean recursive) throws org.apache.thrift.TException { user_createFile_args args = new user_createFile_args(); args.setPath(path); args.setUfsPath(ufsPath); args.setBlockSizeByte(blockSizeByte); args.setRecursive(recursive); sendBase("user_createFile", args); } public int recv_user_createFile() throws FileAlreadyExistException, InvalidPathException, BlockInfoException, SuspectedFileSizeException, TachyonException, org.apache.thrift.TException { user_createFile_result result = new user_createFile_result(); receiveBase(result, "user_createFile"); if (result.isSetSuccess()) { return result.success; } if (result.eR != null) { throw result.eR; } if (result.eI != null) { throw result.eI; } if (result.eB != null) { throw result.eB; } if (result.eS != null) { throw result.eS; } if (result.eT != null) { throw result.eT; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_createFile failed: unknown result"); } public long user_createNewBlock(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException { send_user_createNewBlock(fileId); return recv_user_createNewBlock(); } public void send_user_createNewBlock(int fileId) throws org.apache.thrift.TException { user_createNewBlock_args args = new user_createNewBlock_args(); args.setFileId(fileId); sendBase("user_createNewBlock", args); } public long recv_user_createNewBlock() throws FileDoesNotExistException, org.apache.thrift.TException { user_createNewBlock_result result = new user_createNewBlock_result(); receiveBase(result, "user_createNewBlock"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_createNewBlock failed: unknown result"); } public void user_completeFile(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException { send_user_completeFile(fileId); recv_user_completeFile(); } public void send_user_completeFile(int fileId) throws org.apache.thrift.TException { user_completeFile_args args = new user_completeFile_args(); args.setFileId(fileId); sendBase("user_completeFile", args); } public void recv_user_completeFile() throws FileDoesNotExistException, org.apache.thrift.TException { user_completeFile_result result = new user_completeFile_result(); receiveBase(result, "user_completeFile"); if (result.e != null) { throw result.e; } return; } public long user_getUserId() throws org.apache.thrift.TException { send_user_getUserId(); return recv_user_getUserId(); } public void send_user_getUserId() throws org.apache.thrift.TException { user_getUserId_args args = new user_getUserId_args(); sendBase("user_getUserId", args); } public long recv_user_getUserId() throws org.apache.thrift.TException { user_getUserId_result result = new user_getUserId_result(); receiveBase(result, "user_getUserId"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getUserId failed: unknown result"); } public long user_getBlockId(int fileId, int index) throws FileDoesNotExistException, org.apache.thrift.TException { send_user_getBlockId(fileId, index); return recv_user_getBlockId(); } public void send_user_getBlockId(int fileId, int index) throws org.apache.thrift.TException { user_getBlockId_args args = new user_getBlockId_args(); args.setFileId(fileId); args.setIndex(index); sendBase("user_getBlockId", args); } public long recv_user_getBlockId() throws FileDoesNotExistException, org.apache.thrift.TException { user_getBlockId_result result = new user_getBlockId_result(); receiveBase(result, "user_getBlockId"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getBlockId failed: unknown result"); } public NetAddress user_getWorker(boolean random, String host) throws NoWorkerException, org.apache.thrift.TException { send_user_getWorker(random, host); return recv_user_getWorker(); } public void send_user_getWorker(boolean random, String host) throws org.apache.thrift.TException { user_getWorker_args args = new user_getWorker_args(); args.setRandom(random); args.setHost(host); sendBase("user_getWorker", args); } public NetAddress recv_user_getWorker() throws NoWorkerException, org.apache.thrift.TException { user_getWorker_result result = new user_getWorker_result(); receiveBase(result, "user_getWorker"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getWorker failed: unknown result"); } public ClientFileInfo getFileStatus(int fileId, String path) throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { send_getFileStatus(fileId, path); return recv_getFileStatus(); } public void send_getFileStatus(int fileId, String path) throws org.apache.thrift.TException { getFileStatus_args args = new getFileStatus_args(); args.setFileId(fileId); args.setPath(path); sendBase("getFileStatus", args); } public ClientFileInfo recv_getFileStatus() throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { getFileStatus_result result = new getFileStatus_result(); receiveBase(result, "getFileStatus"); if (result.isSetSuccess()) { return result.success; } if (result.eF != null) { throw result.eF; } if (result.eI != null) { throw result.eI; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getFileStatus failed: unknown result"); } public ClientBlockInfo user_getClientBlockInfo(long blockId) throws FileDoesNotExistException, BlockInfoException, org.apache.thrift.TException { send_user_getClientBlockInfo(blockId); return recv_user_getClientBlockInfo(); } public void send_user_getClientBlockInfo(long blockId) throws org.apache.thrift.TException { user_getClientBlockInfo_args args = new user_getClientBlockInfo_args(); args.setBlockId(blockId); sendBase("user_getClientBlockInfo", args); } public ClientBlockInfo recv_user_getClientBlockInfo() throws FileDoesNotExistException, BlockInfoException, org.apache.thrift.TException { user_getClientBlockInfo_result result = new user_getClientBlockInfo_result(); receiveBase(result, "user_getClientBlockInfo"); if (result.isSetSuccess()) { return result.success; } if (result.eF != null) { throw result.eF; } if (result.eB != null) { throw result.eB; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getClientBlockInfo failed: unknown result"); } public List<ClientBlockInfo> user_getFileBlocks(int fileId, String path) throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { send_user_getFileBlocks(fileId, path); return recv_user_getFileBlocks(); } public void send_user_getFileBlocks(int fileId, String path) throws org.apache.thrift.TException { user_getFileBlocks_args args = new user_getFileBlocks_args(); args.setFileId(fileId); args.setPath(path); sendBase("user_getFileBlocks", args); } public List<ClientBlockInfo> recv_user_getFileBlocks() throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { user_getFileBlocks_result result = new user_getFileBlocks_result(); receiveBase(result, "user_getFileBlocks"); if (result.isSetSuccess()) { return result.success; } if (result.eF != null) { throw result.eF; } if (result.eI != null) { throw result.eI; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getFileBlocks failed: unknown result"); } public boolean user_delete(int fileId, String path, boolean recursive) throws TachyonException, org.apache.thrift.TException { send_user_delete(fileId, path, recursive); return recv_user_delete(); } public void send_user_delete(int fileId, String path, boolean recursive) throws org.apache.thrift.TException { user_delete_args args = new user_delete_args(); args.setFileId(fileId); args.setPath(path); args.setRecursive(recursive); sendBase("user_delete", args); } public boolean recv_user_delete() throws TachyonException, org.apache.thrift.TException { user_delete_result result = new user_delete_result(); receiveBase(result, "user_delete"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_delete failed: unknown result"); } public boolean user_rename(int fileId, String srcPath, String dstPath) throws FileAlreadyExistException, FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { send_user_rename(fileId, srcPath, dstPath); return recv_user_rename(); } public void send_user_rename(int fileId, String srcPath, String dstPath) throws org.apache.thrift.TException { user_rename_args args = new user_rename_args(); args.setFileId(fileId); args.setSrcPath(srcPath); args.setDstPath(dstPath); sendBase("user_rename", args); } public boolean recv_user_rename() throws FileAlreadyExistException, FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { user_rename_result result = new user_rename_result(); receiveBase(result, "user_rename"); if (result.isSetSuccess()) { return result.success; } if (result.eA != null) { throw result.eA; } if (result.eF != null) { throw result.eF; } if (result.eI != null) { throw result.eI; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_rename failed: unknown result"); } public void user_setPinned(int fileId, boolean pinned) throws FileDoesNotExistException, org.apache.thrift.TException { send_user_setPinned(fileId, pinned); recv_user_setPinned(); } public void send_user_setPinned(int fileId, boolean pinned) throws org.apache.thrift.TException { user_setPinned_args args = new user_setPinned_args(); args.setFileId(fileId); args.setPinned(pinned); sendBase("user_setPinned", args); } public void recv_user_setPinned() throws FileDoesNotExistException, org.apache.thrift.TException { user_setPinned_result result = new user_setPinned_result(); receiveBase(result, "user_setPinned"); if (result.e != null) { throw result.e; } return; } public boolean user_mkdirs(String path, boolean recursive) throws FileAlreadyExistException, InvalidPathException, TachyonException, org.apache.thrift.TException { send_user_mkdirs(path, recursive); return recv_user_mkdirs(); } public void send_user_mkdirs(String path, boolean recursive) throws org.apache.thrift.TException { user_mkdirs_args args = new user_mkdirs_args(); args.setPath(path); args.setRecursive(recursive); sendBase("user_mkdirs", args); } public boolean recv_user_mkdirs() throws FileAlreadyExistException, InvalidPathException, TachyonException, org.apache.thrift.TException { user_mkdirs_result result = new user_mkdirs_result(); receiveBase(result, "user_mkdirs"); if (result.isSetSuccess()) { return result.success; } if (result.eR != null) { throw result.eR; } if (result.eI != null) { throw result.eI; } if (result.eT != null) { throw result.eT; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_mkdirs failed: unknown result"); } public int user_createRawTable(String path, int columns, ByteBuffer metadata) throws FileAlreadyExistException, InvalidPathException, TableColumnException, TachyonException, org.apache.thrift.TException { send_user_createRawTable(path, columns, metadata); return recv_user_createRawTable(); } public void send_user_createRawTable(String path, int columns, ByteBuffer metadata) throws org.apache.thrift.TException { user_createRawTable_args args = new user_createRawTable_args(); args.setPath(path); args.setColumns(columns); args.setMetadata(metadata); sendBase("user_createRawTable", args); } public int recv_user_createRawTable() throws FileAlreadyExistException, InvalidPathException, TableColumnException, TachyonException, org.apache.thrift.TException { user_createRawTable_result result = new user_createRawTable_result(); receiveBase(result, "user_createRawTable"); if (result.isSetSuccess()) { return result.success; } if (result.eR != null) { throw result.eR; } if (result.eI != null) { throw result.eI; } if (result.eT != null) { throw result.eT; } if (result.eTa != null) { throw result.eTa; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_createRawTable failed: unknown result"); } public int user_getRawTableId(String path) throws InvalidPathException, org.apache.thrift.TException { send_user_getRawTableId(path); return recv_user_getRawTableId(); } public void send_user_getRawTableId(String path) throws org.apache.thrift.TException { user_getRawTableId_args args = new user_getRawTableId_args(); args.setPath(path); sendBase("user_getRawTableId", args); } public int recv_user_getRawTableId() throws InvalidPathException, org.apache.thrift.TException { user_getRawTableId_result result = new user_getRawTableId_result(); receiveBase(result, "user_getRawTableId"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getRawTableId failed: unknown result"); } public ClientRawTableInfo user_getClientRawTableInfo(int id, String path) throws TableDoesNotExistException, InvalidPathException, org.apache.thrift.TException { send_user_getClientRawTableInfo(id, path); return recv_user_getClientRawTableInfo(); } public void send_user_getClientRawTableInfo(int id, String path) throws org.apache.thrift.TException { user_getClientRawTableInfo_args args = new user_getClientRawTableInfo_args(); args.setId(id); args.setPath(path); sendBase("user_getClientRawTableInfo", args); } public ClientRawTableInfo recv_user_getClientRawTableInfo() throws TableDoesNotExistException, InvalidPathException, org.apache.thrift.TException { user_getClientRawTableInfo_result result = new user_getClientRawTableInfo_result(); receiveBase(result, "user_getClientRawTableInfo"); if (result.isSetSuccess()) { return result.success; } if (result.eT != null) { throw result.eT; } if (result.eI != null) { throw result.eI; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getClientRawTableInfo failed: unknown result"); } public void user_updateRawTableMetadata(int tableId, ByteBuffer metadata) throws TableDoesNotExistException, TachyonException, org.apache.thrift.TException { send_user_updateRawTableMetadata(tableId, metadata); recv_user_updateRawTableMetadata(); } public void send_user_updateRawTableMetadata(int tableId, ByteBuffer metadata) throws org.apache.thrift.TException { user_updateRawTableMetadata_args args = new user_updateRawTableMetadata_args(); args.setTableId(tableId); args.setMetadata(metadata); sendBase("user_updateRawTableMetadata", args); } public void recv_user_updateRawTableMetadata() throws TableDoesNotExistException, TachyonException, org.apache.thrift.TException { user_updateRawTableMetadata_result result = new user_updateRawTableMetadata_result(); receiveBase(result, "user_updateRawTableMetadata"); if (result.eT != null) { throw result.eT; } if (result.eTa != null) { throw result.eTa; } return; } public String user_getUfsAddress() throws org.apache.thrift.TException { send_user_getUfsAddress(); return recv_user_getUfsAddress(); } public void send_user_getUfsAddress() throws org.apache.thrift.TException { user_getUfsAddress_args args = new user_getUfsAddress_args(); sendBase("user_getUfsAddress", args); } public String recv_user_getUfsAddress() throws org.apache.thrift.TException { user_getUfsAddress_result result = new user_getUfsAddress_result(); receiveBase(result, "user_getUfsAddress"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getUfsAddress failed: unknown result"); } public void user_heartbeat() throws org.apache.thrift.TException { send_user_heartbeat(); recv_user_heartbeat(); } public void send_user_heartbeat() throws org.apache.thrift.TException { user_heartbeat_args args = new user_heartbeat_args(); sendBase("user_heartbeat", args); } public void recv_user_heartbeat() throws org.apache.thrift.TException { user_heartbeat_result result = new user_heartbeat_result(); receiveBase(result, "user_heartbeat"); return; } public boolean user_freepath(int fileId, String path, boolean recursive) throws FileDoesNotExistException, org.apache.thrift.TException { send_user_freepath(fileId, path, recursive); return recv_user_freepath(); } public void send_user_freepath(int fileId, String path, boolean recursive) throws org.apache.thrift.TException { user_freepath_args args = new user_freepath_args(); args.setFileId(fileId); args.setPath(path); args.setRecursive(recursive); sendBase("user_freepath", args); } public boolean recv_user_freepath() throws FileDoesNotExistException, org.apache.thrift.TException { user_freepath_result result = new user_freepath_result(); receiveBase(result, "user_freepath"); if (result.isSetSuccess()) { return result.success; } if (result.e != null) { throw result.e; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_freepath failed: unknown result"); } } public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> { private org.apache.thrift.async.TAsyncClientManager clientManager; private org.apache.thrift.protocol.TProtocolFactory protocolFactory; public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { this.clientManager = clientManager; this.protocolFactory = protocolFactory; } public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { return new AsyncClient(protocolFactory, clientManager, transport); } } public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { super(protocolFactory, clientManager, transport); } public void addCheckpoint(long workerId, int fileId, long length, String checkpointPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); addCheckpoint_call method_call = new addCheckpoint_call(workerId, fileId, length, checkpointPath, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class addCheckpoint_call extends org.apache.thrift.async.TAsyncMethodCall { private long workerId; private int fileId; private long length; private String checkpointPath; public addCheckpoint_call(long workerId, int fileId, long length, String checkpointPath, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.workerId = workerId; this.fileId = fileId; this.length = length; this.checkpointPath = checkpointPath; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addCheckpoint", org.apache.thrift.protocol.TMessageType.CALL, 0)); addCheckpoint_args args = new addCheckpoint_args(); args.setWorkerId(workerId); args.setFileId(fileId); args.setLength(length); args.setCheckpointPath(checkpointPath); args.write(prot); prot.writeMessageEnd(); } public boolean getResult() throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_addCheckpoint(); } } public void getWorkersInfo(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getWorkersInfo_call method_call = new getWorkersInfo_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getWorkersInfo_call extends org.apache.thrift.async.TAsyncMethodCall { public getWorkersInfo_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getWorkersInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); getWorkersInfo_args args = new getWorkersInfo_args(); args.write(prot); prot.writeMessageEnd(); } public List<ClientWorkerInfo> getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_getWorkersInfo(); } } public void liststatus(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); liststatus_call method_call = new liststatus_call(path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class liststatus_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; public liststatus_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("liststatus", org.apache.thrift.protocol.TMessageType.CALL, 0)); liststatus_args args = new liststatus_args(); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public List<ClientFileInfo> getResult() throws InvalidPathException, FileDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_liststatus(); } } public void worker_register(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlocks, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); worker_register_call method_call = new worker_register_call(workerNetAddress, totalBytes, usedBytes, currentBlocks, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class worker_register_call extends org.apache.thrift.async.TAsyncMethodCall { private NetAddress workerNetAddress; private long totalBytes; private long usedBytes; private List<Long> currentBlocks; public worker_register_call(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlocks, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.workerNetAddress = workerNetAddress; this.totalBytes = totalBytes; this.usedBytes = usedBytes; this.currentBlocks = currentBlocks; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("worker_register", org.apache.thrift.protocol.TMessageType.CALL, 0)); worker_register_args args = new worker_register_args(); args.setWorkerNetAddress(workerNetAddress); args.setTotalBytes(totalBytes); args.setUsedBytes(usedBytes); args.setCurrentBlocks(currentBlocks); args.write(prot); prot.writeMessageEnd(); } public long getResult() throws BlockInfoException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_worker_register(); } } public void worker_heartbeat(long workerId, long usedBytes, List<Long> removedBlocks, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); worker_heartbeat_call method_call = new worker_heartbeat_call(workerId, usedBytes, removedBlocks, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class worker_heartbeat_call extends org.apache.thrift.async.TAsyncMethodCall { private long workerId; private long usedBytes; private List<Long> removedBlocks; public worker_heartbeat_call(long workerId, long usedBytes, List<Long> removedBlocks, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.workerId = workerId; this.usedBytes = usedBytes; this.removedBlocks = removedBlocks; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("worker_heartbeat", org.apache.thrift.protocol.TMessageType.CALL, 0)); worker_heartbeat_args args = new worker_heartbeat_args(); args.setWorkerId(workerId); args.setUsedBytes(usedBytes); args.setRemovedBlocks(removedBlocks); args.write(prot); prot.writeMessageEnd(); } public Command getResult() throws BlockInfoException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_worker_heartbeat(); } } public void worker_cacheBlock(long workerId, long workerUsedBytes, long blockId, long length, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); worker_cacheBlock_call method_call = new worker_cacheBlock_call(workerId, workerUsedBytes, blockId, length, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class worker_cacheBlock_call extends org.apache.thrift.async.TAsyncMethodCall { private long workerId; private long workerUsedBytes; private long blockId; private long length; public worker_cacheBlock_call(long workerId, long workerUsedBytes, long blockId, long length, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.workerId = workerId; this.workerUsedBytes = workerUsedBytes; this.blockId = blockId; this.length = length; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("worker_cacheBlock", org.apache.thrift.protocol.TMessageType.CALL, 0)); worker_cacheBlock_args args = new worker_cacheBlock_args(); args.setWorkerId(workerId); args.setWorkerUsedBytes(workerUsedBytes); args.setBlockId(blockId); args.setLength(length); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_worker_cacheBlock(); } } public void worker_getPinIdList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); worker_getPinIdList_call method_call = new worker_getPinIdList_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class worker_getPinIdList_call extends org.apache.thrift.async.TAsyncMethodCall { public worker_getPinIdList_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("worker_getPinIdList", org.apache.thrift.protocol.TMessageType.CALL, 0)); worker_getPinIdList_args args = new worker_getPinIdList_args(); args.write(prot); prot.writeMessageEnd(); } public Set<Integer> getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_worker_getPinIdList(); } } public void worker_getPriorityDependencyList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); worker_getPriorityDependencyList_call method_call = new worker_getPriorityDependencyList_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class worker_getPriorityDependencyList_call extends org.apache.thrift.async.TAsyncMethodCall { public worker_getPriorityDependencyList_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("worker_getPriorityDependencyList", org.apache.thrift.protocol.TMessageType.CALL, 0)); worker_getPriorityDependencyList_args args = new worker_getPriorityDependencyList_args(); args.write(prot); prot.writeMessageEnd(); } public List<Integer> getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_worker_getPriorityDependencyList(); } } public void user_createDependency(List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_createDependency_call method_call = new user_createDependency_call(parents, children, commandPrefix, data, comment, framework, frameworkVersion, dependencyType, childrenBlockSizeByte, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_createDependency_call extends org.apache.thrift.async.TAsyncMethodCall { private List<String> parents; private List<String> children; private String commandPrefix; private List<ByteBuffer> data; private String comment; private String framework; private String frameworkVersion; private int dependencyType; private long childrenBlockSizeByte; public user_createDependency_call(List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.parents = parents; this.children = children; this.commandPrefix = commandPrefix; this.data = data; this.comment = comment; this.framework = framework; this.frameworkVersion = frameworkVersion; this.dependencyType = dependencyType; this.childrenBlockSizeByte = childrenBlockSizeByte; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_createDependency", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_createDependency_args args = new user_createDependency_args(); args.setParents(parents); args.setChildren(children); args.setCommandPrefix(commandPrefix); args.setData(data); args.setComment(comment); args.setFramework(framework); args.setFrameworkVersion(frameworkVersion); args.setDependencyType(dependencyType); args.setChildrenBlockSizeByte(childrenBlockSizeByte); args.write(prot); prot.writeMessageEnd(); } public int getResult() throws InvalidPathException, FileDoesNotExistException, FileAlreadyExistException, BlockInfoException, TachyonException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_createDependency(); } } public void user_getClientDependencyInfo(int dependencyId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getClientDependencyInfo_call method_call = new user_getClientDependencyInfo_call(dependencyId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getClientDependencyInfo_call extends org.apache.thrift.async.TAsyncMethodCall { private int dependencyId; public user_getClientDependencyInfo_call(int dependencyId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.dependencyId = dependencyId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getClientDependencyInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getClientDependencyInfo_args args = new user_getClientDependencyInfo_args(); args.setDependencyId(dependencyId); args.write(prot); prot.writeMessageEnd(); } public ClientDependencyInfo getResult() throws DependencyDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getClientDependencyInfo(); } } public void user_reportLostFile(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_reportLostFile_call method_call = new user_reportLostFile_call(fileId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_reportLostFile_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; public user_reportLostFile_call(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_reportLostFile", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_reportLostFile_args args = new user_reportLostFile_args(); args.setFileId(fileId); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws FileDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_user_reportLostFile(); } } public void user_requestFilesInDependency(int depId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_requestFilesInDependency_call method_call = new user_requestFilesInDependency_call(depId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_requestFilesInDependency_call extends org.apache.thrift.async.TAsyncMethodCall { private int depId; public user_requestFilesInDependency_call(int depId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.depId = depId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_requestFilesInDependency", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_requestFilesInDependency_args args = new user_requestFilesInDependency_args(); args.setDepId(depId); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws DependencyDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_user_requestFilesInDependency(); } } public void user_createFile(String path, String ufsPath, long blockSizeByte, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_createFile_call method_call = new user_createFile_call(path, ufsPath, blockSizeByte, recursive, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_createFile_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private String ufsPath; private long blockSizeByte; private boolean recursive; public user_createFile_call(String path, String ufsPath, long blockSizeByte, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.ufsPath = ufsPath; this.blockSizeByte = blockSizeByte; this.recursive = recursive; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_createFile", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_createFile_args args = new user_createFile_args(); args.setPath(path); args.setUfsPath(ufsPath); args.setBlockSizeByte(blockSizeByte); args.setRecursive(recursive); args.write(prot); prot.writeMessageEnd(); } public int getResult() throws FileAlreadyExistException, InvalidPathException, BlockInfoException, SuspectedFileSizeException, TachyonException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_createFile(); } } public void user_createNewBlock(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_createNewBlock_call method_call = new user_createNewBlock_call(fileId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_createNewBlock_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; public user_createNewBlock_call(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_createNewBlock", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_createNewBlock_args args = new user_createNewBlock_args(); args.setFileId(fileId); args.write(prot); prot.writeMessageEnd(); } public long getResult() throws FileDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_createNewBlock(); } } public void user_completeFile(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_completeFile_call method_call = new user_completeFile_call(fileId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_completeFile_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; public user_completeFile_call(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_completeFile", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_completeFile_args args = new user_completeFile_args(); args.setFileId(fileId); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws FileDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_user_completeFile(); } } public void user_getUserId(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getUserId_call method_call = new user_getUserId_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getUserId_call extends org.apache.thrift.async.TAsyncMethodCall { public user_getUserId_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getUserId", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getUserId_args args = new user_getUserId_args(); args.write(prot); prot.writeMessageEnd(); } public long getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getUserId(); } } public void user_getBlockId(int fileId, int index, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getBlockId_call method_call = new user_getBlockId_call(fileId, index, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getBlockId_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; private int index; public user_getBlockId_call(int fileId, int index, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; this.index = index; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getBlockId", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getBlockId_args args = new user_getBlockId_args(); args.setFileId(fileId); args.setIndex(index); args.write(prot); prot.writeMessageEnd(); } public long getResult() throws FileDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getBlockId(); } } public void user_getWorker(boolean random, String host, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getWorker_call method_call = new user_getWorker_call(random, host, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getWorker_call extends org.apache.thrift.async.TAsyncMethodCall { private boolean random; private String host; public user_getWorker_call(boolean random, String host, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.random = random; this.host = host; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getWorker", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getWorker_args args = new user_getWorker_args(); args.setRandom(random); args.setHost(host); args.write(prot); prot.writeMessageEnd(); } public NetAddress getResult() throws NoWorkerException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getWorker(); } } public void getFileStatus(int fileId, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getFileStatus_call method_call = new getFileStatus_call(fileId, path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getFileStatus_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; private String path; public getFileStatus_call(int fileId, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getFileStatus", org.apache.thrift.protocol.TMessageType.CALL, 0)); getFileStatus_args args = new getFileStatus_args(); args.setFileId(fileId); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public ClientFileInfo getResult() throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_getFileStatus(); } } public void user_getClientBlockInfo(long blockId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getClientBlockInfo_call method_call = new user_getClientBlockInfo_call(blockId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getClientBlockInfo_call extends org.apache.thrift.async.TAsyncMethodCall { private long blockId; public user_getClientBlockInfo_call(long blockId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.blockId = blockId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getClientBlockInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getClientBlockInfo_args args = new user_getClientBlockInfo_args(); args.setBlockId(blockId); args.write(prot); prot.writeMessageEnd(); } public ClientBlockInfo getResult() throws FileDoesNotExistException, BlockInfoException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getClientBlockInfo(); } } public void user_getFileBlocks(int fileId, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getFileBlocks_call method_call = new user_getFileBlocks_call(fileId, path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getFileBlocks_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; private String path; public user_getFileBlocks_call(int fileId, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getFileBlocks", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getFileBlocks_args args = new user_getFileBlocks_args(); args.setFileId(fileId); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public List<ClientBlockInfo> getResult() throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getFileBlocks(); } } public void user_delete(int fileId, String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_delete_call method_call = new user_delete_call(fileId, path, recursive, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_delete_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; private String path; private boolean recursive; public user_delete_call(int fileId, String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; this.path = path; this.recursive = recursive; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_delete", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_delete_args args = new user_delete_args(); args.setFileId(fileId); args.setPath(path); args.setRecursive(recursive); args.write(prot); prot.writeMessageEnd(); } public boolean getResult() throws TachyonException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_delete(); } } public void user_rename(int fileId, String srcPath, String dstPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_rename_call method_call = new user_rename_call(fileId, srcPath, dstPath, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_rename_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; private String srcPath; private String dstPath; public user_rename_call(int fileId, String srcPath, String dstPath, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; this.srcPath = srcPath; this.dstPath = dstPath; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_rename", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_rename_args args = new user_rename_args(); args.setFileId(fileId); args.setSrcPath(srcPath); args.setDstPath(dstPath); args.write(prot); prot.writeMessageEnd(); } public boolean getResult() throws FileAlreadyExistException, FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_rename(); } } public void user_setPinned(int fileId, boolean pinned, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_setPinned_call method_call = new user_setPinned_call(fileId, pinned, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_setPinned_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; private boolean pinned; public user_setPinned_call(int fileId, boolean pinned, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; this.pinned = pinned; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_setPinned", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_setPinned_args args = new user_setPinned_args(); args.setFileId(fileId); args.setPinned(pinned); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws FileDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_user_setPinned(); } } public void user_mkdirs(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_mkdirs_call method_call = new user_mkdirs_call(path, recursive, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_mkdirs_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private boolean recursive; public user_mkdirs_call(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.recursive = recursive; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_mkdirs", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_mkdirs_args args = new user_mkdirs_args(); args.setPath(path); args.setRecursive(recursive); args.write(prot); prot.writeMessageEnd(); } public boolean getResult() throws FileAlreadyExistException, InvalidPathException, TachyonException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_mkdirs(); } } public void user_createRawTable(String path, int columns, ByteBuffer metadata, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_createRawTable_call method_call = new user_createRawTable_call(path, columns, metadata, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_createRawTable_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; private int columns; private ByteBuffer metadata; public user_createRawTable_call(String path, int columns, ByteBuffer metadata, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; this.columns = columns; this.metadata = metadata; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_createRawTable", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_createRawTable_args args = new user_createRawTable_args(); args.setPath(path); args.setColumns(columns); args.setMetadata(metadata); args.write(prot); prot.writeMessageEnd(); } public int getResult() throws FileAlreadyExistException, InvalidPathException, TableColumnException, TachyonException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_createRawTable(); } } public void user_getRawTableId(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getRawTableId_call method_call = new user_getRawTableId_call(path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getRawTableId_call extends org.apache.thrift.async.TAsyncMethodCall { private String path; public user_getRawTableId_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getRawTableId", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getRawTableId_args args = new user_getRawTableId_args(); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public int getResult() throws InvalidPathException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getRawTableId(); } } public void user_getClientRawTableInfo(int id, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getClientRawTableInfo_call method_call = new user_getClientRawTableInfo_call(id, path, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getClientRawTableInfo_call extends org.apache.thrift.async.TAsyncMethodCall { private int id; private String path; public user_getClientRawTableInfo_call(int id, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.id = id; this.path = path; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getClientRawTableInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getClientRawTableInfo_args args = new user_getClientRawTableInfo_args(); args.setId(id); args.setPath(path); args.write(prot); prot.writeMessageEnd(); } public ClientRawTableInfo getResult() throws TableDoesNotExistException, InvalidPathException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getClientRawTableInfo(); } } public void user_updateRawTableMetadata(int tableId, ByteBuffer metadata, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_updateRawTableMetadata_call method_call = new user_updateRawTableMetadata_call(tableId, metadata, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_updateRawTableMetadata_call extends org.apache.thrift.async.TAsyncMethodCall { private int tableId; private ByteBuffer metadata; public user_updateRawTableMetadata_call(int tableId, ByteBuffer metadata, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.tableId = tableId; this.metadata = metadata; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_updateRawTableMetadata", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_updateRawTableMetadata_args args = new user_updateRawTableMetadata_args(); args.setTableId(tableId); args.setMetadata(metadata); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws TableDoesNotExistException, TachyonException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_user_updateRawTableMetadata(); } } public void user_getUfsAddress(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_getUfsAddress_call method_call = new user_getUfsAddress_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_getUfsAddress_call extends org.apache.thrift.async.TAsyncMethodCall { public user_getUfsAddress_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getUfsAddress", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_getUfsAddress_args args = new user_getUfsAddress_args(); args.write(prot); prot.writeMessageEnd(); } public String getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_getUfsAddress(); } } public void user_heartbeat(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_heartbeat_call method_call = new user_heartbeat_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_heartbeat_call extends org.apache.thrift.async.TAsyncMethodCall { public user_heartbeat_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_heartbeat", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_heartbeat_args args = new user_heartbeat_args(); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_user_heartbeat(); } } public void user_freepath(int fileId, String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_freepath_call method_call = new user_freepath_call(fileId, path, recursive, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class user_freepath_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; private String path; private boolean recursive; public user_freepath_call(int fileId, String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.fileId = fileId; this.path = path; this.recursive = recursive; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_freepath", org.apache.thrift.protocol.TMessageType.CALL, 0)); user_freepath_args args = new user_freepath_args(); args.setFileId(fileId); args.setPath(path); args.setRecursive(recursive); args.write(prot); prot.writeMessageEnd(); } public boolean getResult() throws FileDoesNotExistException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_user_freepath(); } } } public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); public Processor(I iface) { super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>())); } protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { processMap.put("addCheckpoint", new addCheckpoint()); processMap.put("getWorkersInfo", new getWorkersInfo()); processMap.put("liststatus", new liststatus()); processMap.put("worker_register", new worker_register()); processMap.put("worker_heartbeat", new worker_heartbeat()); processMap.put("worker_cacheBlock", new worker_cacheBlock()); processMap.put("worker_getPinIdList", new worker_getPinIdList()); processMap.put("worker_getPriorityDependencyList", new worker_getPriorityDependencyList()); processMap.put("user_createDependency", new user_createDependency()); processMap.put("user_getClientDependencyInfo", new user_getClientDependencyInfo()); processMap.put("user_reportLostFile", new user_reportLostFile()); processMap.put("user_requestFilesInDependency", new user_requestFilesInDependency()); processMap.put("user_createFile", new user_createFile()); processMap.put("user_createNewBlock", new user_createNewBlock()); processMap.put("user_completeFile", new user_completeFile()); processMap.put("user_getUserId", new user_getUserId()); processMap.put("user_getBlockId", new user_getBlockId()); processMap.put("user_getWorker", new user_getWorker()); processMap.put("getFileStatus", new getFileStatus()); processMap.put("user_getClientBlockInfo", new user_getClientBlockInfo()); processMap.put("user_getFileBlocks", new user_getFileBlocks()); processMap.put("user_delete", new user_delete()); processMap.put("user_rename", new user_rename()); processMap.put("user_setPinned", new user_setPinned()); processMap.put("user_mkdirs", new user_mkdirs()); processMap.put("user_createRawTable", new user_createRawTable()); processMap.put("user_getRawTableId", new user_getRawTableId()); processMap.put("user_getClientRawTableInfo", new user_getClientRawTableInfo()); processMap.put("user_updateRawTableMetadata", new user_updateRawTableMetadata()); processMap.put("user_getUfsAddress", new user_getUfsAddress()); processMap.put("user_heartbeat", new user_heartbeat()); processMap.put("user_freepath", new user_freepath()); return processMap; } public static class addCheckpoint<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addCheckpoint_args> { public addCheckpoint() { super("addCheckpoint"); } public addCheckpoint_args getEmptyArgsInstance() { return new addCheckpoint_args(); } protected boolean isOneway() { return false; } public addCheckpoint_result getResult(I iface, addCheckpoint_args args) throws org.apache.thrift.TException { addCheckpoint_result result = new addCheckpoint_result(); try { result.success = iface.addCheckpoint(args.workerId, args.fileId, args.length, args.checkpointPath); result.setSuccessIsSet(true); } catch (FileDoesNotExistException eP) { result.eP = eP; } catch (SuspectedFileSizeException eS) { result.eS = eS; } catch (BlockInfoException eB) { result.eB = eB; } return result; } } public static class getWorkersInfo<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getWorkersInfo_args> { public getWorkersInfo() { super("getWorkersInfo"); } public getWorkersInfo_args getEmptyArgsInstance() { return new getWorkersInfo_args(); } protected boolean isOneway() { return false; } public getWorkersInfo_result getResult(I iface, getWorkersInfo_args args) throws org.apache.thrift.TException { getWorkersInfo_result result = new getWorkersInfo_result(); result.success = iface.getWorkersInfo(); return result; } } public static class liststatus<I extends Iface> extends org.apache.thrift.ProcessFunction<I, liststatus_args> { public liststatus() { super("liststatus"); } public liststatus_args getEmptyArgsInstance() { return new liststatus_args(); } protected boolean isOneway() { return false; } public liststatus_result getResult(I iface, liststatus_args args) throws org.apache.thrift.TException { liststatus_result result = new liststatus_result(); try { result.success = iface.liststatus(args.path); } catch (InvalidPathException eI) { result.eI = eI; } catch (FileDoesNotExistException eF) { result.eF = eF; } return result; } } public static class worker_register<I extends Iface> extends org.apache.thrift.ProcessFunction<I, worker_register_args> { public worker_register() { super("worker_register"); } public worker_register_args getEmptyArgsInstance() { return new worker_register_args(); } protected boolean isOneway() { return false; } public worker_register_result getResult(I iface, worker_register_args args) throws org.apache.thrift.TException { worker_register_result result = new worker_register_result(); try { result.success = iface.worker_register(args.workerNetAddress, args.totalBytes, args.usedBytes, args.currentBlocks); result.setSuccessIsSet(true); } catch (BlockInfoException e) { result.e = e; } return result; } } public static class worker_heartbeat<I extends Iface> extends org.apache.thrift.ProcessFunction<I, worker_heartbeat_args> { public worker_heartbeat() { super("worker_heartbeat"); } public worker_heartbeat_args getEmptyArgsInstance() { return new worker_heartbeat_args(); } protected boolean isOneway() { return false; } public worker_heartbeat_result getResult(I iface, worker_heartbeat_args args) throws org.apache.thrift.TException { worker_heartbeat_result result = new worker_heartbeat_result(); try { result.success = iface.worker_heartbeat(args.workerId, args.usedBytes, args.removedBlocks); } catch (BlockInfoException e) { result.e = e; } return result; } } public static class worker_cacheBlock<I extends Iface> extends org.apache.thrift.ProcessFunction<I, worker_cacheBlock_args> { public worker_cacheBlock() { super("worker_cacheBlock"); } public worker_cacheBlock_args getEmptyArgsInstance() { return new worker_cacheBlock_args(); } protected boolean isOneway() { return false; } public worker_cacheBlock_result getResult(I iface, worker_cacheBlock_args args) throws org.apache.thrift.TException { worker_cacheBlock_result result = new worker_cacheBlock_result(); try { iface.worker_cacheBlock(args.workerId, args.workerUsedBytes, args.blockId, args.length); } catch (FileDoesNotExistException eP) { result.eP = eP; } catch (SuspectedFileSizeException eS) { result.eS = eS; } catch (BlockInfoException eB) { result.eB = eB; } return result; } } public static class worker_getPinIdList<I extends Iface> extends org.apache.thrift.ProcessFunction<I, worker_getPinIdList_args> { public worker_getPinIdList() { super("worker_getPinIdList"); } public worker_getPinIdList_args getEmptyArgsInstance() { return new worker_getPinIdList_args(); } protected boolean isOneway() { return false; } public worker_getPinIdList_result getResult(I iface, worker_getPinIdList_args args) throws org.apache.thrift.TException { worker_getPinIdList_result result = new worker_getPinIdList_result(); result.success = iface.worker_getPinIdList(); return result; } } public static class worker_getPriorityDependencyList<I extends Iface> extends org.apache.thrift.ProcessFunction<I, worker_getPriorityDependencyList_args> { public worker_getPriorityDependencyList() { super("worker_getPriorityDependencyList"); } public worker_getPriorityDependencyList_args getEmptyArgsInstance() { return new worker_getPriorityDependencyList_args(); } protected boolean isOneway() { return false; } public worker_getPriorityDependencyList_result getResult(I iface, worker_getPriorityDependencyList_args args) throws org.apache.thrift.TException { worker_getPriorityDependencyList_result result = new worker_getPriorityDependencyList_result(); result.success = iface.worker_getPriorityDependencyList(); return result; } } public static class user_createDependency<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_createDependency_args> { public user_createDependency() { super("user_createDependency"); } public user_createDependency_args getEmptyArgsInstance() { return new user_createDependency_args(); } protected boolean isOneway() { return false; } public user_createDependency_result getResult(I iface, user_createDependency_args args) throws org.apache.thrift.TException { user_createDependency_result result = new user_createDependency_result(); try { result.success = iface.user_createDependency(args.parents, args.children, args.commandPrefix, args.data, args.comment, args.framework, args.frameworkVersion, args.dependencyType, args.childrenBlockSizeByte); result.setSuccessIsSet(true); } catch (InvalidPathException eI) { result.eI = eI; } catch (FileDoesNotExistException eF) { result.eF = eF; } catch (FileAlreadyExistException eA) { result.eA = eA; } catch (BlockInfoException eB) { result.eB = eB; } catch (TachyonException eT) { result.eT = eT; } return result; } } public static class user_getClientDependencyInfo<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getClientDependencyInfo_args> { public user_getClientDependencyInfo() { super("user_getClientDependencyInfo"); } public user_getClientDependencyInfo_args getEmptyArgsInstance() { return new user_getClientDependencyInfo_args(); } protected boolean isOneway() { return false; } public user_getClientDependencyInfo_result getResult(I iface, user_getClientDependencyInfo_args args) throws org.apache.thrift.TException { user_getClientDependencyInfo_result result = new user_getClientDependencyInfo_result(); try { result.success = iface.user_getClientDependencyInfo(args.dependencyId); } catch (DependencyDoesNotExistException e) { result.e = e; } return result; } } public static class user_reportLostFile<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_reportLostFile_args> { public user_reportLostFile() { super("user_reportLostFile"); } public user_reportLostFile_args getEmptyArgsInstance() { return new user_reportLostFile_args(); } protected boolean isOneway() { return false; } public user_reportLostFile_result getResult(I iface, user_reportLostFile_args args) throws org.apache.thrift.TException { user_reportLostFile_result result = new user_reportLostFile_result(); try { iface.user_reportLostFile(args.fileId); } catch (FileDoesNotExistException e) { result.e = e; } return result; } } public static class user_requestFilesInDependency<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_requestFilesInDependency_args> { public user_requestFilesInDependency() { super("user_requestFilesInDependency"); } public user_requestFilesInDependency_args getEmptyArgsInstance() { return new user_requestFilesInDependency_args(); } protected boolean isOneway() { return false; } public user_requestFilesInDependency_result getResult(I iface, user_requestFilesInDependency_args args) throws org.apache.thrift.TException { user_requestFilesInDependency_result result = new user_requestFilesInDependency_result(); try { iface.user_requestFilesInDependency(args.depId); } catch (DependencyDoesNotExistException e) { result.e = e; } return result; } } public static class user_createFile<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_createFile_args> { public user_createFile() { super("user_createFile"); } public user_createFile_args getEmptyArgsInstance() { return new user_createFile_args(); } protected boolean isOneway() { return false; } public user_createFile_result getResult(I iface, user_createFile_args args) throws org.apache.thrift.TException { user_createFile_result result = new user_createFile_result(); try { result.success = iface.user_createFile(args.path, args.ufsPath, args.blockSizeByte, args.recursive); result.setSuccessIsSet(true); } catch (FileAlreadyExistException eR) { result.eR = eR; } catch (InvalidPathException eI) { result.eI = eI; } catch (BlockInfoException eB) { result.eB = eB; } catch (SuspectedFileSizeException eS) { result.eS = eS; } catch (TachyonException eT) { result.eT = eT; } return result; } } public static class user_createNewBlock<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_createNewBlock_args> { public user_createNewBlock() { super("user_createNewBlock"); } public user_createNewBlock_args getEmptyArgsInstance() { return new user_createNewBlock_args(); } protected boolean isOneway() { return false; } public user_createNewBlock_result getResult(I iface, user_createNewBlock_args args) throws org.apache.thrift.TException { user_createNewBlock_result result = new user_createNewBlock_result(); try { result.success = iface.user_createNewBlock(args.fileId); result.setSuccessIsSet(true); } catch (FileDoesNotExistException e) { result.e = e; } return result; } } public static class user_completeFile<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_completeFile_args> { public user_completeFile() { super("user_completeFile"); } public user_completeFile_args getEmptyArgsInstance() { return new user_completeFile_args(); } protected boolean isOneway() { return false; } public user_completeFile_result getResult(I iface, user_completeFile_args args) throws org.apache.thrift.TException { user_completeFile_result result = new user_completeFile_result(); try { iface.user_completeFile(args.fileId); } catch (FileDoesNotExistException e) { result.e = e; } return result; } } public static class user_getUserId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getUserId_args> { public user_getUserId() { super("user_getUserId"); } public user_getUserId_args getEmptyArgsInstance() { return new user_getUserId_args(); } protected boolean isOneway() { return false; } public user_getUserId_result getResult(I iface, user_getUserId_args args) throws org.apache.thrift.TException { user_getUserId_result result = new user_getUserId_result(); result.success = iface.user_getUserId(); result.setSuccessIsSet(true); return result; } } public static class user_getBlockId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getBlockId_args> { public user_getBlockId() { super("user_getBlockId"); } public user_getBlockId_args getEmptyArgsInstance() { return new user_getBlockId_args(); } protected boolean isOneway() { return false; } public user_getBlockId_result getResult(I iface, user_getBlockId_args args) throws org.apache.thrift.TException { user_getBlockId_result result = new user_getBlockId_result(); try { result.success = iface.user_getBlockId(args.fileId, args.index); result.setSuccessIsSet(true); } catch (FileDoesNotExistException e) { result.e = e; } return result; } } public static class user_getWorker<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getWorker_args> { public user_getWorker() { super("user_getWorker"); } public user_getWorker_args getEmptyArgsInstance() { return new user_getWorker_args(); } protected boolean isOneway() { return false; } public user_getWorker_result getResult(I iface, user_getWorker_args args) throws org.apache.thrift.TException { user_getWorker_result result = new user_getWorker_result(); try { result.success = iface.user_getWorker(args.random, args.host); } catch (NoWorkerException e) { result.e = e; } return result; } } public static class getFileStatus<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getFileStatus_args> { public getFileStatus() { super("getFileStatus"); } public getFileStatus_args getEmptyArgsInstance() { return new getFileStatus_args(); } protected boolean isOneway() { return false; } public getFileStatus_result getResult(I iface, getFileStatus_args args) throws org.apache.thrift.TException { getFileStatus_result result = new getFileStatus_result(); try { result.success = iface.getFileStatus(args.fileId, args.path); } catch (FileDoesNotExistException eF) { result.eF = eF; } catch (InvalidPathException eI) { result.eI = eI; } return result; } } public static class user_getClientBlockInfo<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getClientBlockInfo_args> { public user_getClientBlockInfo() { super("user_getClientBlockInfo"); } public user_getClientBlockInfo_args getEmptyArgsInstance() { return new user_getClientBlockInfo_args(); } protected boolean isOneway() { return false; } public user_getClientBlockInfo_result getResult(I iface, user_getClientBlockInfo_args args) throws org.apache.thrift.TException { user_getClientBlockInfo_result result = new user_getClientBlockInfo_result(); try { result.success = iface.user_getClientBlockInfo(args.blockId); } catch (FileDoesNotExistException eF) { result.eF = eF; } catch (BlockInfoException eB) { result.eB = eB; } return result; } } public static class user_getFileBlocks<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getFileBlocks_args> { public user_getFileBlocks() { super("user_getFileBlocks"); } public user_getFileBlocks_args getEmptyArgsInstance() { return new user_getFileBlocks_args(); } protected boolean isOneway() { return false; } public user_getFileBlocks_result getResult(I iface, user_getFileBlocks_args args) throws org.apache.thrift.TException { user_getFileBlocks_result result = new user_getFileBlocks_result(); try { result.success = iface.user_getFileBlocks(args.fileId, args.path); } catch (FileDoesNotExistException eF) { result.eF = eF; } catch (InvalidPathException eI) { result.eI = eI; } return result; } } public static class user_delete<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_delete_args> { public user_delete() { super("user_delete"); } public user_delete_args getEmptyArgsInstance() { return new user_delete_args(); } protected boolean isOneway() { return false; } public user_delete_result getResult(I iface, user_delete_args args) throws org.apache.thrift.TException { user_delete_result result = new user_delete_result(); try { result.success = iface.user_delete(args.fileId, args.path, args.recursive); result.setSuccessIsSet(true); } catch (TachyonException e) { result.e = e; } return result; } } public static class user_rename<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_rename_args> { public user_rename() { super("user_rename"); } public user_rename_args getEmptyArgsInstance() { return new user_rename_args(); } protected boolean isOneway() { return false; } public user_rename_result getResult(I iface, user_rename_args args) throws org.apache.thrift.TException { user_rename_result result = new user_rename_result(); try { result.success = iface.user_rename(args.fileId, args.srcPath, args.dstPath); result.setSuccessIsSet(true); } catch (FileAlreadyExistException eA) { result.eA = eA; } catch (FileDoesNotExistException eF) { result.eF = eF; } catch (InvalidPathException eI) { result.eI = eI; } return result; } } public static class user_setPinned<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_setPinned_args> { public user_setPinned() { super("user_setPinned"); } public user_setPinned_args getEmptyArgsInstance() { return new user_setPinned_args(); } protected boolean isOneway() { return false; } public user_setPinned_result getResult(I iface, user_setPinned_args args) throws org.apache.thrift.TException { user_setPinned_result result = new user_setPinned_result(); try { iface.user_setPinned(args.fileId, args.pinned); } catch (FileDoesNotExistException e) { result.e = e; } return result; } } public static class user_mkdirs<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_mkdirs_args> { public user_mkdirs() { super("user_mkdirs"); } public user_mkdirs_args getEmptyArgsInstance() { return new user_mkdirs_args(); } protected boolean isOneway() { return false; } public user_mkdirs_result getResult(I iface, user_mkdirs_args args) throws org.apache.thrift.TException { user_mkdirs_result result = new user_mkdirs_result(); try { result.success = iface.user_mkdirs(args.path, args.recursive); result.setSuccessIsSet(true); } catch (FileAlreadyExistException eR) { result.eR = eR; } catch (InvalidPathException eI) { result.eI = eI; } catch (TachyonException eT) { result.eT = eT; } return result; } } public static class user_createRawTable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_createRawTable_args> { public user_createRawTable() { super("user_createRawTable"); } public user_createRawTable_args getEmptyArgsInstance() { return new user_createRawTable_args(); } protected boolean isOneway() { return false; } public user_createRawTable_result getResult(I iface, user_createRawTable_args args) throws org.apache.thrift.TException { user_createRawTable_result result = new user_createRawTable_result(); try { result.success = iface.user_createRawTable(args.path, args.columns, args.metadata); result.setSuccessIsSet(true); } catch (FileAlreadyExistException eR) { result.eR = eR; } catch (InvalidPathException eI) { result.eI = eI; } catch (TableColumnException eT) { result.eT = eT; } catch (TachyonException eTa) { result.eTa = eTa; } return result; } } public static class user_getRawTableId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getRawTableId_args> { public user_getRawTableId() { super("user_getRawTableId"); } public user_getRawTableId_args getEmptyArgsInstance() { return new user_getRawTableId_args(); } protected boolean isOneway() { return false; } public user_getRawTableId_result getResult(I iface, user_getRawTableId_args args) throws org.apache.thrift.TException { user_getRawTableId_result result = new user_getRawTableId_result(); try { result.success = iface.user_getRawTableId(args.path); result.setSuccessIsSet(true); } catch (InvalidPathException e) { result.e = e; } return result; } } public static class user_getClientRawTableInfo<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getClientRawTableInfo_args> { public user_getClientRawTableInfo() { super("user_getClientRawTableInfo"); } public user_getClientRawTableInfo_args getEmptyArgsInstance() { return new user_getClientRawTableInfo_args(); } protected boolean isOneway() { return false; } public user_getClientRawTableInfo_result getResult(I iface, user_getClientRawTableInfo_args args) throws org.apache.thrift.TException { user_getClientRawTableInfo_result result = new user_getClientRawTableInfo_result(); try { result.success = iface.user_getClientRawTableInfo(args.id, args.path); } catch (TableDoesNotExistException eT) { result.eT = eT; } catch (InvalidPathException eI) { result.eI = eI; } return result; } } public static class user_updateRawTableMetadata<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_updateRawTableMetadata_args> { public user_updateRawTableMetadata() { super("user_updateRawTableMetadata"); } public user_updateRawTableMetadata_args getEmptyArgsInstance() { return new user_updateRawTableMetadata_args(); } protected boolean isOneway() { return false; } public user_updateRawTableMetadata_result getResult(I iface, user_updateRawTableMetadata_args args) throws org.apache.thrift.TException { user_updateRawTableMetadata_result result = new user_updateRawTableMetadata_result(); try { iface.user_updateRawTableMetadata(args.tableId, args.metadata); } catch (TableDoesNotExistException eT) { result.eT = eT; } catch (TachyonException eTa) { result.eTa = eTa; } return result; } } public static class user_getUfsAddress<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_getUfsAddress_args> { public user_getUfsAddress() { super("user_getUfsAddress"); } public user_getUfsAddress_args getEmptyArgsInstance() { return new user_getUfsAddress_args(); } protected boolean isOneway() { return false; } public user_getUfsAddress_result getResult(I iface, user_getUfsAddress_args args) throws org.apache.thrift.TException { user_getUfsAddress_result result = new user_getUfsAddress_result(); result.success = iface.user_getUfsAddress(); return result; } } public static class user_heartbeat<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_heartbeat_args> { public user_heartbeat() { super("user_heartbeat"); } public user_heartbeat_args getEmptyArgsInstance() { return new user_heartbeat_args(); } protected boolean isOneway() { return false; } public user_heartbeat_result getResult(I iface, user_heartbeat_args args) throws org.apache.thrift.TException { user_heartbeat_result result = new user_heartbeat_result(); iface.user_heartbeat(); return result; } } public static class user_freepath<I extends Iface> extends org.apache.thrift.ProcessFunction<I, user_freepath_args> { public user_freepath() { super("user_freepath"); } public user_freepath_args getEmptyArgsInstance() { return new user_freepath_args(); } protected boolean isOneway() { return false; } public user_freepath_result getResult(I iface, user_freepath_args args) throws org.apache.thrift.TException { user_freepath_result result = new user_freepath_result(); try { result.success = iface.user_freepath(args.fileId, args.path, args.recursive); result.setSuccessIsSet(true); } catch (FileDoesNotExistException e) { result.e = e; } return result; } } } public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> { private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); public AsyncProcessor(I iface) { super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>())); } protected AsyncProcessor(I iface, Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { processMap.put("addCheckpoint", new addCheckpoint()); processMap.put("getWorkersInfo", new getWorkersInfo()); processMap.put("liststatus", new liststatus()); processMap.put("worker_register", new worker_register()); processMap.put("worker_heartbeat", new worker_heartbeat()); processMap.put("worker_cacheBlock", new worker_cacheBlock()); processMap.put("worker_getPinIdList", new worker_getPinIdList()); processMap.put("worker_getPriorityDependencyList", new worker_getPriorityDependencyList()); processMap.put("user_createDependency", new user_createDependency()); processMap.put("user_getClientDependencyInfo", new user_getClientDependencyInfo()); processMap.put("user_reportLostFile", new user_reportLostFile()); processMap.put("user_requestFilesInDependency", new user_requestFilesInDependency()); processMap.put("user_createFile", new user_createFile()); processMap.put("user_createNewBlock", new user_createNewBlock()); processMap.put("user_completeFile", new user_completeFile()); processMap.put("user_getUserId", new user_getUserId()); processMap.put("user_getBlockId", new user_getBlockId()); processMap.put("user_getWorker", new user_getWorker()); processMap.put("getFileStatus", new getFileStatus()); processMap.put("user_getClientBlockInfo", new user_getClientBlockInfo()); processMap.put("user_getFileBlocks", new user_getFileBlocks()); processMap.put("user_delete", new user_delete()); processMap.put("user_rename", new user_rename()); processMap.put("user_setPinned", new user_setPinned()); processMap.put("user_mkdirs", new user_mkdirs()); processMap.put("user_createRawTable", new user_createRawTable()); processMap.put("user_getRawTableId", new user_getRawTableId()); processMap.put("user_getClientRawTableInfo", new user_getClientRawTableInfo()); processMap.put("user_updateRawTableMetadata", new user_updateRawTableMetadata()); processMap.put("user_getUfsAddress", new user_getUfsAddress()); processMap.put("user_heartbeat", new user_heartbeat()); processMap.put("user_freepath", new user_freepath()); return processMap; } public static class addCheckpoint<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addCheckpoint_args, Boolean> { public addCheckpoint() { super("addCheckpoint"); } public addCheckpoint_args getEmptyArgsInstance() { return new addCheckpoint_args(); } public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Boolean>() { public void onComplete(Boolean o) { addCheckpoint_result result = new addCheckpoint_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; addCheckpoint_result result = new addCheckpoint_result(); if (e instanceof FileDoesNotExistException) { result.eP = (FileDoesNotExistException) e; result.setEPIsSet(true); msg = result; } else if (e instanceof SuspectedFileSizeException) { result.eS = (SuspectedFileSizeException) e; result.setESIsSet(true); msg = result; } else if (e instanceof BlockInfoException) { result.eB = (BlockInfoException) e; result.setEBIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, addCheckpoint_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { iface.addCheckpoint(args.workerId, args.fileId, args.length, args.checkpointPath,resultHandler); } } public static class getWorkersInfo<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getWorkersInfo_args, List<ClientWorkerInfo>> { public getWorkersInfo() { super("getWorkersInfo"); } public getWorkersInfo_args getEmptyArgsInstance() { return new getWorkersInfo_args(); } public AsyncMethodCallback<List<ClientWorkerInfo>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<List<ClientWorkerInfo>>() { public void onComplete(List<ClientWorkerInfo> o) { getWorkersInfo_result result = new getWorkersInfo_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; getWorkersInfo_result result = new getWorkersInfo_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, getWorkersInfo_args args, org.apache.thrift.async.AsyncMethodCallback<List<ClientWorkerInfo>> resultHandler) throws TException { iface.getWorkersInfo(resultHandler); } } public static class liststatus<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, liststatus_args, List<ClientFileInfo>> { public liststatus() { super("liststatus"); } public liststatus_args getEmptyArgsInstance() { return new liststatus_args(); } public AsyncMethodCallback<List<ClientFileInfo>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<List<ClientFileInfo>>() { public void onComplete(List<ClientFileInfo> o) { liststatus_result result = new liststatus_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; liststatus_result result = new liststatus_result(); if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else if (e instanceof FileDoesNotExistException) { result.eF = (FileDoesNotExistException) e; result.setEFIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, liststatus_args args, org.apache.thrift.async.AsyncMethodCallback<List<ClientFileInfo>> resultHandler) throws TException { iface.liststatus(args.path,resultHandler); } } public static class worker_register<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, worker_register_args, Long> { public worker_register() { super("worker_register"); } public worker_register_args getEmptyArgsInstance() { return new worker_register_args(); } public AsyncMethodCallback<Long> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Long>() { public void onComplete(Long o) { worker_register_result result = new worker_register_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; worker_register_result result = new worker_register_result(); if (e instanceof BlockInfoException) { result.e = (BlockInfoException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, worker_register_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException { iface.worker_register(args.workerNetAddress, args.totalBytes, args.usedBytes, args.currentBlocks,resultHandler); } } public static class worker_heartbeat<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, worker_heartbeat_args, Command> { public worker_heartbeat() { super("worker_heartbeat"); } public worker_heartbeat_args getEmptyArgsInstance() { return new worker_heartbeat_args(); } public AsyncMethodCallback<Command> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Command>() { public void onComplete(Command o) { worker_heartbeat_result result = new worker_heartbeat_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; worker_heartbeat_result result = new worker_heartbeat_result(); if (e instanceof BlockInfoException) { result.e = (BlockInfoException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, worker_heartbeat_args args, org.apache.thrift.async.AsyncMethodCallback<Command> resultHandler) throws TException { iface.worker_heartbeat(args.workerId, args.usedBytes, args.removedBlocks,resultHandler); } } public static class worker_cacheBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, worker_cacheBlock_args, Void> { public worker_cacheBlock() { super("worker_cacheBlock"); } public worker_cacheBlock_args getEmptyArgsInstance() { return new worker_cacheBlock_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { worker_cacheBlock_result result = new worker_cacheBlock_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; worker_cacheBlock_result result = new worker_cacheBlock_result(); if (e instanceof FileDoesNotExistException) { result.eP = (FileDoesNotExistException) e; result.setEPIsSet(true); msg = result; } else if (e instanceof SuspectedFileSizeException) { result.eS = (SuspectedFileSizeException) e; result.setESIsSet(true); msg = result; } else if (e instanceof BlockInfoException) { result.eB = (BlockInfoException) e; result.setEBIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, worker_cacheBlock_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.worker_cacheBlock(args.workerId, args.workerUsedBytes, args.blockId, args.length,resultHandler); } } public static class worker_getPinIdList<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, worker_getPinIdList_args, Set<Integer>> { public worker_getPinIdList() { super("worker_getPinIdList"); } public worker_getPinIdList_args getEmptyArgsInstance() { return new worker_getPinIdList_args(); } public AsyncMethodCallback<Set<Integer>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Set<Integer>>() { public void onComplete(Set<Integer> o) { worker_getPinIdList_result result = new worker_getPinIdList_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; worker_getPinIdList_result result = new worker_getPinIdList_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, worker_getPinIdList_args args, org.apache.thrift.async.AsyncMethodCallback<Set<Integer>> resultHandler) throws TException { iface.worker_getPinIdList(resultHandler); } } public static class worker_getPriorityDependencyList<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, worker_getPriorityDependencyList_args, List<Integer>> { public worker_getPriorityDependencyList() { super("worker_getPriorityDependencyList"); } public worker_getPriorityDependencyList_args getEmptyArgsInstance() { return new worker_getPriorityDependencyList_args(); } public AsyncMethodCallback<List<Integer>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<List<Integer>>() { public void onComplete(List<Integer> o) { worker_getPriorityDependencyList_result result = new worker_getPriorityDependencyList_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; worker_getPriorityDependencyList_result result = new worker_getPriorityDependencyList_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, worker_getPriorityDependencyList_args args, org.apache.thrift.async.AsyncMethodCallback<List<Integer>> resultHandler) throws TException { iface.worker_getPriorityDependencyList(resultHandler); } } public static class user_createDependency<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_createDependency_args, Integer> { public user_createDependency() { super("user_createDependency"); } public user_createDependency_args getEmptyArgsInstance() { return new user_createDependency_args(); } public AsyncMethodCallback<Integer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Integer>() { public void onComplete(Integer o) { user_createDependency_result result = new user_createDependency_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_createDependency_result result = new user_createDependency_result(); if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else if (e instanceof FileDoesNotExistException) { result.eF = (FileDoesNotExistException) e; result.setEFIsSet(true); msg = result; } else if (e instanceof FileAlreadyExistException) { result.eA = (FileAlreadyExistException) e; result.setEAIsSet(true); msg = result; } else if (e instanceof BlockInfoException) { result.eB = (BlockInfoException) e; result.setEBIsSet(true); msg = result; } else if (e instanceof TachyonException) { result.eT = (TachyonException) e; result.setETIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_createDependency_args args, org.apache.thrift.async.AsyncMethodCallback<Integer> resultHandler) throws TException { iface.user_createDependency(args.parents, args.children, args.commandPrefix, args.data, args.comment, args.framework, args.frameworkVersion, args.dependencyType, args.childrenBlockSizeByte,resultHandler); } } public static class user_getClientDependencyInfo<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getClientDependencyInfo_args, ClientDependencyInfo> { public user_getClientDependencyInfo() { super("user_getClientDependencyInfo"); } public user_getClientDependencyInfo_args getEmptyArgsInstance() { return new user_getClientDependencyInfo_args(); } public AsyncMethodCallback<ClientDependencyInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<ClientDependencyInfo>() { public void onComplete(ClientDependencyInfo o) { user_getClientDependencyInfo_result result = new user_getClientDependencyInfo_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getClientDependencyInfo_result result = new user_getClientDependencyInfo_result(); if (e instanceof DependencyDoesNotExistException) { result.e = (DependencyDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getClientDependencyInfo_args args, org.apache.thrift.async.AsyncMethodCallback<ClientDependencyInfo> resultHandler) throws TException { iface.user_getClientDependencyInfo(args.dependencyId,resultHandler); } } public static class user_reportLostFile<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_reportLostFile_args, Void> { public user_reportLostFile() { super("user_reportLostFile"); } public user_reportLostFile_args getEmptyArgsInstance() { return new user_reportLostFile_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { user_reportLostFile_result result = new user_reportLostFile_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_reportLostFile_result result = new user_reportLostFile_result(); if (e instanceof FileDoesNotExistException) { result.e = (FileDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_reportLostFile_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.user_reportLostFile(args.fileId,resultHandler); } } public static class user_requestFilesInDependency<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_requestFilesInDependency_args, Void> { public user_requestFilesInDependency() { super("user_requestFilesInDependency"); } public user_requestFilesInDependency_args getEmptyArgsInstance() { return new user_requestFilesInDependency_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { user_requestFilesInDependency_result result = new user_requestFilesInDependency_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_requestFilesInDependency_result result = new user_requestFilesInDependency_result(); if (e instanceof DependencyDoesNotExistException) { result.e = (DependencyDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_requestFilesInDependency_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.user_requestFilesInDependency(args.depId,resultHandler); } } public static class user_createFile<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_createFile_args, Integer> { public user_createFile() { super("user_createFile"); } public user_createFile_args getEmptyArgsInstance() { return new user_createFile_args(); } public AsyncMethodCallback<Integer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Integer>() { public void onComplete(Integer o) { user_createFile_result result = new user_createFile_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_createFile_result result = new user_createFile_result(); if (e instanceof FileAlreadyExistException) { result.eR = (FileAlreadyExistException) e; result.setERIsSet(true); msg = result; } else if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else if (e instanceof BlockInfoException) { result.eB = (BlockInfoException) e; result.setEBIsSet(true); msg = result; } else if (e instanceof SuspectedFileSizeException) { result.eS = (SuspectedFileSizeException) e; result.setESIsSet(true); msg = result; } else if (e instanceof TachyonException) { result.eT = (TachyonException) e; result.setETIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_createFile_args args, org.apache.thrift.async.AsyncMethodCallback<Integer> resultHandler) throws TException { iface.user_createFile(args.path, args.ufsPath, args.blockSizeByte, args.recursive,resultHandler); } } public static class user_createNewBlock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_createNewBlock_args, Long> { public user_createNewBlock() { super("user_createNewBlock"); } public user_createNewBlock_args getEmptyArgsInstance() { return new user_createNewBlock_args(); } public AsyncMethodCallback<Long> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Long>() { public void onComplete(Long o) { user_createNewBlock_result result = new user_createNewBlock_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_createNewBlock_result result = new user_createNewBlock_result(); if (e instanceof FileDoesNotExistException) { result.e = (FileDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_createNewBlock_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException { iface.user_createNewBlock(args.fileId,resultHandler); } } public static class user_completeFile<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_completeFile_args, Void> { public user_completeFile() { super("user_completeFile"); } public user_completeFile_args getEmptyArgsInstance() { return new user_completeFile_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { user_completeFile_result result = new user_completeFile_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_completeFile_result result = new user_completeFile_result(); if (e instanceof FileDoesNotExistException) { result.e = (FileDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_completeFile_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.user_completeFile(args.fileId,resultHandler); } } public static class user_getUserId<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getUserId_args, Long> { public user_getUserId() { super("user_getUserId"); } public user_getUserId_args getEmptyArgsInstance() { return new user_getUserId_args(); } public AsyncMethodCallback<Long> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Long>() { public void onComplete(Long o) { user_getUserId_result result = new user_getUserId_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getUserId_result result = new user_getUserId_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getUserId_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException { iface.user_getUserId(resultHandler); } } public static class user_getBlockId<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getBlockId_args, Long> { public user_getBlockId() { super("user_getBlockId"); } public user_getBlockId_args getEmptyArgsInstance() { return new user_getBlockId_args(); } public AsyncMethodCallback<Long> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Long>() { public void onComplete(Long o) { user_getBlockId_result result = new user_getBlockId_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getBlockId_result result = new user_getBlockId_result(); if (e instanceof FileDoesNotExistException) { result.e = (FileDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getBlockId_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException { iface.user_getBlockId(args.fileId, args.index,resultHandler); } } public static class user_getWorker<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getWorker_args, NetAddress> { public user_getWorker() { super("user_getWorker"); } public user_getWorker_args getEmptyArgsInstance() { return new user_getWorker_args(); } public AsyncMethodCallback<NetAddress> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<NetAddress>() { public void onComplete(NetAddress o) { user_getWorker_result result = new user_getWorker_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getWorker_result result = new user_getWorker_result(); if (e instanceof NoWorkerException) { result.e = (NoWorkerException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getWorker_args args, org.apache.thrift.async.AsyncMethodCallback<NetAddress> resultHandler) throws TException { iface.user_getWorker(args.random, args.host,resultHandler); } } public static class getFileStatus<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getFileStatus_args, ClientFileInfo> { public getFileStatus() { super("getFileStatus"); } public getFileStatus_args getEmptyArgsInstance() { return new getFileStatus_args(); } public AsyncMethodCallback<ClientFileInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<ClientFileInfo>() { public void onComplete(ClientFileInfo o) { getFileStatus_result result = new getFileStatus_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; getFileStatus_result result = new getFileStatus_result(); if (e instanceof FileDoesNotExistException) { result.eF = (FileDoesNotExistException) e; result.setEFIsSet(true); msg = result; } else if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, getFileStatus_args args, org.apache.thrift.async.AsyncMethodCallback<ClientFileInfo> resultHandler) throws TException { iface.getFileStatus(args.fileId, args.path,resultHandler); } } public static class user_getClientBlockInfo<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getClientBlockInfo_args, ClientBlockInfo> { public user_getClientBlockInfo() { super("user_getClientBlockInfo"); } public user_getClientBlockInfo_args getEmptyArgsInstance() { return new user_getClientBlockInfo_args(); } public AsyncMethodCallback<ClientBlockInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<ClientBlockInfo>() { public void onComplete(ClientBlockInfo o) { user_getClientBlockInfo_result result = new user_getClientBlockInfo_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getClientBlockInfo_result result = new user_getClientBlockInfo_result(); if (e instanceof FileDoesNotExistException) { result.eF = (FileDoesNotExistException) e; result.setEFIsSet(true); msg = result; } else if (e instanceof BlockInfoException) { result.eB = (BlockInfoException) e; result.setEBIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getClientBlockInfo_args args, org.apache.thrift.async.AsyncMethodCallback<ClientBlockInfo> resultHandler) throws TException { iface.user_getClientBlockInfo(args.blockId,resultHandler); } } public static class user_getFileBlocks<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getFileBlocks_args, List<ClientBlockInfo>> { public user_getFileBlocks() { super("user_getFileBlocks"); } public user_getFileBlocks_args getEmptyArgsInstance() { return new user_getFileBlocks_args(); } public AsyncMethodCallback<List<ClientBlockInfo>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<List<ClientBlockInfo>>() { public void onComplete(List<ClientBlockInfo> o) { user_getFileBlocks_result result = new user_getFileBlocks_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getFileBlocks_result result = new user_getFileBlocks_result(); if (e instanceof FileDoesNotExistException) { result.eF = (FileDoesNotExistException) e; result.setEFIsSet(true); msg = result; } else if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getFileBlocks_args args, org.apache.thrift.async.AsyncMethodCallback<List<ClientBlockInfo>> resultHandler) throws TException { iface.user_getFileBlocks(args.fileId, args.path,resultHandler); } } public static class user_delete<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_delete_args, Boolean> { public user_delete() { super("user_delete"); } public user_delete_args getEmptyArgsInstance() { return new user_delete_args(); } public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Boolean>() { public void onComplete(Boolean o) { user_delete_result result = new user_delete_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_delete_result result = new user_delete_result(); if (e instanceof TachyonException) { result.e = (TachyonException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_delete_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { iface.user_delete(args.fileId, args.path, args.recursive,resultHandler); } } public static class user_rename<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_rename_args, Boolean> { public user_rename() { super("user_rename"); } public user_rename_args getEmptyArgsInstance() { return new user_rename_args(); } public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Boolean>() { public void onComplete(Boolean o) { user_rename_result result = new user_rename_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_rename_result result = new user_rename_result(); if (e instanceof FileAlreadyExistException) { result.eA = (FileAlreadyExistException) e; result.setEAIsSet(true); msg = result; } else if (e instanceof FileDoesNotExistException) { result.eF = (FileDoesNotExistException) e; result.setEFIsSet(true); msg = result; } else if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_rename_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { iface.user_rename(args.fileId, args.srcPath, args.dstPath,resultHandler); } } public static class user_setPinned<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_setPinned_args, Void> { public user_setPinned() { super("user_setPinned"); } public user_setPinned_args getEmptyArgsInstance() { return new user_setPinned_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { user_setPinned_result result = new user_setPinned_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_setPinned_result result = new user_setPinned_result(); if (e instanceof FileDoesNotExistException) { result.e = (FileDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_setPinned_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.user_setPinned(args.fileId, args.pinned,resultHandler); } } public static class user_mkdirs<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_mkdirs_args, Boolean> { public user_mkdirs() { super("user_mkdirs"); } public user_mkdirs_args getEmptyArgsInstance() { return new user_mkdirs_args(); } public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Boolean>() { public void onComplete(Boolean o) { user_mkdirs_result result = new user_mkdirs_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_mkdirs_result result = new user_mkdirs_result(); if (e instanceof FileAlreadyExistException) { result.eR = (FileAlreadyExistException) e; result.setERIsSet(true); msg = result; } else if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else if (e instanceof TachyonException) { result.eT = (TachyonException) e; result.setETIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_mkdirs_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { iface.user_mkdirs(args.path, args.recursive,resultHandler); } } public static class user_createRawTable<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_createRawTable_args, Integer> { public user_createRawTable() { super("user_createRawTable"); } public user_createRawTable_args getEmptyArgsInstance() { return new user_createRawTable_args(); } public AsyncMethodCallback<Integer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Integer>() { public void onComplete(Integer o) { user_createRawTable_result result = new user_createRawTable_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_createRawTable_result result = new user_createRawTable_result(); if (e instanceof FileAlreadyExistException) { result.eR = (FileAlreadyExistException) e; result.setERIsSet(true); msg = result; } else if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else if (e instanceof TableColumnException) { result.eT = (TableColumnException) e; result.setETIsSet(true); msg = result; } else if (e instanceof TachyonException) { result.eTa = (TachyonException) e; result.setETaIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_createRawTable_args args, org.apache.thrift.async.AsyncMethodCallback<Integer> resultHandler) throws TException { iface.user_createRawTable(args.path, args.columns, args.metadata,resultHandler); } } public static class user_getRawTableId<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getRawTableId_args, Integer> { public user_getRawTableId() { super("user_getRawTableId"); } public user_getRawTableId_args getEmptyArgsInstance() { return new user_getRawTableId_args(); } public AsyncMethodCallback<Integer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Integer>() { public void onComplete(Integer o) { user_getRawTableId_result result = new user_getRawTableId_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getRawTableId_result result = new user_getRawTableId_result(); if (e instanceof InvalidPathException) { result.e = (InvalidPathException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getRawTableId_args args, org.apache.thrift.async.AsyncMethodCallback<Integer> resultHandler) throws TException { iface.user_getRawTableId(args.path,resultHandler); } } public static class user_getClientRawTableInfo<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getClientRawTableInfo_args, ClientRawTableInfo> { public user_getClientRawTableInfo() { super("user_getClientRawTableInfo"); } public user_getClientRawTableInfo_args getEmptyArgsInstance() { return new user_getClientRawTableInfo_args(); } public AsyncMethodCallback<ClientRawTableInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<ClientRawTableInfo>() { public void onComplete(ClientRawTableInfo o) { user_getClientRawTableInfo_result result = new user_getClientRawTableInfo_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getClientRawTableInfo_result result = new user_getClientRawTableInfo_result(); if (e instanceof TableDoesNotExistException) { result.eT = (TableDoesNotExistException) e; result.setETIsSet(true); msg = result; } else if (e instanceof InvalidPathException) { result.eI = (InvalidPathException) e; result.setEIIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getClientRawTableInfo_args args, org.apache.thrift.async.AsyncMethodCallback<ClientRawTableInfo> resultHandler) throws TException { iface.user_getClientRawTableInfo(args.id, args.path,resultHandler); } } public static class user_updateRawTableMetadata<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_updateRawTableMetadata_args, Void> { public user_updateRawTableMetadata() { super("user_updateRawTableMetadata"); } public user_updateRawTableMetadata_args getEmptyArgsInstance() { return new user_updateRawTableMetadata_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { user_updateRawTableMetadata_result result = new user_updateRawTableMetadata_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_updateRawTableMetadata_result result = new user_updateRawTableMetadata_result(); if (e instanceof TableDoesNotExistException) { result.eT = (TableDoesNotExistException) e; result.setETIsSet(true); msg = result; } else if (e instanceof TachyonException) { result.eTa = (TachyonException) e; result.setETaIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_updateRawTableMetadata_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.user_updateRawTableMetadata(args.tableId, args.metadata,resultHandler); } } public static class user_getUfsAddress<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_getUfsAddress_args, String> { public user_getUfsAddress() { super("user_getUfsAddress"); } public user_getUfsAddress_args getEmptyArgsInstance() { return new user_getUfsAddress_args(); } public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<String>() { public void onComplete(String o) { user_getUfsAddress_result result = new user_getUfsAddress_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_getUfsAddress_result result = new user_getUfsAddress_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_getUfsAddress_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException { iface.user_getUfsAddress(resultHandler); } } public static class user_heartbeat<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_heartbeat_args, Void> { public user_heartbeat() { super("user_heartbeat"); } public user_heartbeat_args getEmptyArgsInstance() { return new user_heartbeat_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { user_heartbeat_result result = new user_heartbeat_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_heartbeat_result result = new user_heartbeat_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_heartbeat_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.user_heartbeat(resultHandler); } } public static class user_freepath<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, user_freepath_args, Boolean> { public user_freepath() { super("user_freepath"); } public user_freepath_args getEmptyArgsInstance() { return new user_freepath_args(); } public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Boolean>() { public void onComplete(Boolean o) { user_freepath_result result = new user_freepath_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; user_freepath_result result = new user_freepath_result(); if (e instanceof FileDoesNotExistException) { result.e = (FileDoesNotExistException) e; result.setEIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, user_freepath_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { iface.user_freepath(args.fileId, args.path, args.recursive,resultHandler); } } } public static class addCheckpoint_args implements org.apache.thrift.TBase<addCheckpoint_args, addCheckpoint_args._Fields>, java.io.Serializable, Cloneable, Comparable<addCheckpoint_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addCheckpoint_args"); private static final org.apache.thrift.protocol.TField WORKER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("workerId", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField LENGTH_FIELD_DESC = new org.apache.thrift.protocol.TField("length", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField CHECKPOINT_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("checkpointPath", org.apache.thrift.protocol.TType.STRING, (short)4); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new addCheckpoint_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new addCheckpoint_argsTupleSchemeFactory()); } public long workerId; // required public int fileId; // required public long length; // required public String checkpointPath; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { WORKER_ID((short)1, "workerId"), FILE_ID((short)2, "fileId"), LENGTH((short)3, "length"), CHECKPOINT_PATH((short)4, "checkpointPath"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // WORKER_ID return WORKER_ID; case 2: // FILE_ID return FILE_ID; case 3: // LENGTH return LENGTH; case 4: // CHECKPOINT_PATH return CHECKPOINT_PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __WORKERID_ISSET_ID = 0; private static final int __FILEID_ISSET_ID = 1; private static final int __LENGTH_ISSET_ID = 2; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.WORKER_ID, new org.apache.thrift.meta_data.FieldMetaData("workerId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.LENGTH, new org.apache.thrift.meta_data.FieldMetaData("length", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.CHECKPOINT_PATH, new org.apache.thrift.meta_data.FieldMetaData("checkpointPath", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addCheckpoint_args.class, metaDataMap); } public addCheckpoint_args() { } public addCheckpoint_args( long workerId, int fileId, long length, String checkpointPath) { this(); this.workerId = workerId; setWorkerIdIsSet(true); this.fileId = fileId; setFileIdIsSet(true); this.length = length; setLengthIsSet(true); this.checkpointPath = checkpointPath; } /** * Performs a deep copy on <i>other</i>. */ public addCheckpoint_args(addCheckpoint_args other) { __isset_bitfield = other.__isset_bitfield; this.workerId = other.workerId; this.fileId = other.fileId; this.length = other.length; if (other.isSetCheckpointPath()) { this.checkpointPath = other.checkpointPath; } } public addCheckpoint_args deepCopy() { return new addCheckpoint_args(this); } @Override public void clear() { setWorkerIdIsSet(false); this.workerId = 0; setFileIdIsSet(false); this.fileId = 0; setLengthIsSet(false); this.length = 0; this.checkpointPath = null; } public long getWorkerId() { return this.workerId; } public addCheckpoint_args setWorkerId(long workerId) { this.workerId = workerId; setWorkerIdIsSet(true); return this; } public void unsetWorkerId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WORKERID_ISSET_ID); } /** Returns true if field workerId is set (has been assigned a value) and false otherwise */ public boolean isSetWorkerId() { return EncodingUtils.testBit(__isset_bitfield, __WORKERID_ISSET_ID); } public void setWorkerIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WORKERID_ISSET_ID, value); } public int getFileId() { return this.fileId; } public addCheckpoint_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public long getLength() { return this.length; } public addCheckpoint_args setLength(long length) { this.length = length; setLengthIsSet(true); return this; } public void unsetLength() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LENGTH_ISSET_ID); } /** Returns true if field length is set (has been assigned a value) and false otherwise */ public boolean isSetLength() { return EncodingUtils.testBit(__isset_bitfield, __LENGTH_ISSET_ID); } public void setLengthIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LENGTH_ISSET_ID, value); } public String getCheckpointPath() { return this.checkpointPath; } public addCheckpoint_args setCheckpointPath(String checkpointPath) { this.checkpointPath = checkpointPath; return this; } public void unsetCheckpointPath() { this.checkpointPath = null; } /** Returns true if field checkpointPath is set (has been assigned a value) and false otherwise */ public boolean isSetCheckpointPath() { return this.checkpointPath != null; } public void setCheckpointPathIsSet(boolean value) { if (!value) { this.checkpointPath = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case WORKER_ID: if (value == null) { unsetWorkerId(); } else { setWorkerId((Long)value); } break; case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case LENGTH: if (value == null) { unsetLength(); } else { setLength((Long)value); } break; case CHECKPOINT_PATH: if (value == null) { unsetCheckpointPath(); } else { setCheckpointPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case WORKER_ID: return Long.valueOf(getWorkerId()); case FILE_ID: return Integer.valueOf(getFileId()); case LENGTH: return Long.valueOf(getLength()); case CHECKPOINT_PATH: return getCheckpointPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case WORKER_ID: return isSetWorkerId(); case FILE_ID: return isSetFileId(); case LENGTH: return isSetLength(); case CHECKPOINT_PATH: return isSetCheckpointPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof addCheckpoint_args) return this.equals((addCheckpoint_args)that); return false; } public boolean equals(addCheckpoint_args that) { if (that == null) return false; boolean this_present_workerId = true; boolean that_present_workerId = true; if (this_present_workerId || that_present_workerId) { if (!(this_present_workerId && that_present_workerId)) return false; if (this.workerId != that.workerId) return false; } boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_length = true; boolean that_present_length = true; if (this_present_length || that_present_length) { if (!(this_present_length && that_present_length)) return false; if (this.length != that.length) return false; } boolean this_present_checkpointPath = true && this.isSetCheckpointPath(); boolean that_present_checkpointPath = true && that.isSetCheckpointPath(); if (this_present_checkpointPath || that_present_checkpointPath) { if (!(this_present_checkpointPath && that_present_checkpointPath)) return false; if (!this.checkpointPath.equals(that.checkpointPath)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(addCheckpoint_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetWorkerId()).compareTo(other.isSetWorkerId()); if (lastComparison != 0) { return lastComparison; } if (isSetWorkerId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workerId, other.workerId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetLength()).compareTo(other.isSetLength()); if (lastComparison != 0) { return lastComparison; } if (isSetLength()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.length, other.length); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetCheckpointPath()).compareTo(other.isSetCheckpointPath()); if (lastComparison != 0) { return lastComparison; } if (isSetCheckpointPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.checkpointPath, other.checkpointPath); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("addCheckpoint_args("); boolean first = true; sb.append("workerId:"); sb.append(this.workerId); first = false; if (!first) sb.append(", "); sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("length:"); sb.append(this.length); first = false; if (!first) sb.append(", "); sb.append("checkpointPath:"); if (this.checkpointPath == null) { sb.append("null"); } else { sb.append(this.checkpointPath); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class addCheckpoint_argsStandardSchemeFactory implements SchemeFactory { public addCheckpoint_argsStandardScheme getScheme() { return new addCheckpoint_argsStandardScheme(); } } private static class addCheckpoint_argsStandardScheme extends StandardScheme<addCheckpoint_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, addCheckpoint_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // WORKER_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.workerId = iprot.readI64(); struct.setWorkerIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // LENGTH if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.length = iprot.readI64(); struct.setLengthIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // CHECKPOINT_PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.checkpointPath = iprot.readString(); struct.setCheckpointPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, addCheckpoint_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(WORKER_ID_FIELD_DESC); oprot.writeI64(struct.workerId); oprot.writeFieldEnd(); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); oprot.writeFieldBegin(LENGTH_FIELD_DESC); oprot.writeI64(struct.length); oprot.writeFieldEnd(); if (struct.checkpointPath != null) { oprot.writeFieldBegin(CHECKPOINT_PATH_FIELD_DESC); oprot.writeString(struct.checkpointPath); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class addCheckpoint_argsTupleSchemeFactory implements SchemeFactory { public addCheckpoint_argsTupleScheme getScheme() { return new addCheckpoint_argsTupleScheme(); } } private static class addCheckpoint_argsTupleScheme extends TupleScheme<addCheckpoint_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetWorkerId()) { optionals.set(0); } if (struct.isSetFileId()) { optionals.set(1); } if (struct.isSetLength()) { optionals.set(2); } if (struct.isSetCheckpointPath()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetWorkerId()) { oprot.writeI64(struct.workerId); } if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetLength()) { oprot.writeI64(struct.length); } if (struct.isSetCheckpointPath()) { oprot.writeString(struct.checkpointPath); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.workerId = iprot.readI64(); struct.setWorkerIdIsSet(true); } if (incoming.get(1)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(2)) { struct.length = iprot.readI64(); struct.setLengthIsSet(true); } if (incoming.get(3)) { struct.checkpointPath = iprot.readString(); struct.setCheckpointPathIsSet(true); } } } } public static class addCheckpoint_result implements org.apache.thrift.TBase<addCheckpoint_result, addCheckpoint_result._Fields>, java.io.Serializable, Cloneable, Comparable<addCheckpoint_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addCheckpoint_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); private static final org.apache.thrift.protocol.TField E_P_FIELD_DESC = new org.apache.thrift.protocol.TField("eP", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_S_FIELD_DESC = new org.apache.thrift.protocol.TField("eS", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField E_B_FIELD_DESC = new org.apache.thrift.protocol.TField("eB", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new addCheckpoint_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new addCheckpoint_resultTupleSchemeFactory()); } public boolean success; // required public FileDoesNotExistException eP; // required public SuspectedFileSizeException eS; // required public BlockInfoException eB; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_P((short)1, "eP"), E_S((short)2, "eS"), E_B((short)3, "eB"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_P return E_P; case 2: // E_S return E_S; case 3: // E_B return E_B; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.E_P, new org.apache.thrift.meta_data.FieldMetaData("eP", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_S, new org.apache.thrift.meta_data.FieldMetaData("eS", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_B, new org.apache.thrift.meta_data.FieldMetaData("eB", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addCheckpoint_result.class, metaDataMap); } public addCheckpoint_result() { } public addCheckpoint_result( boolean success, FileDoesNotExistException eP, SuspectedFileSizeException eS, BlockInfoException eB) { this(); this.success = success; setSuccessIsSet(true); this.eP = eP; this.eS = eS; this.eB = eB; } /** * Performs a deep copy on <i>other</i>. */ public addCheckpoint_result(addCheckpoint_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetEP()) { this.eP = new FileDoesNotExistException(other.eP); } if (other.isSetES()) { this.eS = new SuspectedFileSizeException(other.eS); } if (other.isSetEB()) { this.eB = new BlockInfoException(other.eB); } } public addCheckpoint_result deepCopy() { return new addCheckpoint_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = false; this.eP = null; this.eS = null; this.eB = null; } public boolean isSuccess() { return this.success; } public addCheckpoint_result setSuccess(boolean success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileDoesNotExistException getEP() { return this.eP; } public addCheckpoint_result setEP(FileDoesNotExistException eP) { this.eP = eP; return this; } public void unsetEP() { this.eP = null; } /** Returns true if field eP is set (has been assigned a value) and false otherwise */ public boolean isSetEP() { return this.eP != null; } public void setEPIsSet(boolean value) { if (!value) { this.eP = null; } } public SuspectedFileSizeException getES() { return this.eS; } public addCheckpoint_result setES(SuspectedFileSizeException eS) { this.eS = eS; return this; } public void unsetES() { this.eS = null; } /** Returns true if field eS is set (has been assigned a value) and false otherwise */ public boolean isSetES() { return this.eS != null; } public void setESIsSet(boolean value) { if (!value) { this.eS = null; } } public BlockInfoException getEB() { return this.eB; } public addCheckpoint_result setEB(BlockInfoException eB) { this.eB = eB; return this; } public void unsetEB() { this.eB = null; } /** Returns true if field eB is set (has been assigned a value) and false otherwise */ public boolean isSetEB() { return this.eB != null; } public void setEBIsSet(boolean value) { if (!value) { this.eB = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Boolean)value); } break; case E_P: if (value == null) { unsetEP(); } else { setEP((FileDoesNotExistException)value); } break; case E_S: if (value == null) { unsetES(); } else { setES((SuspectedFileSizeException)value); } break; case E_B: if (value == null) { unsetEB(); } else { setEB((BlockInfoException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Boolean.valueOf(isSuccess()); case E_P: return getEP(); case E_S: return getES(); case E_B: return getEB(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_P: return isSetEP(); case E_S: return isSetES(); case E_B: return isSetEB(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof addCheckpoint_result) return this.equals((addCheckpoint_result)that); return false; } public boolean equals(addCheckpoint_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_eP = true && this.isSetEP(); boolean that_present_eP = true && that.isSetEP(); if (this_present_eP || that_present_eP) { if (!(this_present_eP && that_present_eP)) return false; if (!this.eP.equals(that.eP)) return false; } boolean this_present_eS = true && this.isSetES(); boolean that_present_eS = true && that.isSetES(); if (this_present_eS || that_present_eS) { if (!(this_present_eS && that_present_eS)) return false; if (!this.eS.equals(that.eS)) return false; } boolean this_present_eB = true && this.isSetEB(); boolean that_present_eB = true && that.isSetEB(); if (this_present_eB || that_present_eB) { if (!(this_present_eB && that_present_eB)) return false; if (!this.eB.equals(that.eB)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(addCheckpoint_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEP()).compareTo(other.isSetEP()); if (lastComparison != 0) { return lastComparison; } if (isSetEP()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eP, other.eP); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetES()).compareTo(other.isSetES()); if (lastComparison != 0) { return lastComparison; } if (isSetES()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eS, other.eS); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEB()).compareTo(other.isSetEB()); if (lastComparison != 0) { return lastComparison; } if (isSetEB()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eB, other.eB); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("addCheckpoint_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("eP:"); if (this.eP == null) { sb.append("null"); } else { sb.append(this.eP); } first = false; if (!first) sb.append(", "); sb.append("eS:"); if (this.eS == null) { sb.append("null"); } else { sb.append(this.eS); } first = false; if (!first) sb.append(", "); sb.append("eB:"); if (this.eB == null) { sb.append("null"); } else { sb.append(this.eB); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class addCheckpoint_resultStandardSchemeFactory implements SchemeFactory { public addCheckpoint_resultStandardScheme getScheme() { return new addCheckpoint_resultStandardScheme(); } } private static class addCheckpoint_resultStandardScheme extends StandardScheme<addCheckpoint_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, addCheckpoint_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_P if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eP = new FileDoesNotExistException(); struct.eP.read(iprot); struct.setEPIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_S if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eS = new SuspectedFileSizeException(); struct.eS.read(iprot); struct.setESIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // E_B if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, addCheckpoint_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeBool(struct.success); oprot.writeFieldEnd(); } if (struct.eP != null) { oprot.writeFieldBegin(E_P_FIELD_DESC); struct.eP.write(oprot); oprot.writeFieldEnd(); } if (struct.eS != null) { oprot.writeFieldBegin(E_S_FIELD_DESC); struct.eS.write(oprot); oprot.writeFieldEnd(); } if (struct.eB != null) { oprot.writeFieldBegin(E_B_FIELD_DESC); struct.eB.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class addCheckpoint_resultTupleSchemeFactory implements SchemeFactory { public addCheckpoint_resultTupleScheme getScheme() { return new addCheckpoint_resultTupleScheme(); } } private static class addCheckpoint_resultTupleScheme extends TupleScheme<addCheckpoint_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetEP()) { optionals.set(1); } if (struct.isSetES()) { optionals.set(2); } if (struct.isSetEB()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { oprot.writeBool(struct.success); } if (struct.isSetEP()) { struct.eP.write(oprot); } if (struct.isSetES()) { struct.eS.write(oprot); } if (struct.isSetEB()) { struct.eB.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eP = new FileDoesNotExistException(); struct.eP.read(iprot); struct.setEPIsSet(true); } if (incoming.get(2)) { struct.eS = new SuspectedFileSizeException(); struct.eS.read(iprot); struct.setESIsSet(true); } if (incoming.get(3)) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } } } } public static class getWorkersInfo_args implements org.apache.thrift.TBase<getWorkersInfo_args, getWorkersInfo_args._Fields>, java.io.Serializable, Cloneable, Comparable<getWorkersInfo_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getWorkersInfo_args"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getWorkersInfo_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getWorkersInfo_argsTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getWorkersInfo_args.class, metaDataMap); } public getWorkersInfo_args() { } /** * Performs a deep copy on <i>other</i>. */ public getWorkersInfo_args(getWorkersInfo_args other) { } public getWorkersInfo_args deepCopy() { return new getWorkersInfo_args(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getWorkersInfo_args) return this.equals((getWorkersInfo_args)that); return false; } public boolean equals(getWorkersInfo_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(getWorkersInfo_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getWorkersInfo_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getWorkersInfo_argsStandardSchemeFactory implements SchemeFactory { public getWorkersInfo_argsStandardScheme getScheme() { return new getWorkersInfo_argsStandardScheme(); } } private static class getWorkersInfo_argsStandardScheme extends StandardScheme<getWorkersInfo_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getWorkersInfo_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getWorkersInfo_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getWorkersInfo_argsTupleSchemeFactory implements SchemeFactory { public getWorkersInfo_argsTupleScheme getScheme() { return new getWorkersInfo_argsTupleScheme(); } } private static class getWorkersInfo_argsTupleScheme extends TupleScheme<getWorkersInfo_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getWorkersInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getWorkersInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class getWorkersInfo_result implements org.apache.thrift.TBase<getWorkersInfo_result, getWorkersInfo_result._Fields>, java.io.Serializable, Cloneable, Comparable<getWorkersInfo_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getWorkersInfo_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getWorkersInfo_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getWorkersInfo_resultTupleSchemeFactory()); } public List<ClientWorkerInfo> success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientWorkerInfo.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getWorkersInfo_result.class, metaDataMap); } public getWorkersInfo_result() { } public getWorkersInfo_result( List<ClientWorkerInfo> success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public getWorkersInfo_result(getWorkersInfo_result other) { if (other.isSetSuccess()) { List<ClientWorkerInfo> __this__success = new ArrayList<ClientWorkerInfo>(other.success.size()); for (ClientWorkerInfo other_element : other.success) { __this__success.add(new ClientWorkerInfo(other_element)); } this.success = __this__success; } } public getWorkersInfo_result deepCopy() { return new getWorkersInfo_result(this); } @Override public void clear() { this.success = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<ClientWorkerInfo> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(ClientWorkerInfo elem) { if (this.success == null) { this.success = new ArrayList<ClientWorkerInfo>(); } this.success.add(elem); } public List<ClientWorkerInfo> getSuccess() { return this.success; } public getWorkersInfo_result setSuccess(List<ClientWorkerInfo> success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<ClientWorkerInfo>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getWorkersInfo_result) return this.equals((getWorkersInfo_result)that); return false; } public boolean equals(getWorkersInfo_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(getWorkersInfo_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getWorkersInfo_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getWorkersInfo_resultStandardSchemeFactory implements SchemeFactory { public getWorkersInfo_resultStandardScheme getScheme() { return new getWorkersInfo_resultStandardScheme(); } } private static class getWorkersInfo_resultStandardScheme extends StandardScheme<getWorkersInfo_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getWorkersInfo_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list48 = iprot.readListBegin(); struct.success = new ArrayList<ClientWorkerInfo>(_list48.size); for (int _i49 = 0; _i49 < _list48.size; ++_i49) { ClientWorkerInfo _elem50; _elem50 = new ClientWorkerInfo(); _elem50.read(iprot); struct.success.add(_elem50); } iprot.readListEnd(); } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getWorkersInfo_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); for (ClientWorkerInfo _iter51 : struct.success) { _iter51.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getWorkersInfo_resultTupleSchemeFactory implements SchemeFactory { public getWorkersInfo_resultTupleScheme getScheme() { return new getWorkersInfo_resultTupleScheme(); } } private static class getWorkersInfo_resultTupleScheme extends TupleScheme<getWorkersInfo_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getWorkersInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (ClientWorkerInfo _iter52 : struct.success) { _iter52.write(oprot); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getWorkersInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list53 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.success = new ArrayList<ClientWorkerInfo>(_list53.size); for (int _i54 = 0; _i54 < _list53.size; ++_i54) { ClientWorkerInfo _elem55; _elem55 = new ClientWorkerInfo(); _elem55.read(iprot); struct.success.add(_elem55); } } struct.setSuccessIsSet(true); } } } } public static class liststatus_args implements org.apache.thrift.TBase<liststatus_args, liststatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<liststatus_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("liststatus_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new liststatus_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new liststatus_argsTupleSchemeFactory()); } public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PATH((short)1, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(liststatus_args.class, metaDataMap); } public liststatus_args() { } public liststatus_args( String path) { this(); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public liststatus_args(liststatus_args other) { if (other.isSetPath()) { this.path = other.path; } } public liststatus_args deepCopy() { return new liststatus_args(this); } @Override public void clear() { this.path = null; } public String getPath() { return this.path; } public liststatus_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof liststatus_args) return this.equals((liststatus_args)that); return false; } public boolean equals(liststatus_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(liststatus_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("liststatus_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class liststatus_argsStandardSchemeFactory implements SchemeFactory { public liststatus_argsStandardScheme getScheme() { return new liststatus_argsStandardScheme(); } } private static class liststatus_argsStandardScheme extends StandardScheme<liststatus_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, liststatus_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, liststatus_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class liststatus_argsTupleSchemeFactory implements SchemeFactory { public liststatus_argsTupleScheme getScheme() { return new liststatus_argsTupleScheme(); } } private static class liststatus_argsTupleScheme extends TupleScheme<liststatus_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, liststatus_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, liststatus_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class liststatus_result implements org.apache.thrift.TBase<liststatus_result, liststatus_result._Fields>, java.io.Serializable, Cloneable, Comparable<liststatus_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("liststatus_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new liststatus_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new liststatus_resultTupleSchemeFactory()); } public List<ClientFileInfo> success; // required public InvalidPathException eI; // required public FileDoesNotExistException eF; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_I((short)1, "eI"), E_F((short)2, "eF"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_I return E_I; case 2: // E_F return E_F; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientFileInfo.class)))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_F, new org.apache.thrift.meta_data.FieldMetaData("eF", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(liststatus_result.class, metaDataMap); } public liststatus_result() { } public liststatus_result( List<ClientFileInfo> success, InvalidPathException eI, FileDoesNotExistException eF) { this(); this.success = success; this.eI = eI; this.eF = eF; } /** * Performs a deep copy on <i>other</i>. */ public liststatus_result(liststatus_result other) { if (other.isSetSuccess()) { List<ClientFileInfo> __this__success = new ArrayList<ClientFileInfo>(other.success.size()); for (ClientFileInfo other_element : other.success) { __this__success.add(new ClientFileInfo(other_element)); } this.success = __this__success; } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } if (other.isSetEF()) { this.eF = new FileDoesNotExistException(other.eF); } } public liststatus_result deepCopy() { return new liststatus_result(this); } @Override public void clear() { this.success = null; this.eI = null; this.eF = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<ClientFileInfo> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(ClientFileInfo elem) { if (this.success == null) { this.success = new ArrayList<ClientFileInfo>(); } this.success.add(elem); } public List<ClientFileInfo> getSuccess() { return this.success; } public liststatus_result setSuccess(List<ClientFileInfo> success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public InvalidPathException getEI() { return this.eI; } public liststatus_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public FileDoesNotExistException getEF() { return this.eF; } public liststatus_result setEF(FileDoesNotExistException eF) { this.eF = eF; return this; } public void unsetEF() { this.eF = null; } /** Returns true if field eF is set (has been assigned a value) and false otherwise */ public boolean isSetEF() { return this.eF != null; } public void setEFIsSet(boolean value) { if (!value) { this.eF = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<ClientFileInfo>)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; case E_F: if (value == null) { unsetEF(); } else { setEF((FileDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E_I: return getEI(); case E_F: return getEF(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_I: return isSetEI(); case E_F: return isSetEF(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof liststatus_result) return this.equals((liststatus_result)that); return false; } public boolean equals(liststatus_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } boolean this_present_eF = true && this.isSetEF(); boolean that_present_eF = true && that.isSetEF(); if (this_present_eF || that_present_eF) { if (!(this_present_eF && that_present_eF)) return false; if (!this.eF.equals(that.eF)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(liststatus_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEF()).compareTo(other.isSetEF()); if (lastComparison != 0) { return lastComparison; } if (isSetEF()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eF, other.eF); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("liststatus_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; if (!first) sb.append(", "); sb.append("eF:"); if (this.eF == null) { sb.append("null"); } else { sb.append(this.eF); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class liststatus_resultStandardSchemeFactory implements SchemeFactory { public liststatus_resultStandardScheme getScheme() { return new liststatus_resultStandardScheme(); } } private static class liststatus_resultStandardScheme extends StandardScheme<liststatus_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, liststatus_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list56 = iprot.readListBegin(); struct.success = new ArrayList<ClientFileInfo>(_list56.size); for (int _i57 = 0; _i57 < _list56.size; ++_i57) { ClientFileInfo _elem58; _elem58 = new ClientFileInfo(); _elem58.read(iprot); struct.success.add(_elem58); } iprot.readListEnd(); } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_F if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, liststatus_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); for (ClientFileInfo _iter59 : struct.success) { _iter59.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } if (struct.eF != null) { oprot.writeFieldBegin(E_F_FIELD_DESC); struct.eF.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class liststatus_resultTupleSchemeFactory implements SchemeFactory { public liststatus_resultTupleScheme getScheme() { return new liststatus_resultTupleScheme(); } } private static class liststatus_resultTupleScheme extends TupleScheme<liststatus_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, liststatus_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetEI()) { optionals.set(1); } if (struct.isSetEF()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (ClientFileInfo _iter60 : struct.success) { _iter60.write(oprot); } } } if (struct.isSetEI()) { struct.eI.write(oprot); } if (struct.isSetEF()) { struct.eF.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, liststatus_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list61 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.success = new ArrayList<ClientFileInfo>(_list61.size); for (int _i62 = 0; _i62 < _list61.size; ++_i62) { ClientFileInfo _elem63; _elem63 = new ClientFileInfo(); _elem63.read(iprot); struct.success.add(_elem63); } } struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } if (incoming.get(2)) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } } } } public static class worker_register_args implements org.apache.thrift.TBase<worker_register_args, worker_register_args._Fields>, java.io.Serializable, Cloneable, Comparable<worker_register_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_register_args"); private static final org.apache.thrift.protocol.TField WORKER_NET_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("workerNetAddress", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField TOTAL_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("totalBytes", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField USED_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("usedBytes", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField CURRENT_BLOCKS_FIELD_DESC = new org.apache.thrift.protocol.TField("currentBlocks", org.apache.thrift.protocol.TType.LIST, (short)4); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_register_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_register_argsTupleSchemeFactory()); } public NetAddress workerNetAddress; // required public long totalBytes; // required public long usedBytes; // required public List<Long> currentBlocks; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { WORKER_NET_ADDRESS((short)1, "workerNetAddress"), TOTAL_BYTES((short)2, "totalBytes"), USED_BYTES((short)3, "usedBytes"), CURRENT_BLOCKS((short)4, "currentBlocks"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // WORKER_NET_ADDRESS return WORKER_NET_ADDRESS; case 2: // TOTAL_BYTES return TOTAL_BYTES; case 3: // USED_BYTES return USED_BYTES; case 4: // CURRENT_BLOCKS return CURRENT_BLOCKS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __TOTALBYTES_ISSET_ID = 0; private static final int __USEDBYTES_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.WORKER_NET_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("workerNetAddress", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NetAddress.class))); tmpMap.put(_Fields.TOTAL_BYTES, new org.apache.thrift.meta_data.FieldMetaData("totalBytes", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.USED_BYTES, new org.apache.thrift.meta_data.FieldMetaData("usedBytes", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.CURRENT_BLOCKS, new org.apache.thrift.meta_data.FieldMetaData("currentBlocks", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_register_args.class, metaDataMap); } public worker_register_args() { } public worker_register_args( NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlocks) { this(); this.workerNetAddress = workerNetAddress; this.totalBytes = totalBytes; setTotalBytesIsSet(true); this.usedBytes = usedBytes; setUsedBytesIsSet(true); this.currentBlocks = currentBlocks; } /** * Performs a deep copy on <i>other</i>. */ public worker_register_args(worker_register_args other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetWorkerNetAddress()) { this.workerNetAddress = new NetAddress(other.workerNetAddress); } this.totalBytes = other.totalBytes; this.usedBytes = other.usedBytes; if (other.isSetCurrentBlocks()) { List<Long> __this__currentBlocks = new ArrayList<Long>(other.currentBlocks); this.currentBlocks = __this__currentBlocks; } } public worker_register_args deepCopy() { return new worker_register_args(this); } @Override public void clear() { this.workerNetAddress = null; setTotalBytesIsSet(false); this.totalBytes = 0; setUsedBytesIsSet(false); this.usedBytes = 0; this.currentBlocks = null; } public NetAddress getWorkerNetAddress() { return this.workerNetAddress; } public worker_register_args setWorkerNetAddress(NetAddress workerNetAddress) { this.workerNetAddress = workerNetAddress; return this; } public void unsetWorkerNetAddress() { this.workerNetAddress = null; } /** Returns true if field workerNetAddress is set (has been assigned a value) and false otherwise */ public boolean isSetWorkerNetAddress() { return this.workerNetAddress != null; } public void setWorkerNetAddressIsSet(boolean value) { if (!value) { this.workerNetAddress = null; } } public long getTotalBytes() { return this.totalBytes; } public worker_register_args setTotalBytes(long totalBytes) { this.totalBytes = totalBytes; setTotalBytesIsSet(true); return this; } public void unsetTotalBytes() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TOTALBYTES_ISSET_ID); } /** Returns true if field totalBytes is set (has been assigned a value) and false otherwise */ public boolean isSetTotalBytes() { return EncodingUtils.testBit(__isset_bitfield, __TOTALBYTES_ISSET_ID); } public void setTotalBytesIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TOTALBYTES_ISSET_ID, value); } public long getUsedBytes() { return this.usedBytes; } public worker_register_args setUsedBytes(long usedBytes) { this.usedBytes = usedBytes; setUsedBytesIsSet(true); return this; } public void unsetUsedBytes() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USEDBYTES_ISSET_ID); } /** Returns true if field usedBytes is set (has been assigned a value) and false otherwise */ public boolean isSetUsedBytes() { return EncodingUtils.testBit(__isset_bitfield, __USEDBYTES_ISSET_ID); } public void setUsedBytesIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USEDBYTES_ISSET_ID, value); } public int getCurrentBlocksSize() { return (this.currentBlocks == null) ? 0 : this.currentBlocks.size(); } public java.util.Iterator<Long> getCurrentBlocksIterator() { return (this.currentBlocks == null) ? null : this.currentBlocks.iterator(); } public void addToCurrentBlocks(long elem) { if (this.currentBlocks == null) { this.currentBlocks = new ArrayList<Long>(); } this.currentBlocks.add(elem); } public List<Long> getCurrentBlocks() { return this.currentBlocks; } public worker_register_args setCurrentBlocks(List<Long> currentBlocks) { this.currentBlocks = currentBlocks; return this; } public void unsetCurrentBlocks() { this.currentBlocks = null; } /** Returns true if field currentBlocks is set (has been assigned a value) and false otherwise */ public boolean isSetCurrentBlocks() { return this.currentBlocks != null; } public void setCurrentBlocksIsSet(boolean value) { if (!value) { this.currentBlocks = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case WORKER_NET_ADDRESS: if (value == null) { unsetWorkerNetAddress(); } else { setWorkerNetAddress((NetAddress)value); } break; case TOTAL_BYTES: if (value == null) { unsetTotalBytes(); } else { setTotalBytes((Long)value); } break; case USED_BYTES: if (value == null) { unsetUsedBytes(); } else { setUsedBytes((Long)value); } break; case CURRENT_BLOCKS: if (value == null) { unsetCurrentBlocks(); } else { setCurrentBlocks((List<Long>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case WORKER_NET_ADDRESS: return getWorkerNetAddress(); case TOTAL_BYTES: return Long.valueOf(getTotalBytes()); case USED_BYTES: return Long.valueOf(getUsedBytes()); case CURRENT_BLOCKS: return getCurrentBlocks(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case WORKER_NET_ADDRESS: return isSetWorkerNetAddress(); case TOTAL_BYTES: return isSetTotalBytes(); case USED_BYTES: return isSetUsedBytes(); case CURRENT_BLOCKS: return isSetCurrentBlocks(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_register_args) return this.equals((worker_register_args)that); return false; } public boolean equals(worker_register_args that) { if (that == null) return false; boolean this_present_workerNetAddress = true && this.isSetWorkerNetAddress(); boolean that_present_workerNetAddress = true && that.isSetWorkerNetAddress(); if (this_present_workerNetAddress || that_present_workerNetAddress) { if (!(this_present_workerNetAddress && that_present_workerNetAddress)) return false; if (!this.workerNetAddress.equals(that.workerNetAddress)) return false; } boolean this_present_totalBytes = true; boolean that_present_totalBytes = true; if (this_present_totalBytes || that_present_totalBytes) { if (!(this_present_totalBytes && that_present_totalBytes)) return false; if (this.totalBytes != that.totalBytes) return false; } boolean this_present_usedBytes = true; boolean that_present_usedBytes = true; if (this_present_usedBytes || that_present_usedBytes) { if (!(this_present_usedBytes && that_present_usedBytes)) return false; if (this.usedBytes != that.usedBytes) return false; } boolean this_present_currentBlocks = true && this.isSetCurrentBlocks(); boolean that_present_currentBlocks = true && that.isSetCurrentBlocks(); if (this_present_currentBlocks || that_present_currentBlocks) { if (!(this_present_currentBlocks && that_present_currentBlocks)) return false; if (!this.currentBlocks.equals(that.currentBlocks)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_register_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetWorkerNetAddress()).compareTo(other.isSetWorkerNetAddress()); if (lastComparison != 0) { return lastComparison; } if (isSetWorkerNetAddress()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workerNetAddress, other.workerNetAddress); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetTotalBytes()).compareTo(other.isSetTotalBytes()); if (lastComparison != 0) { return lastComparison; } if (isSetTotalBytes()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalBytes, other.totalBytes); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetUsedBytes()).compareTo(other.isSetUsedBytes()); if (lastComparison != 0) { return lastComparison; } if (isSetUsedBytes()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.usedBytes, other.usedBytes); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetCurrentBlocks()).compareTo(other.isSetCurrentBlocks()); if (lastComparison != 0) { return lastComparison; } if (isSetCurrentBlocks()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.currentBlocks, other.currentBlocks); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_register_args("); boolean first = true; sb.append("workerNetAddress:"); if (this.workerNetAddress == null) { sb.append("null"); } else { sb.append(this.workerNetAddress); } first = false; if (!first) sb.append(", "); sb.append("totalBytes:"); sb.append(this.totalBytes); first = false; if (!first) sb.append(", "); sb.append("usedBytes:"); sb.append(this.usedBytes); first = false; if (!first) sb.append(", "); sb.append("currentBlocks:"); if (this.currentBlocks == null) { sb.append("null"); } else { sb.append(this.currentBlocks); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (workerNetAddress != null) { workerNetAddress.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_register_argsStandardSchemeFactory implements SchemeFactory { public worker_register_argsStandardScheme getScheme() { return new worker_register_argsStandardScheme(); } } private static class worker_register_argsStandardScheme extends StandardScheme<worker_register_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_register_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // WORKER_NET_ADDRESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.workerNetAddress = new NetAddress(); struct.workerNetAddress.read(iprot); struct.setWorkerNetAddressIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // TOTAL_BYTES if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.totalBytes = iprot.readI64(); struct.setTotalBytesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // USED_BYTES if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.usedBytes = iprot.readI64(); struct.setUsedBytesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // CURRENT_BLOCKS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list64 = iprot.readListBegin(); struct.currentBlocks = new ArrayList<Long>(_list64.size); for (int _i65 = 0; _i65 < _list64.size; ++_i65) { long _elem66; _elem66 = iprot.readI64(); struct.currentBlocks.add(_elem66); } iprot.readListEnd(); } struct.setCurrentBlocksIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_register_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.workerNetAddress != null) { oprot.writeFieldBegin(WORKER_NET_ADDRESS_FIELD_DESC); struct.workerNetAddress.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldBegin(TOTAL_BYTES_FIELD_DESC); oprot.writeI64(struct.totalBytes); oprot.writeFieldEnd(); oprot.writeFieldBegin(USED_BYTES_FIELD_DESC); oprot.writeI64(struct.usedBytes); oprot.writeFieldEnd(); if (struct.currentBlocks != null) { oprot.writeFieldBegin(CURRENT_BLOCKS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.currentBlocks.size())); for (long _iter67 : struct.currentBlocks) { oprot.writeI64(_iter67); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_register_argsTupleSchemeFactory implements SchemeFactory { public worker_register_argsTupleScheme getScheme() { return new worker_register_argsTupleScheme(); } } private static class worker_register_argsTupleScheme extends TupleScheme<worker_register_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_register_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetWorkerNetAddress()) { optionals.set(0); } if (struct.isSetTotalBytes()) { optionals.set(1); } if (struct.isSetUsedBytes()) { optionals.set(2); } if (struct.isSetCurrentBlocks()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetWorkerNetAddress()) { struct.workerNetAddress.write(oprot); } if (struct.isSetTotalBytes()) { oprot.writeI64(struct.totalBytes); } if (struct.isSetUsedBytes()) { oprot.writeI64(struct.usedBytes); } if (struct.isSetCurrentBlocks()) { { oprot.writeI32(struct.currentBlocks.size()); for (long _iter68 : struct.currentBlocks) { oprot.writeI64(_iter68); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_register_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.workerNetAddress = new NetAddress(); struct.workerNetAddress.read(iprot); struct.setWorkerNetAddressIsSet(true); } if (incoming.get(1)) { struct.totalBytes = iprot.readI64(); struct.setTotalBytesIsSet(true); } if (incoming.get(2)) { struct.usedBytes = iprot.readI64(); struct.setUsedBytesIsSet(true); } if (incoming.get(3)) { { org.apache.thrift.protocol.TList _list69 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); struct.currentBlocks = new ArrayList<Long>(_list69.size); for (int _i70 = 0; _i70 < _list69.size; ++_i70) { long _elem71; _elem71 = iprot.readI64(); struct.currentBlocks.add(_elem71); } } struct.setCurrentBlocksIsSet(true); } } } } public static class worker_register_result implements org.apache.thrift.TBase<worker_register_result, worker_register_result._Fields>, java.io.Serializable, Cloneable, Comparable<worker_register_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_register_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_register_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_register_resultTupleSchemeFactory()); } public long success; // required public BlockInfoException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_register_result.class, metaDataMap); } public worker_register_result() { } public worker_register_result( long success, BlockInfoException e) { this(); this.success = success; setSuccessIsSet(true); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public worker_register_result(worker_register_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new BlockInfoException(other.e); } } public worker_register_result deepCopy() { return new worker_register_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.e = null; } public long getSuccess() { return this.success; } public worker_register_result setSuccess(long success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public BlockInfoException getE() { return this.e; } public worker_register_result setE(BlockInfoException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Long)value); } break; case E: if (value == null) { unsetE(); } else { setE((BlockInfoException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Long.valueOf(getSuccess()); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_register_result) return this.equals((worker_register_result)that); return false; } public boolean equals(worker_register_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_register_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_register_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_register_resultStandardSchemeFactory implements SchemeFactory { public worker_register_resultStandardScheme getScheme() { return new worker_register_resultStandardScheme(); } } private static class worker_register_resultStandardScheme extends StandardScheme<worker_register_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_register_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new BlockInfoException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_register_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI64(struct.success); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_register_resultTupleSchemeFactory implements SchemeFactory { public worker_register_resultTupleScheme getScheme() { return new worker_register_resultTupleScheme(); } } private static class worker_register_resultTupleScheme extends TupleScheme<worker_register_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_register_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeI64(struct.success); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_register_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new BlockInfoException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class worker_heartbeat_args implements org.apache.thrift.TBase<worker_heartbeat_args, worker_heartbeat_args._Fields>, java.io.Serializable, Cloneable, Comparable<worker_heartbeat_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_heartbeat_args"); private static final org.apache.thrift.protocol.TField WORKER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("workerId", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.protocol.TField USED_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("usedBytes", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField REMOVED_BLOCKS_FIELD_DESC = new org.apache.thrift.protocol.TField("removedBlocks", org.apache.thrift.protocol.TType.LIST, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_heartbeat_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_heartbeat_argsTupleSchemeFactory()); } public long workerId; // required public long usedBytes; // required public List<Long> removedBlocks; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { WORKER_ID((short)1, "workerId"), USED_BYTES((short)2, "usedBytes"), REMOVED_BLOCKS((short)3, "removedBlocks"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // WORKER_ID return WORKER_ID; case 2: // USED_BYTES return USED_BYTES; case 3: // REMOVED_BLOCKS return REMOVED_BLOCKS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __WORKERID_ISSET_ID = 0; private static final int __USEDBYTES_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.WORKER_ID, new org.apache.thrift.meta_data.FieldMetaData("workerId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.USED_BYTES, new org.apache.thrift.meta_data.FieldMetaData("usedBytes", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.REMOVED_BLOCKS, new org.apache.thrift.meta_data.FieldMetaData("removedBlocks", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_heartbeat_args.class, metaDataMap); } public worker_heartbeat_args() { } public worker_heartbeat_args( long workerId, long usedBytes, List<Long> removedBlocks) { this(); this.workerId = workerId; setWorkerIdIsSet(true); this.usedBytes = usedBytes; setUsedBytesIsSet(true); this.removedBlocks = removedBlocks; } /** * Performs a deep copy on <i>other</i>. */ public worker_heartbeat_args(worker_heartbeat_args other) { __isset_bitfield = other.__isset_bitfield; this.workerId = other.workerId; this.usedBytes = other.usedBytes; if (other.isSetRemovedBlocks()) { List<Long> __this__removedBlocks = new ArrayList<Long>(other.removedBlocks); this.removedBlocks = __this__removedBlocks; } } public worker_heartbeat_args deepCopy() { return new worker_heartbeat_args(this); } @Override public void clear() { setWorkerIdIsSet(false); this.workerId = 0; setUsedBytesIsSet(false); this.usedBytes = 0; this.removedBlocks = null; } public long getWorkerId() { return this.workerId; } public worker_heartbeat_args setWorkerId(long workerId) { this.workerId = workerId; setWorkerIdIsSet(true); return this; } public void unsetWorkerId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WORKERID_ISSET_ID); } /** Returns true if field workerId is set (has been assigned a value) and false otherwise */ public boolean isSetWorkerId() { return EncodingUtils.testBit(__isset_bitfield, __WORKERID_ISSET_ID); } public void setWorkerIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WORKERID_ISSET_ID, value); } public long getUsedBytes() { return this.usedBytes; } public worker_heartbeat_args setUsedBytes(long usedBytes) { this.usedBytes = usedBytes; setUsedBytesIsSet(true); return this; } public void unsetUsedBytes() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USEDBYTES_ISSET_ID); } /** Returns true if field usedBytes is set (has been assigned a value) and false otherwise */ public boolean isSetUsedBytes() { return EncodingUtils.testBit(__isset_bitfield, __USEDBYTES_ISSET_ID); } public void setUsedBytesIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USEDBYTES_ISSET_ID, value); } public int getRemovedBlocksSize() { return (this.removedBlocks == null) ? 0 : this.removedBlocks.size(); } public java.util.Iterator<Long> getRemovedBlocksIterator() { return (this.removedBlocks == null) ? null : this.removedBlocks.iterator(); } public void addToRemovedBlocks(long elem) { if (this.removedBlocks == null) { this.removedBlocks = new ArrayList<Long>(); } this.removedBlocks.add(elem); } public List<Long> getRemovedBlocks() { return this.removedBlocks; } public worker_heartbeat_args setRemovedBlocks(List<Long> removedBlocks) { this.removedBlocks = removedBlocks; return this; } public void unsetRemovedBlocks() { this.removedBlocks = null; } /** Returns true if field removedBlocks is set (has been assigned a value) and false otherwise */ public boolean isSetRemovedBlocks() { return this.removedBlocks != null; } public void setRemovedBlocksIsSet(boolean value) { if (!value) { this.removedBlocks = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case WORKER_ID: if (value == null) { unsetWorkerId(); } else { setWorkerId((Long)value); } break; case USED_BYTES: if (value == null) { unsetUsedBytes(); } else { setUsedBytes((Long)value); } break; case REMOVED_BLOCKS: if (value == null) { unsetRemovedBlocks(); } else { setRemovedBlocks((List<Long>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case WORKER_ID: return Long.valueOf(getWorkerId()); case USED_BYTES: return Long.valueOf(getUsedBytes()); case REMOVED_BLOCKS: return getRemovedBlocks(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case WORKER_ID: return isSetWorkerId(); case USED_BYTES: return isSetUsedBytes(); case REMOVED_BLOCKS: return isSetRemovedBlocks(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_heartbeat_args) return this.equals((worker_heartbeat_args)that); return false; } public boolean equals(worker_heartbeat_args that) { if (that == null) return false; boolean this_present_workerId = true; boolean that_present_workerId = true; if (this_present_workerId || that_present_workerId) { if (!(this_present_workerId && that_present_workerId)) return false; if (this.workerId != that.workerId) return false; } boolean this_present_usedBytes = true; boolean that_present_usedBytes = true; if (this_present_usedBytes || that_present_usedBytes) { if (!(this_present_usedBytes && that_present_usedBytes)) return false; if (this.usedBytes != that.usedBytes) return false; } boolean this_present_removedBlocks = true && this.isSetRemovedBlocks(); boolean that_present_removedBlocks = true && that.isSetRemovedBlocks(); if (this_present_removedBlocks || that_present_removedBlocks) { if (!(this_present_removedBlocks && that_present_removedBlocks)) return false; if (!this.removedBlocks.equals(that.removedBlocks)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_heartbeat_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetWorkerId()).compareTo(other.isSetWorkerId()); if (lastComparison != 0) { return lastComparison; } if (isSetWorkerId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workerId, other.workerId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetUsedBytes()).compareTo(other.isSetUsedBytes()); if (lastComparison != 0) { return lastComparison; } if (isSetUsedBytes()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.usedBytes, other.usedBytes); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRemovedBlocks()).compareTo(other.isSetRemovedBlocks()); if (lastComparison != 0) { return lastComparison; } if (isSetRemovedBlocks()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.removedBlocks, other.removedBlocks); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_heartbeat_args("); boolean first = true; sb.append("workerId:"); sb.append(this.workerId); first = false; if (!first) sb.append(", "); sb.append("usedBytes:"); sb.append(this.usedBytes); first = false; if (!first) sb.append(", "); sb.append("removedBlocks:"); if (this.removedBlocks == null) { sb.append("null"); } else { sb.append(this.removedBlocks); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_heartbeat_argsStandardSchemeFactory implements SchemeFactory { public worker_heartbeat_argsStandardScheme getScheme() { return new worker_heartbeat_argsStandardScheme(); } } private static class worker_heartbeat_argsStandardScheme extends StandardScheme<worker_heartbeat_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_heartbeat_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // WORKER_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.workerId = iprot.readI64(); struct.setWorkerIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // USED_BYTES if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.usedBytes = iprot.readI64(); struct.setUsedBytesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // REMOVED_BLOCKS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list72 = iprot.readListBegin(); struct.removedBlocks = new ArrayList<Long>(_list72.size); for (int _i73 = 0; _i73 < _list72.size; ++_i73) { long _elem74; _elem74 = iprot.readI64(); struct.removedBlocks.add(_elem74); } iprot.readListEnd(); } struct.setRemovedBlocksIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_heartbeat_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(WORKER_ID_FIELD_DESC); oprot.writeI64(struct.workerId); oprot.writeFieldEnd(); oprot.writeFieldBegin(USED_BYTES_FIELD_DESC); oprot.writeI64(struct.usedBytes); oprot.writeFieldEnd(); if (struct.removedBlocks != null) { oprot.writeFieldBegin(REMOVED_BLOCKS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.removedBlocks.size())); for (long _iter75 : struct.removedBlocks) { oprot.writeI64(_iter75); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_heartbeat_argsTupleSchemeFactory implements SchemeFactory { public worker_heartbeat_argsTupleScheme getScheme() { return new worker_heartbeat_argsTupleScheme(); } } private static class worker_heartbeat_argsTupleScheme extends TupleScheme<worker_heartbeat_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_heartbeat_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetWorkerId()) { optionals.set(0); } if (struct.isSetUsedBytes()) { optionals.set(1); } if (struct.isSetRemovedBlocks()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetWorkerId()) { oprot.writeI64(struct.workerId); } if (struct.isSetUsedBytes()) { oprot.writeI64(struct.usedBytes); } if (struct.isSetRemovedBlocks()) { { oprot.writeI32(struct.removedBlocks.size()); for (long _iter76 : struct.removedBlocks) { oprot.writeI64(_iter76); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_heartbeat_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.workerId = iprot.readI64(); struct.setWorkerIdIsSet(true); } if (incoming.get(1)) { struct.usedBytes = iprot.readI64(); struct.setUsedBytesIsSet(true); } if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list77 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); struct.removedBlocks = new ArrayList<Long>(_list77.size); for (int _i78 = 0; _i78 < _list77.size; ++_i78) { long _elem79; _elem79 = iprot.readI64(); struct.removedBlocks.add(_elem79); } } struct.setRemovedBlocksIsSet(true); } } } } public static class worker_heartbeat_result implements org.apache.thrift.TBase<worker_heartbeat_result, worker_heartbeat_result._Fields>, java.io.Serializable, Cloneable, Comparable<worker_heartbeat_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_heartbeat_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_heartbeat_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_heartbeat_resultTupleSchemeFactory()); } public Command success; // required public BlockInfoException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Command.class))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_heartbeat_result.class, metaDataMap); } public worker_heartbeat_result() { } public worker_heartbeat_result( Command success, BlockInfoException e) { this(); this.success = success; this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public worker_heartbeat_result(worker_heartbeat_result other) { if (other.isSetSuccess()) { this.success = new Command(other.success); } if (other.isSetE()) { this.e = new BlockInfoException(other.e); } } public worker_heartbeat_result deepCopy() { return new worker_heartbeat_result(this); } @Override public void clear() { this.success = null; this.e = null; } public Command getSuccess() { return this.success; } public worker_heartbeat_result setSuccess(Command success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public BlockInfoException getE() { return this.e; } public worker_heartbeat_result setE(BlockInfoException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Command)value); } break; case E: if (value == null) { unsetE(); } else { setE((BlockInfoException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_heartbeat_result) return this.equals((worker_heartbeat_result)that); return false; } public boolean equals(worker_heartbeat_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_heartbeat_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_heartbeat_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_heartbeat_resultStandardSchemeFactory implements SchemeFactory { public worker_heartbeat_resultStandardScheme getScheme() { return new worker_heartbeat_resultStandardScheme(); } } private static class worker_heartbeat_resultStandardScheme extends StandardScheme<worker_heartbeat_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_heartbeat_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new Command(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new BlockInfoException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_heartbeat_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_heartbeat_resultTupleSchemeFactory implements SchemeFactory { public worker_heartbeat_resultTupleScheme getScheme() { return new worker_heartbeat_resultTupleScheme(); } } private static class worker_heartbeat_resultTupleScheme extends TupleScheme<worker_heartbeat_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_heartbeat_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_heartbeat_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new Command(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new BlockInfoException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class worker_cacheBlock_args implements org.apache.thrift.TBase<worker_cacheBlock_args, worker_cacheBlock_args._Fields>, java.io.Serializable, Cloneable, Comparable<worker_cacheBlock_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_cacheBlock_args"); private static final org.apache.thrift.protocol.TField WORKER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("workerId", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.protocol.TField WORKER_USED_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("workerUsedBytes", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField LENGTH_FIELD_DESC = new org.apache.thrift.protocol.TField("length", org.apache.thrift.protocol.TType.I64, (short)4); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_cacheBlock_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_cacheBlock_argsTupleSchemeFactory()); } public long workerId; // required public long workerUsedBytes; // required public long blockId; // required public long length; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { WORKER_ID((short)1, "workerId"), WORKER_USED_BYTES((short)2, "workerUsedBytes"), BLOCK_ID((short)3, "blockId"), LENGTH((short)4, "length"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // WORKER_ID return WORKER_ID; case 2: // WORKER_USED_BYTES return WORKER_USED_BYTES; case 3: // BLOCK_ID return BLOCK_ID; case 4: // LENGTH return LENGTH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __WORKERID_ISSET_ID = 0; private static final int __WORKERUSEDBYTES_ISSET_ID = 1; private static final int __BLOCKID_ISSET_ID = 2; private static final int __LENGTH_ISSET_ID = 3; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.WORKER_ID, new org.apache.thrift.meta_data.FieldMetaData("workerId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.WORKER_USED_BYTES, new org.apache.thrift.meta_data.FieldMetaData("workerUsedBytes", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.BLOCK_ID, new org.apache.thrift.meta_data.FieldMetaData("blockId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.LENGTH, new org.apache.thrift.meta_data.FieldMetaData("length", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_cacheBlock_args.class, metaDataMap); } public worker_cacheBlock_args() { } public worker_cacheBlock_args( long workerId, long workerUsedBytes, long blockId, long length) { this(); this.workerId = workerId; setWorkerIdIsSet(true); this.workerUsedBytes = workerUsedBytes; setWorkerUsedBytesIsSet(true); this.blockId = blockId; setBlockIdIsSet(true); this.length = length; setLengthIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public worker_cacheBlock_args(worker_cacheBlock_args other) { __isset_bitfield = other.__isset_bitfield; this.workerId = other.workerId; this.workerUsedBytes = other.workerUsedBytes; this.blockId = other.blockId; this.length = other.length; } public worker_cacheBlock_args deepCopy() { return new worker_cacheBlock_args(this); } @Override public void clear() { setWorkerIdIsSet(false); this.workerId = 0; setWorkerUsedBytesIsSet(false); this.workerUsedBytes = 0; setBlockIdIsSet(false); this.blockId = 0; setLengthIsSet(false); this.length = 0; } public long getWorkerId() { return this.workerId; } public worker_cacheBlock_args setWorkerId(long workerId) { this.workerId = workerId; setWorkerIdIsSet(true); return this; } public void unsetWorkerId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WORKERID_ISSET_ID); } /** Returns true if field workerId is set (has been assigned a value) and false otherwise */ public boolean isSetWorkerId() { return EncodingUtils.testBit(__isset_bitfield, __WORKERID_ISSET_ID); } public void setWorkerIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WORKERID_ISSET_ID, value); } public long getWorkerUsedBytes() { return this.workerUsedBytes; } public worker_cacheBlock_args setWorkerUsedBytes(long workerUsedBytes) { this.workerUsedBytes = workerUsedBytes; setWorkerUsedBytesIsSet(true); return this; } public void unsetWorkerUsedBytes() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WORKERUSEDBYTES_ISSET_ID); } /** Returns true if field workerUsedBytes is set (has been assigned a value) and false otherwise */ public boolean isSetWorkerUsedBytes() { return EncodingUtils.testBit(__isset_bitfield, __WORKERUSEDBYTES_ISSET_ID); } public void setWorkerUsedBytesIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WORKERUSEDBYTES_ISSET_ID, value); } public long getBlockId() { return this.blockId; } public worker_cacheBlock_args setBlockId(long blockId) { this.blockId = blockId; setBlockIdIsSet(true); return this; } public void unsetBlockId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID); } /** Returns true if field blockId is set (has been assigned a value) and false otherwise */ public boolean isSetBlockId() { return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID); } public void setBlockIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value); } public long getLength() { return this.length; } public worker_cacheBlock_args setLength(long length) { this.length = length; setLengthIsSet(true); return this; } public void unsetLength() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LENGTH_ISSET_ID); } /** Returns true if field length is set (has been assigned a value) and false otherwise */ public boolean isSetLength() { return EncodingUtils.testBit(__isset_bitfield, __LENGTH_ISSET_ID); } public void setLengthIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LENGTH_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case WORKER_ID: if (value == null) { unsetWorkerId(); } else { setWorkerId((Long)value); } break; case WORKER_USED_BYTES: if (value == null) { unsetWorkerUsedBytes(); } else { setWorkerUsedBytes((Long)value); } break; case BLOCK_ID: if (value == null) { unsetBlockId(); } else { setBlockId((Long)value); } break; case LENGTH: if (value == null) { unsetLength(); } else { setLength((Long)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case WORKER_ID: return Long.valueOf(getWorkerId()); case WORKER_USED_BYTES: return Long.valueOf(getWorkerUsedBytes()); case BLOCK_ID: return Long.valueOf(getBlockId()); case LENGTH: return Long.valueOf(getLength()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case WORKER_ID: return isSetWorkerId(); case WORKER_USED_BYTES: return isSetWorkerUsedBytes(); case BLOCK_ID: return isSetBlockId(); case LENGTH: return isSetLength(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_cacheBlock_args) return this.equals((worker_cacheBlock_args)that); return false; } public boolean equals(worker_cacheBlock_args that) { if (that == null) return false; boolean this_present_workerId = true; boolean that_present_workerId = true; if (this_present_workerId || that_present_workerId) { if (!(this_present_workerId && that_present_workerId)) return false; if (this.workerId != that.workerId) return false; } boolean this_present_workerUsedBytes = true; boolean that_present_workerUsedBytes = true; if (this_present_workerUsedBytes || that_present_workerUsedBytes) { if (!(this_present_workerUsedBytes && that_present_workerUsedBytes)) return false; if (this.workerUsedBytes != that.workerUsedBytes) return false; } boolean this_present_blockId = true; boolean that_present_blockId = true; if (this_present_blockId || that_present_blockId) { if (!(this_present_blockId && that_present_blockId)) return false; if (this.blockId != that.blockId) return false; } boolean this_present_length = true; boolean that_present_length = true; if (this_present_length || that_present_length) { if (!(this_present_length && that_present_length)) return false; if (this.length != that.length) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_cacheBlock_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetWorkerId()).compareTo(other.isSetWorkerId()); if (lastComparison != 0) { return lastComparison; } if (isSetWorkerId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workerId, other.workerId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetWorkerUsedBytes()).compareTo(other.isSetWorkerUsedBytes()); if (lastComparison != 0) { return lastComparison; } if (isSetWorkerUsedBytes()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workerUsedBytes, other.workerUsedBytes); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetBlockId()).compareTo(other.isSetBlockId()); if (lastComparison != 0) { return lastComparison; } if (isSetBlockId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockId, other.blockId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetLength()).compareTo(other.isSetLength()); if (lastComparison != 0) { return lastComparison; } if (isSetLength()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.length, other.length); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_cacheBlock_args("); boolean first = true; sb.append("workerId:"); sb.append(this.workerId); first = false; if (!first) sb.append(", "); sb.append("workerUsedBytes:"); sb.append(this.workerUsedBytes); first = false; if (!first) sb.append(", "); sb.append("blockId:"); sb.append(this.blockId); first = false; if (!first) sb.append(", "); sb.append("length:"); sb.append(this.length); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_cacheBlock_argsStandardSchemeFactory implements SchemeFactory { public worker_cacheBlock_argsStandardScheme getScheme() { return new worker_cacheBlock_argsStandardScheme(); } } private static class worker_cacheBlock_argsStandardScheme extends StandardScheme<worker_cacheBlock_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_cacheBlock_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // WORKER_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.workerId = iprot.readI64(); struct.setWorkerIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // WORKER_USED_BYTES if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.workerUsedBytes = iprot.readI64(); struct.setWorkerUsedBytesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // BLOCK_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.blockId = iprot.readI64(); struct.setBlockIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // LENGTH if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.length = iprot.readI64(); struct.setLengthIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_cacheBlock_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(WORKER_ID_FIELD_DESC); oprot.writeI64(struct.workerId); oprot.writeFieldEnd(); oprot.writeFieldBegin(WORKER_USED_BYTES_FIELD_DESC); oprot.writeI64(struct.workerUsedBytes); oprot.writeFieldEnd(); oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); oprot.writeI64(struct.blockId); oprot.writeFieldEnd(); oprot.writeFieldBegin(LENGTH_FIELD_DESC); oprot.writeI64(struct.length); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_cacheBlock_argsTupleSchemeFactory implements SchemeFactory { public worker_cacheBlock_argsTupleScheme getScheme() { return new worker_cacheBlock_argsTupleScheme(); } } private static class worker_cacheBlock_argsTupleScheme extends TupleScheme<worker_cacheBlock_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_cacheBlock_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetWorkerId()) { optionals.set(0); } if (struct.isSetWorkerUsedBytes()) { optionals.set(1); } if (struct.isSetBlockId()) { optionals.set(2); } if (struct.isSetLength()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetWorkerId()) { oprot.writeI64(struct.workerId); } if (struct.isSetWorkerUsedBytes()) { oprot.writeI64(struct.workerUsedBytes); } if (struct.isSetBlockId()) { oprot.writeI64(struct.blockId); } if (struct.isSetLength()) { oprot.writeI64(struct.length); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_cacheBlock_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.workerId = iprot.readI64(); struct.setWorkerIdIsSet(true); } if (incoming.get(1)) { struct.workerUsedBytes = iprot.readI64(); struct.setWorkerUsedBytesIsSet(true); } if (incoming.get(2)) { struct.blockId = iprot.readI64(); struct.setBlockIdIsSet(true); } if (incoming.get(3)) { struct.length = iprot.readI64(); struct.setLengthIsSet(true); } } } } public static class worker_cacheBlock_result implements org.apache.thrift.TBase<worker_cacheBlock_result, worker_cacheBlock_result._Fields>, java.io.Serializable, Cloneable, Comparable<worker_cacheBlock_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_cacheBlock_result"); private static final org.apache.thrift.protocol.TField E_P_FIELD_DESC = new org.apache.thrift.protocol.TField("eP", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_S_FIELD_DESC = new org.apache.thrift.protocol.TField("eS", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField E_B_FIELD_DESC = new org.apache.thrift.protocol.TField("eB", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_cacheBlock_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_cacheBlock_resultTupleSchemeFactory()); } public FileDoesNotExistException eP; // required public SuspectedFileSizeException eS; // required public BlockInfoException eB; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E_P((short)1, "eP"), E_S((short)2, "eS"), E_B((short)3, "eB"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E_P return E_P; case 2: // E_S return E_S; case 3: // E_B return E_B; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E_P, new org.apache.thrift.meta_data.FieldMetaData("eP", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_S, new org.apache.thrift.meta_data.FieldMetaData("eS", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_B, new org.apache.thrift.meta_data.FieldMetaData("eB", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_cacheBlock_result.class, metaDataMap); } public worker_cacheBlock_result() { } public worker_cacheBlock_result( FileDoesNotExistException eP, SuspectedFileSizeException eS, BlockInfoException eB) { this(); this.eP = eP; this.eS = eS; this.eB = eB; } /** * Performs a deep copy on <i>other</i>. */ public worker_cacheBlock_result(worker_cacheBlock_result other) { if (other.isSetEP()) { this.eP = new FileDoesNotExistException(other.eP); } if (other.isSetES()) { this.eS = new SuspectedFileSizeException(other.eS); } if (other.isSetEB()) { this.eB = new BlockInfoException(other.eB); } } public worker_cacheBlock_result deepCopy() { return new worker_cacheBlock_result(this); } @Override public void clear() { this.eP = null; this.eS = null; this.eB = null; } public FileDoesNotExistException getEP() { return this.eP; } public worker_cacheBlock_result setEP(FileDoesNotExistException eP) { this.eP = eP; return this; } public void unsetEP() { this.eP = null; } /** Returns true if field eP is set (has been assigned a value) and false otherwise */ public boolean isSetEP() { return this.eP != null; } public void setEPIsSet(boolean value) { if (!value) { this.eP = null; } } public SuspectedFileSizeException getES() { return this.eS; } public worker_cacheBlock_result setES(SuspectedFileSizeException eS) { this.eS = eS; return this; } public void unsetES() { this.eS = null; } /** Returns true if field eS is set (has been assigned a value) and false otherwise */ public boolean isSetES() { return this.eS != null; } public void setESIsSet(boolean value) { if (!value) { this.eS = null; } } public BlockInfoException getEB() { return this.eB; } public worker_cacheBlock_result setEB(BlockInfoException eB) { this.eB = eB; return this; } public void unsetEB() { this.eB = null; } /** Returns true if field eB is set (has been assigned a value) and false otherwise */ public boolean isSetEB() { return this.eB != null; } public void setEBIsSet(boolean value) { if (!value) { this.eB = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E_P: if (value == null) { unsetEP(); } else { setEP((FileDoesNotExistException)value); } break; case E_S: if (value == null) { unsetES(); } else { setES((SuspectedFileSizeException)value); } break; case E_B: if (value == null) { unsetEB(); } else { setEB((BlockInfoException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E_P: return getEP(); case E_S: return getES(); case E_B: return getEB(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E_P: return isSetEP(); case E_S: return isSetES(); case E_B: return isSetEB(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_cacheBlock_result) return this.equals((worker_cacheBlock_result)that); return false; } public boolean equals(worker_cacheBlock_result that) { if (that == null) return false; boolean this_present_eP = true && this.isSetEP(); boolean that_present_eP = true && that.isSetEP(); if (this_present_eP || that_present_eP) { if (!(this_present_eP && that_present_eP)) return false; if (!this.eP.equals(that.eP)) return false; } boolean this_present_eS = true && this.isSetES(); boolean that_present_eS = true && that.isSetES(); if (this_present_eS || that_present_eS) { if (!(this_present_eS && that_present_eS)) return false; if (!this.eS.equals(that.eS)) return false; } boolean this_present_eB = true && this.isSetEB(); boolean that_present_eB = true && that.isSetEB(); if (this_present_eB || that_present_eB) { if (!(this_present_eB && that_present_eB)) return false; if (!this.eB.equals(that.eB)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_cacheBlock_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetEP()).compareTo(other.isSetEP()); if (lastComparison != 0) { return lastComparison; } if (isSetEP()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eP, other.eP); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetES()).compareTo(other.isSetES()); if (lastComparison != 0) { return lastComparison; } if (isSetES()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eS, other.eS); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEB()).compareTo(other.isSetEB()); if (lastComparison != 0) { return lastComparison; } if (isSetEB()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eB, other.eB); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_cacheBlock_result("); boolean first = true; sb.append("eP:"); if (this.eP == null) { sb.append("null"); } else { sb.append(this.eP); } first = false; if (!first) sb.append(", "); sb.append("eS:"); if (this.eS == null) { sb.append("null"); } else { sb.append(this.eS); } first = false; if (!first) sb.append(", "); sb.append("eB:"); if (this.eB == null) { sb.append("null"); } else { sb.append(this.eB); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_cacheBlock_resultStandardSchemeFactory implements SchemeFactory { public worker_cacheBlock_resultStandardScheme getScheme() { return new worker_cacheBlock_resultStandardScheme(); } } private static class worker_cacheBlock_resultStandardScheme extends StandardScheme<worker_cacheBlock_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_cacheBlock_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E_P if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eP = new FileDoesNotExistException(); struct.eP.read(iprot); struct.setEPIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_S if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eS = new SuspectedFileSizeException(); struct.eS.read(iprot); struct.setESIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // E_B if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_cacheBlock_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.eP != null) { oprot.writeFieldBegin(E_P_FIELD_DESC); struct.eP.write(oprot); oprot.writeFieldEnd(); } if (struct.eS != null) { oprot.writeFieldBegin(E_S_FIELD_DESC); struct.eS.write(oprot); oprot.writeFieldEnd(); } if (struct.eB != null) { oprot.writeFieldBegin(E_B_FIELD_DESC); struct.eB.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_cacheBlock_resultTupleSchemeFactory implements SchemeFactory { public worker_cacheBlock_resultTupleScheme getScheme() { return new worker_cacheBlock_resultTupleScheme(); } } private static class worker_cacheBlock_resultTupleScheme extends TupleScheme<worker_cacheBlock_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_cacheBlock_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetEP()) { optionals.set(0); } if (struct.isSetES()) { optionals.set(1); } if (struct.isSetEB()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetEP()) { struct.eP.write(oprot); } if (struct.isSetES()) { struct.eS.write(oprot); } if (struct.isSetEB()) { struct.eB.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_cacheBlock_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.eP = new FileDoesNotExistException(); struct.eP.read(iprot); struct.setEPIsSet(true); } if (incoming.get(1)) { struct.eS = new SuspectedFileSizeException(); struct.eS.read(iprot); struct.setESIsSet(true); } if (incoming.get(2)) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } } } } public static class worker_getPinIdList_args implements org.apache.thrift.TBase<worker_getPinIdList_args, worker_getPinIdList_args._Fields>, java.io.Serializable, Cloneable, Comparable<worker_getPinIdList_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_getPinIdList_args"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_getPinIdList_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_getPinIdList_argsTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_getPinIdList_args.class, metaDataMap); } public worker_getPinIdList_args() { } /** * Performs a deep copy on <i>other</i>. */ public worker_getPinIdList_args(worker_getPinIdList_args other) { } public worker_getPinIdList_args deepCopy() { return new worker_getPinIdList_args(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_getPinIdList_args) return this.equals((worker_getPinIdList_args)that); return false; } public boolean equals(worker_getPinIdList_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_getPinIdList_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_getPinIdList_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_getPinIdList_argsStandardSchemeFactory implements SchemeFactory { public worker_getPinIdList_argsStandardScheme getScheme() { return new worker_getPinIdList_argsStandardScheme(); } } private static class worker_getPinIdList_argsStandardScheme extends StandardScheme<worker_getPinIdList_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_getPinIdList_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_getPinIdList_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_getPinIdList_argsTupleSchemeFactory implements SchemeFactory { public worker_getPinIdList_argsTupleScheme getScheme() { return new worker_getPinIdList_argsTupleScheme(); } } private static class worker_getPinIdList_argsTupleScheme extends TupleScheme<worker_getPinIdList_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_getPinIdList_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_getPinIdList_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class worker_getPinIdList_result implements org.apache.thrift.TBase<worker_getPinIdList_result, worker_getPinIdList_result._Fields>, java.io.Serializable, Cloneable, Comparable<worker_getPinIdList_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_getPinIdList_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.SET, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_getPinIdList_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_getPinIdList_resultTupleSchemeFactory()); } public Set<Integer> success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_getPinIdList_result.class, metaDataMap); } public worker_getPinIdList_result() { } public worker_getPinIdList_result( Set<Integer> success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public worker_getPinIdList_result(worker_getPinIdList_result other) { if (other.isSetSuccess()) { Set<Integer> __this__success = new HashSet<Integer>(other.success); this.success = __this__success; } } public worker_getPinIdList_result deepCopy() { return new worker_getPinIdList_result(this); } @Override public void clear() { this.success = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<Integer> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(int elem) { if (this.success == null) { this.success = new HashSet<Integer>(); } this.success.add(elem); } public Set<Integer> getSuccess() { return this.success; } public worker_getPinIdList_result setSuccess(Set<Integer> success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Set<Integer>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_getPinIdList_result) return this.equals((worker_getPinIdList_result)that); return false; } public boolean equals(worker_getPinIdList_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_getPinIdList_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_getPinIdList_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_getPinIdList_resultStandardSchemeFactory implements SchemeFactory { public worker_getPinIdList_resultStandardScheme getScheme() { return new worker_getPinIdList_resultStandardScheme(); } } private static class worker_getPinIdList_resultStandardScheme extends StandardScheme<worker_getPinIdList_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_getPinIdList_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.SET) { { org.apache.thrift.protocol.TSet _set80 = iprot.readSetBegin(); struct.success = new HashSet<Integer>(2*_set80.size); for (int _i81 = 0; _i81 < _set80.size; ++_i81) { int _elem82; _elem82 = iprot.readI32(); struct.success.add(_elem82); } iprot.readSetEnd(); } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_getPinIdList_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.success.size())); for (int _iter83 : struct.success) { oprot.writeI32(_iter83); } oprot.writeSetEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_getPinIdList_resultTupleSchemeFactory implements SchemeFactory { public worker_getPinIdList_resultTupleScheme getScheme() { return new worker_getPinIdList_resultTupleScheme(); } } private static class worker_getPinIdList_resultTupleScheme extends TupleScheme<worker_getPinIdList_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_getPinIdList_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (int _iter84 : struct.success) { oprot.writeI32(_iter84); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_getPinIdList_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TSet _set85 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32()); struct.success = new HashSet<Integer>(2*_set85.size); for (int _i86 = 0; _i86 < _set85.size; ++_i86) { int _elem87; _elem87 = iprot.readI32(); struct.success.add(_elem87); } } struct.setSuccessIsSet(true); } } } } public static class worker_getPriorityDependencyList_args implements org.apache.thrift.TBase<worker_getPriorityDependencyList_args, worker_getPriorityDependencyList_args._Fields>, java.io.Serializable, Cloneable, Comparable<worker_getPriorityDependencyList_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_getPriorityDependencyList_args"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_getPriorityDependencyList_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_getPriorityDependencyList_argsTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_getPriorityDependencyList_args.class, metaDataMap); } public worker_getPriorityDependencyList_args() { } /** * Performs a deep copy on <i>other</i>. */ public worker_getPriorityDependencyList_args(worker_getPriorityDependencyList_args other) { } public worker_getPriorityDependencyList_args deepCopy() { return new worker_getPriorityDependencyList_args(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_getPriorityDependencyList_args) return this.equals((worker_getPriorityDependencyList_args)that); return false; } public boolean equals(worker_getPriorityDependencyList_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_getPriorityDependencyList_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_getPriorityDependencyList_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_getPriorityDependencyList_argsStandardSchemeFactory implements SchemeFactory { public worker_getPriorityDependencyList_argsStandardScheme getScheme() { return new worker_getPriorityDependencyList_argsStandardScheme(); } } private static class worker_getPriorityDependencyList_argsStandardScheme extends StandardScheme<worker_getPriorityDependencyList_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_getPriorityDependencyList_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_getPriorityDependencyList_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_getPriorityDependencyList_argsTupleSchemeFactory implements SchemeFactory { public worker_getPriorityDependencyList_argsTupleScheme getScheme() { return new worker_getPriorityDependencyList_argsTupleScheme(); } } private static class worker_getPriorityDependencyList_argsTupleScheme extends TupleScheme<worker_getPriorityDependencyList_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_getPriorityDependencyList_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_getPriorityDependencyList_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class worker_getPriorityDependencyList_result implements org.apache.thrift.TBase<worker_getPriorityDependencyList_result, worker_getPriorityDependencyList_result._Fields>, java.io.Serializable, Cloneable, Comparable<worker_getPriorityDependencyList_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_getPriorityDependencyList_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new worker_getPriorityDependencyList_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new worker_getPriorityDependencyList_resultTupleSchemeFactory()); } public List<Integer> success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_getPriorityDependencyList_result.class, metaDataMap); } public worker_getPriorityDependencyList_result() { } public worker_getPriorityDependencyList_result( List<Integer> success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public worker_getPriorityDependencyList_result(worker_getPriorityDependencyList_result other) { if (other.isSetSuccess()) { List<Integer> __this__success = new ArrayList<Integer>(other.success); this.success = __this__success; } } public worker_getPriorityDependencyList_result deepCopy() { return new worker_getPriorityDependencyList_result(this); } @Override public void clear() { this.success = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<Integer> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(int elem) { if (this.success == null) { this.success = new ArrayList<Integer>(); } this.success.add(elem); } public List<Integer> getSuccess() { return this.success; } public worker_getPriorityDependencyList_result setSuccess(List<Integer> success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<Integer>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof worker_getPriorityDependencyList_result) return this.equals((worker_getPriorityDependencyList_result)that); return false; } public boolean equals(worker_getPriorityDependencyList_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(worker_getPriorityDependencyList_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("worker_getPriorityDependencyList_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class worker_getPriorityDependencyList_resultStandardSchemeFactory implements SchemeFactory { public worker_getPriorityDependencyList_resultStandardScheme getScheme() { return new worker_getPriorityDependencyList_resultStandardScheme(); } } private static class worker_getPriorityDependencyList_resultStandardScheme extends StandardScheme<worker_getPriorityDependencyList_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, worker_getPriorityDependencyList_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list88 = iprot.readListBegin(); struct.success = new ArrayList<Integer>(_list88.size); for (int _i89 = 0; _i89 < _list88.size; ++_i89) { int _elem90; _elem90 = iprot.readI32(); struct.success.add(_elem90); } iprot.readListEnd(); } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, worker_getPriorityDependencyList_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.success.size())); for (int _iter91 : struct.success) { oprot.writeI32(_iter91); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class worker_getPriorityDependencyList_resultTupleSchemeFactory implements SchemeFactory { public worker_getPriorityDependencyList_resultTupleScheme getScheme() { return new worker_getPriorityDependencyList_resultTupleScheme(); } } private static class worker_getPriorityDependencyList_resultTupleScheme extends TupleScheme<worker_getPriorityDependencyList_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, worker_getPriorityDependencyList_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (int _iter92 : struct.success) { oprot.writeI32(_iter92); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, worker_getPriorityDependencyList_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list93 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); struct.success = new ArrayList<Integer>(_list93.size); for (int _i94 = 0; _i94 < _list93.size; ++_i94) { int _elem95; _elem95 = iprot.readI32(); struct.success.add(_elem95); } } struct.setSuccessIsSet(true); } } } } public static class user_createDependency_args implements org.apache.thrift.TBase<user_createDependency_args, user_createDependency_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_createDependency_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createDependency_args"); private static final org.apache.thrift.protocol.TField PARENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("parents", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField CHILDREN_FIELD_DESC = new org.apache.thrift.protocol.TField("children", org.apache.thrift.protocol.TType.LIST, (short)2); private static final org.apache.thrift.protocol.TField COMMAND_PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("commandPrefix", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.LIST, (short)4); private static final org.apache.thrift.protocol.TField COMMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("comment", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.protocol.TField FRAMEWORK_FIELD_DESC = new org.apache.thrift.protocol.TField("framework", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.protocol.TField FRAMEWORK_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("frameworkVersion", org.apache.thrift.protocol.TType.STRING, (short)7); private static final org.apache.thrift.protocol.TField DEPENDENCY_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("dependencyType", org.apache.thrift.protocol.TType.I32, (short)8); private static final org.apache.thrift.protocol.TField CHILDREN_BLOCK_SIZE_BYTE_FIELD_DESC = new org.apache.thrift.protocol.TField("childrenBlockSizeByte", org.apache.thrift.protocol.TType.I64, (short)9); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createDependency_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createDependency_argsTupleSchemeFactory()); } public List<String> parents; // required public List<String> children; // required public String commandPrefix; // required public List<ByteBuffer> data; // required public String comment; // required public String framework; // required public String frameworkVersion; // required public int dependencyType; // required public long childrenBlockSizeByte; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PARENTS((short)1, "parents"), CHILDREN((short)2, "children"), COMMAND_PREFIX((short)3, "commandPrefix"), DATA((short)4, "data"), COMMENT((short)5, "comment"), FRAMEWORK((short)6, "framework"), FRAMEWORK_VERSION((short)7, "frameworkVersion"), DEPENDENCY_TYPE((short)8, "dependencyType"), CHILDREN_BLOCK_SIZE_BYTE((short)9, "childrenBlockSizeByte"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PARENTS return PARENTS; case 2: // CHILDREN return CHILDREN; case 3: // COMMAND_PREFIX return COMMAND_PREFIX; case 4: // DATA return DATA; case 5: // COMMENT return COMMENT; case 6: // FRAMEWORK return FRAMEWORK; case 7: // FRAMEWORK_VERSION return FRAMEWORK_VERSION; case 8: // DEPENDENCY_TYPE return DEPENDENCY_TYPE; case 9: // CHILDREN_BLOCK_SIZE_BYTE return CHILDREN_BLOCK_SIZE_BYTE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __DEPENDENCYTYPE_ISSET_ID = 0; private static final int __CHILDRENBLOCKSIZEBYTE_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PARENTS, new org.apache.thrift.meta_data.FieldMetaData("parents", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); tmpMap.put(_Fields.CHILDREN, new org.apache.thrift.meta_data.FieldMetaData("children", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); tmpMap.put(_Fields.COMMAND_PREFIX, new org.apache.thrift.meta_data.FieldMetaData("commandPrefix", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); tmpMap.put(_Fields.COMMENT, new org.apache.thrift.meta_data.FieldMetaData("comment", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.FRAMEWORK, new org.apache.thrift.meta_data.FieldMetaData("framework", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.FRAMEWORK_VERSION, new org.apache.thrift.meta_data.FieldMetaData("frameworkVersion", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DEPENDENCY_TYPE, new org.apache.thrift.meta_data.FieldMetaData("dependencyType", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.CHILDREN_BLOCK_SIZE_BYTE, new org.apache.thrift.meta_data.FieldMetaData("childrenBlockSizeByte", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createDependency_args.class, metaDataMap); } public user_createDependency_args() { } public user_createDependency_args( List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte) { this(); this.parents = parents; this.children = children; this.commandPrefix = commandPrefix; this.data = data; this.comment = comment; this.framework = framework; this.frameworkVersion = frameworkVersion; this.dependencyType = dependencyType; setDependencyTypeIsSet(true); this.childrenBlockSizeByte = childrenBlockSizeByte; setChildrenBlockSizeByteIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_createDependency_args(user_createDependency_args other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetParents()) { List<String> __this__parents = new ArrayList<String>(other.parents); this.parents = __this__parents; } if (other.isSetChildren()) { List<String> __this__children = new ArrayList<String>(other.children); this.children = __this__children; } if (other.isSetCommandPrefix()) { this.commandPrefix = other.commandPrefix; } if (other.isSetData()) { List<ByteBuffer> __this__data = new ArrayList<ByteBuffer>(other.data); this.data = __this__data; } if (other.isSetComment()) { this.comment = other.comment; } if (other.isSetFramework()) { this.framework = other.framework; } if (other.isSetFrameworkVersion()) { this.frameworkVersion = other.frameworkVersion; } this.dependencyType = other.dependencyType; this.childrenBlockSizeByte = other.childrenBlockSizeByte; } public user_createDependency_args deepCopy() { return new user_createDependency_args(this); } @Override public void clear() { this.parents = null; this.children = null; this.commandPrefix = null; this.data = null; this.comment = null; this.framework = null; this.frameworkVersion = null; setDependencyTypeIsSet(false); this.dependencyType = 0; setChildrenBlockSizeByteIsSet(false); this.childrenBlockSizeByte = 0; } public int getParentsSize() { return (this.parents == null) ? 0 : this.parents.size(); } public java.util.Iterator<String> getParentsIterator() { return (this.parents == null) ? null : this.parents.iterator(); } public void addToParents(String elem) { if (this.parents == null) { this.parents = new ArrayList<String>(); } this.parents.add(elem); } public List<String> getParents() { return this.parents; } public user_createDependency_args setParents(List<String> parents) { this.parents = parents; return this; } public void unsetParents() { this.parents = null; } /** Returns true if field parents is set (has been assigned a value) and false otherwise */ public boolean isSetParents() { return this.parents != null; } public void setParentsIsSet(boolean value) { if (!value) { this.parents = null; } } public int getChildrenSize() { return (this.children == null) ? 0 : this.children.size(); } public java.util.Iterator<String> getChildrenIterator() { return (this.children == null) ? null : this.children.iterator(); } public void addToChildren(String elem) { if (this.children == null) { this.children = new ArrayList<String>(); } this.children.add(elem); } public List<String> getChildren() { return this.children; } public user_createDependency_args setChildren(List<String> children) { this.children = children; return this; } public void unsetChildren() { this.children = null; } /** Returns true if field children is set (has been assigned a value) and false otherwise */ public boolean isSetChildren() { return this.children != null; } public void setChildrenIsSet(boolean value) { if (!value) { this.children = null; } } public String getCommandPrefix() { return this.commandPrefix; } public user_createDependency_args setCommandPrefix(String commandPrefix) { this.commandPrefix = commandPrefix; return this; } public void unsetCommandPrefix() { this.commandPrefix = null; } /** Returns true if field commandPrefix is set (has been assigned a value) and false otherwise */ public boolean isSetCommandPrefix() { return this.commandPrefix != null; } public void setCommandPrefixIsSet(boolean value) { if (!value) { this.commandPrefix = null; } } public int getDataSize() { return (this.data == null) ? 0 : this.data.size(); } public java.util.Iterator<ByteBuffer> getDataIterator() { return (this.data == null) ? null : this.data.iterator(); } public void addToData(ByteBuffer elem) { if (this.data == null) { this.data = new ArrayList<ByteBuffer>(); } this.data.add(elem); } public List<ByteBuffer> getData() { return this.data; } public user_createDependency_args setData(List<ByteBuffer> data) { this.data = data; return this; } public void unsetData() { this.data = null; } /** Returns true if field data is set (has been assigned a value) and false otherwise */ public boolean isSetData() { return this.data != null; } public void setDataIsSet(boolean value) { if (!value) { this.data = null; } } public String getComment() { return this.comment; } public user_createDependency_args setComment(String comment) { this.comment = comment; return this; } public void unsetComment() { this.comment = null; } /** Returns true if field comment is set (has been assigned a value) and false otherwise */ public boolean isSetComment() { return this.comment != null; } public void setCommentIsSet(boolean value) { if (!value) { this.comment = null; } } public String getFramework() { return this.framework; } public user_createDependency_args setFramework(String framework) { this.framework = framework; return this; } public void unsetFramework() { this.framework = null; } /** Returns true if field framework is set (has been assigned a value) and false otherwise */ public boolean isSetFramework() { return this.framework != null; } public void setFrameworkIsSet(boolean value) { if (!value) { this.framework = null; } } public String getFrameworkVersion() { return this.frameworkVersion; } public user_createDependency_args setFrameworkVersion(String frameworkVersion) { this.frameworkVersion = frameworkVersion; return this; } public void unsetFrameworkVersion() { this.frameworkVersion = null; } /** Returns true if field frameworkVersion is set (has been assigned a value) and false otherwise */ public boolean isSetFrameworkVersion() { return this.frameworkVersion != null; } public void setFrameworkVersionIsSet(boolean value) { if (!value) { this.frameworkVersion = null; } } public int getDependencyType() { return this.dependencyType; } public user_createDependency_args setDependencyType(int dependencyType) { this.dependencyType = dependencyType; setDependencyTypeIsSet(true); return this; } public void unsetDependencyType() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DEPENDENCYTYPE_ISSET_ID); } /** Returns true if field dependencyType is set (has been assigned a value) and false otherwise */ public boolean isSetDependencyType() { return EncodingUtils.testBit(__isset_bitfield, __DEPENDENCYTYPE_ISSET_ID); } public void setDependencyTypeIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DEPENDENCYTYPE_ISSET_ID, value); } public long getChildrenBlockSizeByte() { return this.childrenBlockSizeByte; } public user_createDependency_args setChildrenBlockSizeByte(long childrenBlockSizeByte) { this.childrenBlockSizeByte = childrenBlockSizeByte; setChildrenBlockSizeByteIsSet(true); return this; } public void unsetChildrenBlockSizeByte() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CHILDRENBLOCKSIZEBYTE_ISSET_ID); } /** Returns true if field childrenBlockSizeByte is set (has been assigned a value) and false otherwise */ public boolean isSetChildrenBlockSizeByte() { return EncodingUtils.testBit(__isset_bitfield, __CHILDRENBLOCKSIZEBYTE_ISSET_ID); } public void setChildrenBlockSizeByteIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CHILDRENBLOCKSIZEBYTE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case PARENTS: if (value == null) { unsetParents(); } else { setParents((List<String>)value); } break; case CHILDREN: if (value == null) { unsetChildren(); } else { setChildren((List<String>)value); } break; case COMMAND_PREFIX: if (value == null) { unsetCommandPrefix(); } else { setCommandPrefix((String)value); } break; case DATA: if (value == null) { unsetData(); } else { setData((List<ByteBuffer>)value); } break; case COMMENT: if (value == null) { unsetComment(); } else { setComment((String)value); } break; case FRAMEWORK: if (value == null) { unsetFramework(); } else { setFramework((String)value); } break; case FRAMEWORK_VERSION: if (value == null) { unsetFrameworkVersion(); } else { setFrameworkVersion((String)value); } break; case DEPENDENCY_TYPE: if (value == null) { unsetDependencyType(); } else { setDependencyType((Integer)value); } break; case CHILDREN_BLOCK_SIZE_BYTE: if (value == null) { unsetChildrenBlockSizeByte(); } else { setChildrenBlockSizeByte((Long)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PARENTS: return getParents(); case CHILDREN: return getChildren(); case COMMAND_PREFIX: return getCommandPrefix(); case DATA: return getData(); case COMMENT: return getComment(); case FRAMEWORK: return getFramework(); case FRAMEWORK_VERSION: return getFrameworkVersion(); case DEPENDENCY_TYPE: return Integer.valueOf(getDependencyType()); case CHILDREN_BLOCK_SIZE_BYTE: return Long.valueOf(getChildrenBlockSizeByte()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PARENTS: return isSetParents(); case CHILDREN: return isSetChildren(); case COMMAND_PREFIX: return isSetCommandPrefix(); case DATA: return isSetData(); case COMMENT: return isSetComment(); case FRAMEWORK: return isSetFramework(); case FRAMEWORK_VERSION: return isSetFrameworkVersion(); case DEPENDENCY_TYPE: return isSetDependencyType(); case CHILDREN_BLOCK_SIZE_BYTE: return isSetChildrenBlockSizeByte(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createDependency_args) return this.equals((user_createDependency_args)that); return false; } public boolean equals(user_createDependency_args that) { if (that == null) return false; boolean this_present_parents = true && this.isSetParents(); boolean that_present_parents = true && that.isSetParents(); if (this_present_parents || that_present_parents) { if (!(this_present_parents && that_present_parents)) return false; if (!this.parents.equals(that.parents)) return false; } boolean this_present_children = true && this.isSetChildren(); boolean that_present_children = true && that.isSetChildren(); if (this_present_children || that_present_children) { if (!(this_present_children && that_present_children)) return false; if (!this.children.equals(that.children)) return false; } boolean this_present_commandPrefix = true && this.isSetCommandPrefix(); boolean that_present_commandPrefix = true && that.isSetCommandPrefix(); if (this_present_commandPrefix || that_present_commandPrefix) { if (!(this_present_commandPrefix && that_present_commandPrefix)) return false; if (!this.commandPrefix.equals(that.commandPrefix)) return false; } boolean this_present_data = true && this.isSetData(); boolean that_present_data = true && that.isSetData(); if (this_present_data || that_present_data) { if (!(this_present_data && that_present_data)) return false; if (!this.data.equals(that.data)) return false; } boolean this_present_comment = true && this.isSetComment(); boolean that_present_comment = true && that.isSetComment(); if (this_present_comment || that_present_comment) { if (!(this_present_comment && that_present_comment)) return false; if (!this.comment.equals(that.comment)) return false; } boolean this_present_framework = true && this.isSetFramework(); boolean that_present_framework = true && that.isSetFramework(); if (this_present_framework || that_present_framework) { if (!(this_present_framework && that_present_framework)) return false; if (!this.framework.equals(that.framework)) return false; } boolean this_present_frameworkVersion = true && this.isSetFrameworkVersion(); boolean that_present_frameworkVersion = true && that.isSetFrameworkVersion(); if (this_present_frameworkVersion || that_present_frameworkVersion) { if (!(this_present_frameworkVersion && that_present_frameworkVersion)) return false; if (!this.frameworkVersion.equals(that.frameworkVersion)) return false; } boolean this_present_dependencyType = true; boolean that_present_dependencyType = true; if (this_present_dependencyType || that_present_dependencyType) { if (!(this_present_dependencyType && that_present_dependencyType)) return false; if (this.dependencyType != that.dependencyType) return false; } boolean this_present_childrenBlockSizeByte = true; boolean that_present_childrenBlockSizeByte = true; if (this_present_childrenBlockSizeByte || that_present_childrenBlockSizeByte) { if (!(this_present_childrenBlockSizeByte && that_present_childrenBlockSizeByte)) return false; if (this.childrenBlockSizeByte != that.childrenBlockSizeByte) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createDependency_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetParents()).compareTo(other.isSetParents()); if (lastComparison != 0) { return lastComparison; } if (isSetParents()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parents, other.parents); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetChildren()).compareTo(other.isSetChildren()); if (lastComparison != 0) { return lastComparison; } if (isSetChildren()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.children, other.children); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetCommandPrefix()).compareTo(other.isSetCommandPrefix()); if (lastComparison != 0) { return lastComparison; } if (isSetCommandPrefix()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.commandPrefix, other.commandPrefix); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetData()).compareTo(other.isSetData()); if (lastComparison != 0) { return lastComparison; } if (isSetData()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, other.data); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetComment()).compareTo(other.isSetComment()); if (lastComparison != 0) { return lastComparison; } if (isSetComment()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.comment, other.comment); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetFramework()).compareTo(other.isSetFramework()); if (lastComparison != 0) { return lastComparison; } if (isSetFramework()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.framework, other.framework); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetFrameworkVersion()).compareTo(other.isSetFrameworkVersion()); if (lastComparison != 0) { return lastComparison; } if (isSetFrameworkVersion()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.frameworkVersion, other.frameworkVersion); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDependencyType()).compareTo(other.isSetDependencyType()); if (lastComparison != 0) { return lastComparison; } if (isSetDependencyType()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dependencyType, other.dependencyType); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetChildrenBlockSizeByte()).compareTo(other.isSetChildrenBlockSizeByte()); if (lastComparison != 0) { return lastComparison; } if (isSetChildrenBlockSizeByte()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.childrenBlockSizeByte, other.childrenBlockSizeByte); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createDependency_args("); boolean first = true; sb.append("parents:"); if (this.parents == null) { sb.append("null"); } else { sb.append(this.parents); } first = false; if (!first) sb.append(", "); sb.append("children:"); if (this.children == null) { sb.append("null"); } else { sb.append(this.children); } first = false; if (!first) sb.append(", "); sb.append("commandPrefix:"); if (this.commandPrefix == null) { sb.append("null"); } else { sb.append(this.commandPrefix); } first = false; if (!first) sb.append(", "); sb.append("data:"); if (this.data == null) { sb.append("null"); } else { sb.append(this.data); } first = false; if (!first) sb.append(", "); sb.append("comment:"); if (this.comment == null) { sb.append("null"); } else { sb.append(this.comment); } first = false; if (!first) sb.append(", "); sb.append("framework:"); if (this.framework == null) { sb.append("null"); } else { sb.append(this.framework); } first = false; if (!first) sb.append(", "); sb.append("frameworkVersion:"); if (this.frameworkVersion == null) { sb.append("null"); } else { sb.append(this.frameworkVersion); } first = false; if (!first) sb.append(", "); sb.append("dependencyType:"); sb.append(this.dependencyType); first = false; if (!first) sb.append(", "); sb.append("childrenBlockSizeByte:"); sb.append(this.childrenBlockSizeByte); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createDependency_argsStandardSchemeFactory implements SchemeFactory { public user_createDependency_argsStandardScheme getScheme() { return new user_createDependency_argsStandardScheme(); } } private static class user_createDependency_argsStandardScheme extends StandardScheme<user_createDependency_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createDependency_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PARENTS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list96 = iprot.readListBegin(); struct.parents = new ArrayList<String>(_list96.size); for (int _i97 = 0; _i97 < _list96.size; ++_i97) { String _elem98; _elem98 = iprot.readString(); struct.parents.add(_elem98); } iprot.readListEnd(); } struct.setParentsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // CHILDREN if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list99 = iprot.readListBegin(); struct.children = new ArrayList<String>(_list99.size); for (int _i100 = 0; _i100 < _list99.size; ++_i100) { String _elem101; _elem101 = iprot.readString(); struct.children.add(_elem101); } iprot.readListEnd(); } struct.setChildrenIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // COMMAND_PREFIX if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.commandPrefix = iprot.readString(); struct.setCommandPrefixIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // DATA if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list102 = iprot.readListBegin(); struct.data = new ArrayList<ByteBuffer>(_list102.size); for (int _i103 = 0; _i103 < _list102.size; ++_i103) { ByteBuffer _elem104; _elem104 = iprot.readBinary(); struct.data.add(_elem104); } iprot.readListEnd(); } struct.setDataIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // COMMENT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.comment = iprot.readString(); struct.setCommentIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // FRAMEWORK if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.framework = iprot.readString(); struct.setFrameworkIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // FRAMEWORK_VERSION if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.frameworkVersion = iprot.readString(); struct.setFrameworkVersionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // DEPENDENCY_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.dependencyType = iprot.readI32(); struct.setDependencyTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 9: // CHILDREN_BLOCK_SIZE_BYTE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.childrenBlockSizeByte = iprot.readI64(); struct.setChildrenBlockSizeByteIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createDependency_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.parents != null) { oprot.writeFieldBegin(PARENTS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.parents.size())); for (String _iter105 : struct.parents) { oprot.writeString(_iter105); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.children != null) { oprot.writeFieldBegin(CHILDREN_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.children.size())); for (String _iter106 : struct.children) { oprot.writeString(_iter106); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.commandPrefix != null) { oprot.writeFieldBegin(COMMAND_PREFIX_FIELD_DESC); oprot.writeString(struct.commandPrefix); oprot.writeFieldEnd(); } if (struct.data != null) { oprot.writeFieldBegin(DATA_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.data.size())); for (ByteBuffer _iter107 : struct.data) { oprot.writeBinary(_iter107); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.comment != null) { oprot.writeFieldBegin(COMMENT_FIELD_DESC); oprot.writeString(struct.comment); oprot.writeFieldEnd(); } if (struct.framework != null) { oprot.writeFieldBegin(FRAMEWORK_FIELD_DESC); oprot.writeString(struct.framework); oprot.writeFieldEnd(); } if (struct.frameworkVersion != null) { oprot.writeFieldBegin(FRAMEWORK_VERSION_FIELD_DESC); oprot.writeString(struct.frameworkVersion); oprot.writeFieldEnd(); } oprot.writeFieldBegin(DEPENDENCY_TYPE_FIELD_DESC); oprot.writeI32(struct.dependencyType); oprot.writeFieldEnd(); oprot.writeFieldBegin(CHILDREN_BLOCK_SIZE_BYTE_FIELD_DESC); oprot.writeI64(struct.childrenBlockSizeByte); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createDependency_argsTupleSchemeFactory implements SchemeFactory { public user_createDependency_argsTupleScheme getScheme() { return new user_createDependency_argsTupleScheme(); } } private static class user_createDependency_argsTupleScheme extends TupleScheme<user_createDependency_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createDependency_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetParents()) { optionals.set(0); } if (struct.isSetChildren()) { optionals.set(1); } if (struct.isSetCommandPrefix()) { optionals.set(2); } if (struct.isSetData()) { optionals.set(3); } if (struct.isSetComment()) { optionals.set(4); } if (struct.isSetFramework()) { optionals.set(5); } if (struct.isSetFrameworkVersion()) { optionals.set(6); } if (struct.isSetDependencyType()) { optionals.set(7); } if (struct.isSetChildrenBlockSizeByte()) { optionals.set(8); } oprot.writeBitSet(optionals, 9); if (struct.isSetParents()) { { oprot.writeI32(struct.parents.size()); for (String _iter108 : struct.parents) { oprot.writeString(_iter108); } } } if (struct.isSetChildren()) { { oprot.writeI32(struct.children.size()); for (String _iter109 : struct.children) { oprot.writeString(_iter109); } } } if (struct.isSetCommandPrefix()) { oprot.writeString(struct.commandPrefix); } if (struct.isSetData()) { { oprot.writeI32(struct.data.size()); for (ByteBuffer _iter110 : struct.data) { oprot.writeBinary(_iter110); } } } if (struct.isSetComment()) { oprot.writeString(struct.comment); } if (struct.isSetFramework()) { oprot.writeString(struct.framework); } if (struct.isSetFrameworkVersion()) { oprot.writeString(struct.frameworkVersion); } if (struct.isSetDependencyType()) { oprot.writeI32(struct.dependencyType); } if (struct.isSetChildrenBlockSizeByte()) { oprot.writeI64(struct.childrenBlockSizeByte); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createDependency_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(9); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list111 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.parents = new ArrayList<String>(_list111.size); for (int _i112 = 0; _i112 < _list111.size; ++_i112) { String _elem113; _elem113 = iprot.readString(); struct.parents.add(_elem113); } } struct.setParentsIsSet(true); } if (incoming.get(1)) { { org.apache.thrift.protocol.TList _list114 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.children = new ArrayList<String>(_list114.size); for (int _i115 = 0; _i115 < _list114.size; ++_i115) { String _elem116; _elem116 = iprot.readString(); struct.children.add(_elem116); } } struct.setChildrenIsSet(true); } if (incoming.get(2)) { struct.commandPrefix = iprot.readString(); struct.setCommandPrefixIsSet(true); } if (incoming.get(3)) { { org.apache.thrift.protocol.TList _list117 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.data = new ArrayList<ByteBuffer>(_list117.size); for (int _i118 = 0; _i118 < _list117.size; ++_i118) { ByteBuffer _elem119; _elem119 = iprot.readBinary(); struct.data.add(_elem119); } } struct.setDataIsSet(true); } if (incoming.get(4)) { struct.comment = iprot.readString(); struct.setCommentIsSet(true); } if (incoming.get(5)) { struct.framework = iprot.readString(); struct.setFrameworkIsSet(true); } if (incoming.get(6)) { struct.frameworkVersion = iprot.readString(); struct.setFrameworkVersionIsSet(true); } if (incoming.get(7)) { struct.dependencyType = iprot.readI32(); struct.setDependencyTypeIsSet(true); } if (incoming.get(8)) { struct.childrenBlockSizeByte = iprot.readI64(); struct.setChildrenBlockSizeByteIsSet(true); } } } } public static class user_createDependency_result implements org.apache.thrift.TBase<user_createDependency_result, user_createDependency_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_createDependency_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createDependency_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField E_A_FIELD_DESC = new org.apache.thrift.protocol.TField("eA", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField E_B_FIELD_DESC = new org.apache.thrift.protocol.TField("eB", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)5); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createDependency_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createDependency_resultTupleSchemeFactory()); } public int success; // required public InvalidPathException eI; // required public FileDoesNotExistException eF; // required public FileAlreadyExistException eA; // required public BlockInfoException eB; // required public TachyonException eT; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_I((short)1, "eI"), E_F((short)2, "eF"), E_A((short)3, "eA"), E_B((short)4, "eB"), E_T((short)5, "eT"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_I return E_I; case 2: // E_F return E_F; case 3: // E_A return E_A; case 4: // E_B return E_B; case 5: // E_T return E_T; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_F, new org.apache.thrift.meta_data.FieldMetaData("eF", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_A, new org.apache.thrift.meta_data.FieldMetaData("eA", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_B, new org.apache.thrift.meta_data.FieldMetaData("eB", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_T, new org.apache.thrift.meta_data.FieldMetaData("eT", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createDependency_result.class, metaDataMap); } public user_createDependency_result() { } public user_createDependency_result( int success, InvalidPathException eI, FileDoesNotExistException eF, FileAlreadyExistException eA, BlockInfoException eB, TachyonException eT) { this(); this.success = success; setSuccessIsSet(true); this.eI = eI; this.eF = eF; this.eA = eA; this.eB = eB; this.eT = eT; } /** * Performs a deep copy on <i>other</i>. */ public user_createDependency_result(user_createDependency_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } if (other.isSetEF()) { this.eF = new FileDoesNotExistException(other.eF); } if (other.isSetEA()) { this.eA = new FileAlreadyExistException(other.eA); } if (other.isSetEB()) { this.eB = new BlockInfoException(other.eB); } if (other.isSetET()) { this.eT = new TachyonException(other.eT); } } public user_createDependency_result deepCopy() { return new user_createDependency_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.eI = null; this.eF = null; this.eA = null; this.eB = null; this.eT = null; } public int getSuccess() { return this.success; } public user_createDependency_result setSuccess(int success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public InvalidPathException getEI() { return this.eI; } public user_createDependency_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public FileDoesNotExistException getEF() { return this.eF; } public user_createDependency_result setEF(FileDoesNotExistException eF) { this.eF = eF; return this; } public void unsetEF() { this.eF = null; } /** Returns true if field eF is set (has been assigned a value) and false otherwise */ public boolean isSetEF() { return this.eF != null; } public void setEFIsSet(boolean value) { if (!value) { this.eF = null; } } public FileAlreadyExistException getEA() { return this.eA; } public user_createDependency_result setEA(FileAlreadyExistException eA) { this.eA = eA; return this; } public void unsetEA() { this.eA = null; } /** Returns true if field eA is set (has been assigned a value) and false otherwise */ public boolean isSetEA() { return this.eA != null; } public void setEAIsSet(boolean value) { if (!value) { this.eA = null; } } public BlockInfoException getEB() { return this.eB; } public user_createDependency_result setEB(BlockInfoException eB) { this.eB = eB; return this; } public void unsetEB() { this.eB = null; } /** Returns true if field eB is set (has been assigned a value) and false otherwise */ public boolean isSetEB() { return this.eB != null; } public void setEBIsSet(boolean value) { if (!value) { this.eB = null; } } public TachyonException getET() { return this.eT; } public user_createDependency_result setET(TachyonException eT) { this.eT = eT; return this; } public void unsetET() { this.eT = null; } /** Returns true if field eT is set (has been assigned a value) and false otherwise */ public boolean isSetET() { return this.eT != null; } public void setETIsSet(boolean value) { if (!value) { this.eT = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Integer)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; case E_F: if (value == null) { unsetEF(); } else { setEF((FileDoesNotExistException)value); } break; case E_A: if (value == null) { unsetEA(); } else { setEA((FileAlreadyExistException)value); } break; case E_B: if (value == null) { unsetEB(); } else { setEB((BlockInfoException)value); } break; case E_T: if (value == null) { unsetET(); } else { setET((TachyonException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Integer.valueOf(getSuccess()); case E_I: return getEI(); case E_F: return getEF(); case E_A: return getEA(); case E_B: return getEB(); case E_T: return getET(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_I: return isSetEI(); case E_F: return isSetEF(); case E_A: return isSetEA(); case E_B: return isSetEB(); case E_T: return isSetET(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createDependency_result) return this.equals((user_createDependency_result)that); return false; } public boolean equals(user_createDependency_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } boolean this_present_eF = true && this.isSetEF(); boolean that_present_eF = true && that.isSetEF(); if (this_present_eF || that_present_eF) { if (!(this_present_eF && that_present_eF)) return false; if (!this.eF.equals(that.eF)) return false; } boolean this_present_eA = true && this.isSetEA(); boolean that_present_eA = true && that.isSetEA(); if (this_present_eA || that_present_eA) { if (!(this_present_eA && that_present_eA)) return false; if (!this.eA.equals(that.eA)) return false; } boolean this_present_eB = true && this.isSetEB(); boolean that_present_eB = true && that.isSetEB(); if (this_present_eB || that_present_eB) { if (!(this_present_eB && that_present_eB)) return false; if (!this.eB.equals(that.eB)) return false; } boolean this_present_eT = true && this.isSetET(); boolean that_present_eT = true && that.isSetET(); if (this_present_eT || that_present_eT) { if (!(this_present_eT && that_present_eT)) return false; if (!this.eT.equals(that.eT)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createDependency_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEF()).compareTo(other.isSetEF()); if (lastComparison != 0) { return lastComparison; } if (isSetEF()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eF, other.eF); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEA()).compareTo(other.isSetEA()); if (lastComparison != 0) { return lastComparison; } if (isSetEA()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eA, other.eA); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEB()).compareTo(other.isSetEB()); if (lastComparison != 0) { return lastComparison; } if (isSetEB()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eB, other.eB); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetET()).compareTo(other.isSetET()); if (lastComparison != 0) { return lastComparison; } if (isSetET()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eT, other.eT); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createDependency_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; if (!first) sb.append(", "); sb.append("eF:"); if (this.eF == null) { sb.append("null"); } else { sb.append(this.eF); } first = false; if (!first) sb.append(", "); sb.append("eA:"); if (this.eA == null) { sb.append("null"); } else { sb.append(this.eA); } first = false; if (!first) sb.append(", "); sb.append("eB:"); if (this.eB == null) { sb.append("null"); } else { sb.append(this.eB); } first = false; if (!first) sb.append(", "); sb.append("eT:"); if (this.eT == null) { sb.append("null"); } else { sb.append(this.eT); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createDependency_resultStandardSchemeFactory implements SchemeFactory { public user_createDependency_resultStandardScheme getScheme() { return new user_createDependency_resultStandardScheme(); } } private static class user_createDependency_resultStandardScheme extends StandardScheme<user_createDependency_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createDependency_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_F if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // E_A if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eA = new FileAlreadyExistException(); struct.eA.read(iprot); struct.setEAIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // E_B if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // E_T if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eT = new TachyonException(); struct.eT.read(iprot); struct.setETIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createDependency_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI32(struct.success); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } if (struct.eF != null) { oprot.writeFieldBegin(E_F_FIELD_DESC); struct.eF.write(oprot); oprot.writeFieldEnd(); } if (struct.eA != null) { oprot.writeFieldBegin(E_A_FIELD_DESC); struct.eA.write(oprot); oprot.writeFieldEnd(); } if (struct.eB != null) { oprot.writeFieldBegin(E_B_FIELD_DESC); struct.eB.write(oprot); oprot.writeFieldEnd(); } if (struct.eT != null) { oprot.writeFieldBegin(E_T_FIELD_DESC); struct.eT.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createDependency_resultTupleSchemeFactory implements SchemeFactory { public user_createDependency_resultTupleScheme getScheme() { return new user_createDependency_resultTupleScheme(); } } private static class user_createDependency_resultTupleScheme extends TupleScheme<user_createDependency_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createDependency_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetEI()) { optionals.set(1); } if (struct.isSetEF()) { optionals.set(2); } if (struct.isSetEA()) { optionals.set(3); } if (struct.isSetEB()) { optionals.set(4); } if (struct.isSetET()) { optionals.set(5); } oprot.writeBitSet(optionals, 6); if (struct.isSetSuccess()) { oprot.writeI32(struct.success); } if (struct.isSetEI()) { struct.eI.write(oprot); } if (struct.isSetEF()) { struct.eF.write(oprot); } if (struct.isSetEA()) { struct.eA.write(oprot); } if (struct.isSetEB()) { struct.eB.write(oprot); } if (struct.isSetET()) { struct.eT.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createDependency_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } if (incoming.get(2)) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } if (incoming.get(3)) { struct.eA = new FileAlreadyExistException(); struct.eA.read(iprot); struct.setEAIsSet(true); } if (incoming.get(4)) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } if (incoming.get(5)) { struct.eT = new TachyonException(); struct.eT.read(iprot); struct.setETIsSet(true); } } } } public static class user_getClientDependencyInfo_args implements org.apache.thrift.TBase<user_getClientDependencyInfo_args, user_getClientDependencyInfo_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getClientDependencyInfo_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientDependencyInfo_args"); private static final org.apache.thrift.protocol.TField DEPENDENCY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("dependencyId", org.apache.thrift.protocol.TType.I32, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getClientDependencyInfo_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getClientDependencyInfo_argsTupleSchemeFactory()); } public int dependencyId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { DEPENDENCY_ID((short)1, "dependencyId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // DEPENDENCY_ID return DEPENDENCY_ID; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __DEPENDENCYID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.DEPENDENCY_ID, new org.apache.thrift.meta_data.FieldMetaData("dependencyId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientDependencyInfo_args.class, metaDataMap); } public user_getClientDependencyInfo_args() { } public user_getClientDependencyInfo_args( int dependencyId) { this(); this.dependencyId = dependencyId; setDependencyIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_getClientDependencyInfo_args(user_getClientDependencyInfo_args other) { __isset_bitfield = other.__isset_bitfield; this.dependencyId = other.dependencyId; } public user_getClientDependencyInfo_args deepCopy() { return new user_getClientDependencyInfo_args(this); } @Override public void clear() { setDependencyIdIsSet(false); this.dependencyId = 0; } public int getDependencyId() { return this.dependencyId; } public user_getClientDependencyInfo_args setDependencyId(int dependencyId) { this.dependencyId = dependencyId; setDependencyIdIsSet(true); return this; } public void unsetDependencyId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DEPENDENCYID_ISSET_ID); } /** Returns true if field dependencyId is set (has been assigned a value) and false otherwise */ public boolean isSetDependencyId() { return EncodingUtils.testBit(__isset_bitfield, __DEPENDENCYID_ISSET_ID); } public void setDependencyIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DEPENDENCYID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case DEPENDENCY_ID: if (value == null) { unsetDependencyId(); } else { setDependencyId((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case DEPENDENCY_ID: return Integer.valueOf(getDependencyId()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case DEPENDENCY_ID: return isSetDependencyId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getClientDependencyInfo_args) return this.equals((user_getClientDependencyInfo_args)that); return false; } public boolean equals(user_getClientDependencyInfo_args that) { if (that == null) return false; boolean this_present_dependencyId = true; boolean that_present_dependencyId = true; if (this_present_dependencyId || that_present_dependencyId) { if (!(this_present_dependencyId && that_present_dependencyId)) return false; if (this.dependencyId != that.dependencyId) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getClientDependencyInfo_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetDependencyId()).compareTo(other.isSetDependencyId()); if (lastComparison != 0) { return lastComparison; } if (isSetDependencyId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dependencyId, other.dependencyId); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getClientDependencyInfo_args("); boolean first = true; sb.append("dependencyId:"); sb.append(this.dependencyId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getClientDependencyInfo_argsStandardSchemeFactory implements SchemeFactory { public user_getClientDependencyInfo_argsStandardScheme getScheme() { return new user_getClientDependencyInfo_argsStandardScheme(); } } private static class user_getClientDependencyInfo_argsStandardScheme extends StandardScheme<user_getClientDependencyInfo_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientDependencyInfo_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // DEPENDENCY_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.dependencyId = iprot.readI32(); struct.setDependencyIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientDependencyInfo_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(DEPENDENCY_ID_FIELD_DESC); oprot.writeI32(struct.dependencyId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getClientDependencyInfo_argsTupleSchemeFactory implements SchemeFactory { public user_getClientDependencyInfo_argsTupleScheme getScheme() { return new user_getClientDependencyInfo_argsTupleScheme(); } } private static class user_getClientDependencyInfo_argsTupleScheme extends TupleScheme<user_getClientDependencyInfo_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientDependencyInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetDependencyId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetDependencyId()) { oprot.writeI32(struct.dependencyId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientDependencyInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.dependencyId = iprot.readI32(); struct.setDependencyIdIsSet(true); } } } } public static class user_getClientDependencyInfo_result implements org.apache.thrift.TBase<user_getClientDependencyInfo_result, user_getClientDependencyInfo_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getClientDependencyInfo_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientDependencyInfo_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getClientDependencyInfo_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getClientDependencyInfo_resultTupleSchemeFactory()); } public ClientDependencyInfo success; // required public DependencyDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientDependencyInfo.class))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientDependencyInfo_result.class, metaDataMap); } public user_getClientDependencyInfo_result() { } public user_getClientDependencyInfo_result( ClientDependencyInfo success, DependencyDoesNotExistException e) { this(); this.success = success; this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_getClientDependencyInfo_result(user_getClientDependencyInfo_result other) { if (other.isSetSuccess()) { this.success = new ClientDependencyInfo(other.success); } if (other.isSetE()) { this.e = new DependencyDoesNotExistException(other.e); } } public user_getClientDependencyInfo_result deepCopy() { return new user_getClientDependencyInfo_result(this); } @Override public void clear() { this.success = null; this.e = null; } public ClientDependencyInfo getSuccess() { return this.success; } public user_getClientDependencyInfo_result setSuccess(ClientDependencyInfo success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public DependencyDoesNotExistException getE() { return this.e; } public user_getClientDependencyInfo_result setE(DependencyDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((ClientDependencyInfo)value); } break; case E: if (value == null) { unsetE(); } else { setE((DependencyDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getClientDependencyInfo_result) return this.equals((user_getClientDependencyInfo_result)that); return false; } public boolean equals(user_getClientDependencyInfo_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getClientDependencyInfo_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getClientDependencyInfo_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getClientDependencyInfo_resultStandardSchemeFactory implements SchemeFactory { public user_getClientDependencyInfo_resultStandardScheme getScheme() { return new user_getClientDependencyInfo_resultStandardScheme(); } } private static class user_getClientDependencyInfo_resultStandardScheme extends StandardScheme<user_getClientDependencyInfo_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientDependencyInfo_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new ClientDependencyInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new DependencyDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientDependencyInfo_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getClientDependencyInfo_resultTupleSchemeFactory implements SchemeFactory { public user_getClientDependencyInfo_resultTupleScheme getScheme() { return new user_getClientDependencyInfo_resultTupleScheme(); } } private static class user_getClientDependencyInfo_resultTupleScheme extends TupleScheme<user_getClientDependencyInfo_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientDependencyInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientDependencyInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new ClientDependencyInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new DependencyDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_reportLostFile_args implements org.apache.thrift.TBase<user_reportLostFile_args, user_reportLostFile_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_reportLostFile_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_reportLostFile_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_reportLostFile_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_reportLostFile_argsTupleSchemeFactory()); } public int fileId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_reportLostFile_args.class, metaDataMap); } public user_reportLostFile_args() { } public user_reportLostFile_args( int fileId) { this(); this.fileId = fileId; setFileIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_reportLostFile_args(user_reportLostFile_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; } public user_reportLostFile_args deepCopy() { return new user_reportLostFile_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; } public int getFileId() { return this.fileId; } public user_reportLostFile_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_reportLostFile_args) return this.equals((user_reportLostFile_args)that); return false; } public boolean equals(user_reportLostFile_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_reportLostFile_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_reportLostFile_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_reportLostFile_argsStandardSchemeFactory implements SchemeFactory { public user_reportLostFile_argsStandardScheme getScheme() { return new user_reportLostFile_argsStandardScheme(); } } private static class user_reportLostFile_argsStandardScheme extends StandardScheme<user_reportLostFile_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_reportLostFile_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_reportLostFile_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_reportLostFile_argsTupleSchemeFactory implements SchemeFactory { public user_reportLostFile_argsTupleScheme getScheme() { return new user_reportLostFile_argsTupleScheme(); } } private static class user_reportLostFile_argsTupleScheme extends TupleScheme<user_reportLostFile_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_reportLostFile_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_reportLostFile_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } } } } public static class user_reportLostFile_result implements org.apache.thrift.TBase<user_reportLostFile_result, user_reportLostFile_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_reportLostFile_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_reportLostFile_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_reportLostFile_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_reportLostFile_resultTupleSchemeFactory()); } public FileDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_reportLostFile_result.class, metaDataMap); } public user_reportLostFile_result() { } public user_reportLostFile_result( FileDoesNotExistException e) { this(); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_reportLostFile_result(user_reportLostFile_result other) { if (other.isSetE()) { this.e = new FileDoesNotExistException(other.e); } } public user_reportLostFile_result deepCopy() { return new user_reportLostFile_result(this); } @Override public void clear() { this.e = null; } public FileDoesNotExistException getE() { return this.e; } public user_reportLostFile_result setE(FileDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((FileDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_reportLostFile_result) return this.equals((user_reportLostFile_result)that); return false; } public boolean equals(user_reportLostFile_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_reportLostFile_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_reportLostFile_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_reportLostFile_resultStandardSchemeFactory implements SchemeFactory { public user_reportLostFile_resultStandardScheme getScheme() { return new user_reportLostFile_resultStandardScheme(); } } private static class user_reportLostFile_resultStandardScheme extends StandardScheme<user_reportLostFile_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_reportLostFile_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_reportLostFile_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_reportLostFile_resultTupleSchemeFactory implements SchemeFactory { public user_reportLostFile_resultTupleScheme getScheme() { return new user_reportLostFile_resultTupleScheme(); } } private static class user_reportLostFile_resultTupleScheme extends TupleScheme<user_reportLostFile_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_reportLostFile_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_reportLostFile_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_requestFilesInDependency_args implements org.apache.thrift.TBase<user_requestFilesInDependency_args, user_requestFilesInDependency_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_requestFilesInDependency_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_requestFilesInDependency_args"); private static final org.apache.thrift.protocol.TField DEP_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("depId", org.apache.thrift.protocol.TType.I32, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_requestFilesInDependency_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_requestFilesInDependency_argsTupleSchemeFactory()); } public int depId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { DEP_ID((short)1, "depId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // DEP_ID return DEP_ID; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __DEPID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.DEP_ID, new org.apache.thrift.meta_data.FieldMetaData("depId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_requestFilesInDependency_args.class, metaDataMap); } public user_requestFilesInDependency_args() { } public user_requestFilesInDependency_args( int depId) { this(); this.depId = depId; setDepIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_requestFilesInDependency_args(user_requestFilesInDependency_args other) { __isset_bitfield = other.__isset_bitfield; this.depId = other.depId; } public user_requestFilesInDependency_args deepCopy() { return new user_requestFilesInDependency_args(this); } @Override public void clear() { setDepIdIsSet(false); this.depId = 0; } public int getDepId() { return this.depId; } public user_requestFilesInDependency_args setDepId(int depId) { this.depId = depId; setDepIdIsSet(true); return this; } public void unsetDepId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DEPID_ISSET_ID); } /** Returns true if field depId is set (has been assigned a value) and false otherwise */ public boolean isSetDepId() { return EncodingUtils.testBit(__isset_bitfield, __DEPID_ISSET_ID); } public void setDepIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DEPID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case DEP_ID: if (value == null) { unsetDepId(); } else { setDepId((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case DEP_ID: return Integer.valueOf(getDepId()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case DEP_ID: return isSetDepId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_requestFilesInDependency_args) return this.equals((user_requestFilesInDependency_args)that); return false; } public boolean equals(user_requestFilesInDependency_args that) { if (that == null) return false; boolean this_present_depId = true; boolean that_present_depId = true; if (this_present_depId || that_present_depId) { if (!(this_present_depId && that_present_depId)) return false; if (this.depId != that.depId) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_requestFilesInDependency_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetDepId()).compareTo(other.isSetDepId()); if (lastComparison != 0) { return lastComparison; } if (isSetDepId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.depId, other.depId); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_requestFilesInDependency_args("); boolean first = true; sb.append("depId:"); sb.append(this.depId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_requestFilesInDependency_argsStandardSchemeFactory implements SchemeFactory { public user_requestFilesInDependency_argsStandardScheme getScheme() { return new user_requestFilesInDependency_argsStandardScheme(); } } private static class user_requestFilesInDependency_argsStandardScheme extends StandardScheme<user_requestFilesInDependency_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_requestFilesInDependency_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // DEP_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.depId = iprot.readI32(); struct.setDepIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_requestFilesInDependency_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(DEP_ID_FIELD_DESC); oprot.writeI32(struct.depId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_requestFilesInDependency_argsTupleSchemeFactory implements SchemeFactory { public user_requestFilesInDependency_argsTupleScheme getScheme() { return new user_requestFilesInDependency_argsTupleScheme(); } } private static class user_requestFilesInDependency_argsTupleScheme extends TupleScheme<user_requestFilesInDependency_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_requestFilesInDependency_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetDepId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetDepId()) { oprot.writeI32(struct.depId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_requestFilesInDependency_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.depId = iprot.readI32(); struct.setDepIdIsSet(true); } } } } public static class user_requestFilesInDependency_result implements org.apache.thrift.TBase<user_requestFilesInDependency_result, user_requestFilesInDependency_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_requestFilesInDependency_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_requestFilesInDependency_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_requestFilesInDependency_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_requestFilesInDependency_resultTupleSchemeFactory()); } public DependencyDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_requestFilesInDependency_result.class, metaDataMap); } public user_requestFilesInDependency_result() { } public user_requestFilesInDependency_result( DependencyDoesNotExistException e) { this(); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_requestFilesInDependency_result(user_requestFilesInDependency_result other) { if (other.isSetE()) { this.e = new DependencyDoesNotExistException(other.e); } } public user_requestFilesInDependency_result deepCopy() { return new user_requestFilesInDependency_result(this); } @Override public void clear() { this.e = null; } public DependencyDoesNotExistException getE() { return this.e; } public user_requestFilesInDependency_result setE(DependencyDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((DependencyDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_requestFilesInDependency_result) return this.equals((user_requestFilesInDependency_result)that); return false; } public boolean equals(user_requestFilesInDependency_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_requestFilesInDependency_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_requestFilesInDependency_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_requestFilesInDependency_resultStandardSchemeFactory implements SchemeFactory { public user_requestFilesInDependency_resultStandardScheme getScheme() { return new user_requestFilesInDependency_resultStandardScheme(); } } private static class user_requestFilesInDependency_resultStandardScheme extends StandardScheme<user_requestFilesInDependency_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_requestFilesInDependency_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new DependencyDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_requestFilesInDependency_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_requestFilesInDependency_resultTupleSchemeFactory implements SchemeFactory { public user_requestFilesInDependency_resultTupleScheme getScheme() { return new user_requestFilesInDependency_resultTupleScheme(); } } private static class user_requestFilesInDependency_resultTupleScheme extends TupleScheme<user_requestFilesInDependency_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_requestFilesInDependency_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_requestFilesInDependency_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.e = new DependencyDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_createFile_args implements org.apache.thrift.TBase<user_createFile_args, user_createFile_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_createFile_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createFile_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField UFS_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("ufsPath", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField BLOCK_SIZE_BYTE_FIELD_DESC = new org.apache.thrift.protocol.TField("blockSizeByte", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField RECURSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("recursive", org.apache.thrift.protocol.TType.BOOL, (short)4); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createFile_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createFile_argsTupleSchemeFactory()); } public String path; // required public String ufsPath; // required public long blockSizeByte; // required public boolean recursive; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PATH((short)1, "path"), UFS_PATH((short)2, "ufsPath"), BLOCK_SIZE_BYTE((short)3, "blockSizeByte"), RECURSIVE((short)4, "recursive"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // UFS_PATH return UFS_PATH; case 3: // BLOCK_SIZE_BYTE return BLOCK_SIZE_BYTE; case 4: // RECURSIVE return RECURSIVE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __BLOCKSIZEBYTE_ISSET_ID = 0; private static final int __RECURSIVE_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.UFS_PATH, new org.apache.thrift.meta_data.FieldMetaData("ufsPath", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.BLOCK_SIZE_BYTE, new org.apache.thrift.meta_data.FieldMetaData("blockSizeByte", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.RECURSIVE, new org.apache.thrift.meta_data.FieldMetaData("recursive", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createFile_args.class, metaDataMap); } public user_createFile_args() { } public user_createFile_args( String path, String ufsPath, long blockSizeByte, boolean recursive) { this(); this.path = path; this.ufsPath = ufsPath; this.blockSizeByte = blockSizeByte; setBlockSizeByteIsSet(true); this.recursive = recursive; setRecursiveIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_createFile_args(user_createFile_args other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetPath()) { this.path = other.path; } if (other.isSetUfsPath()) { this.ufsPath = other.ufsPath; } this.blockSizeByte = other.blockSizeByte; this.recursive = other.recursive; } public user_createFile_args deepCopy() { return new user_createFile_args(this); } @Override public void clear() { this.path = null; this.ufsPath = null; setBlockSizeByteIsSet(false); this.blockSizeByte = 0; setRecursiveIsSet(false); this.recursive = false; } public String getPath() { return this.path; } public user_createFile_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public String getUfsPath() { return this.ufsPath; } public user_createFile_args setUfsPath(String ufsPath) { this.ufsPath = ufsPath; return this; } public void unsetUfsPath() { this.ufsPath = null; } /** Returns true if field ufsPath is set (has been assigned a value) and false otherwise */ public boolean isSetUfsPath() { return this.ufsPath != null; } public void setUfsPathIsSet(boolean value) { if (!value) { this.ufsPath = null; } } public long getBlockSizeByte() { return this.blockSizeByte; } public user_createFile_args setBlockSizeByte(long blockSizeByte) { this.blockSizeByte = blockSizeByte; setBlockSizeByteIsSet(true); return this; } public void unsetBlockSizeByte() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKSIZEBYTE_ISSET_ID); } /** Returns true if field blockSizeByte is set (has been assigned a value) and false otherwise */ public boolean isSetBlockSizeByte() { return EncodingUtils.testBit(__isset_bitfield, __BLOCKSIZEBYTE_ISSET_ID); } public void setBlockSizeByteIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKSIZEBYTE_ISSET_ID, value); } public boolean isRecursive() { return this.recursive; } public user_createFile_args setRecursive(boolean recursive) { this.recursive = recursive; setRecursiveIsSet(true); return this; } public void unsetRecursive() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ public boolean isSetRecursive() { return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } public void setRecursiveIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case UFS_PATH: if (value == null) { unsetUfsPath(); } else { setUfsPath((String)value); } break; case BLOCK_SIZE_BYTE: if (value == null) { unsetBlockSizeByte(); } else { setBlockSizeByte((Long)value); } break; case RECURSIVE: if (value == null) { unsetRecursive(); } else { setRecursive((Boolean)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case UFS_PATH: return getUfsPath(); case BLOCK_SIZE_BYTE: return Long.valueOf(getBlockSizeByte()); case RECURSIVE: return Boolean.valueOf(isRecursive()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case UFS_PATH: return isSetUfsPath(); case BLOCK_SIZE_BYTE: return isSetBlockSizeByte(); case RECURSIVE: return isSetRecursive(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createFile_args) return this.equals((user_createFile_args)that); return false; } public boolean equals(user_createFile_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_ufsPath = true && this.isSetUfsPath(); boolean that_present_ufsPath = true && that.isSetUfsPath(); if (this_present_ufsPath || that_present_ufsPath) { if (!(this_present_ufsPath && that_present_ufsPath)) return false; if (!this.ufsPath.equals(that.ufsPath)) return false; } boolean this_present_blockSizeByte = true; boolean that_present_blockSizeByte = true; if (this_present_blockSizeByte || that_present_blockSizeByte) { if (!(this_present_blockSizeByte && that_present_blockSizeByte)) return false; if (this.blockSizeByte != that.blockSizeByte) return false; } boolean this_present_recursive = true; boolean that_present_recursive = true; if (this_present_recursive || that_present_recursive) { if (!(this_present_recursive && that_present_recursive)) return false; if (this.recursive != that.recursive) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createFile_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetUfsPath()).compareTo(other.isSetUfsPath()); if (lastComparison != 0) { return lastComparison; } if (isSetUfsPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ufsPath, other.ufsPath); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetBlockSizeByte()).compareTo(other.isSetBlockSizeByte()); if (lastComparison != 0) { return lastComparison; } if (isSetBlockSizeByte()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockSizeByte, other.blockSizeByte); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRecursive()).compareTo(other.isSetRecursive()); if (lastComparison != 0) { return lastComparison; } if (isSetRecursive()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recursive, other.recursive); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createFile_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("ufsPath:"); if (this.ufsPath == null) { sb.append("null"); } else { sb.append(this.ufsPath); } first = false; if (!first) sb.append(", "); sb.append("blockSizeByte:"); sb.append(this.blockSizeByte); first = false; if (!first) sb.append(", "); sb.append("recursive:"); sb.append(this.recursive); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createFile_argsStandardSchemeFactory implements SchemeFactory { public user_createFile_argsStandardScheme getScheme() { return new user_createFile_argsStandardScheme(); } } private static class user_createFile_argsStandardScheme extends StandardScheme<user_createFile_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createFile_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // UFS_PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.ufsPath = iprot.readString(); struct.setUfsPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // BLOCK_SIZE_BYTE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.blockSizeByte = iprot.readI64(); struct.setBlockSizeByteIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // RECURSIVE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createFile_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } if (struct.ufsPath != null) { oprot.writeFieldBegin(UFS_PATH_FIELD_DESC); oprot.writeString(struct.ufsPath); oprot.writeFieldEnd(); } oprot.writeFieldBegin(BLOCK_SIZE_BYTE_FIELD_DESC); oprot.writeI64(struct.blockSizeByte); oprot.writeFieldEnd(); oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); oprot.writeBool(struct.recursive); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createFile_argsTupleSchemeFactory implements SchemeFactory { public user_createFile_argsTupleScheme getScheme() { return new user_createFile_argsTupleScheme(); } } private static class user_createFile_argsTupleScheme extends TupleScheme<user_createFile_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createFile_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetUfsPath()) { optionals.set(1); } if (struct.isSetBlockSizeByte()) { optionals.set(2); } if (struct.isSetRecursive()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetUfsPath()) { oprot.writeString(struct.ufsPath); } if (struct.isSetBlockSizeByte()) { oprot.writeI64(struct.blockSizeByte); } if (struct.isSetRecursive()) { oprot.writeBool(struct.recursive); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createFile_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.ufsPath = iprot.readString(); struct.setUfsPathIsSet(true); } if (incoming.get(2)) { struct.blockSizeByte = iprot.readI64(); struct.setBlockSizeByteIsSet(true); } if (incoming.get(3)) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } } } } public static class user_createFile_result implements org.apache.thrift.TBase<user_createFile_result, user_createFile_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_createFile_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createFile_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); private static final org.apache.thrift.protocol.TField E_R_FIELD_DESC = new org.apache.thrift.protocol.TField("eR", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField E_B_FIELD_DESC = new org.apache.thrift.protocol.TField("eB", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField E_S_FIELD_DESC = new org.apache.thrift.protocol.TField("eS", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)5); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createFile_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createFile_resultTupleSchemeFactory()); } public int success; // required public FileAlreadyExistException eR; // required public InvalidPathException eI; // required public BlockInfoException eB; // required public SuspectedFileSizeException eS; // required public TachyonException eT; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_R((short)1, "eR"), E_I((short)2, "eI"), E_B((short)3, "eB"), E_S((short)4, "eS"), E_T((short)5, "eT"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_R return E_R; case 2: // E_I return E_I; case 3: // E_B return E_B; case 4: // E_S return E_S; case 5: // E_T return E_T; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.E_R, new org.apache.thrift.meta_data.FieldMetaData("eR", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_B, new org.apache.thrift.meta_data.FieldMetaData("eB", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_S, new org.apache.thrift.meta_data.FieldMetaData("eS", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_T, new org.apache.thrift.meta_data.FieldMetaData("eT", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createFile_result.class, metaDataMap); } public user_createFile_result() { } public user_createFile_result( int success, FileAlreadyExistException eR, InvalidPathException eI, BlockInfoException eB, SuspectedFileSizeException eS, TachyonException eT) { this(); this.success = success; setSuccessIsSet(true); this.eR = eR; this.eI = eI; this.eB = eB; this.eS = eS; this.eT = eT; } /** * Performs a deep copy on <i>other</i>. */ public user_createFile_result(user_createFile_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetER()) { this.eR = new FileAlreadyExistException(other.eR); } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } if (other.isSetEB()) { this.eB = new BlockInfoException(other.eB); } if (other.isSetES()) { this.eS = new SuspectedFileSizeException(other.eS); } if (other.isSetET()) { this.eT = new TachyonException(other.eT); } } public user_createFile_result deepCopy() { return new user_createFile_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.eR = null; this.eI = null; this.eB = null; this.eS = null; this.eT = null; } public int getSuccess() { return this.success; } public user_createFile_result setSuccess(int success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileAlreadyExistException getER() { return this.eR; } public user_createFile_result setER(FileAlreadyExistException eR) { this.eR = eR; return this; } public void unsetER() { this.eR = null; } /** Returns true if field eR is set (has been assigned a value) and false otherwise */ public boolean isSetER() { return this.eR != null; } public void setERIsSet(boolean value) { if (!value) { this.eR = null; } } public InvalidPathException getEI() { return this.eI; } public user_createFile_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public BlockInfoException getEB() { return this.eB; } public user_createFile_result setEB(BlockInfoException eB) { this.eB = eB; return this; } public void unsetEB() { this.eB = null; } /** Returns true if field eB is set (has been assigned a value) and false otherwise */ public boolean isSetEB() { return this.eB != null; } public void setEBIsSet(boolean value) { if (!value) { this.eB = null; } } public SuspectedFileSizeException getES() { return this.eS; } public user_createFile_result setES(SuspectedFileSizeException eS) { this.eS = eS; return this; } public void unsetES() { this.eS = null; } /** Returns true if field eS is set (has been assigned a value) and false otherwise */ public boolean isSetES() { return this.eS != null; } public void setESIsSet(boolean value) { if (!value) { this.eS = null; } } public TachyonException getET() { return this.eT; } public user_createFile_result setET(TachyonException eT) { this.eT = eT; return this; } public void unsetET() { this.eT = null; } /** Returns true if field eT is set (has been assigned a value) and false otherwise */ public boolean isSetET() { return this.eT != null; } public void setETIsSet(boolean value) { if (!value) { this.eT = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Integer)value); } break; case E_R: if (value == null) { unsetER(); } else { setER((FileAlreadyExistException)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; case E_B: if (value == null) { unsetEB(); } else { setEB((BlockInfoException)value); } break; case E_S: if (value == null) { unsetES(); } else { setES((SuspectedFileSizeException)value); } break; case E_T: if (value == null) { unsetET(); } else { setET((TachyonException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Integer.valueOf(getSuccess()); case E_R: return getER(); case E_I: return getEI(); case E_B: return getEB(); case E_S: return getES(); case E_T: return getET(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_R: return isSetER(); case E_I: return isSetEI(); case E_B: return isSetEB(); case E_S: return isSetES(); case E_T: return isSetET(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createFile_result) return this.equals((user_createFile_result)that); return false; } public boolean equals(user_createFile_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_eR = true && this.isSetER(); boolean that_present_eR = true && that.isSetER(); if (this_present_eR || that_present_eR) { if (!(this_present_eR && that_present_eR)) return false; if (!this.eR.equals(that.eR)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } boolean this_present_eB = true && this.isSetEB(); boolean that_present_eB = true && that.isSetEB(); if (this_present_eB || that_present_eB) { if (!(this_present_eB && that_present_eB)) return false; if (!this.eB.equals(that.eB)) return false; } boolean this_present_eS = true && this.isSetES(); boolean that_present_eS = true && that.isSetES(); if (this_present_eS || that_present_eS) { if (!(this_present_eS && that_present_eS)) return false; if (!this.eS.equals(that.eS)) return false; } boolean this_present_eT = true && this.isSetET(); boolean that_present_eT = true && that.isSetET(); if (this_present_eT || that_present_eT) { if (!(this_present_eT && that_present_eT)) return false; if (!this.eT.equals(that.eT)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createFile_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetER()).compareTo(other.isSetER()); if (lastComparison != 0) { return lastComparison; } if (isSetER()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eR, other.eR); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEB()).compareTo(other.isSetEB()); if (lastComparison != 0) { return lastComparison; } if (isSetEB()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eB, other.eB); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetES()).compareTo(other.isSetES()); if (lastComparison != 0) { return lastComparison; } if (isSetES()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eS, other.eS); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetET()).compareTo(other.isSetET()); if (lastComparison != 0) { return lastComparison; } if (isSetET()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eT, other.eT); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createFile_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("eR:"); if (this.eR == null) { sb.append("null"); } else { sb.append(this.eR); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; if (!first) sb.append(", "); sb.append("eB:"); if (this.eB == null) { sb.append("null"); } else { sb.append(this.eB); } first = false; if (!first) sb.append(", "); sb.append("eS:"); if (this.eS == null) { sb.append("null"); } else { sb.append(this.eS); } first = false; if (!first) sb.append(", "); sb.append("eT:"); if (this.eT == null) { sb.append("null"); } else { sb.append(this.eT); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createFile_resultStandardSchemeFactory implements SchemeFactory { public user_createFile_resultStandardScheme getScheme() { return new user_createFile_resultStandardScheme(); } } private static class user_createFile_resultStandardScheme extends StandardScheme<user_createFile_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createFile_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_R if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eR = new FileAlreadyExistException(); struct.eR.read(iprot); struct.setERIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // E_B if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // E_S if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eS = new SuspectedFileSizeException(); struct.eS.read(iprot); struct.setESIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // E_T if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eT = new TachyonException(); struct.eT.read(iprot); struct.setETIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createFile_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI32(struct.success); oprot.writeFieldEnd(); } if (struct.eR != null) { oprot.writeFieldBegin(E_R_FIELD_DESC); struct.eR.write(oprot); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } if (struct.eB != null) { oprot.writeFieldBegin(E_B_FIELD_DESC); struct.eB.write(oprot); oprot.writeFieldEnd(); } if (struct.eS != null) { oprot.writeFieldBegin(E_S_FIELD_DESC); struct.eS.write(oprot); oprot.writeFieldEnd(); } if (struct.eT != null) { oprot.writeFieldBegin(E_T_FIELD_DESC); struct.eT.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createFile_resultTupleSchemeFactory implements SchemeFactory { public user_createFile_resultTupleScheme getScheme() { return new user_createFile_resultTupleScheme(); } } private static class user_createFile_resultTupleScheme extends TupleScheme<user_createFile_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createFile_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetER()) { optionals.set(1); } if (struct.isSetEI()) { optionals.set(2); } if (struct.isSetEB()) { optionals.set(3); } if (struct.isSetES()) { optionals.set(4); } if (struct.isSetET()) { optionals.set(5); } oprot.writeBitSet(optionals, 6); if (struct.isSetSuccess()) { oprot.writeI32(struct.success); } if (struct.isSetER()) { struct.eR.write(oprot); } if (struct.isSetEI()) { struct.eI.write(oprot); } if (struct.isSetEB()) { struct.eB.write(oprot); } if (struct.isSetES()) { struct.eS.write(oprot); } if (struct.isSetET()) { struct.eT.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createFile_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eR = new FileAlreadyExistException(); struct.eR.read(iprot); struct.setERIsSet(true); } if (incoming.get(2)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } if (incoming.get(3)) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } if (incoming.get(4)) { struct.eS = new SuspectedFileSizeException(); struct.eS.read(iprot); struct.setESIsSet(true); } if (incoming.get(5)) { struct.eT = new TachyonException(); struct.eT.read(iprot); struct.setETIsSet(true); } } } } public static class user_createNewBlock_args implements org.apache.thrift.TBase<user_createNewBlock_args, user_createNewBlock_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_createNewBlock_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createNewBlock_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createNewBlock_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createNewBlock_argsTupleSchemeFactory()); } public int fileId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createNewBlock_args.class, metaDataMap); } public user_createNewBlock_args() { } public user_createNewBlock_args( int fileId) { this(); this.fileId = fileId; setFileIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_createNewBlock_args(user_createNewBlock_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; } public user_createNewBlock_args deepCopy() { return new user_createNewBlock_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; } public int getFileId() { return this.fileId; } public user_createNewBlock_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createNewBlock_args) return this.equals((user_createNewBlock_args)that); return false; } public boolean equals(user_createNewBlock_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createNewBlock_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createNewBlock_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createNewBlock_argsStandardSchemeFactory implements SchemeFactory { public user_createNewBlock_argsStandardScheme getScheme() { return new user_createNewBlock_argsStandardScheme(); } } private static class user_createNewBlock_argsStandardScheme extends StandardScheme<user_createNewBlock_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createNewBlock_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createNewBlock_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createNewBlock_argsTupleSchemeFactory implements SchemeFactory { public user_createNewBlock_argsTupleScheme getScheme() { return new user_createNewBlock_argsTupleScheme(); } } private static class user_createNewBlock_argsTupleScheme extends TupleScheme<user_createNewBlock_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createNewBlock_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createNewBlock_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } } } } public static class user_createNewBlock_result implements org.apache.thrift.TBase<user_createNewBlock_result, user_createNewBlock_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_createNewBlock_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createNewBlock_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createNewBlock_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createNewBlock_resultTupleSchemeFactory()); } public long success; // required public FileDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createNewBlock_result.class, metaDataMap); } public user_createNewBlock_result() { } public user_createNewBlock_result( long success, FileDoesNotExistException e) { this(); this.success = success; setSuccessIsSet(true); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_createNewBlock_result(user_createNewBlock_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new FileDoesNotExistException(other.e); } } public user_createNewBlock_result deepCopy() { return new user_createNewBlock_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.e = null; } public long getSuccess() { return this.success; } public user_createNewBlock_result setSuccess(long success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileDoesNotExistException getE() { return this.e; } public user_createNewBlock_result setE(FileDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Long)value); } break; case E: if (value == null) { unsetE(); } else { setE((FileDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Long.valueOf(getSuccess()); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createNewBlock_result) return this.equals((user_createNewBlock_result)that); return false; } public boolean equals(user_createNewBlock_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createNewBlock_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createNewBlock_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createNewBlock_resultStandardSchemeFactory implements SchemeFactory { public user_createNewBlock_resultStandardScheme getScheme() { return new user_createNewBlock_resultStandardScheme(); } } private static class user_createNewBlock_resultStandardScheme extends StandardScheme<user_createNewBlock_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createNewBlock_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createNewBlock_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI64(struct.success); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createNewBlock_resultTupleSchemeFactory implements SchemeFactory { public user_createNewBlock_resultTupleScheme getScheme() { return new user_createNewBlock_resultTupleScheme(); } } private static class user_createNewBlock_resultTupleScheme extends TupleScheme<user_createNewBlock_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createNewBlock_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeI64(struct.success); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createNewBlock_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_completeFile_args implements org.apache.thrift.TBase<user_completeFile_args, user_completeFile_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_completeFile_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_completeFile_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_completeFile_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_completeFile_argsTupleSchemeFactory()); } public int fileId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_completeFile_args.class, metaDataMap); } public user_completeFile_args() { } public user_completeFile_args( int fileId) { this(); this.fileId = fileId; setFileIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_completeFile_args(user_completeFile_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; } public user_completeFile_args deepCopy() { return new user_completeFile_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; } public int getFileId() { return this.fileId; } public user_completeFile_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_completeFile_args) return this.equals((user_completeFile_args)that); return false; } public boolean equals(user_completeFile_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_completeFile_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_completeFile_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_completeFile_argsStandardSchemeFactory implements SchemeFactory { public user_completeFile_argsStandardScheme getScheme() { return new user_completeFile_argsStandardScheme(); } } private static class user_completeFile_argsStandardScheme extends StandardScheme<user_completeFile_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_completeFile_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_completeFile_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_completeFile_argsTupleSchemeFactory implements SchemeFactory { public user_completeFile_argsTupleScheme getScheme() { return new user_completeFile_argsTupleScheme(); } } private static class user_completeFile_argsTupleScheme extends TupleScheme<user_completeFile_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_completeFile_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_completeFile_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } } } } public static class user_completeFile_result implements org.apache.thrift.TBase<user_completeFile_result, user_completeFile_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_completeFile_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_completeFile_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_completeFile_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_completeFile_resultTupleSchemeFactory()); } public FileDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_completeFile_result.class, metaDataMap); } public user_completeFile_result() { } public user_completeFile_result( FileDoesNotExistException e) { this(); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_completeFile_result(user_completeFile_result other) { if (other.isSetE()) { this.e = new FileDoesNotExistException(other.e); } } public user_completeFile_result deepCopy() { return new user_completeFile_result(this); } @Override public void clear() { this.e = null; } public FileDoesNotExistException getE() { return this.e; } public user_completeFile_result setE(FileDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((FileDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_completeFile_result) return this.equals((user_completeFile_result)that); return false; } public boolean equals(user_completeFile_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_completeFile_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_completeFile_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_completeFile_resultStandardSchemeFactory implements SchemeFactory { public user_completeFile_resultStandardScheme getScheme() { return new user_completeFile_resultStandardScheme(); } } private static class user_completeFile_resultStandardScheme extends StandardScheme<user_completeFile_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_completeFile_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_completeFile_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_completeFile_resultTupleSchemeFactory implements SchemeFactory { public user_completeFile_resultTupleScheme getScheme() { return new user_completeFile_resultTupleScheme(); } } private static class user_completeFile_resultTupleScheme extends TupleScheme<user_completeFile_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_completeFile_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_completeFile_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_getUserId_args implements org.apache.thrift.TBase<user_getUserId_args, user_getUserId_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getUserId_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getUserId_args"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getUserId_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getUserId_argsTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getUserId_args.class, metaDataMap); } public user_getUserId_args() { } /** * Performs a deep copy on <i>other</i>. */ public user_getUserId_args(user_getUserId_args other) { } public user_getUserId_args deepCopy() { return new user_getUserId_args(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getUserId_args) return this.equals((user_getUserId_args)that); return false; } public boolean equals(user_getUserId_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getUserId_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getUserId_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getUserId_argsStandardSchemeFactory implements SchemeFactory { public user_getUserId_argsStandardScheme getScheme() { return new user_getUserId_argsStandardScheme(); } } private static class user_getUserId_argsStandardScheme extends StandardScheme<user_getUserId_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getUserId_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getUserId_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getUserId_argsTupleSchemeFactory implements SchemeFactory { public user_getUserId_argsTupleScheme getScheme() { return new user_getUserId_argsTupleScheme(); } } private static class user_getUserId_argsTupleScheme extends TupleScheme<user_getUserId_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getUserId_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getUserId_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class user_getUserId_result implements org.apache.thrift.TBase<user_getUserId_result, user_getUserId_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getUserId_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getUserId_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getUserId_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getUserId_resultTupleSchemeFactory()); } public long success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getUserId_result.class, metaDataMap); } public user_getUserId_result() { } public user_getUserId_result( long success) { this(); this.success = success; setSuccessIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_getUserId_result(user_getUserId_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; } public user_getUserId_result deepCopy() { return new user_getUserId_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; } public long getSuccess() { return this.success; } public user_getUserId_result setSuccess(long success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Long)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Long.valueOf(getSuccess()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getUserId_result) return this.equals((user_getUserId_result)that); return false; } public boolean equals(user_getUserId_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getUserId_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getUserId_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getUserId_resultStandardSchemeFactory implements SchemeFactory { public user_getUserId_resultStandardScheme getScheme() { return new user_getUserId_resultStandardScheme(); } } private static class user_getUserId_resultStandardScheme extends StandardScheme<user_getUserId_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getUserId_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getUserId_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI64(struct.success); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getUserId_resultTupleSchemeFactory implements SchemeFactory { public user_getUserId_resultTupleScheme getScheme() { return new user_getUserId_resultTupleScheme(); } } private static class user_getUserId_resultTupleScheme extends TupleScheme<user_getUserId_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getUserId_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { oprot.writeI64(struct.success); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getUserId_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } } } } public static class user_getBlockId_args implements org.apache.thrift.TBase<user_getBlockId_args, user_getBlockId_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getBlockId_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getBlockId_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField INDEX_FIELD_DESC = new org.apache.thrift.protocol.TField("index", org.apache.thrift.protocol.TType.I32, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getBlockId_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getBlockId_argsTupleSchemeFactory()); } public int fileId; // required public int index; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"), INDEX((short)2, "index"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; case 2: // INDEX return INDEX; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private static final int __INDEX_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.INDEX, new org.apache.thrift.meta_data.FieldMetaData("index", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getBlockId_args.class, metaDataMap); } public user_getBlockId_args() { } public user_getBlockId_args( int fileId, int index) { this(); this.fileId = fileId; setFileIdIsSet(true); this.index = index; setIndexIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_getBlockId_args(user_getBlockId_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; this.index = other.index; } public user_getBlockId_args deepCopy() { return new user_getBlockId_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; setIndexIsSet(false); this.index = 0; } public int getFileId() { return this.fileId; } public user_getBlockId_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public int getIndex() { return this.index; } public user_getBlockId_args setIndex(int index) { this.index = index; setIndexIsSet(true); return this; } public void unsetIndex() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INDEX_ISSET_ID); } /** Returns true if field index is set (has been assigned a value) and false otherwise */ public boolean isSetIndex() { return EncodingUtils.testBit(__isset_bitfield, __INDEX_ISSET_ID); } public void setIndexIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INDEX_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case INDEX: if (value == null) { unsetIndex(); } else { setIndex((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); case INDEX: return Integer.valueOf(getIndex()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); case INDEX: return isSetIndex(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getBlockId_args) return this.equals((user_getBlockId_args)that); return false; } public boolean equals(user_getBlockId_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_index = true; boolean that_present_index = true; if (this_present_index || that_present_index) { if (!(this_present_index && that_present_index)) return false; if (this.index != that.index) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getBlockId_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetIndex()).compareTo(other.isSetIndex()); if (lastComparison != 0) { return lastComparison; } if (isSetIndex()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.index, other.index); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getBlockId_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("index:"); sb.append(this.index); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getBlockId_argsStandardSchemeFactory implements SchemeFactory { public user_getBlockId_argsStandardScheme getScheme() { return new user_getBlockId_argsStandardScheme(); } } private static class user_getBlockId_argsStandardScheme extends StandardScheme<user_getBlockId_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getBlockId_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // INDEX if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.index = iprot.readI32(); struct.setIndexIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getBlockId_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); oprot.writeFieldBegin(INDEX_FIELD_DESC); oprot.writeI32(struct.index); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getBlockId_argsTupleSchemeFactory implements SchemeFactory { public user_getBlockId_argsTupleScheme getScheme() { return new user_getBlockId_argsTupleScheme(); } } private static class user_getBlockId_argsTupleScheme extends TupleScheme<user_getBlockId_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getBlockId_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } if (struct.isSetIndex()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetIndex()) { oprot.writeI32(struct.index); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getBlockId_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(1)) { struct.index = iprot.readI32(); struct.setIndexIsSet(true); } } } } public static class user_getBlockId_result implements org.apache.thrift.TBase<user_getBlockId_result, user_getBlockId_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getBlockId_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getBlockId_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getBlockId_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getBlockId_resultTupleSchemeFactory()); } public long success; // required public FileDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getBlockId_result.class, metaDataMap); } public user_getBlockId_result() { } public user_getBlockId_result( long success, FileDoesNotExistException e) { this(); this.success = success; setSuccessIsSet(true); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_getBlockId_result(user_getBlockId_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new FileDoesNotExistException(other.e); } } public user_getBlockId_result deepCopy() { return new user_getBlockId_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.e = null; } public long getSuccess() { return this.success; } public user_getBlockId_result setSuccess(long success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileDoesNotExistException getE() { return this.e; } public user_getBlockId_result setE(FileDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Long)value); } break; case E: if (value == null) { unsetE(); } else { setE((FileDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Long.valueOf(getSuccess()); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getBlockId_result) return this.equals((user_getBlockId_result)that); return false; } public boolean equals(user_getBlockId_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getBlockId_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getBlockId_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getBlockId_resultStandardSchemeFactory implements SchemeFactory { public user_getBlockId_resultStandardScheme getScheme() { return new user_getBlockId_resultStandardScheme(); } } private static class user_getBlockId_resultStandardScheme extends StandardScheme<user_getBlockId_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getBlockId_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getBlockId_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI64(struct.success); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getBlockId_resultTupleSchemeFactory implements SchemeFactory { public user_getBlockId_resultTupleScheme getScheme() { return new user_getBlockId_resultTupleScheme(); } } private static class user_getBlockId_resultTupleScheme extends TupleScheme<user_getBlockId_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getBlockId_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeI64(struct.success); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getBlockId_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readI64(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_getWorker_args implements org.apache.thrift.TBase<user_getWorker_args, user_getWorker_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getWorker_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getWorker_args"); private static final org.apache.thrift.protocol.TField RANDOM_FIELD_DESC = new org.apache.thrift.protocol.TField("random", org.apache.thrift.protocol.TType.BOOL, (short)1); private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getWorker_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getWorker_argsTupleSchemeFactory()); } public boolean random; // required public String host; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { RANDOM((short)1, "random"), HOST((short)2, "host"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // RANDOM return RANDOM; case 2: // HOST return HOST; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __RANDOM_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.RANDOM, new org.apache.thrift.meta_data.FieldMetaData("random", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getWorker_args.class, metaDataMap); } public user_getWorker_args() { } public user_getWorker_args( boolean random, String host) { this(); this.random = random; setRandomIsSet(true); this.host = host; } /** * Performs a deep copy on <i>other</i>. */ public user_getWorker_args(user_getWorker_args other) { __isset_bitfield = other.__isset_bitfield; this.random = other.random; if (other.isSetHost()) { this.host = other.host; } } public user_getWorker_args deepCopy() { return new user_getWorker_args(this); } @Override public void clear() { setRandomIsSet(false); this.random = false; this.host = null; } public boolean isRandom() { return this.random; } public user_getWorker_args setRandom(boolean random) { this.random = random; setRandomIsSet(true); return this; } public void unsetRandom() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RANDOM_ISSET_ID); } /** Returns true if field random is set (has been assigned a value) and false otherwise */ public boolean isSetRandom() { return EncodingUtils.testBit(__isset_bitfield, __RANDOM_ISSET_ID); } public void setRandomIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RANDOM_ISSET_ID, value); } public String getHost() { return this.host; } public user_getWorker_args setHost(String host) { this.host = host; return this; } public void unsetHost() { this.host = null; } /** Returns true if field host is set (has been assigned a value) and false otherwise */ public boolean isSetHost() { return this.host != null; } public void setHostIsSet(boolean value) { if (!value) { this.host = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case RANDOM: if (value == null) { unsetRandom(); } else { setRandom((Boolean)value); } break; case HOST: if (value == null) { unsetHost(); } else { setHost((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case RANDOM: return Boolean.valueOf(isRandom()); case HOST: return getHost(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case RANDOM: return isSetRandom(); case HOST: return isSetHost(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getWorker_args) return this.equals((user_getWorker_args)that); return false; } public boolean equals(user_getWorker_args that) { if (that == null) return false; boolean this_present_random = true; boolean that_present_random = true; if (this_present_random || that_present_random) { if (!(this_present_random && that_present_random)) return false; if (this.random != that.random) return false; } boolean this_present_host = true && this.isSetHost(); boolean that_present_host = true && that.isSetHost(); if (this_present_host || that_present_host) { if (!(this_present_host && that_present_host)) return false; if (!this.host.equals(that.host)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getWorker_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetRandom()).compareTo(other.isSetRandom()); if (lastComparison != 0) { return lastComparison; } if (isSetRandom()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.random, other.random); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetHost()).compareTo(other.isSetHost()); if (lastComparison != 0) { return lastComparison; } if (isSetHost()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, other.host); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getWorker_args("); boolean first = true; sb.append("random:"); sb.append(this.random); first = false; if (!first) sb.append(", "); sb.append("host:"); if (this.host == null) { sb.append("null"); } else { sb.append(this.host); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getWorker_argsStandardSchemeFactory implements SchemeFactory { public user_getWorker_argsStandardScheme getScheme() { return new user_getWorker_argsStandardScheme(); } } private static class user_getWorker_argsStandardScheme extends StandardScheme<user_getWorker_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getWorker_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // RANDOM if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.random = iprot.readBool(); struct.setRandomIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // HOST if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.host = iprot.readString(); struct.setHostIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getWorker_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(RANDOM_FIELD_DESC); oprot.writeBool(struct.random); oprot.writeFieldEnd(); if (struct.host != null) { oprot.writeFieldBegin(HOST_FIELD_DESC); oprot.writeString(struct.host); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getWorker_argsTupleSchemeFactory implements SchemeFactory { public user_getWorker_argsTupleScheme getScheme() { return new user_getWorker_argsTupleScheme(); } } private static class user_getWorker_argsTupleScheme extends TupleScheme<user_getWorker_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getWorker_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetRandom()) { optionals.set(0); } if (struct.isSetHost()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetRandom()) { oprot.writeBool(struct.random); } if (struct.isSetHost()) { oprot.writeString(struct.host); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getWorker_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.random = iprot.readBool(); struct.setRandomIsSet(true); } if (incoming.get(1)) { struct.host = iprot.readString(); struct.setHostIsSet(true); } } } } public static class user_getWorker_result implements org.apache.thrift.TBase<user_getWorker_result, user_getWorker_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getWorker_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getWorker_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getWorker_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getWorker_resultTupleSchemeFactory()); } public NetAddress success; // required public NoWorkerException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NetAddress.class))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getWorker_result.class, metaDataMap); } public user_getWorker_result() { } public user_getWorker_result( NetAddress success, NoWorkerException e) { this(); this.success = success; this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_getWorker_result(user_getWorker_result other) { if (other.isSetSuccess()) { this.success = new NetAddress(other.success); } if (other.isSetE()) { this.e = new NoWorkerException(other.e); } } public user_getWorker_result deepCopy() { return new user_getWorker_result(this); } @Override public void clear() { this.success = null; this.e = null; } public NetAddress getSuccess() { return this.success; } public user_getWorker_result setSuccess(NetAddress success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public NoWorkerException getE() { return this.e; } public user_getWorker_result setE(NoWorkerException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((NetAddress)value); } break; case E: if (value == null) { unsetE(); } else { setE((NoWorkerException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getWorker_result) return this.equals((user_getWorker_result)that); return false; } public boolean equals(user_getWorker_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getWorker_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getWorker_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getWorker_resultStandardSchemeFactory implements SchemeFactory { public user_getWorker_resultStandardScheme getScheme() { return new user_getWorker_resultStandardScheme(); } } private static class user_getWorker_resultStandardScheme extends StandardScheme<user_getWorker_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getWorker_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new NetAddress(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new NoWorkerException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getWorker_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getWorker_resultTupleSchemeFactory implements SchemeFactory { public user_getWorker_resultTupleScheme getScheme() { return new user_getWorker_resultTupleScheme(); } } private static class user_getWorker_resultTupleScheme extends TupleScheme<user_getWorker_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getWorker_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getWorker_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new NetAddress(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new NoWorkerException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class getFileStatus_args implements org.apache.thrift.TBase<getFileStatus_args, getFileStatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<getFileStatus_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getFileStatus_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getFileStatus_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getFileStatus_argsTupleSchemeFactory()); } public int fileId; // required public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"), PATH((short)2, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; case 2: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getFileStatus_args.class, metaDataMap); } public getFileStatus_args() { } public getFileStatus_args( int fileId, String path) { this(); this.fileId = fileId; setFileIdIsSet(true); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public getFileStatus_args(getFileStatus_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; if (other.isSetPath()) { this.path = other.path; } } public getFileStatus_args deepCopy() { return new getFileStatus_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; this.path = null; } public int getFileId() { return this.fileId; } public getFileStatus_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public String getPath() { return this.path; } public getFileStatus_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getFileStatus_args) return this.equals((getFileStatus_args)that); return false; } public boolean equals(getFileStatus_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(getFileStatus_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getFileStatus_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getFileStatus_argsStandardSchemeFactory implements SchemeFactory { public getFileStatus_argsStandardScheme getScheme() { return new getFileStatus_argsStandardScheme(); } } private static class getFileStatus_argsStandardScheme extends StandardScheme<getFileStatus_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getFileStatus_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getFileStatus_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getFileStatus_argsTupleSchemeFactory implements SchemeFactory { public getFileStatus_argsTupleScheme getScheme() { return new getFileStatus_argsTupleScheme(); } } private static class getFileStatus_argsTupleScheme extends TupleScheme<getFileStatus_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getFileStatus_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } if (struct.isSetPath()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getFileStatus_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(1)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class getFileStatus_result implements org.apache.thrift.TBase<getFileStatus_result, getFileStatus_result._Fields>, java.io.Serializable, Cloneable, Comparable<getFileStatus_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getFileStatus_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getFileStatus_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getFileStatus_resultTupleSchemeFactory()); } public ClientFileInfo success; // required public FileDoesNotExistException eF; // required public InvalidPathException eI; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_F((short)1, "eF"), E_I((short)2, "eI"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_F return E_F; case 2: // E_I return E_I; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientFileInfo.class))); tmpMap.put(_Fields.E_F, new org.apache.thrift.meta_data.FieldMetaData("eF", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getFileStatus_result.class, metaDataMap); } public getFileStatus_result() { } public getFileStatus_result( ClientFileInfo success, FileDoesNotExistException eF, InvalidPathException eI) { this(); this.success = success; this.eF = eF; this.eI = eI; } /** * Performs a deep copy on <i>other</i>. */ public getFileStatus_result(getFileStatus_result other) { if (other.isSetSuccess()) { this.success = new ClientFileInfo(other.success); } if (other.isSetEF()) { this.eF = new FileDoesNotExistException(other.eF); } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } } public getFileStatus_result deepCopy() { return new getFileStatus_result(this); } @Override public void clear() { this.success = null; this.eF = null; this.eI = null; } public ClientFileInfo getSuccess() { return this.success; } public getFileStatus_result setSuccess(ClientFileInfo success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public FileDoesNotExistException getEF() { return this.eF; } public getFileStatus_result setEF(FileDoesNotExistException eF) { this.eF = eF; return this; } public void unsetEF() { this.eF = null; } /** Returns true if field eF is set (has been assigned a value) and false otherwise */ public boolean isSetEF() { return this.eF != null; } public void setEFIsSet(boolean value) { if (!value) { this.eF = null; } } public InvalidPathException getEI() { return this.eI; } public getFileStatus_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((ClientFileInfo)value); } break; case E_F: if (value == null) { unsetEF(); } else { setEF((FileDoesNotExistException)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E_F: return getEF(); case E_I: return getEI(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_F: return isSetEF(); case E_I: return isSetEI(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getFileStatus_result) return this.equals((getFileStatus_result)that); return false; } public boolean equals(getFileStatus_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_eF = true && this.isSetEF(); boolean that_present_eF = true && that.isSetEF(); if (this_present_eF || that_present_eF) { if (!(this_present_eF && that_present_eF)) return false; if (!this.eF.equals(that.eF)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(getFileStatus_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEF()).compareTo(other.isSetEF()); if (lastComparison != 0) { return lastComparison; } if (isSetEF()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eF, other.eF); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getFileStatus_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("eF:"); if (this.eF == null) { sb.append("null"); } else { sb.append(this.eF); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getFileStatus_resultStandardSchemeFactory implements SchemeFactory { public getFileStatus_resultStandardScheme getScheme() { return new getFileStatus_resultStandardScheme(); } } private static class getFileStatus_resultStandardScheme extends StandardScheme<getFileStatus_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getFileStatus_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new ClientFileInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_F if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getFileStatus_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.eF != null) { oprot.writeFieldBegin(E_F_FIELD_DESC); struct.eF.write(oprot); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getFileStatus_resultTupleSchemeFactory implements SchemeFactory { public getFileStatus_resultTupleScheme getScheme() { return new getFileStatus_resultTupleScheme(); } } private static class getFileStatus_resultTupleScheme extends TupleScheme<getFileStatus_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getFileStatus_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetEF()) { optionals.set(1); } if (struct.isSetEI()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetEF()) { struct.eF.write(oprot); } if (struct.isSetEI()) { struct.eI.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getFileStatus_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.success = new ClientFileInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } if (incoming.get(2)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } } } } public static class user_getClientBlockInfo_args implements org.apache.thrift.TBase<user_getClientBlockInfo_args, user_getClientBlockInfo_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getClientBlockInfo_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientBlockInfo_args"); private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getClientBlockInfo_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getClientBlockInfo_argsTupleSchemeFactory()); } public long blockId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { BLOCK_ID((short)1, "blockId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // BLOCK_ID return BLOCK_ID; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __BLOCKID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.BLOCK_ID, new org.apache.thrift.meta_data.FieldMetaData("blockId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientBlockInfo_args.class, metaDataMap); } public user_getClientBlockInfo_args() { } public user_getClientBlockInfo_args( long blockId) { this(); this.blockId = blockId; setBlockIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_getClientBlockInfo_args(user_getClientBlockInfo_args other) { __isset_bitfield = other.__isset_bitfield; this.blockId = other.blockId; } public user_getClientBlockInfo_args deepCopy() { return new user_getClientBlockInfo_args(this); } @Override public void clear() { setBlockIdIsSet(false); this.blockId = 0; } public long getBlockId() { return this.blockId; } public user_getClientBlockInfo_args setBlockId(long blockId) { this.blockId = blockId; setBlockIdIsSet(true); return this; } public void unsetBlockId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID); } /** Returns true if field blockId is set (has been assigned a value) and false otherwise */ public boolean isSetBlockId() { return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID); } public void setBlockIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case BLOCK_ID: if (value == null) { unsetBlockId(); } else { setBlockId((Long)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case BLOCK_ID: return Long.valueOf(getBlockId()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case BLOCK_ID: return isSetBlockId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getClientBlockInfo_args) return this.equals((user_getClientBlockInfo_args)that); return false; } public boolean equals(user_getClientBlockInfo_args that) { if (that == null) return false; boolean this_present_blockId = true; boolean that_present_blockId = true; if (this_present_blockId || that_present_blockId) { if (!(this_present_blockId && that_present_blockId)) return false; if (this.blockId != that.blockId) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getClientBlockInfo_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetBlockId()).compareTo(other.isSetBlockId()); if (lastComparison != 0) { return lastComparison; } if (isSetBlockId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockId, other.blockId); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getClientBlockInfo_args("); boolean first = true; sb.append("blockId:"); sb.append(this.blockId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getClientBlockInfo_argsStandardSchemeFactory implements SchemeFactory { public user_getClientBlockInfo_argsStandardScheme getScheme() { return new user_getClientBlockInfo_argsStandardScheme(); } } private static class user_getClientBlockInfo_argsStandardScheme extends StandardScheme<user_getClientBlockInfo_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientBlockInfo_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // BLOCK_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.blockId = iprot.readI64(); struct.setBlockIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientBlockInfo_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); oprot.writeI64(struct.blockId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getClientBlockInfo_argsTupleSchemeFactory implements SchemeFactory { public user_getClientBlockInfo_argsTupleScheme getScheme() { return new user_getClientBlockInfo_argsTupleScheme(); } } private static class user_getClientBlockInfo_argsTupleScheme extends TupleScheme<user_getClientBlockInfo_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientBlockInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetBlockId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetBlockId()) { oprot.writeI64(struct.blockId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientBlockInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.blockId = iprot.readI64(); struct.setBlockIdIsSet(true); } } } } public static class user_getClientBlockInfo_result implements org.apache.thrift.TBase<user_getClientBlockInfo_result, user_getClientBlockInfo_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getClientBlockInfo_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientBlockInfo_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_B_FIELD_DESC = new org.apache.thrift.protocol.TField("eB", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getClientBlockInfo_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getClientBlockInfo_resultTupleSchemeFactory()); } public ClientBlockInfo success; // required public FileDoesNotExistException eF; // required public BlockInfoException eB; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_F((short)1, "eF"), E_B((short)2, "eB"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_F return E_F; case 2: // E_B return E_B; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientBlockInfo.class))); tmpMap.put(_Fields.E_F, new org.apache.thrift.meta_data.FieldMetaData("eF", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_B, new org.apache.thrift.meta_data.FieldMetaData("eB", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientBlockInfo_result.class, metaDataMap); } public user_getClientBlockInfo_result() { } public user_getClientBlockInfo_result( ClientBlockInfo success, FileDoesNotExistException eF, BlockInfoException eB) { this(); this.success = success; this.eF = eF; this.eB = eB; } /** * Performs a deep copy on <i>other</i>. */ public user_getClientBlockInfo_result(user_getClientBlockInfo_result other) { if (other.isSetSuccess()) { this.success = new ClientBlockInfo(other.success); } if (other.isSetEF()) { this.eF = new FileDoesNotExistException(other.eF); } if (other.isSetEB()) { this.eB = new BlockInfoException(other.eB); } } public user_getClientBlockInfo_result deepCopy() { return new user_getClientBlockInfo_result(this); } @Override public void clear() { this.success = null; this.eF = null; this.eB = null; } public ClientBlockInfo getSuccess() { return this.success; } public user_getClientBlockInfo_result setSuccess(ClientBlockInfo success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public FileDoesNotExistException getEF() { return this.eF; } public user_getClientBlockInfo_result setEF(FileDoesNotExistException eF) { this.eF = eF; return this; } public void unsetEF() { this.eF = null; } /** Returns true if field eF is set (has been assigned a value) and false otherwise */ public boolean isSetEF() { return this.eF != null; } public void setEFIsSet(boolean value) { if (!value) { this.eF = null; } } public BlockInfoException getEB() { return this.eB; } public user_getClientBlockInfo_result setEB(BlockInfoException eB) { this.eB = eB; return this; } public void unsetEB() { this.eB = null; } /** Returns true if field eB is set (has been assigned a value) and false otherwise */ public boolean isSetEB() { return this.eB != null; } public void setEBIsSet(boolean value) { if (!value) { this.eB = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((ClientBlockInfo)value); } break; case E_F: if (value == null) { unsetEF(); } else { setEF((FileDoesNotExistException)value); } break; case E_B: if (value == null) { unsetEB(); } else { setEB((BlockInfoException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E_F: return getEF(); case E_B: return getEB(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_F: return isSetEF(); case E_B: return isSetEB(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getClientBlockInfo_result) return this.equals((user_getClientBlockInfo_result)that); return false; } public boolean equals(user_getClientBlockInfo_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_eF = true && this.isSetEF(); boolean that_present_eF = true && that.isSetEF(); if (this_present_eF || that_present_eF) { if (!(this_present_eF && that_present_eF)) return false; if (!this.eF.equals(that.eF)) return false; } boolean this_present_eB = true && this.isSetEB(); boolean that_present_eB = true && that.isSetEB(); if (this_present_eB || that_present_eB) { if (!(this_present_eB && that_present_eB)) return false; if (!this.eB.equals(that.eB)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getClientBlockInfo_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEF()).compareTo(other.isSetEF()); if (lastComparison != 0) { return lastComparison; } if (isSetEF()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eF, other.eF); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEB()).compareTo(other.isSetEB()); if (lastComparison != 0) { return lastComparison; } if (isSetEB()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eB, other.eB); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getClientBlockInfo_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("eF:"); if (this.eF == null) { sb.append("null"); } else { sb.append(this.eF); } first = false; if (!first) sb.append(", "); sb.append("eB:"); if (this.eB == null) { sb.append("null"); } else { sb.append(this.eB); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getClientBlockInfo_resultStandardSchemeFactory implements SchemeFactory { public user_getClientBlockInfo_resultStandardScheme getScheme() { return new user_getClientBlockInfo_resultStandardScheme(); } } private static class user_getClientBlockInfo_resultStandardScheme extends StandardScheme<user_getClientBlockInfo_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientBlockInfo_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new ClientBlockInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_F if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_B if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientBlockInfo_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.eF != null) { oprot.writeFieldBegin(E_F_FIELD_DESC); struct.eF.write(oprot); oprot.writeFieldEnd(); } if (struct.eB != null) { oprot.writeFieldBegin(E_B_FIELD_DESC); struct.eB.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getClientBlockInfo_resultTupleSchemeFactory implements SchemeFactory { public user_getClientBlockInfo_resultTupleScheme getScheme() { return new user_getClientBlockInfo_resultTupleScheme(); } } private static class user_getClientBlockInfo_resultTupleScheme extends TupleScheme<user_getClientBlockInfo_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientBlockInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetEF()) { optionals.set(1); } if (struct.isSetEB()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetEF()) { struct.eF.write(oprot); } if (struct.isSetEB()) { struct.eB.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientBlockInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.success = new ClientBlockInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } if (incoming.get(2)) { struct.eB = new BlockInfoException(); struct.eB.read(iprot); struct.setEBIsSet(true); } } } } public static class user_getFileBlocks_args implements org.apache.thrift.TBase<user_getFileBlocks_args, user_getFileBlocks_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getFileBlocks_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getFileBlocks_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getFileBlocks_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getFileBlocks_argsTupleSchemeFactory()); } public int fileId; // required public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"), PATH((short)2, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; case 2: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getFileBlocks_args.class, metaDataMap); } public user_getFileBlocks_args() { } public user_getFileBlocks_args( int fileId, String path) { this(); this.fileId = fileId; setFileIdIsSet(true); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public user_getFileBlocks_args(user_getFileBlocks_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; if (other.isSetPath()) { this.path = other.path; } } public user_getFileBlocks_args deepCopy() { return new user_getFileBlocks_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; this.path = null; } public int getFileId() { return this.fileId; } public user_getFileBlocks_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public String getPath() { return this.path; } public user_getFileBlocks_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getFileBlocks_args) return this.equals((user_getFileBlocks_args)that); return false; } public boolean equals(user_getFileBlocks_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getFileBlocks_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getFileBlocks_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getFileBlocks_argsStandardSchemeFactory implements SchemeFactory { public user_getFileBlocks_argsStandardScheme getScheme() { return new user_getFileBlocks_argsStandardScheme(); } } private static class user_getFileBlocks_argsStandardScheme extends StandardScheme<user_getFileBlocks_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getFileBlocks_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getFileBlocks_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getFileBlocks_argsTupleSchemeFactory implements SchemeFactory { public user_getFileBlocks_argsTupleScheme getScheme() { return new user_getFileBlocks_argsTupleScheme(); } } private static class user_getFileBlocks_argsTupleScheme extends TupleScheme<user_getFileBlocks_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocks_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } if (struct.isSetPath()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocks_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(1)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class user_getFileBlocks_result implements org.apache.thrift.TBase<user_getFileBlocks_result, user_getFileBlocks_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getFileBlocks_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getFileBlocks_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getFileBlocks_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getFileBlocks_resultTupleSchemeFactory()); } public List<ClientBlockInfo> success; // required public FileDoesNotExistException eF; // required public InvalidPathException eI; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_F((short)1, "eF"), E_I((short)2, "eI"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_F return E_F; case 2: // E_I return E_I; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientBlockInfo.class)))); tmpMap.put(_Fields.E_F, new org.apache.thrift.meta_data.FieldMetaData("eF", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getFileBlocks_result.class, metaDataMap); } public user_getFileBlocks_result() { } public user_getFileBlocks_result( List<ClientBlockInfo> success, FileDoesNotExistException eF, InvalidPathException eI) { this(); this.success = success; this.eF = eF; this.eI = eI; } /** * Performs a deep copy on <i>other</i>. */ public user_getFileBlocks_result(user_getFileBlocks_result other) { if (other.isSetSuccess()) { List<ClientBlockInfo> __this__success = new ArrayList<ClientBlockInfo>(other.success.size()); for (ClientBlockInfo other_element : other.success) { __this__success.add(new ClientBlockInfo(other_element)); } this.success = __this__success; } if (other.isSetEF()) { this.eF = new FileDoesNotExistException(other.eF); } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } } public user_getFileBlocks_result deepCopy() { return new user_getFileBlocks_result(this); } @Override public void clear() { this.success = null; this.eF = null; this.eI = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<ClientBlockInfo> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(ClientBlockInfo elem) { if (this.success == null) { this.success = new ArrayList<ClientBlockInfo>(); } this.success.add(elem); } public List<ClientBlockInfo> getSuccess() { return this.success; } public user_getFileBlocks_result setSuccess(List<ClientBlockInfo> success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public FileDoesNotExistException getEF() { return this.eF; } public user_getFileBlocks_result setEF(FileDoesNotExistException eF) { this.eF = eF; return this; } public void unsetEF() { this.eF = null; } /** Returns true if field eF is set (has been assigned a value) and false otherwise */ public boolean isSetEF() { return this.eF != null; } public void setEFIsSet(boolean value) { if (!value) { this.eF = null; } } public InvalidPathException getEI() { return this.eI; } public user_getFileBlocks_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<ClientBlockInfo>)value); } break; case E_F: if (value == null) { unsetEF(); } else { setEF((FileDoesNotExistException)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E_F: return getEF(); case E_I: return getEI(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_F: return isSetEF(); case E_I: return isSetEI(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getFileBlocks_result) return this.equals((user_getFileBlocks_result)that); return false; } public boolean equals(user_getFileBlocks_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_eF = true && this.isSetEF(); boolean that_present_eF = true && that.isSetEF(); if (this_present_eF || that_present_eF) { if (!(this_present_eF && that_present_eF)) return false; if (!this.eF.equals(that.eF)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getFileBlocks_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEF()).compareTo(other.isSetEF()); if (lastComparison != 0) { return lastComparison; } if (isSetEF()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eF, other.eF); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getFileBlocks_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("eF:"); if (this.eF == null) { sb.append("null"); } else { sb.append(this.eF); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getFileBlocks_resultStandardSchemeFactory implements SchemeFactory { public user_getFileBlocks_resultStandardScheme getScheme() { return new user_getFileBlocks_resultStandardScheme(); } } private static class user_getFileBlocks_resultStandardScheme extends StandardScheme<user_getFileBlocks_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getFileBlocks_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list120 = iprot.readListBegin(); struct.success = new ArrayList<ClientBlockInfo>(_list120.size); for (int _i121 = 0; _i121 < _list120.size; ++_i121) { ClientBlockInfo _elem122; _elem122 = new ClientBlockInfo(); _elem122.read(iprot); struct.success.add(_elem122); } iprot.readListEnd(); } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_F if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getFileBlocks_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); for (ClientBlockInfo _iter123 : struct.success) { _iter123.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.eF != null) { oprot.writeFieldBegin(E_F_FIELD_DESC); struct.eF.write(oprot); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getFileBlocks_resultTupleSchemeFactory implements SchemeFactory { public user_getFileBlocks_resultTupleScheme getScheme() { return new user_getFileBlocks_resultTupleScheme(); } } private static class user_getFileBlocks_resultTupleScheme extends TupleScheme<user_getFileBlocks_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocks_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetEF()) { optionals.set(1); } if (struct.isSetEI()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (ClientBlockInfo _iter124 : struct.success) { _iter124.write(oprot); } } } if (struct.isSetEF()) { struct.eF.write(oprot); } if (struct.isSetEI()) { struct.eI.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocks_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list125 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.success = new ArrayList<ClientBlockInfo>(_list125.size); for (int _i126 = 0; _i126 < _list125.size; ++_i126) { ClientBlockInfo _elem127; _elem127 = new ClientBlockInfo(); _elem127.read(iprot); struct.success.add(_elem127); } } struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } if (incoming.get(2)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } } } } public static class user_delete_args implements org.apache.thrift.TBase<user_delete_args, user_delete_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_delete_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_delete_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField RECURSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("recursive", org.apache.thrift.protocol.TType.BOOL, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_delete_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_delete_argsTupleSchemeFactory()); } public int fileId; // required public String path; // required public boolean recursive; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"), PATH((short)2, "path"), RECURSIVE((short)3, "recursive"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; case 2: // PATH return PATH; case 3: // RECURSIVE return RECURSIVE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private static final int __RECURSIVE_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RECURSIVE, new org.apache.thrift.meta_data.FieldMetaData("recursive", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_delete_args.class, metaDataMap); } public user_delete_args() { } public user_delete_args( int fileId, String path, boolean recursive) { this(); this.fileId = fileId; setFileIdIsSet(true); this.path = path; this.recursive = recursive; setRecursiveIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_delete_args(user_delete_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; if (other.isSetPath()) { this.path = other.path; } this.recursive = other.recursive; } public user_delete_args deepCopy() { return new user_delete_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; this.path = null; setRecursiveIsSet(false); this.recursive = false; } public int getFileId() { return this.fileId; } public user_delete_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public String getPath() { return this.path; } public user_delete_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public boolean isRecursive() { return this.recursive; } public user_delete_args setRecursive(boolean recursive) { this.recursive = recursive; setRecursiveIsSet(true); return this; } public void unsetRecursive() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ public boolean isSetRecursive() { return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } public void setRecursiveIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case RECURSIVE: if (value == null) { unsetRecursive(); } else { setRecursive((Boolean)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); case PATH: return getPath(); case RECURSIVE: return Boolean.valueOf(isRecursive()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); case PATH: return isSetPath(); case RECURSIVE: return isSetRecursive(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_delete_args) return this.equals((user_delete_args)that); return false; } public boolean equals(user_delete_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_recursive = true; boolean that_present_recursive = true; if (this_present_recursive || that_present_recursive) { if (!(this_present_recursive && that_present_recursive)) return false; if (this.recursive != that.recursive) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_delete_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRecursive()).compareTo(other.isSetRecursive()); if (lastComparison != 0) { return lastComparison; } if (isSetRecursive()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recursive, other.recursive); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_delete_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("recursive:"); sb.append(this.recursive); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_delete_argsStandardSchemeFactory implements SchemeFactory { public user_delete_argsStandardScheme getScheme() { return new user_delete_argsStandardScheme(); } } private static class user_delete_argsStandardScheme extends StandardScheme<user_delete_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_delete_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // RECURSIVE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_delete_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); oprot.writeBool(struct.recursive); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_delete_argsTupleSchemeFactory implements SchemeFactory { public user_delete_argsTupleScheme getScheme() { return new user_delete_argsTupleScheme(); } } private static class user_delete_argsTupleScheme extends TupleScheme<user_delete_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_delete_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } if (struct.isSetPath()) { optionals.set(1); } if (struct.isSetRecursive()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetRecursive()) { oprot.writeBool(struct.recursive); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_delete_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(1)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(2)) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } } } } public static class user_delete_result implements org.apache.thrift.TBase<user_delete_result, user_delete_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_delete_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_delete_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_delete_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_delete_resultTupleSchemeFactory()); } public boolean success; // required public TachyonException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_delete_result.class, metaDataMap); } public user_delete_result() { } public user_delete_result( boolean success, TachyonException e) { this(); this.success = success; setSuccessIsSet(true); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_delete_result(user_delete_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new TachyonException(other.e); } } public user_delete_result deepCopy() { return new user_delete_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = false; this.e = null; } public boolean isSuccess() { return this.success; } public user_delete_result setSuccess(boolean success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public TachyonException getE() { return this.e; } public user_delete_result setE(TachyonException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Boolean)value); } break; case E: if (value == null) { unsetE(); } else { setE((TachyonException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Boolean.valueOf(isSuccess()); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_delete_result) return this.equals((user_delete_result)that); return false; } public boolean equals(user_delete_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_delete_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_delete_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_delete_resultStandardSchemeFactory implements SchemeFactory { public user_delete_resultStandardScheme getScheme() { return new user_delete_resultStandardScheme(); } } private static class user_delete_resultStandardScheme extends StandardScheme<user_delete_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_delete_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new TachyonException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_delete_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeBool(struct.success); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_delete_resultTupleSchemeFactory implements SchemeFactory { public user_delete_resultTupleScheme getScheme() { return new user_delete_resultTupleScheme(); } } private static class user_delete_resultTupleScheme extends TupleScheme<user_delete_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_delete_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeBool(struct.success); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_delete_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new TachyonException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_rename_args implements org.apache.thrift.TBase<user_rename_args, user_rename_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_rename_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_rename_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField SRC_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("srcPath", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField DST_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("dstPath", org.apache.thrift.protocol.TType.STRING, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_rename_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_rename_argsTupleSchemeFactory()); } public int fileId; // required public String srcPath; // required public String dstPath; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"), SRC_PATH((short)2, "srcPath"), DST_PATH((short)3, "dstPath"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; case 2: // SRC_PATH return SRC_PATH; case 3: // DST_PATH return DST_PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.SRC_PATH, new org.apache.thrift.meta_data.FieldMetaData("srcPath", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DST_PATH, new org.apache.thrift.meta_data.FieldMetaData("dstPath", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_rename_args.class, metaDataMap); } public user_rename_args() { } public user_rename_args( int fileId, String srcPath, String dstPath) { this(); this.fileId = fileId; setFileIdIsSet(true); this.srcPath = srcPath; this.dstPath = dstPath; } /** * Performs a deep copy on <i>other</i>. */ public user_rename_args(user_rename_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; if (other.isSetSrcPath()) { this.srcPath = other.srcPath; } if (other.isSetDstPath()) { this.dstPath = other.dstPath; } } public user_rename_args deepCopy() { return new user_rename_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; this.srcPath = null; this.dstPath = null; } public int getFileId() { return this.fileId; } public user_rename_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public String getSrcPath() { return this.srcPath; } public user_rename_args setSrcPath(String srcPath) { this.srcPath = srcPath; return this; } public void unsetSrcPath() { this.srcPath = null; } /** Returns true if field srcPath is set (has been assigned a value) and false otherwise */ public boolean isSetSrcPath() { return this.srcPath != null; } public void setSrcPathIsSet(boolean value) { if (!value) { this.srcPath = null; } } public String getDstPath() { return this.dstPath; } public user_rename_args setDstPath(String dstPath) { this.dstPath = dstPath; return this; } public void unsetDstPath() { this.dstPath = null; } /** Returns true if field dstPath is set (has been assigned a value) and false otherwise */ public boolean isSetDstPath() { return this.dstPath != null; } public void setDstPathIsSet(boolean value) { if (!value) { this.dstPath = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case SRC_PATH: if (value == null) { unsetSrcPath(); } else { setSrcPath((String)value); } break; case DST_PATH: if (value == null) { unsetDstPath(); } else { setDstPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); case SRC_PATH: return getSrcPath(); case DST_PATH: return getDstPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); case SRC_PATH: return isSetSrcPath(); case DST_PATH: return isSetDstPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_rename_args) return this.equals((user_rename_args)that); return false; } public boolean equals(user_rename_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_srcPath = true && this.isSetSrcPath(); boolean that_present_srcPath = true && that.isSetSrcPath(); if (this_present_srcPath || that_present_srcPath) { if (!(this_present_srcPath && that_present_srcPath)) return false; if (!this.srcPath.equals(that.srcPath)) return false; } boolean this_present_dstPath = true && this.isSetDstPath(); boolean that_present_dstPath = true && that.isSetDstPath(); if (this_present_dstPath || that_present_dstPath) { if (!(this_present_dstPath && that_present_dstPath)) return false; if (!this.dstPath.equals(that.dstPath)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_rename_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSrcPath()).compareTo(other.isSetSrcPath()); if (lastComparison != 0) { return lastComparison; } if (isSetSrcPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.srcPath, other.srcPath); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDstPath()).compareTo(other.isSetDstPath()); if (lastComparison != 0) { return lastComparison; } if (isSetDstPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dstPath, other.dstPath); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_rename_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("srcPath:"); if (this.srcPath == null) { sb.append("null"); } else { sb.append(this.srcPath); } first = false; if (!first) sb.append(", "); sb.append("dstPath:"); if (this.dstPath == null) { sb.append("null"); } else { sb.append(this.dstPath); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_rename_argsStandardSchemeFactory implements SchemeFactory { public user_rename_argsStandardScheme getScheme() { return new user_rename_argsStandardScheme(); } } private static class user_rename_argsStandardScheme extends StandardScheme<user_rename_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_rename_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // SRC_PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.srcPath = iprot.readString(); struct.setSrcPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // DST_PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.dstPath = iprot.readString(); struct.setDstPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_rename_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); if (struct.srcPath != null) { oprot.writeFieldBegin(SRC_PATH_FIELD_DESC); oprot.writeString(struct.srcPath); oprot.writeFieldEnd(); } if (struct.dstPath != null) { oprot.writeFieldBegin(DST_PATH_FIELD_DESC); oprot.writeString(struct.dstPath); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_rename_argsTupleSchemeFactory implements SchemeFactory { public user_rename_argsTupleScheme getScheme() { return new user_rename_argsTupleScheme(); } } private static class user_rename_argsTupleScheme extends TupleScheme<user_rename_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_rename_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } if (struct.isSetSrcPath()) { optionals.set(1); } if (struct.isSetDstPath()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetSrcPath()) { oprot.writeString(struct.srcPath); } if (struct.isSetDstPath()) { oprot.writeString(struct.dstPath); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_rename_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(1)) { struct.srcPath = iprot.readString(); struct.setSrcPathIsSet(true); } if (incoming.get(2)) { struct.dstPath = iprot.readString(); struct.setDstPathIsSet(true); } } } } public static class user_rename_result implements org.apache.thrift.TBase<user_rename_result, user_rename_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_rename_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_rename_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); private static final org.apache.thrift.protocol.TField E_A_FIELD_DESC = new org.apache.thrift.protocol.TField("eA", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_rename_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_rename_resultTupleSchemeFactory()); } public boolean success; // required public FileAlreadyExistException eA; // required public FileDoesNotExistException eF; // required public InvalidPathException eI; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_A((short)1, "eA"), E_F((short)2, "eF"), E_I((short)3, "eI"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_A return E_A; case 2: // E_F return E_F; case 3: // E_I return E_I; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.E_A, new org.apache.thrift.meta_data.FieldMetaData("eA", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_F, new org.apache.thrift.meta_data.FieldMetaData("eF", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_rename_result.class, metaDataMap); } public user_rename_result() { } public user_rename_result( boolean success, FileAlreadyExistException eA, FileDoesNotExistException eF, InvalidPathException eI) { this(); this.success = success; setSuccessIsSet(true); this.eA = eA; this.eF = eF; this.eI = eI; } /** * Performs a deep copy on <i>other</i>. */ public user_rename_result(user_rename_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetEA()) { this.eA = new FileAlreadyExistException(other.eA); } if (other.isSetEF()) { this.eF = new FileDoesNotExistException(other.eF); } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } } public user_rename_result deepCopy() { return new user_rename_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = false; this.eA = null; this.eF = null; this.eI = null; } public boolean isSuccess() { return this.success; } public user_rename_result setSuccess(boolean success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileAlreadyExistException getEA() { return this.eA; } public user_rename_result setEA(FileAlreadyExistException eA) { this.eA = eA; return this; } public void unsetEA() { this.eA = null; } /** Returns true if field eA is set (has been assigned a value) and false otherwise */ public boolean isSetEA() { return this.eA != null; } public void setEAIsSet(boolean value) { if (!value) { this.eA = null; } } public FileDoesNotExistException getEF() { return this.eF; } public user_rename_result setEF(FileDoesNotExistException eF) { this.eF = eF; return this; } public void unsetEF() { this.eF = null; } /** Returns true if field eF is set (has been assigned a value) and false otherwise */ public boolean isSetEF() { return this.eF != null; } public void setEFIsSet(boolean value) { if (!value) { this.eF = null; } } public InvalidPathException getEI() { return this.eI; } public user_rename_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Boolean)value); } break; case E_A: if (value == null) { unsetEA(); } else { setEA((FileAlreadyExistException)value); } break; case E_F: if (value == null) { unsetEF(); } else { setEF((FileDoesNotExistException)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Boolean.valueOf(isSuccess()); case E_A: return getEA(); case E_F: return getEF(); case E_I: return getEI(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_A: return isSetEA(); case E_F: return isSetEF(); case E_I: return isSetEI(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_rename_result) return this.equals((user_rename_result)that); return false; } public boolean equals(user_rename_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_eA = true && this.isSetEA(); boolean that_present_eA = true && that.isSetEA(); if (this_present_eA || that_present_eA) { if (!(this_present_eA && that_present_eA)) return false; if (!this.eA.equals(that.eA)) return false; } boolean this_present_eF = true && this.isSetEF(); boolean that_present_eF = true && that.isSetEF(); if (this_present_eF || that_present_eF) { if (!(this_present_eF && that_present_eF)) return false; if (!this.eF.equals(that.eF)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_rename_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEA()).compareTo(other.isSetEA()); if (lastComparison != 0) { return lastComparison; } if (isSetEA()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eA, other.eA); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEF()).compareTo(other.isSetEF()); if (lastComparison != 0) { return lastComparison; } if (isSetEF()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eF, other.eF); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_rename_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("eA:"); if (this.eA == null) { sb.append("null"); } else { sb.append(this.eA); } first = false; if (!first) sb.append(", "); sb.append("eF:"); if (this.eF == null) { sb.append("null"); } else { sb.append(this.eF); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_rename_resultStandardSchemeFactory implements SchemeFactory { public user_rename_resultStandardScheme getScheme() { return new user_rename_resultStandardScheme(); } } private static class user_rename_resultStandardScheme extends StandardScheme<user_rename_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_rename_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_A if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eA = new FileAlreadyExistException(); struct.eA.read(iprot); struct.setEAIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_F if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_rename_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeBool(struct.success); oprot.writeFieldEnd(); } if (struct.eA != null) { oprot.writeFieldBegin(E_A_FIELD_DESC); struct.eA.write(oprot); oprot.writeFieldEnd(); } if (struct.eF != null) { oprot.writeFieldBegin(E_F_FIELD_DESC); struct.eF.write(oprot); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_rename_resultTupleSchemeFactory implements SchemeFactory { public user_rename_resultTupleScheme getScheme() { return new user_rename_resultTupleScheme(); } } private static class user_rename_resultTupleScheme extends TupleScheme<user_rename_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_rename_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetEA()) { optionals.set(1); } if (struct.isSetEF()) { optionals.set(2); } if (struct.isSetEI()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { oprot.writeBool(struct.success); } if (struct.isSetEA()) { struct.eA.write(oprot); } if (struct.isSetEF()) { struct.eF.write(oprot); } if (struct.isSetEI()) { struct.eI.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_rename_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eA = new FileAlreadyExistException(); struct.eA.read(iprot); struct.setEAIsSet(true); } if (incoming.get(2)) { struct.eF = new FileDoesNotExistException(); struct.eF.read(iprot); struct.setEFIsSet(true); } if (incoming.get(3)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } } } } public static class user_setPinned_args implements org.apache.thrift.TBase<user_setPinned_args, user_setPinned_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_setPinned_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_setPinned_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField PINNED_FIELD_DESC = new org.apache.thrift.protocol.TField("pinned", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_setPinned_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_setPinned_argsTupleSchemeFactory()); } public int fileId; // required public boolean pinned; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"), PINNED((short)2, "pinned"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; case 2: // PINNED return PINNED; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private static final int __PINNED_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.PINNED, new org.apache.thrift.meta_data.FieldMetaData("pinned", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_setPinned_args.class, metaDataMap); } public user_setPinned_args() { } public user_setPinned_args( int fileId, boolean pinned) { this(); this.fileId = fileId; setFileIdIsSet(true); this.pinned = pinned; setPinnedIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_setPinned_args(user_setPinned_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; this.pinned = other.pinned; } public user_setPinned_args deepCopy() { return new user_setPinned_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; setPinnedIsSet(false); this.pinned = false; } public int getFileId() { return this.fileId; } public user_setPinned_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public boolean isPinned() { return this.pinned; } public user_setPinned_args setPinned(boolean pinned) { this.pinned = pinned; setPinnedIsSet(true); return this; } public void unsetPinned() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PINNED_ISSET_ID); } /** Returns true if field pinned is set (has been assigned a value) and false otherwise */ public boolean isSetPinned() { return EncodingUtils.testBit(__isset_bitfield, __PINNED_ISSET_ID); } public void setPinnedIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PINNED_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case PINNED: if (value == null) { unsetPinned(); } else { setPinned((Boolean)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); case PINNED: return Boolean.valueOf(isPinned()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); case PINNED: return isSetPinned(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_setPinned_args) return this.equals((user_setPinned_args)that); return false; } public boolean equals(user_setPinned_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_pinned = true; boolean that_present_pinned = true; if (this_present_pinned || that_present_pinned) { if (!(this_present_pinned && that_present_pinned)) return false; if (this.pinned != that.pinned) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_setPinned_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPinned()).compareTo(other.isSetPinned()); if (lastComparison != 0) { return lastComparison; } if (isSetPinned()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pinned, other.pinned); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_setPinned_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("pinned:"); sb.append(this.pinned); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_setPinned_argsStandardSchemeFactory implements SchemeFactory { public user_setPinned_argsStandardScheme getScheme() { return new user_setPinned_argsStandardScheme(); } } private static class user_setPinned_argsStandardScheme extends StandardScheme<user_setPinned_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_setPinned_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PINNED if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.pinned = iprot.readBool(); struct.setPinnedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_setPinned_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); oprot.writeFieldBegin(PINNED_FIELD_DESC); oprot.writeBool(struct.pinned); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_setPinned_argsTupleSchemeFactory implements SchemeFactory { public user_setPinned_argsTupleScheme getScheme() { return new user_setPinned_argsTupleScheme(); } } private static class user_setPinned_argsTupleScheme extends TupleScheme<user_setPinned_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_setPinned_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } if (struct.isSetPinned()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetPinned()) { oprot.writeBool(struct.pinned); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_setPinned_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(1)) { struct.pinned = iprot.readBool(); struct.setPinnedIsSet(true); } } } } public static class user_setPinned_result implements org.apache.thrift.TBase<user_setPinned_result, user_setPinned_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_setPinned_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_setPinned_result"); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_setPinned_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_setPinned_resultTupleSchemeFactory()); } public FileDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_setPinned_result.class, metaDataMap); } public user_setPinned_result() { } public user_setPinned_result( FileDoesNotExistException e) { this(); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_setPinned_result(user_setPinned_result other) { if (other.isSetE()) { this.e = new FileDoesNotExistException(other.e); } } public user_setPinned_result deepCopy() { return new user_setPinned_result(this); } @Override public void clear() { this.e = null; } public FileDoesNotExistException getE() { return this.e; } public user_setPinned_result setE(FileDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E: if (value == null) { unsetE(); } else { setE((FileDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_setPinned_result) return this.equals((user_setPinned_result)that); return false; } public boolean equals(user_setPinned_result that) { if (that == null) return false; boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_setPinned_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_setPinned_result("); boolean first = true; sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_setPinned_resultStandardSchemeFactory implements SchemeFactory { public user_setPinned_resultStandardScheme getScheme() { return new user_setPinned_resultStandardScheme(); } } private static class user_setPinned_resultStandardScheme extends StandardScheme<user_setPinned_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_setPinned_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_setPinned_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_setPinned_resultTupleSchemeFactory implements SchemeFactory { public user_setPinned_resultTupleScheme getScheme() { return new user_setPinned_resultTupleScheme(); } } private static class user_setPinned_resultTupleScheme extends TupleScheme<user_setPinned_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_setPinned_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetE()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_setPinned_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_mkdirs_args implements org.apache.thrift.TBase<user_mkdirs_args, user_mkdirs_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_mkdirs_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_mkdirs_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField RECURSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("recursive", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_mkdirs_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_mkdirs_argsTupleSchemeFactory()); } public String path; // required public boolean recursive; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PATH((short)1, "path"), RECURSIVE((short)2, "recursive"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // RECURSIVE return RECURSIVE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __RECURSIVE_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RECURSIVE, new org.apache.thrift.meta_data.FieldMetaData("recursive", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_mkdirs_args.class, metaDataMap); } public user_mkdirs_args() { } public user_mkdirs_args( String path, boolean recursive) { this(); this.path = path; this.recursive = recursive; setRecursiveIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_mkdirs_args(user_mkdirs_args other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetPath()) { this.path = other.path; } this.recursive = other.recursive; } public user_mkdirs_args deepCopy() { return new user_mkdirs_args(this); } @Override public void clear() { this.path = null; setRecursiveIsSet(false); this.recursive = false; } public String getPath() { return this.path; } public user_mkdirs_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public boolean isRecursive() { return this.recursive; } public user_mkdirs_args setRecursive(boolean recursive) { this.recursive = recursive; setRecursiveIsSet(true); return this; } public void unsetRecursive() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ public boolean isSetRecursive() { return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } public void setRecursiveIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case RECURSIVE: if (value == null) { unsetRecursive(); } else { setRecursive((Boolean)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case RECURSIVE: return Boolean.valueOf(isRecursive()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case RECURSIVE: return isSetRecursive(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_mkdirs_args) return this.equals((user_mkdirs_args)that); return false; } public boolean equals(user_mkdirs_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_recursive = true; boolean that_present_recursive = true; if (this_present_recursive || that_present_recursive) { if (!(this_present_recursive && that_present_recursive)) return false; if (this.recursive != that.recursive) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_mkdirs_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRecursive()).compareTo(other.isSetRecursive()); if (lastComparison != 0) { return lastComparison; } if (isSetRecursive()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recursive, other.recursive); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_mkdirs_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("recursive:"); sb.append(this.recursive); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_mkdirs_argsStandardSchemeFactory implements SchemeFactory { public user_mkdirs_argsStandardScheme getScheme() { return new user_mkdirs_argsStandardScheme(); } } private static class user_mkdirs_argsStandardScheme extends StandardScheme<user_mkdirs_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_mkdirs_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // RECURSIVE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_mkdirs_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); oprot.writeBool(struct.recursive); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_mkdirs_argsTupleSchemeFactory implements SchemeFactory { public user_mkdirs_argsTupleScheme getScheme() { return new user_mkdirs_argsTupleScheme(); } } private static class user_mkdirs_argsTupleScheme extends TupleScheme<user_mkdirs_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_mkdirs_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetRecursive()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetRecursive()) { oprot.writeBool(struct.recursive); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_mkdirs_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } } } } public static class user_mkdirs_result implements org.apache.thrift.TBase<user_mkdirs_result, user_mkdirs_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_mkdirs_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_mkdirs_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); private static final org.apache.thrift.protocol.TField E_R_FIELD_DESC = new org.apache.thrift.protocol.TField("eR", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_mkdirs_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_mkdirs_resultTupleSchemeFactory()); } public boolean success; // required public FileAlreadyExistException eR; // required public InvalidPathException eI; // required public TachyonException eT; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_R((short)1, "eR"), E_I((short)2, "eI"), E_T((short)3, "eT"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_R return E_R; case 2: // E_I return E_I; case 3: // E_T return E_T; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.E_R, new org.apache.thrift.meta_data.FieldMetaData("eR", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_T, new org.apache.thrift.meta_data.FieldMetaData("eT", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_mkdirs_result.class, metaDataMap); } public user_mkdirs_result() { } public user_mkdirs_result( boolean success, FileAlreadyExistException eR, InvalidPathException eI, TachyonException eT) { this(); this.success = success; setSuccessIsSet(true); this.eR = eR; this.eI = eI; this.eT = eT; } /** * Performs a deep copy on <i>other</i>. */ public user_mkdirs_result(user_mkdirs_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetER()) { this.eR = new FileAlreadyExistException(other.eR); } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } if (other.isSetET()) { this.eT = new TachyonException(other.eT); } } public user_mkdirs_result deepCopy() { return new user_mkdirs_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = false; this.eR = null; this.eI = null; this.eT = null; } public boolean isSuccess() { return this.success; } public user_mkdirs_result setSuccess(boolean success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileAlreadyExistException getER() { return this.eR; } public user_mkdirs_result setER(FileAlreadyExistException eR) { this.eR = eR; return this; } public void unsetER() { this.eR = null; } /** Returns true if field eR is set (has been assigned a value) and false otherwise */ public boolean isSetER() { return this.eR != null; } public void setERIsSet(boolean value) { if (!value) { this.eR = null; } } public InvalidPathException getEI() { return this.eI; } public user_mkdirs_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public TachyonException getET() { return this.eT; } public user_mkdirs_result setET(TachyonException eT) { this.eT = eT; return this; } public void unsetET() { this.eT = null; } /** Returns true if field eT is set (has been assigned a value) and false otherwise */ public boolean isSetET() { return this.eT != null; } public void setETIsSet(boolean value) { if (!value) { this.eT = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Boolean)value); } break; case E_R: if (value == null) { unsetER(); } else { setER((FileAlreadyExistException)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; case E_T: if (value == null) { unsetET(); } else { setET((TachyonException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Boolean.valueOf(isSuccess()); case E_R: return getER(); case E_I: return getEI(); case E_T: return getET(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_R: return isSetER(); case E_I: return isSetEI(); case E_T: return isSetET(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_mkdirs_result) return this.equals((user_mkdirs_result)that); return false; } public boolean equals(user_mkdirs_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_eR = true && this.isSetER(); boolean that_present_eR = true && that.isSetER(); if (this_present_eR || that_present_eR) { if (!(this_present_eR && that_present_eR)) return false; if (!this.eR.equals(that.eR)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } boolean this_present_eT = true && this.isSetET(); boolean that_present_eT = true && that.isSetET(); if (this_present_eT || that_present_eT) { if (!(this_present_eT && that_present_eT)) return false; if (!this.eT.equals(that.eT)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_mkdirs_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetER()).compareTo(other.isSetER()); if (lastComparison != 0) { return lastComparison; } if (isSetER()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eR, other.eR); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetET()).compareTo(other.isSetET()); if (lastComparison != 0) { return lastComparison; } if (isSetET()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eT, other.eT); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_mkdirs_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("eR:"); if (this.eR == null) { sb.append("null"); } else { sb.append(this.eR); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; if (!first) sb.append(", "); sb.append("eT:"); if (this.eT == null) { sb.append("null"); } else { sb.append(this.eT); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_mkdirs_resultStandardSchemeFactory implements SchemeFactory { public user_mkdirs_resultStandardScheme getScheme() { return new user_mkdirs_resultStandardScheme(); } } private static class user_mkdirs_resultStandardScheme extends StandardScheme<user_mkdirs_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_mkdirs_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_R if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eR = new FileAlreadyExistException(); struct.eR.read(iprot); struct.setERIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // E_T if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eT = new TachyonException(); struct.eT.read(iprot); struct.setETIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_mkdirs_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeBool(struct.success); oprot.writeFieldEnd(); } if (struct.eR != null) { oprot.writeFieldBegin(E_R_FIELD_DESC); struct.eR.write(oprot); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } if (struct.eT != null) { oprot.writeFieldBegin(E_T_FIELD_DESC); struct.eT.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_mkdirs_resultTupleSchemeFactory implements SchemeFactory { public user_mkdirs_resultTupleScheme getScheme() { return new user_mkdirs_resultTupleScheme(); } } private static class user_mkdirs_resultTupleScheme extends TupleScheme<user_mkdirs_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_mkdirs_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetER()) { optionals.set(1); } if (struct.isSetEI()) { optionals.set(2); } if (struct.isSetET()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { oprot.writeBool(struct.success); } if (struct.isSetER()) { struct.eR.write(oprot); } if (struct.isSetEI()) { struct.eI.write(oprot); } if (struct.isSetET()) { struct.eT.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_mkdirs_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eR = new FileAlreadyExistException(); struct.eR.read(iprot); struct.setERIsSet(true); } if (incoming.get(2)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } if (incoming.get(3)) { struct.eT = new TachyonException(); struct.eT.read(iprot); struct.setETIsSet(true); } } } } public static class user_createRawTable_args implements org.apache.thrift.TBase<user_createRawTable_args, user_createRawTable_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_createRawTable_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createRawTable_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("metadata", org.apache.thrift.protocol.TType.STRING, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createRawTable_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createRawTable_argsTupleSchemeFactory()); } public String path; // required public int columns; // required public ByteBuffer metadata; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PATH((short)1, "path"), COLUMNS((short)2, "columns"), METADATA((short)3, "metadata"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; case 2: // COLUMNS return COLUMNS; case 3: // METADATA return METADATA; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __COLUMNS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.METADATA, new org.apache.thrift.meta_data.FieldMetaData("metadata", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createRawTable_args.class, metaDataMap); } public user_createRawTable_args() { } public user_createRawTable_args( String path, int columns, ByteBuffer metadata) { this(); this.path = path; this.columns = columns; setColumnsIsSet(true); this.metadata = metadata; } /** * Performs a deep copy on <i>other</i>. */ public user_createRawTable_args(user_createRawTable_args other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetPath()) { this.path = other.path; } this.columns = other.columns; if (other.isSetMetadata()) { this.metadata = org.apache.thrift.TBaseHelper.copyBinary(other.metadata); ; } } public user_createRawTable_args deepCopy() { return new user_createRawTable_args(this); } @Override public void clear() { this.path = null; setColumnsIsSet(false); this.columns = 0; this.metadata = null; } public String getPath() { return this.path; } public user_createRawTable_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public int getColumns() { return this.columns; } public user_createRawTable_args setColumns(int columns) { this.columns = columns; setColumnsIsSet(true); return this; } public void unsetColumns() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COLUMNS_ISSET_ID); } /** Returns true if field columns is set (has been assigned a value) and false otherwise */ public boolean isSetColumns() { return EncodingUtils.testBit(__isset_bitfield, __COLUMNS_ISSET_ID); } public void setColumnsIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COLUMNS_ISSET_ID, value); } public byte[] getMetadata() { setMetadata(org.apache.thrift.TBaseHelper.rightSize(metadata)); return metadata == null ? null : metadata.array(); } public ByteBuffer bufferForMetadata() { return metadata; } public user_createRawTable_args setMetadata(byte[] metadata) { setMetadata(metadata == null ? (ByteBuffer)null : ByteBuffer.wrap(metadata)); return this; } public user_createRawTable_args setMetadata(ByteBuffer metadata) { this.metadata = metadata; return this; } public void unsetMetadata() { this.metadata = null; } /** Returns true if field metadata is set (has been assigned a value) and false otherwise */ public boolean isSetMetadata() { return this.metadata != null; } public void setMetadataIsSet(boolean value) { if (!value) { this.metadata = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case COLUMNS: if (value == null) { unsetColumns(); } else { setColumns((Integer)value); } break; case METADATA: if (value == null) { unsetMetadata(); } else { setMetadata((ByteBuffer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case COLUMNS: return Integer.valueOf(getColumns()); case METADATA: return getMetadata(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); case COLUMNS: return isSetColumns(); case METADATA: return isSetMetadata(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createRawTable_args) return this.equals((user_createRawTable_args)that); return false; } public boolean equals(user_createRawTable_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_columns = true; boolean that_present_columns = true; if (this_present_columns || that_present_columns) { if (!(this_present_columns && that_present_columns)) return false; if (this.columns != that.columns) return false; } boolean this_present_metadata = true && this.isSetMetadata(); boolean that_present_metadata = true && that.isSetMetadata(); if (this_present_metadata || that_present_metadata) { if (!(this_present_metadata && that_present_metadata)) return false; if (!this.metadata.equals(that.metadata)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createRawTable_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); if (lastComparison != 0) { return lastComparison; } if (isSetColumns()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetMetadata()).compareTo(other.isSetMetadata()); if (lastComparison != 0) { return lastComparison; } if (isSetMetadata()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadata, other.metadata); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createRawTable_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("columns:"); sb.append(this.columns); first = false; if (!first) sb.append(", "); sb.append("metadata:"); if (this.metadata == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.metadata, sb); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createRawTable_argsStandardSchemeFactory implements SchemeFactory { public user_createRawTable_argsStandardScheme getScheme() { return new user_createRawTable_argsStandardScheme(); } } private static class user_createRawTable_argsStandardScheme extends StandardScheme<user_createRawTable_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createRawTable_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // COLUMNS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.columns = iprot.readI32(); struct.setColumnsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // METADATA if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.metadata = iprot.readBinary(); struct.setMetadataIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createRawTable_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldBegin(COLUMNS_FIELD_DESC); oprot.writeI32(struct.columns); oprot.writeFieldEnd(); if (struct.metadata != null) { oprot.writeFieldBegin(METADATA_FIELD_DESC); oprot.writeBinary(struct.metadata); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createRawTable_argsTupleSchemeFactory implements SchemeFactory { public user_createRawTable_argsTupleScheme getScheme() { return new user_createRawTable_argsTupleScheme(); } } private static class user_createRawTable_argsTupleScheme extends TupleScheme<user_createRawTable_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createRawTable_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } if (struct.isSetColumns()) { optionals.set(1); } if (struct.isSetMetadata()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetColumns()) { oprot.writeI32(struct.columns); } if (struct.isSetMetadata()) { oprot.writeBinary(struct.metadata); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createRawTable_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(1)) { struct.columns = iprot.readI32(); struct.setColumnsIsSet(true); } if (incoming.get(2)) { struct.metadata = iprot.readBinary(); struct.setMetadataIsSet(true); } } } } public static class user_createRawTable_result implements org.apache.thrift.TBase<user_createRawTable_result, user_createRawTable_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_createRawTable_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createRawTable_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); private static final org.apache.thrift.protocol.TField E_R_FIELD_DESC = new org.apache.thrift.protocol.TField("eR", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField E_TA_FIELD_DESC = new org.apache.thrift.protocol.TField("eTa", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_createRawTable_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_createRawTable_resultTupleSchemeFactory()); } public int success; // required public FileAlreadyExistException eR; // required public InvalidPathException eI; // required public TableColumnException eT; // required public TachyonException eTa; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_R((short)1, "eR"), E_I((short)2, "eI"), E_T((short)3, "eT"), E_TA((short)4, "eTa"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_R return E_R; case 2: // E_I return E_I; case 3: // E_T return E_T; case 4: // E_TA return E_TA; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.E_R, new org.apache.thrift.meta_data.FieldMetaData("eR", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_T, new org.apache.thrift.meta_data.FieldMetaData("eT", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_TA, new org.apache.thrift.meta_data.FieldMetaData("eTa", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createRawTable_result.class, metaDataMap); } public user_createRawTable_result() { } public user_createRawTable_result( int success, FileAlreadyExistException eR, InvalidPathException eI, TableColumnException eT, TachyonException eTa) { this(); this.success = success; setSuccessIsSet(true); this.eR = eR; this.eI = eI; this.eT = eT; this.eTa = eTa; } /** * Performs a deep copy on <i>other</i>. */ public user_createRawTable_result(user_createRawTable_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetER()) { this.eR = new FileAlreadyExistException(other.eR); } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } if (other.isSetET()) { this.eT = new TableColumnException(other.eT); } if (other.isSetETa()) { this.eTa = new TachyonException(other.eTa); } } public user_createRawTable_result deepCopy() { return new user_createRawTable_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.eR = null; this.eI = null; this.eT = null; this.eTa = null; } public int getSuccess() { return this.success; } public user_createRawTable_result setSuccess(int success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileAlreadyExistException getER() { return this.eR; } public user_createRawTable_result setER(FileAlreadyExistException eR) { this.eR = eR; return this; } public void unsetER() { this.eR = null; } /** Returns true if field eR is set (has been assigned a value) and false otherwise */ public boolean isSetER() { return this.eR != null; } public void setERIsSet(boolean value) { if (!value) { this.eR = null; } } public InvalidPathException getEI() { return this.eI; } public user_createRawTable_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public TableColumnException getET() { return this.eT; } public user_createRawTable_result setET(TableColumnException eT) { this.eT = eT; return this; } public void unsetET() { this.eT = null; } /** Returns true if field eT is set (has been assigned a value) and false otherwise */ public boolean isSetET() { return this.eT != null; } public void setETIsSet(boolean value) { if (!value) { this.eT = null; } } public TachyonException getETa() { return this.eTa; } public user_createRawTable_result setETa(TachyonException eTa) { this.eTa = eTa; return this; } public void unsetETa() { this.eTa = null; } /** Returns true if field eTa is set (has been assigned a value) and false otherwise */ public boolean isSetETa() { return this.eTa != null; } public void setETaIsSet(boolean value) { if (!value) { this.eTa = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Integer)value); } break; case E_R: if (value == null) { unsetER(); } else { setER((FileAlreadyExistException)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; case E_T: if (value == null) { unsetET(); } else { setET((TableColumnException)value); } break; case E_TA: if (value == null) { unsetETa(); } else { setETa((TachyonException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Integer.valueOf(getSuccess()); case E_R: return getER(); case E_I: return getEI(); case E_T: return getET(); case E_TA: return getETa(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_R: return isSetER(); case E_I: return isSetEI(); case E_T: return isSetET(); case E_TA: return isSetETa(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_createRawTable_result) return this.equals((user_createRawTable_result)that); return false; } public boolean equals(user_createRawTable_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_eR = true && this.isSetER(); boolean that_present_eR = true && that.isSetER(); if (this_present_eR || that_present_eR) { if (!(this_present_eR && that_present_eR)) return false; if (!this.eR.equals(that.eR)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } boolean this_present_eT = true && this.isSetET(); boolean that_present_eT = true && that.isSetET(); if (this_present_eT || that_present_eT) { if (!(this_present_eT && that_present_eT)) return false; if (!this.eT.equals(that.eT)) return false; } boolean this_present_eTa = true && this.isSetETa(); boolean that_present_eTa = true && that.isSetETa(); if (this_present_eTa || that_present_eTa) { if (!(this_present_eTa && that_present_eTa)) return false; if (!this.eTa.equals(that.eTa)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_createRawTable_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetER()).compareTo(other.isSetER()); if (lastComparison != 0) { return lastComparison; } if (isSetER()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eR, other.eR); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetET()).compareTo(other.isSetET()); if (lastComparison != 0) { return lastComparison; } if (isSetET()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eT, other.eT); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetETa()).compareTo(other.isSetETa()); if (lastComparison != 0) { return lastComparison; } if (isSetETa()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eTa, other.eTa); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_createRawTable_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("eR:"); if (this.eR == null) { sb.append("null"); } else { sb.append(this.eR); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; if (!first) sb.append(", "); sb.append("eT:"); if (this.eT == null) { sb.append("null"); } else { sb.append(this.eT); } first = false; if (!first) sb.append(", "); sb.append("eTa:"); if (this.eTa == null) { sb.append("null"); } else { sb.append(this.eTa); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_createRawTable_resultStandardSchemeFactory implements SchemeFactory { public user_createRawTable_resultStandardScheme getScheme() { return new user_createRawTable_resultStandardScheme(); } } private static class user_createRawTable_resultStandardScheme extends StandardScheme<user_createRawTable_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_createRawTable_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_R if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eR = new FileAlreadyExistException(); struct.eR.read(iprot); struct.setERIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // E_T if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eT = new TableColumnException(); struct.eT.read(iprot); struct.setETIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // E_TA if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eTa = new TachyonException(); struct.eTa.read(iprot); struct.setETaIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_createRawTable_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI32(struct.success); oprot.writeFieldEnd(); } if (struct.eR != null) { oprot.writeFieldBegin(E_R_FIELD_DESC); struct.eR.write(oprot); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } if (struct.eT != null) { oprot.writeFieldBegin(E_T_FIELD_DESC); struct.eT.write(oprot); oprot.writeFieldEnd(); } if (struct.eTa != null) { oprot.writeFieldBegin(E_TA_FIELD_DESC); struct.eTa.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_createRawTable_resultTupleSchemeFactory implements SchemeFactory { public user_createRawTable_resultTupleScheme getScheme() { return new user_createRawTable_resultTupleScheme(); } } private static class user_createRawTable_resultTupleScheme extends TupleScheme<user_createRawTable_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_createRawTable_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetER()) { optionals.set(1); } if (struct.isSetEI()) { optionals.set(2); } if (struct.isSetET()) { optionals.set(3); } if (struct.isSetETa()) { optionals.set(4); } oprot.writeBitSet(optionals, 5); if (struct.isSetSuccess()) { oprot.writeI32(struct.success); } if (struct.isSetER()) { struct.eR.write(oprot); } if (struct.isSetEI()) { struct.eI.write(oprot); } if (struct.isSetET()) { struct.eT.write(oprot); } if (struct.isSetETa()) { struct.eTa.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_createRawTable_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eR = new FileAlreadyExistException(); struct.eR.read(iprot); struct.setERIsSet(true); } if (incoming.get(2)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } if (incoming.get(3)) { struct.eT = new TableColumnException(); struct.eT.read(iprot); struct.setETIsSet(true); } if (incoming.get(4)) { struct.eTa = new TachyonException(); struct.eTa.read(iprot); struct.setETaIsSet(true); } } } } public static class user_getRawTableId_args implements org.apache.thrift.TBase<user_getRawTableId_args, user_getRawTableId_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getRawTableId_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getRawTableId_args"); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getRawTableId_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getRawTableId_argsTupleSchemeFactory()); } public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PATH((short)1, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getRawTableId_args.class, metaDataMap); } public user_getRawTableId_args() { } public user_getRawTableId_args( String path) { this(); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public user_getRawTableId_args(user_getRawTableId_args other) { if (other.isSetPath()) { this.path = other.path; } } public user_getRawTableId_args deepCopy() { return new user_getRawTableId_args(this); } @Override public void clear() { this.path = null; } public String getPath() { return this.path; } public user_getRawTableId_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getRawTableId_args) return this.equals((user_getRawTableId_args)that); return false; } public boolean equals(user_getRawTableId_args that) { if (that == null) return false; boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getRawTableId_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getRawTableId_args("); boolean first = true; sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getRawTableId_argsStandardSchemeFactory implements SchemeFactory { public user_getRawTableId_argsStandardScheme getScheme() { return new user_getRawTableId_argsStandardScheme(); } } private static class user_getRawTableId_argsStandardScheme extends StandardScheme<user_getRawTableId_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getRawTableId_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getRawTableId_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getRawTableId_argsTupleSchemeFactory implements SchemeFactory { public user_getRawTableId_argsTupleScheme getScheme() { return new user_getRawTableId_argsTupleScheme(); } } private static class user_getRawTableId_argsTupleScheme extends TupleScheme<user_getRawTableId_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getRawTableId_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPath()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getRawTableId_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class user_getRawTableId_result implements org.apache.thrift.TBase<user_getRawTableId_result, user_getRawTableId_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getRawTableId_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getRawTableId_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getRawTableId_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getRawTableId_resultTupleSchemeFactory()); } public int success; // required public InvalidPathException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getRawTableId_result.class, metaDataMap); } public user_getRawTableId_result() { } public user_getRawTableId_result( int success, InvalidPathException e) { this(); this.success = success; setSuccessIsSet(true); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_getRawTableId_result(user_getRawTableId_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new InvalidPathException(other.e); } } public user_getRawTableId_result deepCopy() { return new user_getRawTableId_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.e = null; } public int getSuccess() { return this.success; } public user_getRawTableId_result setSuccess(int success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public InvalidPathException getE() { return this.e; } public user_getRawTableId_result setE(InvalidPathException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Integer)value); } break; case E: if (value == null) { unsetE(); } else { setE((InvalidPathException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Integer.valueOf(getSuccess()); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getRawTableId_result) return this.equals((user_getRawTableId_result)that); return false; } public boolean equals(user_getRawTableId_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getRawTableId_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getRawTableId_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getRawTableId_resultStandardSchemeFactory implements SchemeFactory { public user_getRawTableId_resultStandardScheme getScheme() { return new user_getRawTableId_resultStandardScheme(); } } private static class user_getRawTableId_resultStandardScheme extends StandardScheme<user_getRawTableId_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getRawTableId_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new InvalidPathException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getRawTableId_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI32(struct.success); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getRawTableId_resultTupleSchemeFactory implements SchemeFactory { public user_getRawTableId_resultTupleScheme getScheme() { return new user_getRawTableId_resultTupleScheme(); } } private static class user_getRawTableId_resultTupleScheme extends TupleScheme<user_getRawTableId_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getRawTableId_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeI32(struct.success); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getRawTableId_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new InvalidPathException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } public static class user_getClientRawTableInfo_args implements org.apache.thrift.TBase<user_getClientRawTableInfo_args, user_getClientRawTableInfo_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getClientRawTableInfo_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientRawTableInfo_args"); private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getClientRawTableInfo_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getClientRawTableInfo_argsTupleSchemeFactory()); } public int id; // required public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ID((short)1, "id"), PATH((short)2, "path"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // ID return ID; case 2: // PATH return PATH; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __ID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientRawTableInfo_args.class, metaDataMap); } public user_getClientRawTableInfo_args() { } public user_getClientRawTableInfo_args( int id, String path) { this(); this.id = id; setIdIsSet(true); this.path = path; } /** * Performs a deep copy on <i>other</i>. */ public user_getClientRawTableInfo_args(user_getClientRawTableInfo_args other) { __isset_bitfield = other.__isset_bitfield; this.id = other.id; if (other.isSetPath()) { this.path = other.path; } } public user_getClientRawTableInfo_args deepCopy() { return new user_getClientRawTableInfo_args(this); } @Override public void clear() { setIdIsSet(false); this.id = 0; this.path = null; } public int getId() { return this.id; } public user_getClientRawTableInfo_args setId(int id) { this.id = id; setIdIsSet(true); return this; } public void unsetId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); } /** Returns true if field id is set (has been assigned a value) and false otherwise */ public boolean isSetId() { return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); } public void setIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); } public String getPath() { return this.path; } public user_getClientRawTableInfo_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case ID: if (value == null) { unsetId(); } else { setId((Integer)value); } break; case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case ID: return Integer.valueOf(getId()); case PATH: return getPath(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case ID: return isSetId(); case PATH: return isSetPath(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getClientRawTableInfo_args) return this.equals((user_getClientRawTableInfo_args)that); return false; } public boolean equals(user_getClientRawTableInfo_args that) { if (that == null) return false; boolean this_present_id = true; boolean that_present_id = true; if (this_present_id || that_present_id) { if (!(this_present_id && that_present_id)) return false; if (this.id != that.id) return false; } boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getClientRawTableInfo_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); if (lastComparison != 0) { return lastComparison; } if (isSetId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getClientRawTableInfo_args("); boolean first = true; sb.append("id:"); sb.append(this.id); first = false; if (!first) sb.append(", "); sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getClientRawTableInfo_argsStandardSchemeFactory implements SchemeFactory { public user_getClientRawTableInfo_argsStandardScheme getScheme() { return new user_getClientRawTableInfo_argsStandardScheme(); } } private static class user_getClientRawTableInfo_argsStandardScheme extends StandardScheme<user_getClientRawTableInfo_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientRawTableInfo_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.id = iprot.readI32(); struct.setIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientRawTableInfo_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(ID_FIELD_DESC); oprot.writeI32(struct.id); oprot.writeFieldEnd(); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getClientRawTableInfo_argsTupleSchemeFactory implements SchemeFactory { public user_getClientRawTableInfo_argsTupleScheme getScheme() { return new user_getClientRawTableInfo_argsTupleScheme(); } } private static class user_getClientRawTableInfo_argsTupleScheme extends TupleScheme<user_getClientRawTableInfo_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetId()) { optionals.set(0); } if (struct.isSetPath()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetId()) { oprot.writeI32(struct.id); } if (struct.isSetPath()) { oprot.writeString(struct.path); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfo_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.id = iprot.readI32(); struct.setIdIsSet(true); } if (incoming.get(1)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } } } } public static class user_getClientRawTableInfo_result implements org.apache.thrift.TBase<user_getClientRawTableInfo_result, user_getClientRawTableInfo_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getClientRawTableInfo_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientRawTableInfo_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getClientRawTableInfo_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getClientRawTableInfo_resultTupleSchemeFactory()); } public ClientRawTableInfo success; // required public TableDoesNotExistException eT; // required public InvalidPathException eI; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E_T((short)1, "eT"), E_I((short)2, "eI"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E_T return E_T; case 2: // E_I return E_I; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientRawTableInfo.class))); tmpMap.put(_Fields.E_T, new org.apache.thrift.meta_data.FieldMetaData("eT", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientRawTableInfo_result.class, metaDataMap); } public user_getClientRawTableInfo_result() { } public user_getClientRawTableInfo_result( ClientRawTableInfo success, TableDoesNotExistException eT, InvalidPathException eI) { this(); this.success = success; this.eT = eT; this.eI = eI; } /** * Performs a deep copy on <i>other</i>. */ public user_getClientRawTableInfo_result(user_getClientRawTableInfo_result other) { if (other.isSetSuccess()) { this.success = new ClientRawTableInfo(other.success); } if (other.isSetET()) { this.eT = new TableDoesNotExistException(other.eT); } if (other.isSetEI()) { this.eI = new InvalidPathException(other.eI); } } public user_getClientRawTableInfo_result deepCopy() { return new user_getClientRawTableInfo_result(this); } @Override public void clear() { this.success = null; this.eT = null; this.eI = null; } public ClientRawTableInfo getSuccess() { return this.success; } public user_getClientRawTableInfo_result setSuccess(ClientRawTableInfo success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public TableDoesNotExistException getET() { return this.eT; } public user_getClientRawTableInfo_result setET(TableDoesNotExistException eT) { this.eT = eT; return this; } public void unsetET() { this.eT = null; } /** Returns true if field eT is set (has been assigned a value) and false otherwise */ public boolean isSetET() { return this.eT != null; } public void setETIsSet(boolean value) { if (!value) { this.eT = null; } } public InvalidPathException getEI() { return this.eI; } public user_getClientRawTableInfo_result setEI(InvalidPathException eI) { this.eI = eI; return this; } public void unsetEI() { this.eI = null; } /** Returns true if field eI is set (has been assigned a value) and false otherwise */ public boolean isSetEI() { return this.eI != null; } public void setEIIsSet(boolean value) { if (!value) { this.eI = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((ClientRawTableInfo)value); } break; case E_T: if (value == null) { unsetET(); } else { setET((TableDoesNotExistException)value); } break; case E_I: if (value == null) { unsetEI(); } else { setEI((InvalidPathException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case E_T: return getET(); case E_I: return getEI(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E_T: return isSetET(); case E_I: return isSetEI(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getClientRawTableInfo_result) return this.equals((user_getClientRawTableInfo_result)that); return false; } public boolean equals(user_getClientRawTableInfo_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_eT = true && this.isSetET(); boolean that_present_eT = true && that.isSetET(); if (this_present_eT || that_present_eT) { if (!(this_present_eT && that_present_eT)) return false; if (!this.eT.equals(that.eT)) return false; } boolean this_present_eI = true && this.isSetEI(); boolean that_present_eI = true && that.isSetEI(); if (this_present_eI || that_present_eI) { if (!(this_present_eI && that_present_eI)) return false; if (!this.eI.equals(that.eI)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getClientRawTableInfo_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetET()).compareTo(other.isSetET()); if (lastComparison != 0) { return lastComparison; } if (isSetET()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eT, other.eT); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); if (lastComparison != 0) { return lastComparison; } if (isSetEI()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, other.eI); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getClientRawTableInfo_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("eT:"); if (this.eT == null) { sb.append("null"); } else { sb.append(this.eT); } first = false; if (!first) sb.append(", "); sb.append("eI:"); if (this.eI == null) { sb.append("null"); } else { sb.append(this.eI); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getClientRawTableInfo_resultStandardSchemeFactory implements SchemeFactory { public user_getClientRawTableInfo_resultStandardScheme getScheme() { return new user_getClientRawTableInfo_resultStandardScheme(); } } private static class user_getClientRawTableInfo_resultStandardScheme extends StandardScheme<user_getClientRawTableInfo_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientRawTableInfo_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new ClientRawTableInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E_T if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eT = new TableDoesNotExistException(); struct.eT.read(iprot); struct.setETIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_I if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientRawTableInfo_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.eT != null) { oprot.writeFieldBegin(E_T_FIELD_DESC); struct.eT.write(oprot); oprot.writeFieldEnd(); } if (struct.eI != null) { oprot.writeFieldBegin(E_I_FIELD_DESC); struct.eI.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getClientRawTableInfo_resultTupleSchemeFactory implements SchemeFactory { public user_getClientRawTableInfo_resultTupleScheme getScheme() { return new user_getClientRawTableInfo_resultTupleScheme(); } } private static class user_getClientRawTableInfo_resultTupleScheme extends TupleScheme<user_getClientRawTableInfo_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetET()) { optionals.set(1); } if (struct.isSetEI()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetET()) { struct.eT.write(oprot); } if (struct.isSetEI()) { struct.eI.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfo_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.success = new ClientRawTableInfo(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.eT = new TableDoesNotExistException(); struct.eT.read(iprot); struct.setETIsSet(true); } if (incoming.get(2)) { struct.eI = new InvalidPathException(); struct.eI.read(iprot); struct.setEIIsSet(true); } } } } public static class user_updateRawTableMetadata_args implements org.apache.thrift.TBase<user_updateRawTableMetadata_args, user_updateRawTableMetadata_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_updateRawTableMetadata_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_updateRawTableMetadata_args"); private static final org.apache.thrift.protocol.TField TABLE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tableId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("metadata", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_updateRawTableMetadata_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_updateRawTableMetadata_argsTupleSchemeFactory()); } public int tableId; // required public ByteBuffer metadata; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { TABLE_ID((short)1, "tableId"), METADATA((short)2, "metadata"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // TABLE_ID return TABLE_ID; case 2: // METADATA return METADATA; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __TABLEID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.TABLE_ID, new org.apache.thrift.meta_data.FieldMetaData("tableId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.METADATA, new org.apache.thrift.meta_data.FieldMetaData("metadata", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_updateRawTableMetadata_args.class, metaDataMap); } public user_updateRawTableMetadata_args() { } public user_updateRawTableMetadata_args( int tableId, ByteBuffer metadata) { this(); this.tableId = tableId; setTableIdIsSet(true); this.metadata = metadata; } /** * Performs a deep copy on <i>other</i>. */ public user_updateRawTableMetadata_args(user_updateRawTableMetadata_args other) { __isset_bitfield = other.__isset_bitfield; this.tableId = other.tableId; if (other.isSetMetadata()) { this.metadata = org.apache.thrift.TBaseHelper.copyBinary(other.metadata); ; } } public user_updateRawTableMetadata_args deepCopy() { return new user_updateRawTableMetadata_args(this); } @Override public void clear() { setTableIdIsSet(false); this.tableId = 0; this.metadata = null; } public int getTableId() { return this.tableId; } public user_updateRawTableMetadata_args setTableId(int tableId) { this.tableId = tableId; setTableIdIsSet(true); return this; } public void unsetTableId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TABLEID_ISSET_ID); } /** Returns true if field tableId is set (has been assigned a value) and false otherwise */ public boolean isSetTableId() { return EncodingUtils.testBit(__isset_bitfield, __TABLEID_ISSET_ID); } public void setTableIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TABLEID_ISSET_ID, value); } public byte[] getMetadata() { setMetadata(org.apache.thrift.TBaseHelper.rightSize(metadata)); return metadata == null ? null : metadata.array(); } public ByteBuffer bufferForMetadata() { return metadata; } public user_updateRawTableMetadata_args setMetadata(byte[] metadata) { setMetadata(metadata == null ? (ByteBuffer)null : ByteBuffer.wrap(metadata)); return this; } public user_updateRawTableMetadata_args setMetadata(ByteBuffer metadata) { this.metadata = metadata; return this; } public void unsetMetadata() { this.metadata = null; } /** Returns true if field metadata is set (has been assigned a value) and false otherwise */ public boolean isSetMetadata() { return this.metadata != null; } public void setMetadataIsSet(boolean value) { if (!value) { this.metadata = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case TABLE_ID: if (value == null) { unsetTableId(); } else { setTableId((Integer)value); } break; case METADATA: if (value == null) { unsetMetadata(); } else { setMetadata((ByteBuffer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case TABLE_ID: return Integer.valueOf(getTableId()); case METADATA: return getMetadata(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case TABLE_ID: return isSetTableId(); case METADATA: return isSetMetadata(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_updateRawTableMetadata_args) return this.equals((user_updateRawTableMetadata_args)that); return false; } public boolean equals(user_updateRawTableMetadata_args that) { if (that == null) return false; boolean this_present_tableId = true; boolean that_present_tableId = true; if (this_present_tableId || that_present_tableId) { if (!(this_present_tableId && that_present_tableId)) return false; if (this.tableId != that.tableId) return false; } boolean this_present_metadata = true && this.isSetMetadata(); boolean that_present_metadata = true && that.isSetMetadata(); if (this_present_metadata || that_present_metadata) { if (!(this_present_metadata && that_present_metadata)) return false; if (!this.metadata.equals(that.metadata)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_updateRawTableMetadata_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetTableId()).compareTo(other.isSetTableId()); if (lastComparison != 0) { return lastComparison; } if (isSetTableId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableId, other.tableId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetMetadata()).compareTo(other.isSetMetadata()); if (lastComparison != 0) { return lastComparison; } if (isSetMetadata()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadata, other.metadata); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_updateRawTableMetadata_args("); boolean first = true; sb.append("tableId:"); sb.append(this.tableId); first = false; if (!first) sb.append(", "); sb.append("metadata:"); if (this.metadata == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.metadata, sb); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_updateRawTableMetadata_argsStandardSchemeFactory implements SchemeFactory { public user_updateRawTableMetadata_argsStandardScheme getScheme() { return new user_updateRawTableMetadata_argsStandardScheme(); } } private static class user_updateRawTableMetadata_argsStandardScheme extends StandardScheme<user_updateRawTableMetadata_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_updateRawTableMetadata_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // TABLE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.tableId = iprot.readI32(); struct.setTableIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // METADATA if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.metadata = iprot.readBinary(); struct.setMetadataIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_updateRawTableMetadata_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(TABLE_ID_FIELD_DESC); oprot.writeI32(struct.tableId); oprot.writeFieldEnd(); if (struct.metadata != null) { oprot.writeFieldBegin(METADATA_FIELD_DESC); oprot.writeBinary(struct.metadata); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_updateRawTableMetadata_argsTupleSchemeFactory implements SchemeFactory { public user_updateRawTableMetadata_argsTupleScheme getScheme() { return new user_updateRawTableMetadata_argsTupleScheme(); } } private static class user_updateRawTableMetadata_argsTupleScheme extends TupleScheme<user_updateRawTableMetadata_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_updateRawTableMetadata_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetTableId()) { optionals.set(0); } if (struct.isSetMetadata()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetTableId()) { oprot.writeI32(struct.tableId); } if (struct.isSetMetadata()) { oprot.writeBinary(struct.metadata); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_updateRawTableMetadata_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.tableId = iprot.readI32(); struct.setTableIdIsSet(true); } if (incoming.get(1)) { struct.metadata = iprot.readBinary(); struct.setMetadataIsSet(true); } } } } public static class user_updateRawTableMetadata_result implements org.apache.thrift.TBase<user_updateRawTableMetadata_result, user_updateRawTableMetadata_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_updateRawTableMetadata_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_updateRawTableMetadata_result"); private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_TA_FIELD_DESC = new org.apache.thrift.protocol.TField("eTa", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_updateRawTableMetadata_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_updateRawTableMetadata_resultTupleSchemeFactory()); } public TableDoesNotExistException eT; // required public TachyonException eTa; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { E_T((short)1, "eT"), E_TA((short)2, "eTa"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // E_T return E_T; case 2: // E_TA return E_TA; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.E_T, new org.apache.thrift.meta_data.FieldMetaData("eT", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.E_TA, new org.apache.thrift.meta_data.FieldMetaData("eTa", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_updateRawTableMetadata_result.class, metaDataMap); } public user_updateRawTableMetadata_result() { } public user_updateRawTableMetadata_result( TableDoesNotExistException eT, TachyonException eTa) { this(); this.eT = eT; this.eTa = eTa; } /** * Performs a deep copy on <i>other</i>. */ public user_updateRawTableMetadata_result(user_updateRawTableMetadata_result other) { if (other.isSetET()) { this.eT = new TableDoesNotExistException(other.eT); } if (other.isSetETa()) { this.eTa = new TachyonException(other.eTa); } } public user_updateRawTableMetadata_result deepCopy() { return new user_updateRawTableMetadata_result(this); } @Override public void clear() { this.eT = null; this.eTa = null; } public TableDoesNotExistException getET() { return this.eT; } public user_updateRawTableMetadata_result setET(TableDoesNotExistException eT) { this.eT = eT; return this; } public void unsetET() { this.eT = null; } /** Returns true if field eT is set (has been assigned a value) and false otherwise */ public boolean isSetET() { return this.eT != null; } public void setETIsSet(boolean value) { if (!value) { this.eT = null; } } public TachyonException getETa() { return this.eTa; } public user_updateRawTableMetadata_result setETa(TachyonException eTa) { this.eTa = eTa; return this; } public void unsetETa() { this.eTa = null; } /** Returns true if field eTa is set (has been assigned a value) and false otherwise */ public boolean isSetETa() { return this.eTa != null; } public void setETaIsSet(boolean value) { if (!value) { this.eTa = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case E_T: if (value == null) { unsetET(); } else { setET((TableDoesNotExistException)value); } break; case E_TA: if (value == null) { unsetETa(); } else { setETa((TachyonException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case E_T: return getET(); case E_TA: return getETa(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case E_T: return isSetET(); case E_TA: return isSetETa(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_updateRawTableMetadata_result) return this.equals((user_updateRawTableMetadata_result)that); return false; } public boolean equals(user_updateRawTableMetadata_result that) { if (that == null) return false; boolean this_present_eT = true && this.isSetET(); boolean that_present_eT = true && that.isSetET(); if (this_present_eT || that_present_eT) { if (!(this_present_eT && that_present_eT)) return false; if (!this.eT.equals(that.eT)) return false; } boolean this_present_eTa = true && this.isSetETa(); boolean that_present_eTa = true && that.isSetETa(); if (this_present_eTa || that_present_eTa) { if (!(this_present_eTa && that_present_eTa)) return false; if (!this.eTa.equals(that.eTa)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_updateRawTableMetadata_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetET()).compareTo(other.isSetET()); if (lastComparison != 0) { return lastComparison; } if (isSetET()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eT, other.eT); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetETa()).compareTo(other.isSetETa()); if (lastComparison != 0) { return lastComparison; } if (isSetETa()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eTa, other.eTa); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_updateRawTableMetadata_result("); boolean first = true; sb.append("eT:"); if (this.eT == null) { sb.append("null"); } else { sb.append(this.eT); } first = false; if (!first) sb.append(", "); sb.append("eTa:"); if (this.eTa == null) { sb.append("null"); } else { sb.append(this.eTa); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_updateRawTableMetadata_resultStandardSchemeFactory implements SchemeFactory { public user_updateRawTableMetadata_resultStandardScheme getScheme() { return new user_updateRawTableMetadata_resultStandardScheme(); } } private static class user_updateRawTableMetadata_resultStandardScheme extends StandardScheme<user_updateRawTableMetadata_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_updateRawTableMetadata_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // E_T if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eT = new TableDoesNotExistException(); struct.eT.read(iprot); struct.setETIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // E_TA if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.eTa = new TachyonException(); struct.eTa.read(iprot); struct.setETaIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_updateRawTableMetadata_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.eT != null) { oprot.writeFieldBegin(E_T_FIELD_DESC); struct.eT.write(oprot); oprot.writeFieldEnd(); } if (struct.eTa != null) { oprot.writeFieldBegin(E_TA_FIELD_DESC); struct.eTa.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_updateRawTableMetadata_resultTupleSchemeFactory implements SchemeFactory { public user_updateRawTableMetadata_resultTupleScheme getScheme() { return new user_updateRawTableMetadata_resultTupleScheme(); } } private static class user_updateRawTableMetadata_resultTupleScheme extends TupleScheme<user_updateRawTableMetadata_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_updateRawTableMetadata_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetET()) { optionals.set(0); } if (struct.isSetETa()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetET()) { struct.eT.write(oprot); } if (struct.isSetETa()) { struct.eTa.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_updateRawTableMetadata_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.eT = new TableDoesNotExistException(); struct.eT.read(iprot); struct.setETIsSet(true); } if (incoming.get(1)) { struct.eTa = new TachyonException(); struct.eTa.read(iprot); struct.setETaIsSet(true); } } } } public static class user_getUfsAddress_args implements org.apache.thrift.TBase<user_getUfsAddress_args, user_getUfsAddress_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_getUfsAddress_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getUfsAddress_args"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getUfsAddress_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getUfsAddress_argsTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getUfsAddress_args.class, metaDataMap); } public user_getUfsAddress_args() { } /** * Performs a deep copy on <i>other</i>. */ public user_getUfsAddress_args(user_getUfsAddress_args other) { } public user_getUfsAddress_args deepCopy() { return new user_getUfsAddress_args(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getUfsAddress_args) return this.equals((user_getUfsAddress_args)that); return false; } public boolean equals(user_getUfsAddress_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getUfsAddress_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getUfsAddress_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getUfsAddress_argsStandardSchemeFactory implements SchemeFactory { public user_getUfsAddress_argsStandardScheme getScheme() { return new user_getUfsAddress_argsStandardScheme(); } } private static class user_getUfsAddress_argsStandardScheme extends StandardScheme<user_getUfsAddress_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getUfsAddress_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getUfsAddress_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getUfsAddress_argsTupleSchemeFactory implements SchemeFactory { public user_getUfsAddress_argsTupleScheme getScheme() { return new user_getUfsAddress_argsTupleScheme(); } } private static class user_getUfsAddress_argsTupleScheme extends TupleScheme<user_getUfsAddress_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getUfsAddress_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getUfsAddress_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class user_getUfsAddress_result implements org.apache.thrift.TBase<user_getUfsAddress_result, user_getUfsAddress_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_getUfsAddress_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getUfsAddress_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_getUfsAddress_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_getUfsAddress_resultTupleSchemeFactory()); } public String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getUfsAddress_result.class, metaDataMap); } public user_getUfsAddress_result() { } public user_getUfsAddress_result( String success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public user_getUfsAddress_result(user_getUfsAddress_result other) { if (other.isSetSuccess()) { this.success = other.success; } } public user_getUfsAddress_result deepCopy() { return new user_getUfsAddress_result(this); } @Override public void clear() { this.success = null; } public String getSuccess() { return this.success; } public user_getUfsAddress_result setSuccess(String success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_getUfsAddress_result) return this.equals((user_getUfsAddress_result)that); return false; } public boolean equals(user_getUfsAddress_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_getUfsAddress_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_getUfsAddress_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_getUfsAddress_resultStandardSchemeFactory implements SchemeFactory { public user_getUfsAddress_resultStandardScheme getScheme() { return new user_getUfsAddress_resultStandardScheme(); } } private static class user_getUfsAddress_resultStandardScheme extends StandardScheme<user_getUfsAddress_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_getUfsAddress_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_getUfsAddress_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeString(struct.success); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_getUfsAddress_resultTupleSchemeFactory implements SchemeFactory { public user_getUfsAddress_resultTupleScheme getScheme() { return new user_getUfsAddress_resultTupleScheme(); } } private static class user_getUfsAddress_resultTupleScheme extends TupleScheme<user_getUfsAddress_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_getUfsAddress_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { oprot.writeString(struct.success); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_getUfsAddress_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } } } } public static class user_heartbeat_args implements org.apache.thrift.TBase<user_heartbeat_args, user_heartbeat_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_heartbeat_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_heartbeat_args"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_heartbeat_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_heartbeat_argsTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_heartbeat_args.class, metaDataMap); } public user_heartbeat_args() { } /** * Performs a deep copy on <i>other</i>. */ public user_heartbeat_args(user_heartbeat_args other) { } public user_heartbeat_args deepCopy() { return new user_heartbeat_args(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_heartbeat_args) return this.equals((user_heartbeat_args)that); return false; } public boolean equals(user_heartbeat_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_heartbeat_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_heartbeat_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_heartbeat_argsStandardSchemeFactory implements SchemeFactory { public user_heartbeat_argsStandardScheme getScheme() { return new user_heartbeat_argsStandardScheme(); } } private static class user_heartbeat_argsStandardScheme extends StandardScheme<user_heartbeat_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_heartbeat_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_heartbeat_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_heartbeat_argsTupleSchemeFactory implements SchemeFactory { public user_heartbeat_argsTupleScheme getScheme() { return new user_heartbeat_argsTupleScheme(); } } private static class user_heartbeat_argsTupleScheme extends TupleScheme<user_heartbeat_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_heartbeat_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_heartbeat_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class user_heartbeat_result implements org.apache.thrift.TBase<user_heartbeat_result, user_heartbeat_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_heartbeat_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_heartbeat_result"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_heartbeat_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_heartbeat_resultTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_heartbeat_result.class, metaDataMap); } public user_heartbeat_result() { } /** * Performs a deep copy on <i>other</i>. */ public user_heartbeat_result(user_heartbeat_result other) { } public user_heartbeat_result deepCopy() { return new user_heartbeat_result(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_heartbeat_result) return this.equals((user_heartbeat_result)that); return false; } public boolean equals(user_heartbeat_result that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_heartbeat_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_heartbeat_result("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_heartbeat_resultStandardSchemeFactory implements SchemeFactory { public user_heartbeat_resultStandardScheme getScheme() { return new user_heartbeat_resultStandardScheme(); } } private static class user_heartbeat_resultStandardScheme extends StandardScheme<user_heartbeat_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_heartbeat_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_heartbeat_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_heartbeat_resultTupleSchemeFactory implements SchemeFactory { public user_heartbeat_resultTupleScheme getScheme() { return new user_heartbeat_resultTupleScheme(); } } private static class user_heartbeat_resultTupleScheme extends TupleScheme<user_heartbeat_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_heartbeat_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_heartbeat_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class user_freepath_args implements org.apache.thrift.TBase<user_freepath_args, user_freepath_args._Fields>, java.io.Serializable, Cloneable, Comparable<user_freepath_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_freepath_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField RECURSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("recursive", org.apache.thrift.protocol.TType.BOOL, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_freepath_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_freepath_argsTupleSchemeFactory()); } public int fileId; // required public String path; // required public boolean recursive; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FILE_ID((short)1, "fileId"), PATH((short)2, "path"), RECURSIVE((short)3, "recursive"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // FILE_ID return FILE_ID; case 2: // PATH return PATH; case 3: // RECURSIVE return RECURSIVE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __FILEID_ISSET_ID = 0; private static final int __RECURSIVE_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RECURSIVE, new org.apache.thrift.meta_data.FieldMetaData("recursive", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_freepath_args.class, metaDataMap); } public user_freepath_args() { } public user_freepath_args( int fileId, String path, boolean recursive) { this(); this.fileId = fileId; setFileIdIsSet(true); this.path = path; this.recursive = recursive; setRecursiveIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public user_freepath_args(user_freepath_args other) { __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; if (other.isSetPath()) { this.path = other.path; } this.recursive = other.recursive; } public user_freepath_args deepCopy() { return new user_freepath_args(this); } @Override public void clear() { setFileIdIsSet(false); this.fileId = 0; this.path = null; setRecursiveIsSet(false); this.recursive = false; } public int getFileId() { return this.fileId; } public user_freepath_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public String getPath() { return this.path; } public user_freepath_args setPath(String path) { this.path = path; return this; } public void unsetPath() { this.path = null; } /** Returns true if field path is set (has been assigned a value) and false otherwise */ public boolean isSetPath() { return this.path != null; } public void setPathIsSet(boolean value) { if (!value) { this.path = null; } } public boolean isRecursive() { return this.recursive; } public user_freepath_args setRecursive(boolean recursive) { this.recursive = recursive; setRecursiveIsSet(true); return this; } public void unsetRecursive() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ public boolean isSetRecursive() { return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } public void setRecursiveIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case FILE_ID: if (value == null) { unsetFileId(); } else { setFileId((Integer)value); } break; case PATH: if (value == null) { unsetPath(); } else { setPath((String)value); } break; case RECURSIVE: if (value == null) { unsetRecursive(); } else { setRecursive((Boolean)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FILE_ID: return Integer.valueOf(getFileId()); case PATH: return getPath(); case RECURSIVE: return Boolean.valueOf(isRecursive()); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FILE_ID: return isSetFileId(); case PATH: return isSetPath(); case RECURSIVE: return isSetRecursive(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_freepath_args) return this.equals((user_freepath_args)that); return false; } public boolean equals(user_freepath_args that) { if (that == null) return false; boolean this_present_fileId = true; boolean that_present_fileId = true; if (this_present_fileId || that_present_fileId) { if (!(this_present_fileId && that_present_fileId)) return false; if (this.fileId != that.fileId) return false; } boolean this_present_path = true && this.isSetPath(); boolean that_present_path = true && that.isSetPath(); if (this_present_path || that_present_path) { if (!(this_present_path && that_present_path)) return false; if (!this.path.equals(that.path)) return false; } boolean this_present_recursive = true; boolean that_present_recursive = true; if (this_present_recursive || that_present_recursive) { if (!(this_present_recursive && that_present_recursive)) return false; if (this.recursive != that.recursive) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_freepath_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId()); if (lastComparison != 0) { return lastComparison; } if (isSetFileId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); if (lastComparison != 0) { return lastComparison; } if (isSetPath()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRecursive()).compareTo(other.isSetRecursive()); if (lastComparison != 0) { return lastComparison; } if (isSetRecursive()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recursive, other.recursive); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_freepath_args("); boolean first = true; sb.append("fileId:"); sb.append(this.fileId); first = false; if (!first) sb.append(", "); sb.append("path:"); if (this.path == null) { sb.append("null"); } else { sb.append(this.path); } first = false; if (!first) sb.append(", "); sb.append("recursive:"); sb.append(this.recursive); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_freepath_argsStandardSchemeFactory implements SchemeFactory { public user_freepath_argsStandardScheme getScheme() { return new user_freepath_argsStandardScheme(); } } private static class user_freepath_argsStandardScheme extends StandardScheme<user_freepath_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_freepath_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // FILE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PATH if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.path = iprot.readString(); struct.setPathIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // RECURSIVE if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_freepath_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(FILE_ID_FIELD_DESC); oprot.writeI32(struct.fileId); oprot.writeFieldEnd(); if (struct.path != null) { oprot.writeFieldBegin(PATH_FIELD_DESC); oprot.writeString(struct.path); oprot.writeFieldEnd(); } oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); oprot.writeBool(struct.recursive); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_freepath_argsTupleSchemeFactory implements SchemeFactory { public user_freepath_argsTupleScheme getScheme() { return new user_freepath_argsTupleScheme(); } } private static class user_freepath_argsTupleScheme extends TupleScheme<user_freepath_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_freepath_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFileId()) { optionals.set(0); } if (struct.isSetPath()) { optionals.set(1); } if (struct.isSetRecursive()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetFileId()) { oprot.writeI32(struct.fileId); } if (struct.isSetPath()) { oprot.writeString(struct.path); } if (struct.isSetRecursive()) { oprot.writeBool(struct.recursive); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_freepath_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.fileId = iprot.readI32(); struct.setFileIdIsSet(true); } if (incoming.get(1)) { struct.path = iprot.readString(); struct.setPathIsSet(true); } if (incoming.get(2)) { struct.recursive = iprot.readBool(); struct.setRecursiveIsSet(true); } } } } public static class user_freepath_result implements org.apache.thrift.TBase<user_freepath_result, user_freepath_result._Fields>, java.io.Serializable, Cloneable, Comparable<user_freepath_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_freepath_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new user_freepath_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new user_freepath_resultTupleSchemeFactory()); } public boolean success; // required public FileDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), E((short)1, "e"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // E return E; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_freepath_result.class, metaDataMap); } public user_freepath_result() { } public user_freepath_result( boolean success, FileDoesNotExistException e) { this(); this.success = success; setSuccessIsSet(true); this.e = e; } /** * Performs a deep copy on <i>other</i>. */ public user_freepath_result(user_freepath_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new FileDoesNotExistException(other.e); } } public user_freepath_result deepCopy() { return new user_freepath_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = false; this.e = null; } public boolean isSuccess() { return this.success; } public user_freepath_result setSuccess(boolean success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileDoesNotExistException getE() { return this.e; } public user_freepath_result setE(FileDoesNotExistException e) { this.e = e; return this; } public void unsetE() { this.e = null; } /** Returns true if field e is set (has been assigned a value) and false otherwise */ public boolean isSetE() { return this.e != null; } public void setEIsSet(boolean value) { if (!value) { this.e = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Boolean)value); } break; case E: if (value == null) { unsetE(); } else { setE((FileDoesNotExistException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Boolean.valueOf(isSuccess()); case E: return getE(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case E: return isSetE(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof user_freepath_result) return this.equals((user_freepath_result)that); return false; } public boolean equals(user_freepath_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_e = true && this.isSetE(); boolean that_present_e = true && that.isSetE(); if (this_present_e || that_present_e) { if (!(this_present_e && that_present_e)) return false; if (!this.e.equals(that.e)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(user_freepath_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE()); if (lastComparison != 0) { return lastComparison; } if (isSetE()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("user_freepath_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("e:"); if (this.e == null) { sb.append("null"); } else { sb.append(this.e); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class user_freepath_resultStandardSchemeFactory implements SchemeFactory { public user_freepath_resultStandardScheme getScheme() { return new user_freepath_resultStandardScheme(); } } private static class user_freepath_resultStandardScheme extends StandardScheme<user_freepath_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, user_freepath_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // E if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, user_freepath_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeBool(struct.success); oprot.writeFieldEnd(); } if (struct.e != null) { oprot.writeFieldBegin(E_FIELD_DESC); struct.e.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class user_freepath_resultTupleSchemeFactory implements SchemeFactory { public user_freepath_resultTupleScheme getScheme() { return new user_freepath_resultTupleScheme(); } } private static class user_freepath_resultTupleScheme extends TupleScheme<user_freepath_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, user_freepath_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetE()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeBool(struct.success); } if (struct.isSetE()) { struct.e.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, user_freepath_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.e = new FileDoesNotExistException(); struct.e.read(iprot); struct.setEIsSet(true); } } } } }
remove unused FileDoesNotException for getFileStatus - thrift change
core/src/main/java/tachyon/thrift/MasterService.java
remove unused FileDoesNotException for getFileStatus - thrift change
<ide><path>ore/src/main/java/tachyon/thrift/MasterService.java <ide> */ <ide> public NetAddress user_getWorker(boolean random, String host) throws NoWorkerException, org.apache.thrift.TException; <ide> <del> public ClientFileInfo getFileStatus(int fileId, String path) throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException; <add> public ClientFileInfo getFileStatus(int fileId, String path) throws InvalidPathException, org.apache.thrift.TException; <ide> <ide> /** <ide> * Get block's ClientBlockInfo. <ide> throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getWorker failed: unknown result"); <ide> } <ide> <del> public ClientFileInfo getFileStatus(int fileId, String path) throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException <add> public ClientFileInfo getFileStatus(int fileId, String path) throws InvalidPathException, org.apache.thrift.TException <ide> { <ide> send_getFileStatus(fileId, path); <ide> return recv_getFileStatus(); <ide> sendBase("getFileStatus", args); <ide> } <ide> <del> public ClientFileInfo recv_getFileStatus() throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException <add> public ClientFileInfo recv_getFileStatus() throws InvalidPathException, org.apache.thrift.TException <ide> { <ide> getFileStatus_result result = new getFileStatus_result(); <ide> receiveBase(result, "getFileStatus"); <ide> if (result.isSetSuccess()) { <ide> return result.success; <del> } <del> if (result.eF != null) { <del> throw result.eF; <ide> } <ide> if (result.eI != null) { <ide> throw result.eI; <ide> prot.writeMessageEnd(); <ide> } <ide> <del> public ClientFileInfo getResult() throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException { <add> public ClientFileInfo getResult() throws InvalidPathException, org.apache.thrift.TException { <ide> if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { <ide> throw new IllegalStateException("Method call not finished!"); <ide> } <ide> getFileStatus_result result = new getFileStatus_result(); <ide> try { <ide> result.success = iface.getFileStatus(args.fileId, args.path); <del> } catch (FileDoesNotExistException eF) { <del> result.eF = eF; <ide> } catch (InvalidPathException eI) { <ide> result.eI = eI; <ide> } <ide> byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; <ide> org.apache.thrift.TBase msg; <ide> getFileStatus_result result = new getFileStatus_result(); <del> if (e instanceof FileDoesNotExistException) { <del> result.eF = (FileDoesNotExistException) e; <del> result.setEFIsSet(true); <del> msg = result; <del> } <del> else if (e instanceof InvalidPathException) { <add> if (e instanceof InvalidPathException) { <ide> result.eI = (InvalidPathException) e; <ide> result.setEIIsSet(true); <ide> msg = result; <ide> private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getFileStatus_result"); <ide> <ide> private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); <del> private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)1); <del> private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); <add> private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)1); <ide> <ide> private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); <ide> static { <ide> } <ide> <ide> public ClientFileInfo success; // required <del> public FileDoesNotExistException eF; // required <ide> public InvalidPathException eI; // required <ide> <ide> /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ <ide> public enum _Fields implements org.apache.thrift.TFieldIdEnum { <ide> SUCCESS((short)0, "success"), <del> E_F((short)1, "eF"), <del> E_I((short)2, "eI"); <add> E_I((short)1, "eI"); <ide> <ide> private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); <ide> <ide> switch(fieldId) { <ide> case 0: // SUCCESS <ide> return SUCCESS; <del> case 1: // E_F <del> return E_F; <del> case 2: // E_I <add> case 1: // E_I <ide> return E_I; <ide> default: <ide> return null; <ide> Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); <ide> tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, <ide> new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientFileInfo.class))); <del> tmpMap.put(_Fields.E_F, new org.apache.thrift.meta_data.FieldMetaData("eF", org.apache.thrift.TFieldRequirementType.DEFAULT, <del> new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); <ide> tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, <ide> new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); <ide> metaDataMap = Collections.unmodifiableMap(tmpMap); <ide> <ide> public getFileStatus_result( <ide> ClientFileInfo success, <del> FileDoesNotExistException eF, <ide> InvalidPathException eI) <ide> { <ide> this(); <ide> this.success = success; <del> this.eF = eF; <ide> this.eI = eI; <ide> } <ide> <ide> if (other.isSetSuccess()) { <ide> this.success = new ClientFileInfo(other.success); <ide> } <del> if (other.isSetEF()) { <del> this.eF = new FileDoesNotExistException(other.eF); <del> } <ide> if (other.isSetEI()) { <ide> this.eI = new InvalidPathException(other.eI); <ide> } <ide> @Override <ide> public void clear() { <ide> this.success = null; <del> this.eF = null; <ide> this.eI = null; <ide> } <ide> <ide> public void setSuccessIsSet(boolean value) { <ide> if (!value) { <ide> this.success = null; <del> } <del> } <del> <del> public FileDoesNotExistException getEF() { <del> return this.eF; <del> } <del> <del> public getFileStatus_result setEF(FileDoesNotExistException eF) { <del> this.eF = eF; <del> return this; <del> } <del> <del> public void unsetEF() { <del> this.eF = null; <del> } <del> <del> /** Returns true if field eF is set (has been assigned a value) and false otherwise */ <del> public boolean isSetEF() { <del> return this.eF != null; <del> } <del> <del> public void setEFIsSet(boolean value) { <del> if (!value) { <del> this.eF = null; <ide> } <ide> } <ide> <ide> } <ide> break; <ide> <del> case E_F: <del> if (value == null) { <del> unsetEF(); <del> } else { <del> setEF((FileDoesNotExistException)value); <del> } <del> break; <del> <ide> case E_I: <ide> if (value == null) { <ide> unsetEI(); <ide> case SUCCESS: <ide> return getSuccess(); <ide> <del> case E_F: <del> return getEF(); <del> <ide> case E_I: <ide> return getEI(); <ide> <ide> switch (field) { <ide> case SUCCESS: <ide> return isSetSuccess(); <del> case E_F: <del> return isSetEF(); <ide> case E_I: <ide> return isSetEI(); <ide> } <ide> return false; <ide> } <ide> <del> boolean this_present_eF = true && this.isSetEF(); <del> boolean that_present_eF = true && that.isSetEF(); <del> if (this_present_eF || that_present_eF) { <del> if (!(this_present_eF && that_present_eF)) <del> return false; <del> if (!this.eF.equals(that.eF)) <del> return false; <del> } <del> <ide> boolean this_present_eI = true && this.isSetEI(); <ide> boolean that_present_eI = true && that.isSetEI(); <ide> if (this_present_eI || that_present_eI) { <ide> return lastComparison; <ide> } <ide> } <del> lastComparison = Boolean.valueOf(isSetEF()).compareTo(other.isSetEF()); <del> if (lastComparison != 0) { <del> return lastComparison; <del> } <del> if (isSetEF()) { <del> lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eF, other.eF); <del> if (lastComparison != 0) { <del> return lastComparison; <del> } <del> } <ide> lastComparison = Boolean.valueOf(isSetEI()).compareTo(other.isSetEI()); <ide> if (lastComparison != 0) { <ide> return lastComparison; <ide> sb.append("null"); <ide> } else { <ide> sb.append(this.success); <del> } <del> first = false; <del> if (!first) sb.append(", "); <del> sb.append("eF:"); <del> if (this.eF == null) { <del> sb.append("null"); <del> } else { <del> sb.append(this.eF); <ide> } <ide> first = false; <ide> if (!first) sb.append(", "); <ide> org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); <ide> } <ide> break; <del> case 1: // E_F <del> if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { <del> struct.eF = new FileDoesNotExistException(); <del> struct.eF.read(iprot); <del> struct.setEFIsSet(true); <del> } else { <del> org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); <del> } <del> break; <del> case 2: // E_I <add> case 1: // E_I <ide> if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { <ide> struct.eI = new InvalidPathException(); <ide> struct.eI.read(iprot); <ide> struct.success.write(oprot); <ide> oprot.writeFieldEnd(); <ide> } <del> if (struct.eF != null) { <del> oprot.writeFieldBegin(E_F_FIELD_DESC); <del> struct.eF.write(oprot); <del> oprot.writeFieldEnd(); <del> } <ide> if (struct.eI != null) { <ide> oprot.writeFieldBegin(E_I_FIELD_DESC); <ide> struct.eI.write(oprot); <ide> if (struct.isSetSuccess()) { <ide> optionals.set(0); <ide> } <del> if (struct.isSetEF()) { <add> if (struct.isSetEI()) { <ide> optionals.set(1); <ide> } <del> if (struct.isSetEI()) { <del> optionals.set(2); <del> } <del> oprot.writeBitSet(optionals, 3); <add> oprot.writeBitSet(optionals, 2); <ide> if (struct.isSetSuccess()) { <ide> struct.success.write(oprot); <del> } <del> if (struct.isSetEF()) { <del> struct.eF.write(oprot); <ide> } <ide> if (struct.isSetEI()) { <ide> struct.eI.write(oprot); <ide> @Override <ide> public void read(org.apache.thrift.protocol.TProtocol prot, getFileStatus_result struct) throws org.apache.thrift.TException { <ide> TTupleProtocol iprot = (TTupleProtocol) prot; <del> BitSet incoming = iprot.readBitSet(3); <add> BitSet incoming = iprot.readBitSet(2); <ide> if (incoming.get(0)) { <ide> struct.success = new ClientFileInfo(); <ide> struct.success.read(iprot); <ide> struct.setSuccessIsSet(true); <ide> } <ide> if (incoming.get(1)) { <del> struct.eF = new FileDoesNotExistException(); <del> struct.eF.read(iprot); <del> struct.setEFIsSet(true); <del> } <del> if (incoming.get(2)) { <ide> struct.eI = new InvalidPathException(); <ide> struct.eI.read(iprot); <ide> struct.setEIIsSet(true);
Java
mpl-2.0
f5dce4ed9774671d4c4fa91def7473476f1acaa2
0
JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core
/************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: PrologueCtrl.java,v $ * $Revision: 1.8 $ * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 * only, as published by the Free Software Foundation. * * OpenOffice.org is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License version 3 for more details * (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU Lesser General Public License * version 3 along with OpenOffice.org. If not, see * <http://www.openoffice.org/license.html> * for a copy of the LGPLv3 License. * ************************************************************************/ package org.openoffice.setup.Controller; import org.openoffice.setup.InstallData; import org.openoffice.setup.Installer.Installer; import org.openoffice.setup.Installer.InstallerFactory; import org.openoffice.setup.PanelController; import org.openoffice.setup.Panel.Prologue; import org.openoffice.setup.SetupData.PackageDescription; import org.openoffice.setup.SetupData.SetupDataProvider; import org.openoffice.setup.Util.Controller; import org.openoffice.setup.Util.Dumper; import org.openoffice.setup.Util.ModuleCtrl; import org.openoffice.setup.Util.SystemManager; public class PrologueCtrl extends PanelController { private String helpFile; public PrologueCtrl() { super("Prologue", new Prologue()); helpFile = "String_Helpfile_Prologue"; } // public void beforeShow() { public void duringShow() { getSetupFrame().setButtonEnabled(false, getSetupFrame().BUTTON_PREVIOUS); Thread t = new Thread() { public void run() { InstallData installData = InstallData.getInstance(); if ( ! installData.preInstallDone() ) { getSetupFrame().setButtonEnabled(false, getSetupFrame().BUTTON_NEXT); Controller.checkPackagePathExistence(installData); Controller.checkPackageFormat(installData); if (( installData.getOSType().equalsIgnoreCase("SunOS") ) && ( installData.isMultiLingual() )) { Controller.collectSystemLanguages(installData); } PackageDescription packageData = SetupDataProvider.getPackageDescription(); Installer installer = InstallerFactory.getInstance(); installer.preInstall(packageData); installData.setPreInstallDone(true); if ( SystemManager.logModuleStates() ) { installData.setLogModuleStates(true); } if ( installData.logModuleStates() ) { Dumper.logModuleStates(packageData, "Prologue Dialog"); } if (( installData.getOSType().equalsIgnoreCase("SunOS") ) && ( installData.isMultiLingual() )) { ModuleCtrl.checkLanguagesPackages(packageData, installData); // int count = installData.getPreselectedLanguages(); // System.err.println("Number of preselected language packages: " + count); if ( installData.getPreselectedLanguages() == 0 ) { // Something misterious happened. Setting all languages again. ModuleCtrl.setLanguagesPackages(packageData); } if ( installData.logModuleStates() ) { Dumper.logModuleStates(packageData, "Prologue Dialog Language Selection"); } } if ( ! installData.isMultiLingual() ) { ModuleCtrl.setHiddenLanguageModuleDefaultSettings(packageData); if ( installData.logModuleStates() ) { Dumper.logModuleStates(packageData, "after setHiddenLanguageModuleDefaultSettings"); } } if (( installData.isRootInstallation() ) && ( installData.getOSType().equalsIgnoreCase("SunOS") )) { // Check, if root has write access in /usr and /etc . // In sparse zones with imported directories this is not always the case. if ( Controller.reducedRootWritePrivileges() ) { ModuleCtrl.setIgnoreNonRelocatablePackages(packageData); } if ( installData.logModuleStates() ) { Dumper.logModuleStates(packageData, "after setIgnoreNonRelocatablePackages"); } } if ( installData.isRootInstallation() ) { // Setting installation directory! String dir = "/"; installData.setInstallDir(dir); installData.setInstallDefaultDir(installData.getDefaultDir()); Controller.checkForNewerVersion(installData); // Check Write privileges in installation directory (installData.getInstallDefaultDir()) // If the directory exists, is has to be tested, whether the user has write access dir = installData.getInstallDefaultDir(); if ( SystemManager.exists_directory(dir) ) { if ( ! Controller.createdSubDirectory(dir) ) { System.err.println("ERROR: No write privileges inside directory: " + dir); System.exit(1); } } // If the directory does not exist, is has to be tested, whether the user can create it if ( ! SystemManager.exists_directory(dir)) { if ( ! Controller.createdDirectory(dir) ) { System.err.println("ERROR: No privileges to create directory: " + dir); System.exit(1); } } // Setting macro SetupDataProvider.setNewMacro("DIR", dir); // important for string replacement // Calculate available disc space int discSpace = SystemManager.calculateDiscSpace(dir); installData.setAvailableDiscSpace(discSpace); if ( ! installData.databaseAnalyzed()) { ModuleCtrl.defaultDatabaseAnalysis(installData); installData.setDatabaseAnalyzed(true); } } getSetupFrame().setButtonEnabled(true, getSetupFrame().BUTTON_NEXT); } } }; t.start(); } public boolean afterShow(boolean nextButtonPressed) { boolean repeatDialog = false; getSetupFrame().setButtonEnabled(true, getSetupFrame().BUTTON_PREVIOUS); return repeatDialog; } public String getNext() { InstallData data = InstallData.getInstance(); if ( data.hideEula() ) { if ( data.isRootInstallation() ) { if ( data.olderVersionExists() ) { return new String("InstallationImminent"); } else if ( data.sameVersionExists() ) { return new String("ChooseComponents"); } else { return new String("ChooseInstallationType"); } } else { return new String("ChooseDirectory"); } } else { return new String("AcceptLicense"); } } public String getPrevious() { return null; } public final String getHelpFileName() { return this.helpFile; } }
javainstaller2/src/JavaSetup/org/openoffice/setup/Controller/PrologueCtrl.java
/************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: PrologueCtrl.java,v $ * $Revision: 1.7 $ * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 * only, as published by the Free Software Foundation. * * OpenOffice.org is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License version 3 for more details * (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU Lesser General Public License * version 3 along with OpenOffice.org. If not, see * <http://www.openoffice.org/license.html> * for a copy of the LGPLv3 License. * ************************************************************************/ package org.openoffice.setup.Controller; import org.openoffice.setup.InstallData; import org.openoffice.setup.Installer.Installer; import org.openoffice.setup.Installer.InstallerFactory; import org.openoffice.setup.PanelController; import org.openoffice.setup.Panel.Prologue; import org.openoffice.setup.SetupData.PackageDescription; import org.openoffice.setup.SetupData.SetupDataProvider; import org.openoffice.setup.Util.Controller; import org.openoffice.setup.Util.Dumper; import org.openoffice.setup.Util.ModuleCtrl; import org.openoffice.setup.Util.SystemManager; public class PrologueCtrl extends PanelController { private String helpFile; public PrologueCtrl() { super("Prologue", new Prologue()); helpFile = "String_Helpfile_Prologue"; } // public void beforeShow() { public void duringShow() { getSetupFrame().setButtonEnabled(false, getSetupFrame().BUTTON_PREVIOUS); Thread t = new Thread() { public void run() { InstallData installData = InstallData.getInstance(); if ( ! installData.preInstallDone() ) { getSetupFrame().setButtonEnabled(false, getSetupFrame().BUTTON_NEXT); Controller.checkPackagePathExistence(installData); Controller.checkPackageFormat(installData); if (( installData.getOSType().equalsIgnoreCase("SunOS") ) && ( installData.isMultiLingual() )) { Controller.collectSystemLanguages(installData); } PackageDescription packageData = SetupDataProvider.getPackageDescription(); Installer installer = InstallerFactory.getInstance(); installer.preInstall(packageData); installData.setPreInstallDone(true); if ( SystemManager.logModuleStates() ) { installData.setLogModuleStates(true); } if ( installData.logModuleStates() ) { Dumper.logModuleStates(packageData, "Prologue Dialog"); } if (( installData.getOSType().equalsIgnoreCase("SunOS") ) && ( installData.isMultiLingual() )) { ModuleCtrl.checkLanguagesPackages(packageData, installData); if ( installData.logModuleStates() ) { Dumper.logModuleStates(packageData, "Prologue Dialog Language Selection"); } } if ( ! installData.isMultiLingual() ) { ModuleCtrl.setHiddenLanguageModuleDefaultSettings(packageData); if ( installData.logModuleStates() ) { Dumper.logModuleStates(packageData, "after setHiddenLanguageModuleDefaultSettings"); } } if (( installData.isRootInstallation() ) && ( installData.getOSType().equalsIgnoreCase("SunOS") )) { // Check, if root has write access in /usr and /etc . // In sparse zones with imported directories this is not always the case. if ( Controller.reducedRootWritePrivileges() ) { ModuleCtrl.setIgnoreNonRelocatablePackages(packageData); } if ( installData.logModuleStates() ) { Dumper.logModuleStates(packageData, "after setIgnoreNonRelocatablePackages"); } } if ( installData.isRootInstallation() ) { // Setting installation directory! String dir = "/"; installData.setInstallDir(dir); installData.setInstallDefaultDir(installData.getDefaultDir()); Controller.checkForNewerVersion(installData); // Check Write privileges in installation directory (installData.getInstallDefaultDir()) // If the directory exists, is has to be tested, whether the user has write access dir = installData.getInstallDefaultDir(); if ( SystemManager.exists_directory(dir) ) { if ( ! Controller.createdSubDirectory(dir) ) { System.err.println("ERROR: No write privileges inside directory: " + dir); System.exit(1); } } // If the directory does not exist, is has to be tested, whether the user can create it if ( ! SystemManager.exists_directory(dir)) { if ( ! Controller.createdDirectory(dir) ) { System.err.println("ERROR: No privileges to create directory: " + dir); System.exit(1); } } // Setting macro SetupDataProvider.setNewMacro("DIR", dir); // important for string replacement // Calculate available disc space int discSpace = SystemManager.calculateDiscSpace(dir); installData.setAvailableDiscSpace(discSpace); if ( ! installData.databaseAnalyzed()) { ModuleCtrl.defaultDatabaseAnalysis(installData); installData.setDatabaseAnalyzed(true); } } getSetupFrame().setButtonEnabled(true, getSetupFrame().BUTTON_NEXT); } } }; t.start(); } public boolean afterShow(boolean nextButtonPressed) { boolean repeatDialog = false; getSetupFrame().setButtonEnabled(true, getSetupFrame().BUTTON_PREVIOUS); return repeatDialog; } public String getNext() { InstallData data = InstallData.getInstance(); if ( data.hideEula() ) { if ( data.isRootInstallation() ) { if ( data.olderVersionExists() ) { return new String("InstallationImminent"); } else if ( data.sameVersionExists() ) { return new String("ChooseComponents"); } else { return new String("ChooseInstallationType"); } } else { return new String("ChooseDirectory"); } } else { return new String("AcceptLicense"); } } public String getPrevious() { return null; } public final String getHelpFileName() { return this.helpFile; } }
INTEGRATION: CWS native179 (1.7.20); FILE MERGED 2008/07/31 15:12:17 is 1.7.20.1: #i91489# improved solaris language preselection process
javainstaller2/src/JavaSetup/org/openoffice/setup/Controller/PrologueCtrl.java
INTEGRATION: CWS native179 (1.7.20); FILE MERGED 2008/07/31 15:12:17 is 1.7.20.1: #i91489# improved solaris language preselection process
<ide><path>avainstaller2/src/JavaSetup/org/openoffice/setup/Controller/PrologueCtrl.java <ide> * OpenOffice.org - a multi-platform office productivity suite <ide> * <ide> * $RCSfile: PrologueCtrl.java,v $ <del> * $Revision: 1.7 $ <add> * $Revision: 1.8 $ <ide> * <ide> * This file is part of OpenOffice.org. <ide> * <ide> <ide> if (( installData.getOSType().equalsIgnoreCase("SunOS") ) && ( installData.isMultiLingual() )) { <ide> ModuleCtrl.checkLanguagesPackages(packageData, installData); <add> <add> // int count = installData.getPreselectedLanguages(); <add> // System.err.println("Number of preselected language packages: " + count); <add> <add> if ( installData.getPreselectedLanguages() == 0 ) { <add> // Something misterious happened. Setting all languages again. <add> ModuleCtrl.setLanguagesPackages(packageData); <add> } <ide> <ide> if ( installData.logModuleStates() ) { <ide> Dumper.logModuleStates(packageData, "Prologue Dialog Language Selection");
JavaScript
mit
a493e5a4d1571491dfd4b5c834b22019e021d49d
0
coderaiser/cloudcmd,coderaiser/cloudcmd
'use strict'; /* global DOM */ const { Dialog, Images, } = DOM; const forEachKey = require('for-each-key/legacy'); const wraptile = require('wraptile/legacy'); const format = require('./format'); module.exports = (options) => (emitter) => { const { operation, callback, noContinue, from, to, } = options; let done; let lastError; const onAbort = wraptile(({emitter, operation}) => { emitter.abort(); const msg = `${operation} aborted`; lastError = true; Dialog.alert(msg, { cancel: false, }); }); const removeListener = emitter.removeListener.bind(emitter); const on = emitter.on.bind(emitter); const message = format(operation, from, to); const progress = Dialog.progress(message); progress.catch(onAbort({ emitter, operation, })); const listeners = { progress: (value) => { done = value === 100; progress.setProgress(value); }, end: () => { Images.hide(); forEachKey(removeListener, listeners); progress.remove(); if (lastError || done) callback(); }, error: async (error) => { lastError = error; if (noContinue) { listeners.end(error); Dialog.alert(error); progress.remove(); return; } const [cancel] = await Dialog.confirm(error + '\n Continue?'); if (!done && !cancel) return emitter.continue(); emitter.abort(); progress.remove(); }, }; forEachKey(on, listeners); };
client/modules/operation/set-listeners.js
'use strict'; /* global DOM */ const { Dialog, Images, } = DOM; const forEachKey = require('for-each-key/legacy'); const wraptile = require('wraptile/legacy'); const format = require('./format'); module.exports = (options) => (emitter) => { const { operation, callback, noContinue, from, to, } = options; let done; let lastError; const onAbort = wraptile(({emitter, operation}) => { emitter.abort(); const msg = `${operation} aborted`; lastError = true; Dialog.alert(msg, { cancel: false, }); }); const removeListener = emitter.removeListener.bind(emitter); const on = emitter.on.bind(emitter); const message = format(operation, from, to); const progress = Dialog.progress(message); progress.catch(onAbort({ emitter, operation, })); const listeners = { progress: (value) => { done = value === 100; progress.setProgress(value); }, end: () => { Images.hide(); forEachKey(removeListener, listeners); progress.remove(); if (lastError || done) callback(); }, error: async (error) => { lastError = error; if (noContinue) { listeners.end(error); Dialog.alert(error); progress.remove(); return; } const [cancel] = await Dialog.confirm(error + '\n Continue?'); if (!cancel) emitter.continue(); emitter.abort(); progress.remove(); }, }; forEachKey(on, listeners); };
fix(set-listeners) can not continue first error operation error
client/modules/operation/set-listeners.js
fix(set-listeners) can not continue first error operation error
<ide><path>lient/modules/operation/set-listeners.js <ide> <ide> const [cancel] = await Dialog.confirm(error + '\n Continue?'); <ide> <del> if (!cancel) <del> emitter.continue(); <add> if (!done && !cancel) <add> return emitter.continue(); <ide> <ide> emitter.abort(); <ide> progress.remove();
Java
apache-2.0
5b957c86f82d1a5477174632369f12768b7c7abc
0
zzhui1988/zxing,mig1098/zxing,graug/zxing,wangjun/zxing,ChanJLee/zxing,todotobe1/zxing,ChristingKim/zxing,sunil1989/zxing,irfanah/zxing,jianwoo/zxing,SriramRamesh/zxing,ikenneth/zxing,geeklain/zxing,easycold/zxing,huihui4045/zxing,HiWong/zxing,reidwooten99/zxing,Kabele/zxing,JasOXIII/zxing,kyosho81/zxing,ForeverLucky/zxing,keqingyuan/zxing,eddyb/zxing,917386389/zxing,slayerlp/zxing,ctoliver/zxing,lijian17/zxing,MonkeyZZZZ/Zxing,Akylas/zxing,ren545457803/zxing,angrilove/zxing,micwallace/webscanner,tanelihuuskonen/zxing,fhchina/zxing,RatanPaul/zxing,huihui4045/zxing,Akylas/zxing,mig1098/zxing,liboLiao/zxing,JasOXIII/zxing,917386389/zxing,wangdoubleyan/zxing,roudunyy/zxing,saif-hmk/zxing,wirthandrel/zxing,wangdoubleyan/zxing,liboLiao/zxing,geeklain/zxing,mecury/zxing,allenmo/zxing,huangsongyan/zxing,TestSmirk/zxing,rustemferreira/zxing-projectx,GeorgeMe/zxing,Luise-li/zxing,danielZhang0601/zxing,krishnanMurali/zxing,zilaiyedaren/zxing,GeekHades/zxing,irfanah/zxing,projectocolibri/zxing,bittorrent/zxing,YongHuiLuo/zxing,layeka/zxing,liuchaoya/zxing,ctoliver/zxing,DavidLDawes/zxing,easycold/zxing,daverix/zxing,angrilove/zxing,eight-pack-abdominals/ZXing,t123yh/zxing,wangxd1213/zxing,irwinai/zxing,praveen062/zxing,1yvT0s/zxing,graug/zxing,keqingyuan/zxing,hiagodotme/zxing,mecury/zxing,shixingxing/zxing,Akylas/zxing,GeekHades/zxing,cnbin/zxing,loaf/zxing,OnecloudVideo/zxing,Luise-li/zxing,yuanhuihui/zxing,juoni/zxing,kharohiy/zxing,ChristingKim/zxing,whycode/zxing,RatanPaul/zxing,erbear/zxing,wanjingyan001/zxing,DONIKAN/zxing,whycode/zxing,ssakitha/sakisolutions,l-dobrev/zxing,cnbin/zxing,sysujzh/zxing,ForeverLucky/zxing,YLBFDEV/zxing,shixingxing/zxing,freakynit/zxing,huopochuan/zxing,zhangyihao/zxing,Fedhaier/zxing,ZhernakovMikhail/zxing,saif-hmk/zxing,juoni/zxing,Akylas/zxing,daverix/zxing,krishnanMurali/zxing,Peter32/zxing,Kabele/zxing,meixililu/zxing,andyshao/zxing,eight-pack-abdominals/ZXing,slayerlp/zxing,zonamovil/zxing,todotobe1/zxing,andyao/zxing,andyshao/zxing,huangsongyan/zxing,meixililu/zxing,shwethamallya89/zxing,Kevinsu917/zxing,iris-iriswang/zxing,qingsong-xu/zxing,manl1100/zxing,BraveAction/zxing,erbear/zxing,Solvoj/zxing,DONIKAN/zxing,iris-iriswang/zxing,Kevinsu917/zxing,geeklain/zxing,BraveAction/zxing,FloatingGuy/zxing,mayfourth/zxing,zxing/zxing,zxing/zxing,tks-dp/zxing,huopochuan/zxing,sitexa/zxing,t123yh/zxing,hgl888/zxing,YongHuiLuo/zxing,ssakitha/sakisolutions,wangjun/zxing,micwallace/webscanner,JerryChin/zxing,rustemferreira/zxing-projectx,sitexa/zxing,befairyliu/zxing,bestwpw/zxing,micwallace/webscanner,nickperez1285/zxing,gank0326/zxing,befairyliu/zxing,roudunyy/zxing,finch0219/zxing,l-dobrev/zxing,qianchenglenger/zxing,joni1408/zxing,eddyb/zxing,ale13jo/zxing,east119/zxing,ChanJLee/zxing,cncomer/zxing,reidwooten99/zxing,menglifei/zxing,ssakitha/QR-Code-Reader,1yvT0s/zxing,liuchaoya/zxing,qingsong-xu/zxing,Akylas/zxing,manl1100/zxing,fhchina/zxing,praveen062/zxing,nickperez1285/zxing,YLBFDEV/zxing,layeka/zxing,ZhernakovMikhail/zxing,shwethamallya89/zxing,ptrnov/zxing,DavidLDawes/zxing,projectocolibri/zxing,catalindavid/zxing,Akylas/zxing,daverix/zxing,hgl888/zxing,zjcscut/zxing,1shawn/zxing,GeorgeMe/zxing,lijian17/zxing,OnecloudVideo/zxing,Fedhaier/zxing,ptrnov/zxing,WB-ZZ-TEAM/zxing,danielZhang0601/zxing,Akylas/zxing,YuYongzhi/zxing,ouyangkongtong/zxing,sysujzh/zxing,SriramRamesh/zxing,10045125/zxing,sunil1989/zxing,ikenneth/zxing,MonkeyZZZZ/Zxing,lvbaosong/zxing,huangzl233/zxing,FloatingGuy/zxing,ale13jo/zxing,YuYongzhi/zxing,huangzl233/zxing,ssakitha/QR-Code-Reader,wangxd1213/zxing,east119/zxing,catalindavid/zxing,irwinai/zxing,freakynit/zxing,HiWong/zxing,qianchenglenger/zxing,menglifei/zxing,zjcscut/zxing,zzhui1988/zxing,andyao/zxing,zilaiyedaren/zxing,tks-dp/zxing,Yi-Kun/zxing,zonamovil/zxing,wanjingyan001/zxing,daverix/zxing,ren545457803/zxing,kailIII/zxing,TestSmirk/zxing,loaf/zxing,WB-ZZ-TEAM/zxing,roadrunner1987/zxing,wirthandrel/zxing,joni1408/zxing,mayfourth/zxing,kyosho81/zxing,yuanhuihui/zxing,bestwpw/zxing,daverix/zxing,JerryChin/zxing,allenmo/zxing,kailIII/zxing,ouyangkongtong/zxing,zhangyihao/zxing,tanelihuuskonen/zxing,finch0219/zxing,cncomer/zxing,lvbaosong/zxing,hiagodotme/zxing,roadrunner1987/zxing,Yi-Kun/zxing,1shawn/zxing,jianwoo/zxing,Solvoj/zxing,kharohiy/zxing,Peter32/zxing,bittorrent/zxing
/* * Copyright (C) 2012 ZXing authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.zxing.client.android.camera.open; import android.hardware.Camera; import android.util.Log; public final class OpenCameraInterface { private static final String TAG = OpenCameraInterface.class.getName(); private OpenCameraInterface() { } /** * Opens the requested camera with {@link Camera#open(int)}, if one exists. * * @param cameraId camera ID of the camera to use * @return handle to {@link Camera} that was opened */ public static Camera open(int cameraId) { if (cameraId < 0) { Log.w(TAG, "Requested invalid camera ID: " + cameraId); return null; } int numCameras = Camera.getNumberOfCameras(); if (numCameras == 0) { Log.w(TAG, "No cameras!"); return null; } Camera camera; if (cameraId < numCameras) { Log.i(TAG, "Opening camera #" + cameraId); camera = Camera.open(cameraId); } else { Log.w(TAG, "Requested camera does not exist: " + cameraId); camera = null; } return camera; } /** * Opens a rear-facing camera with {@link Camera#open(int)}, if one exists, or opens camera 0. * * @return handle to {@link Camera} that was opened */ public static Camera open() { int numCameras = Camera.getNumberOfCameras(); if (numCameras == 0) { Log.w(TAG, "No cameras!"); return null; } int index = 0; while (index < numCameras) { Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); Camera.getCameraInfo(index, cameraInfo); if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) { break; } index++; } Camera camera; if (index < numCameras) { Log.i(TAG, "Opening camera #" + index); camera = Camera.open(index); } else { Log.i(TAG, "No camera facing back; returning camera #0"); camera = Camera.open(0); } return camera; } }
android/src/com/google/zxing/client/android/camera/open/OpenCameraInterface.java
/* * Copyright (C) 2012 ZXing authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.zxing.client.android.camera.open; import android.hardware.Camera; import android.util.Log; public final class OpenCameraInterface { private static final String TAG = OpenCameraInterface.class.getName(); private OpenCameraInterface() { } /** * Opens a rear-facing camera with {@link Camera#open(int)}, if one exists, or opens camera 0. * * @return handle to {@link Camera} that was opened */ public static Camera open() { int numCameras = Camera.getNumberOfCameras(); if (numCameras == 0) { Log.w(TAG, "No cameras!"); return null; } int index = 0; while (index < numCameras) { Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); Camera.getCameraInfo(index, cameraInfo); if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) { break; } index++; } Camera camera; if (index < numCameras) { Log.i(TAG, "Opening camera #" + index); camera = Camera.open(index); } else { Log.i(TAG, "No camera facing back; returning camera #0"); camera = Camera.open(0); } return camera; } }
Added overload: open(cameraId)
android/src/com/google/zxing/client/android/camera/open/OpenCameraInterface.java
Added overload: open(cameraId)
<ide><path>ndroid/src/com/google/zxing/client/android/camera/open/OpenCameraInterface.java <ide> private OpenCameraInterface() { <ide> } <ide> <add> <add> /** <add> * Opens the requested camera with {@link Camera#open(int)}, if one exists. <add> * <add> * @param cameraId camera ID of the camera to use <add> * @return handle to {@link Camera} that was opened <add> */ <add> public static Camera open(int cameraId) { <add> if (cameraId < 0) { <add> Log.w(TAG, "Requested invalid camera ID: " + cameraId); <add> return null; <add> } <add> <add> int numCameras = Camera.getNumberOfCameras(); <add> <add> if (numCameras == 0) { <add> Log.w(TAG, "No cameras!"); <add> return null; <add> } <add> <add> Camera camera; <add> if (cameraId < numCameras) { <add> Log.i(TAG, "Opening camera #" + cameraId); <add> camera = Camera.open(cameraId); <add> } else { <add> Log.w(TAG, "Requested camera does not exist: " + cameraId); <add> camera = null; <add> } <add> <add> return camera; <add> } <add> <add> <ide> /** <ide> * Opens a rear-facing camera with {@link Camera#open(int)}, if one exists, or opens camera 0. <ide> *
JavaScript
mit
e795562d5599171ad7595e54ff3622ddd563501b
0
aarontract/leaflet-search,timophey/leaflet-search,kyroskoh/leaflet-search,ajvol/leaflet-search,johan--/leaflet-search,stefanocudini/leaflet-search,ajvol/leaflet-search,MuellerMatthew/leaflet-search,johan--/leaflet-search,aarontract/leaflet-search,cityhubla/leaflet-search,MuellerMatthew/leaflet-search,kyroskoh/leaflet-search,timophey/leaflet-search,MuellerMatthew/leaflet-search,stefanocudini/leaflet-search,cityhubla/leaflet-search
/* * Leaflet Search Control 1.3.5 * http://labs.easyblog.it/maps/leaflet-search * * https://github.com/stefanocudini/leaflet-search * https://bitbucket.org/zakis_/leaflet-search * * Copyright 2013, Stefano Cudini - [email protected] * Licensed under the MIT license. */ (function() {//closure for hide SearchMarker var SearchMarker = L.Marker.extend({ includes: L.Mixin.Events, options: { radius: 10, weight: 3, color: '#e03', stroke: true, fill: false, title: '', //TODO add custom icon! marker: false //show icon optional, show only circleLoc }, initialize: function (latlng, options) { L.setOptions(this, options); L.Marker.prototype.initialize.call(this, latlng, options); this._circleLoc = new L.CircleMarker(latlng, this.options); }, onAdd: function (map) { L.Marker.prototype.onAdd.call(this, map); map.addLayer(this._circleLoc); this.hide(); }, onRemove: function (map) { L.Marker.prototype.onRemove.call(this, map); map.removeLayer(this._circleLoc); }, setLatLng: function (latlng) { L.Marker.prototype.setLatLng.call(this, latlng); this._circleLoc.setLatLng(latlng); return this; }, setTitle: function(title) { title = title || ''; this.options.title = title; if(this._icon) this._icon.title = title; return this; }, show: function() { if(this.options.marker) { if(this._icon) this._icon.style.display = 'block'; if(this._shadow) this._shadow.style.display = 'block'; //this._bringToFront(); } if(this._circleLoc) { this._circleLoc.setStyle({fill: this.options.fill, stroke: this.options.stroke}); //this._circleLoc.bringToFront(); } return this; }, hide: function() { if(this._icon) this._icon.style.display = 'none'; if(this._shadow) this._shadow.style.display = 'none'; if(this._circleLoc) this._circleLoc.setStyle({fill: false, stroke: false}); return this; }, animate: function() { //TODO refact animate() more smooth! like this: http://goo.gl/DDlRs var circle = this._circleLoc, tInt = 200, //time interval ss = 10, //frames mr = parseInt(circle._radius/ss), oldrad = this.options.radius, newrad = circle._radius * 2.5, acc = 0; circle._timerAnimLoc = setInterval(function() { acc += 0.5; mr += acc; //adding acceleration newrad -= mr; circle.setRadius(newrad); if(newrad<oldrad) { clearInterval(circle._timerAnimLoc); circle.setRadius(oldrad);//reset radius //if(typeof afterAnimCall == 'function') //afterAnimCall(); //TODO use create event 'animateEnd' in SearchMarker } }, tInt); return this; } }); L.Control.Search = L.Control.extend({ includes: L.Mixin.Events, options: { layer: null, //layer where search markers(is a L.LayerGroup) propertyName: 'title', //property in marker.options trough filter elements in layer //TODO implement sub property filter for propertyName option like this value: "pro1.subprop.title" //TODO add option searchLoc or searchLat,searchLon for remapping json data fields searchCall: null, //function that fill _recordsCache, receive searching text in first param callTip: null, //function that return tip html node, receive text tooltip in first param jsonpUrl: '', //url for search by jsonp service, ex: "search.php?q={s}&callback={c}" filterJSON: null, //callback for filtering data to _recordsCache minLength: 1, //minimal text length for autocomplete initial: true, //search elements only by initial text autoType: true, //complete input with first suggested result and select this filled-in text. tooltipLimit: -1, //limit max results to show in tooltip. -1 for no limit. tipAutoSubmit: true, //auto map panTo when click on tooltip autoResize: true, //autoresize on input change autoCollapse: false, //collapse search control after submit(on button or on tips if enabled tipAutoSubmit) //TODO add option for persist markerLoc after collapse! autoCollapseTime: 1200, //delay for autoclosing alert and collapse after blur animateLocation: true, //animate a circle over location found markerLocation: false, //draw a marker in location found zoom: null, //zoom after pan to location found, default: map.getZoom() text: 'Search...', //placeholder value textCancel: 'Cancel', //title in cancel button textErr: 'Location not found', //error message position: 'topleft' //TODO add option collapsed, like control.layers }, //FIXME option condition problem {autoCollapse: true, markerLocation: true} not show location //FIXME option condition problem {autoCollapse:false } initialize: function(options) { L.Util.setOptions(this, options); this._inputMinSize = this.options.text ? this.options.text.length : 10; this._layer = this.options.layer || new L.LayerGroup(); this._filterJSON = this.options.filterJSON || this._defaultFilterJSON; this._autoTypeTmp = this.options.autoType; //useful for disable autoType temporarily in delete/backspace keydown this._delayType = 400; this._recordsCache = {}; //key,value table! that store locations! format: key,latlng }, onAdd: function (map) { this._map = map; this._container = L.DomUtil.create('div', 'leaflet-control-search'); this._input = this._createInput(this.options.text, 'search-input'); this._tooltip = this._createTooltip('search-tooltip'); this._cancel = this._createCancel(this.options.textCancel, 'search-cancel'); this._createButton(this.options.text, 'search-button'); this._alert = this._createAlert('search-alert'); this._markerLoc = new SearchMarker([0,0], {marker: this.options.markerLocation}); this.setLayer( this._layer ); this._map .on('layeradd', this._onLayerAddRemove, this) .on('layerremove', this._onLayerAddRemove, this); return this._container; }, onRemove: function(map) { this._recordsCache = {}; this._map .off('layeradd', this._onLayerAddRemove) .off('layerremove', this._onLayerAddRemove); }, _onLayerAddRemove: function(e) { //console.info('_onLayerAddRemove'); if(e.layer instanceof L.LayerGroup)//without this, run setLayer also for each Markers!! to optimize! if( L.stamp(e.layer) != L.stamp(this._layer) ) this.setLayer(e.layer); }, setLayer: function(layer) { //set search layer at runtime //this.options.layer = layer; //setting this, run only this._recordsFromLayer() this._layer = layer; this._layer.addTo(this._map); this._layer.addLayer(this._markerLoc); return this; }, showAlert: function(text) { text = text || this.options.textErr; this._alert.style.display = 'block'; this._alert.innerHTML = text; clearTimeout(this.timerAlert); var that = this; this.timerAlert = setTimeout(function() { that.hideAlert(); },this.options.autoCollapseTime); return this; }, hideAlert: function() { this._alert.style.display = 'none'; return this; }, cancel: function() { this._input.value = ''; this._handleKeypress({keyCode:8});//simulate backspace keypress this._input.size = this._inputMinSize; this._input.focus(); this._cancel.style.display = 'none'; return this; }, expand: function() { this._input.style.display = 'block'; L.DomUtil.addClass(this._container, 'search-exp'); this._input.focus(); this._map.on('dragstart', this.collapse, this); return this; }, collapse: function() { this._hideTooltip(); this.cancel(); this._alert.style.display = 'none'; this._input.style.display = 'none'; this._input.blur(); this._cancel.style.display = 'none'; L.DomUtil.removeClass(this._container, 'search-exp'); this._markerLoc.hide(); this._map.off('dragstart', this.collapse, this); return this; }, collapseDelayed: function() { //collapse after delay, used on_input blur var that = this; clearTimeout(this.timerCollapse); this.timerCollapse = setTimeout(function() { that.collapse(); }, this.options.autoCollapseTime); return this; }, collapseDelayedStop: function() { clearTimeout(this.timerCollapse); return this; }, ////start DOM creations _createAlert: function(className) { var alert = L.DomUtil.create('div', className, this._container); alert.style.display = 'none'; L.DomEvent .on(alert, 'click', L.DomEvent.stop, this) .on(alert, 'click', this.hideAlert, this); return alert; }, _createInput: function (text, className) { var input = L.DomUtil.create('input', className, this._container); input.type = 'text'; input.size = this._inputMinSize; input.value = ''; input.autocomplete = 'off'; input.placeholder = text; input.style.display = 'none'; L.DomEvent .disableClickPropagation(input) .on(input, 'keyup', this._handleKeypress, this) .on(input, 'keydown', this._handleAutoresize, this) .on(input, 'blur', this.collapseDelayed, this) .on(input, 'focus', this.collapseDelayedStop, this); return input; }, _createCancel: function (title, className) { var cancel = L.DomUtil.create('a', className, this._container); cancel.href = '#'; cancel.title = title; cancel.style.display = 'none'; cancel.innerHTML = "<span>&otimes;</span>";//imageless(see css) L.DomEvent .on(cancel, 'click', L.DomEvent.stop, this) .on(cancel, 'click', this.cancel, this); return cancel; }, _createButton: function (title, className) { var button = L.DomUtil.create('a', className, this._container); button.href = '#'; button.title = title; L.DomEvent .on(button, 'click', L.DomEvent.stop, this) .on(button, 'click', this._handleSubmit, this) .on(button, 'focus', this.collapseDelayedStop, this) .on(button, 'blur', this.collapseDelayed, this); return button; }, _createTooltip: function(className) { var tool = L.DomUtil.create('div', className, this._container); tool.style.display = 'none'; var that = this; L.DomEvent .disableClickPropagation(tool) .on(tool, 'blur', this.collapseDelayed, this) .on(tool, 'mousewheel', function(e) { that.collapseDelayedStop(); L.DomEvent.stopPropagation(e);//disable zoom map }, this) .on(tool, 'mouseover', function(e) { that.collapseDelayedStop(); }, this); return tool; }, _createTip: function(text, loc) { var tip; if(this.options.callTip) tip = this.options.callTip.apply(this, arguments); //custom tip content else { tip = L.DomUtil.create('a', ''); tip.href = '#'; tip.innerHTML = text; } L.DomUtil.addClass(tip, 'search-tip'); tip._text = text; //value replaced in this._input and used by _autoType L.DomEvent .disableClickPropagation(tip) .on(tip, 'click', L.DomEvent.stop, this) .on(tip, 'click', function(e) { this._input.value = text; this._handleAutoresize(); this._input.focus(); this._hideTooltip(); if(this.options.tipAutoSubmit)//go to location at once this._handleSubmit(); }, this); return tip; }, //////end DOM creations _filterRecords: function(text) { //Filter this._recordsCache case insensitive and much more.. var regFilter = new RegExp("^[.]$|[\[\]|()*]",'g'), //remove . * | ( ) ] [ text = text.replace(regFilter,''), //sanitize text I = this.options.initial ? '^' : '', //search only initial text regSearch = new RegExp(I + text,'i'), //TODO add option for case sesitive search, also showLocation frecords = {}; for(var key in this._recordsCache)//use .filter or .map if( regSearch.test(key) ) frecords[key]= this._recordsCache[key]; return frecords; }, _showTooltip: function() { var filteredRecords, ntip = 0; //FIXME problem with jsonp/ajax when remote filter has different behavior of this._filterRecords if(this.options.layer) filteredRecords = this._filterRecords( this._input.value ); else filteredRecords = this._recordsCache; this._tooltip.innerHTML = ''; this._tooltip.currentSelection = -1; //inizialized for _handleArrowSelect() for(var key in filteredRecords)//fill tooltip { if(++ntip == this.options.tooltipLimit) break; this._tooltip.appendChild( this._createTip(key, filteredRecords[key] ) ); } if(ntip > 0) { this._tooltip.style.display = 'block'; if(this._autoTypeTmp) this._autoType(); this._autoTypeTmp = this.options.autoType;//reset default value } else this._hideTooltip(); this._tooltip.scrollTop = 0; return ntip; }, _hideTooltip: function() { this._tooltip.style.display = 'none'; this._tooltip.innerHTML = ''; return 0; }, _defaultFilterJSON: function(jsonraw) { //default callback for filter data var jsonret = {}, propname = this.options.propertyName; for(var i in jsonraw) { if( jsonraw[i].hasOwnProperty(propname) ) jsonret[ jsonraw[i][propname] ]= L.latLng( jsonraw[i].loc ); else throw new Error("propertyName '"+propname+"' not found in JSON"); } return jsonret; }, //TODO make new method for ajax requestes using XMLHttpRequest _recordsFromJsonp: function(text, callAfter) { //extract searched records from remote jsonp service //TODO remove script node after call run var that = this; L.Control.Search.callJsonp = function(data) { //jsonp callback var fdata = that._filterJSON.apply(that,[data]);//_filterJSON defined in inizialize... callAfter(fdata); } var script = L.DomUtil.create('script','search-jsonp', document.getElementsByTagName('body')[0] ), url = L.Util.template(this.options.jsonpUrl, {s: text, c:"L.Control.Search.callJsonp"}); //parsing url //rnd = '&_='+Math.floor(Math.random()*10000); //TODO add rnd param or randomize callback name! in recordsFromJsonp script.type = 'text/javascript'; script.src = url; return this; }, _recordsFromLayer: function() { //return table: key,value from layer var retRecords = {}, propname = this.options.propertyName; //TODO implement filter by element type: marker|polyline|circle... //TODO return also marker! in _recordsFromLayer this._layer.eachLayer(function(marker) { if(marker.options.hasOwnProperty(propname)) retRecords[ marker.options[propname] ] = marker.getLatLng(); else throw new Error("propertyName '"+propname+"' not found in marker"); },this); return retRecords; }, _autoType: function() { //TODO implements autype without selection(useful for mobile device) var start = this._input.value.length, firstRecord = this._tooltip.firstChild._text, end = firstRecord.length; this._input.value = firstRecord; this._handleAutoresize(); if (this._input.createTextRange) { var selRange = this._input.createTextRange(); selRange.collapse(true); selRange.moveStart('character', start); selRange.moveEnd('character', end); selRange.select(); } else if(this._input.setSelectionRange) { this._input.setSelectionRange(start, end); } else if(this._input.selectionStart) { this._input.selectionStart = start; this._input.selectionEnd = end; } }, _hideAutoType: function() { // deselect text: var sel; if ((sel = this._input.selection) && sel.empty) { sel.empty(); } else { if (this._input.getSelection) { this._input.getSelection().removeAllRanges(); } this._input.selectionStart = this._input.selectionEnd; } }, _handleKeypress: function (e) { //run _input keyup event switch(e.keyCode) { case 27: //Esc this.collapse(); break; case 13: //Enter this._handleSubmit(); //do search break; case 38://Up this._handleArrowSelect(-1); break; case 40://Down this._handleArrowSelect(1); break; case 37://Left case 39://Right case 16://Shift case 17://Ctrl //case 32://Space break; case 8://backspace case 46://delete this._autoTypeTmp = false;//disable temporarily autoType default://All keys if(this._input.value.length) this._cancel.style.display = 'block'; else this._cancel.style.display = 'none'; if(this._input.value.length >= this.options.minLength) { var that = this; clearTimeout(this.timerKeypress); //cancel last search request while type in this.timerKeypress = setTimeout(function() { //delay before request, for limit jsonp/ajax request that._fillRecordsCache(); }, this._delayType); } else this._hideTooltip(); } }, _fillRecordsCache: function() { //TODO important optimization!!! always append data in this._recordsCache //now _recordsCache content is emptied and replaced with new data founded //always appending data on _recordsCache give the possibility of caching ajax, jsonp and layersearch! //TODO here insert function that search inputText FIRST in _recordsCache keys and if not find results.. //run one of callbacks search(searchCall,jsonpUrl or options.layer) //and run this._showTooltip //TODO change structure of _recordsCache // like this: _recordsCache = {"text-key1": {loc:[lat,lng], ..other attributes.. }, {"text-key2": {loc:[lat,lng]}...}, ...} // in this mode every record can have a free structure of attributes, only 'loc' is required var inputText = this._input.value; L.DomUtil.addClass(this._container, 'search-load'); if(this.options.searchCall) //CUSTOM SEARCH CALLBACK(USUALLY FOR AJAX SEARCHING) { this._recordsCache = this.options.searchCall.apply(this, [inputText] ); this._showTooltip(); L.DomUtil.removeClass(this._container, 'search-load'); //FIXME removeClass .search-load apparently executed before searchCall!! A BIG MYSTERY! } else if(this.options.jsonpUrl) //JSONP SERVICE REQUESTING { var that = this; this._recordsFromJsonp(inputText, function(data) {// is async request then it need callback that._recordsCache = data; that._showTooltip(); L.DomUtil.removeClass(that._container, 'search-load'); }); } else if(this.options.layer) //SEARCH ELEMENTS IN PRELOADED LAYER { this._recordsCache = this._recordsFromLayer(); //fill table key,value from markers into layer this._showTooltip(); L.DomUtil.removeClass(this._container, 'search-load'); } }, //FIXME _handleAutoresize Should resize max search box size when map is resized. _handleAutoresize: function() { //autoresize this._input //TODO refact _handleAutoresize now is not accurate if(this.options.autoResize && (this._container.offsetWidth + 45 < this._map._container.offsetWidth)) this._input.size = this._input.value.length<this._inputMinSize ? this._inputMinSize : this._input.value.length; }, _handleArrowSelect: function(velocity) { var searchTips = this._tooltip.hasChildNodes() ? this._tooltip.childNodes : []; for (i=0; i<searchTips.length; i++) L.DomUtil.removeClass(searchTips[i], 'search-tip-select'); if ((velocity == 1 ) && (this._tooltip.currentSelection >= (searchTips.length - 1))) {// If at end of list. L.DomUtil.addClass(searchTips[this._tooltip.currentSelection], 'search-tip-select'); } else if ((velocity == -1 ) && (this._tooltip.currentSelection <= 0)) { // Going back up to the search box. this._tooltip.currentSelection = -1; } else if (this._tooltip.style.display != 'none') { // regular up/down this._tooltip.currentSelection += velocity; L.DomUtil.addClass(searchTips[this._tooltip.currentSelection], 'search-tip-select'); this._input.value = searchTips[this._tooltip.currentSelection]._text; // scroll: var tipOffsetTop = searchTips[this._tooltip.currentSelection].offsetTop; if (tipOffsetTop + searchTips[this._tooltip.currentSelection].clientHeight >= this._tooltip.scrollTop + this._tooltip.clientHeight) { this._tooltip.scrollTop = tipOffsetTop - this._tooltip.clientHeight + searchTips[this._tooltip.currentSelection].clientHeight; } else if (tipOffsetTop <= this._tooltip.scrollTop) { this._tooltip.scrollTop = tipOffsetTop; } } }, _handleSubmit: function() { //button and tooltip click and enter submit this._hideAutoType(); this.hideAlert(); this._hideTooltip(); if(this._input.style.display == 'none') //on first click show _input only this.expand(); else { if(this._input.value == '') //hide _input only this.collapse(); else { var loc = this._getLocation(this._input.value); if(loc) this.showLocation(loc);//, this._input.value); else this.showAlert(); //this.collapse(); //FIXME if collapse in _handleSubmit hide _markerLoc! } } }, _getLocation: function(key) { //extract latlng from _recordsCache if( this._recordsCache.hasOwnProperty(key) ) return this._recordsCache[this._input.value];//then after use .loc attribute else return false; }, showLocation: function(latlng, title) { //set location on map from _recordsCache if(this.options.zoom) this._map.setView(latlng, this.options.zoom); else this._map.panTo(latlng); this._markerLoc.setLatLng(latlng); //show circle/marker in location found this._markerLoc.setTitle(title); this._markerLoc.show(); if(this.options.animateLocation) this._markerLoc.animate(); //TODO showLocation: start animation after setView or panTo, maybe with map.on('moveend')... this.fire("locationfound", {latlng: latlng, text: title}); //FIXME autoCollapse option hide this._markerLoc before that visualized!! if(this.options.autoCollapse) this.collapse(); return this; } }); }).call(this);
leaflet-search.js
/* * Leaflet Search Control 1.3.5 * http://labs.easyblog.it/maps/leaflet-search * * https://github.com/stefanocudini/leaflet-search * https://bitbucket.org/zakis_/leaflet-search * * Copyright 2013, Stefano Cudini - [email protected] * Licensed under the MIT license. */ (function() {//closure for hide SearchMarker var SearchMarker = L.Marker.extend({ includes: L.Mixin.Events, options: { radius: 10, weight: 3, color: '#e03', stroke: true, fill: false, title: '', //TODO add custom icon! marker: false //show icon optional, show only circleLoc }, initialize: function (latlng, options) { L.setOptions(this, options); L.Marker.prototype.initialize.call(this, latlng, options); this._circleLoc = new L.CircleMarker(latlng, this.options); }, onAdd: function (map) { L.Marker.prototype.onAdd.call(this, map); map.addLayer(this._circleLoc); this.hide(); }, onRemove: function (map) { L.Marker.prototype.onRemove.call(this, map); map.removeLayer(this._circleLoc); }, setLatLng: function (latlng) { L.Marker.prototype.setLatLng.call(this, latlng); this._circleLoc.setLatLng(latlng); return this; }, setTitle: function(title) { title = title || ''; this.options.title = title; if(this._icon) this._icon.title = title; return this; }, show: function() { if(this.options.marker) { if(this._icon) this._icon.style.display = 'block'; if(this._shadow) this._shadow.style.display = 'block'; //this._bringToFront(); } if(this._circleLoc) { this._circleLoc.setStyle({fill: this.options.fill, stroke: this.options.stroke}); //this._circleLoc.bringToFront(); } return this; }, hide: function() { if(this._icon) this._icon.style.display = 'none'; if(this._shadow) this._shadow.style.display = 'none'; if(this._circleLoc) this._circleLoc.setStyle({fill: false, stroke: false}); return this; }, animate: function() { //TODO refact animate() more smooth! like this: http://goo.gl/DDlRs var circle = this._circleLoc, tInt = 200, //time interval ss = 10, //frames mr = parseInt(circle._radius/ss), oldrad = this.options.radius, newrad = circle._radius * 2.5, acc = 0; circle._timerAnimLoc = setInterval(function() { acc += 0.5; mr += acc; //adding acceleration newrad -= mr; circle.setRadius(newrad); if(newrad<oldrad) { clearInterval(circle._timerAnimLoc); circle.setRadius(oldrad);//reset radius //if(typeof afterAnimCall == 'function') //afterAnimCall(); //TODO use create event 'animateEnd' in SearchMarker } }, tInt); return this; } }); L.Control.Search = L.Control.extend({ includes: L.Mixin.Events, options: { layer: null, //layer where search markers(is a L.LayerGroup) propertyName: 'title', //property in marker.options trough filter elements in layer //TODO implement sub property filter for propertyName option like this value: "pro1.subprop.title" //TODO add option searchLoc or searchLat,searchLon for remapping json data fields searchCall: null, //function that fill _recordsCache, receive searching text in first param callTip: null, //function that return tip html node, receive text tooltip in first param jsonpUrl: '', //url for search by jsonp service, ex: "search.php?q={s}&callback={c}" filterJSON: null, //callback for filtering data to _recordsCache minLength: 1, //minimal text length for autocomplete initial: true, //search elements only by initial text autoType: true, //complete input with first suggested result and select this filled-in text. tooltipLimit: -1, //limit max results to show in tooltip. -1 for no limit. tipAutoSubmit: true, //auto map panTo when click on tooltip autoResize: true, //autoresize on input change autoCollapse: false, //collapse search control after submit(on button or on tips if enabled tipAutoSubmit) //TODO add option for persist markerLoc after collapse! autoCollapseTime: 1200, //delay for autoclosing alert and collapse after blur animateLocation: true, //animate a circle over location found markerLocation: false, //draw a marker in location found zoom: null, //zoom after pan to location found, default: map.getZoom() text: 'Search...', //placeholder value textCancel: 'Cancel', //title in cancel button textErr: 'Location not found', //error message position: 'topleft' //TODO add option collapsed, like control.layers }, //FIXME option condition problem {autoCollapse: true, markerLocation: true} not show location //FIXME option condition problem {autoCollapse:false } initialize: function(options) { L.Util.setOptions(this, options); this._inputMinSize = this.options.text ? this.options.text.length : 10; this._layer = this.options.layer || new L.LayerGroup(); this._filterJSON = this.options.filterJSON || this._defaultFilterJSON; this._autoTypeTmp = this.options.autoType; //useful for disable autoType temporarily in delete/backspace keydown this._delayType = 400; this._recordsCache = {}; //key,value table! that store locations! format: key,latlng }, onAdd: function (map) { this._map = map; this._container = L.DomUtil.create('div', 'leaflet-control-search'); this._input = this._createInput(this.options.text, 'search-input'); this._tooltip = this._createTooltip('search-tooltip'); this._cancel = this._createCancel(this.options.textCancel, 'search-cancel'); this._createButton(this.options.text, 'search-button'); this._alert = this._createAlert('search-alert'); this._markerLoc = new SearchMarker([0,0], {marker: this.options.markerLocation}); this.setLayer( this._layer ); this._map .on('layeradd', this._onLayerAddRemove, this) .on('layerremove', this._onLayerAddRemove, this); return this._container; }, onRemove: function(map) { this._recordsCache = {}; this._map .off('layeradd', this._onLayerAddRemove) .off('layerremove', this._onLayerAddRemove); }, _onLayerAddRemove: function(e) { //console.info('_onLayerAddRemove'); if(e.layer instanceof L.LayerGroup)//without this, run setLayer also for each Markers!! to optimize! if( L.stamp(e.layer) != L.stamp(this._layer) ) this.setLayer(e.layer); }, setLayer: function(layer) { //set search layer at runtime //this.options.layer = layer; //setting this, run only this._recordsFromLayer() this._layer = layer; this._layer.addTo(this._map); this._layer.addLayer(this._markerLoc); return this; }, showAlert: function(text) { text = text || this.options.textErr; this._alert.style.display = 'block'; this._alert.innerHTML = text; clearTimeout(this.timerAlert); var that = this; this.timerAlert = setTimeout(function() { that.hideAlert(); },this.options.autoCollapseTime); return this; }, hideAlert: function() { this._alert.style.display = 'none'; return this; }, cancel: function() { this._input.value = ''; this._handleKeypress({keyCode:8});//simulate backspace keypress this._input.size = this._inputMinSize; this._input.focus(); this._cancel.style.display = 'none'; return this; }, expand: function() { this._input.style.display = 'block'; L.DomUtil.addClass(this._container, 'search-exp'); this._input.focus(); this._map.on('dragstart', this.collapse, this); return this; }, collapse: function() { this._hideTooltip(); this.cancel(); this._alert.style.display = 'none'; this._input.style.display = 'none'; this._input.blur(); this._cancel.style.display = 'none'; L.DomUtil.removeClass(this._container, 'search-exp'); this._markerLoc.hide(); this._map.off('dragstart', this.collapse, this); return this; }, collapseDelayed: function() { //collapse after delay, used on_input blur var that = this; clearTimeout(this.timerCollapse); this.timerCollapse = setTimeout(function() { that.collapse(); }, this.options.autoCollapseTime); return this; }, collapseDelayedStop: function() { clearTimeout(this.timerCollapse); return this; }, ////start DOM creations _createAlert: function(className) { var alert = L.DomUtil.create('div', className, this._container); alert.style.display = 'none'; L.DomEvent .on(alert, 'click', L.DomEvent.stop, this) .on(alert, 'click', this.hideAlert, this); return alert; }, _createInput: function (text, className) { var input = L.DomUtil.create('input', className, this._container); input.type = 'text'; input.size = this._inputMinSize; input.value = ''; input.autocomplete = 'off'; input.placeholder = text; input.style.display = 'none'; L.DomEvent .disableClickPropagation(input) .on(input, 'keyup', this._handleKeypress, this) .on(input, 'keydown', this._handleAutoresize, this) .on(input, 'blur', this.collapseDelayed, this) .on(input, 'focus', this.collapseDelayedStop, this); return input; }, _createCancel: function (title, className) { var cancel = L.DomUtil.create('a', className, this._container); cancel.href = '#'; cancel.title = title; cancel.style.display = 'none'; cancel.innerHTML = "<span>&otimes;</span>";//imageless(see css) L.DomEvent .on(cancel, 'click', L.DomEvent.stop, this) .on(cancel, 'click', this.cancel, this); return cancel; }, _createButton: function (title, className) { var button = L.DomUtil.create('a', className, this._container); button.href = '#'; button.title = title; L.DomEvent .on(button, 'click', L.DomEvent.stop, this) .on(button, 'click', this._handleSubmit, this) .on(button, 'focus', this.collapseDelayedStop, this) .on(button, 'blur', this.collapseDelayed, this); return button; }, _createTooltip: function(className) { var tool = L.DomUtil.create('div', className, this._container); tool.style.display = 'none'; var that = this; L.DomEvent .disableClickPropagation(tool) .on(tool, 'blur', this.collapseDelayed, this) .on(tool, 'mousewheel', function(e) { that.collapseDelayedStop(); L.DomEvent.stopPropagation(e);//disable zoom map }, this) .on(tool, 'mouseover', function(e) { that.collapseDelayedStop(); }, this); return tool; }, _createTip: function(text) { var tip; if(this.options.callTip) tip = this.options.callTip.call(this, text); //custom tip content else { tip = L.DomUtil.create('a', ''); tip.href = '#'; tip.innerHTML = text; } L.DomUtil.addClass(tip, 'search-tip'); tip._text = text; //value replaced in this._input and used by _autoType L.DomEvent .disableClickPropagation(tip) .on(tip, 'click', L.DomEvent.stop, this) .on(tip, 'click', function(e) { this._input.value = text; this._handleAutoresize(); this._input.focus(); this._hideTooltip(); if(this.options.tipAutoSubmit)//go to location at once this._handleSubmit(); }, this); return tip; }, //////end DOM creations _filterRecords: function(text) { //Filter this._recordsCache case insensitive and much more.. var regFilter = new RegExp("^[.]$|[\[\]|()*]",'g'), //remove . * | ( ) ] [ text = text.replace(regFilter,''), //sanitize text I = this.options.initial ? '^' : '', //search only initial text regSearch = new RegExp(I + text,'i'), //TODO add option for case sesitive search, also showLocation frecords = {}; for(var key in this._recordsCache)//use .filter or .map if( regSearch.test(key) ) frecords[key]= this._recordsCache[key]; return frecords; }, _showTooltip: function() { var filteredRecords, ntip = 0; //FIXME problem with jsonp/ajax when remote filter has different behavior of this._filterRecords if(this.options.layer) filteredRecords = this._filterRecords( this._input.value ); else filteredRecords = this._recordsCache; this._tooltip.innerHTML = ''; this._tooltip.currentSelection = -1; //inizialized for _handleArrowSelect() for(var key in filteredRecords)//fill tooltip { if(++ntip == this.options.tooltipLimit) break; this._tooltip.appendChild( this._createTip(key) ); //TODO pass key and value to _createTip, when _recordsCache support properties } if(ntip > 0) { this._tooltip.style.display = 'block'; if(this._autoTypeTmp) this._autoType(); this._autoTypeTmp = this.options.autoType;//reset default value } else this._hideTooltip(); this._tooltip.scrollTop = 0; return ntip; }, _hideTooltip: function() { this._tooltip.style.display = 'none'; this._tooltip.innerHTML = ''; return 0; }, _defaultFilterJSON: function(jsonraw) { //default callback for filter data var jsonret = {}, propname = this.options.propertyName; for(var i in jsonraw) { if( jsonraw[i].hasOwnProperty(propname) ) jsonret[ jsonraw[i][propname] ]= L.latLng( jsonraw[i].loc ); else throw new Error("propertyName '"+propname+"' not found in JSON"); } return jsonret; }, //TODO make new method for ajax requestes using XMLHttpRequest _recordsFromJsonp: function(text, callAfter) { //extract searched records from remote jsonp service //TODO remove script node after call run var that = this; L.Control.Search.callJsonp = function(data) { //jsonp callback var fdata = that._filterJSON.apply(that,[data]);//_filterJSON defined in inizialize... callAfter(fdata); } var script = L.DomUtil.create('script','search-jsonp', document.getElementsByTagName('body')[0] ), url = L.Util.template(this.options.jsonpUrl, {s: text, c:"L.Control.Search.callJsonp"}); //parsing url //rnd = '&_='+Math.floor(Math.random()*10000); //TODO add rnd param or randomize callback name! in recordsFromJsonp script.type = 'text/javascript'; script.src = url; return this; }, _recordsFromLayer: function() { //return table: key,value from layer var retRecords = {}, propname = this.options.propertyName; //TODO implement filter by element type: marker|polyline|circle... //TODO return also marker! in _recordsFromLayer this._layer.eachLayer(function(marker) { if(marker.options.hasOwnProperty(propname)) retRecords[ marker.options[propname] ] = marker.getLatLng(); else throw new Error("propertyName '"+propname+"' not found in marker"); },this); return retRecords; }, _autoType: function() { //TODO implements autype without selection(useful for mobile device) var start = this._input.value.length, firstRecord = this._tooltip.firstChild._text, end = firstRecord.length; this._input.value = firstRecord; this._handleAutoresize(); if (this._input.createTextRange) { var selRange = this._input.createTextRange(); selRange.collapse(true); selRange.moveStart('character', start); selRange.moveEnd('character', end); selRange.select(); } else if(this._input.setSelectionRange) { this._input.setSelectionRange(start, end); } else if(this._input.selectionStart) { this._input.selectionStart = start; this._input.selectionEnd = end; } }, _hideAutoType: function() { // deselect text: var sel; if ((sel = this._input.selection) && sel.empty) { sel.empty(); } else { if (this._input.getSelection) { this._input.getSelection().removeAllRanges(); } this._input.selectionStart = this._input.selectionEnd; } }, _handleKeypress: function (e) { //run _input keyup event switch(e.keyCode) { case 27: //Esc this.collapse(); break; case 13: //Enter this._handleSubmit(); //do search break; case 38://Up this._handleArrowSelect(-1); break; case 40://Down this._handleArrowSelect(1); break; case 37://Left case 39://Right case 16://Shift case 17://Ctrl //case 32://Space break; case 8://backspace case 46://delete this._autoTypeTmp = false;//disable temporarily autoType default://All keys if(this._input.value.length) this._cancel.style.display = 'block'; else this._cancel.style.display = 'none'; if(this._input.value.length >= this.options.minLength) { var that = this; clearTimeout(this.timerKeypress); //cancel last search request while type in this.timerKeypress = setTimeout(function() { //delay before request, for limit jsonp/ajax request that._fillRecordsCache(); }, this._delayType); } else this._hideTooltip(); } }, _fillRecordsCache: function() { //TODO important optimization!!! always append data in this._recordsCache //now _recordsCache content is emptied and replaced with new data founded //always appending data on _recordsCache give the possibility of caching ajax, jsonp and layersearch! //TODO here insert function that search inputText FIRST in _recordsCache keys and if not find results.. //run one of callbacks search(searchCall,jsonpUrl or options.layer) //and run this._showTooltip //TODO change structure of _recordsCache // like this: _recordsCache = {"text-key1": {loc:[lat,lng], ..other attributes.. }, {"text-key2": {loc:[lat,lng]}...}, ...} // in this mode every record can have a free structure of attributes, only 'loc' is required var inputText = this._input.value; L.DomUtil.addClass(this._container, 'search-load'); if(this.options.searchCall) //CUSTOM SEARCH CALLBACK(USUALLY FOR AJAX SEARCHING) { this._recordsCache = this.options.searchCall.apply(this, [inputText] ); this._showTooltip(); L.DomUtil.removeClass(this._container, 'search-load'); //FIXME removeClass .search-load apparently executed before searchCall!! A BIG MYSTERY! } else if(this.options.jsonpUrl) //JSONP SERVICE REQUESTING { var that = this; this._recordsFromJsonp(inputText, function(data) {// is async request then it need callback that._recordsCache = data; that._showTooltip(); L.DomUtil.removeClass(that._container, 'search-load'); }); } else if(this.options.layer) //SEARCH ELEMENTS IN PRELOADED LAYER { this._recordsCache = this._recordsFromLayer(); //fill table key,value from markers into layer this._showTooltip(); L.DomUtil.removeClass(this._container, 'search-load'); } }, //FIXME _handleAutoresize Should resize max search box size when map is resized. _handleAutoresize: function() { //autoresize this._input //TODO refact _handleAutoresize now is not accurate if(this.options.autoResize && (this._container.offsetWidth + 45 < this._map._container.offsetWidth)) this._input.size = this._input.value.length<this._inputMinSize ? this._inputMinSize : this._input.value.length; }, _handleArrowSelect: function(velocity) { var searchTips = this._tooltip.hasChildNodes() ? this._tooltip.childNodes : []; for (i=0; i<searchTips.length; i++) L.DomUtil.removeClass(searchTips[i], 'search-tip-select'); if ((velocity == 1 ) && (this._tooltip.currentSelection >= (searchTips.length - 1))) {// If at end of list. L.DomUtil.addClass(searchTips[this._tooltip.currentSelection], 'search-tip-select'); } else if ((velocity == -1 ) && (this._tooltip.currentSelection <= 0)) { // Going back up to the search box. this._tooltip.currentSelection = -1; } else if (this._tooltip.style.display != 'none') { // regular up/down this._tooltip.currentSelection += velocity; L.DomUtil.addClass(searchTips[this._tooltip.currentSelection], 'search-tip-select'); this._input.value = searchTips[this._tooltip.currentSelection]._text; // scroll: var tipOffsetTop = searchTips[this._tooltip.currentSelection].offsetTop; if (tipOffsetTop + searchTips[this._tooltip.currentSelection].clientHeight >= this._tooltip.scrollTop + this._tooltip.clientHeight) { this._tooltip.scrollTop = tipOffsetTop - this._tooltip.clientHeight + searchTips[this._tooltip.currentSelection].clientHeight; } else if (tipOffsetTop <= this._tooltip.scrollTop) { this._tooltip.scrollTop = tipOffsetTop; } } }, _handleSubmit: function() { //button and tooltip click and enter submit this._hideAutoType(); this.hideAlert(); this._hideTooltip(); if(this._input.style.display == 'none') //on first click show _input only this.expand(); else { if(this._input.value == '') //hide _input only this.collapse(); else { var loc = this._getLocation(this._input.value); if(loc) this.showLocation(loc);//, this._input.value); else this.showAlert(); //this.collapse(); //FIXME if collapse in _handleSubmit hide _markerLoc! } } }, _getLocation: function(key) { //extract latlng from _recordsCache if( this._recordsCache.hasOwnProperty(key) ) return this._recordsCache[this._input.value];//then after use .loc attribute else return false; }, showLocation: function(latlng, title) { //set location on map from _recordsCache if(this.options.zoom) this._map.setView(latlng, this.options.zoom); else this._map.panTo(latlng); this._markerLoc.setLatLng(latlng); //show circle/marker in location found this._markerLoc.setTitle(title); this._markerLoc.show(); if(this.options.animateLocation) this._markerLoc.animate(); //TODO showLocation: start animation after setView or panTo, maybe with map.on('moveend')... this.fire("locationfound", {latlng: latlng, text: title}); //FIXME autoCollapse option hide this._markerLoc before that visualized!! if(this.options.autoCollapse) this.collapse(); return this; } }); }).call(this);
passed loc in _createTip
leaflet-search.js
passed loc in _createTip
<ide><path>eaflet-search.js <ide> return tool; <ide> }, <ide> <del> _createTip: function(text) { <add> _createTip: function(text, loc) { <ide> var tip; <ide> <ide> if(this.options.callTip) <del> tip = this.options.callTip.call(this, text); //custom tip content <add> tip = this.options.callTip.apply(this, arguments); //custom tip content <ide> else <ide> { <ide> tip = L.DomUtil.create('a', ''); <ide> for(var key in filteredRecords)//fill tooltip <ide> { <ide> if(++ntip == this.options.tooltipLimit) break; <del> this._tooltip.appendChild( this._createTip(key) ); <del> //TODO pass key and value to _createTip, when _recordsCache support properties <add> this._tooltip.appendChild( this._createTip(key, filteredRecords[key] ) ); <ide> } <ide> <ide> if(ntip > 0)
JavaScript
mit
59b5701fcb58f0a0fbc7adea5f6db0f23f0dd2a9
0
angular/material,isaaclyman/material,dmitriz/material,gmoothart/material,gkalpak/material,jelbourn/material,marekmicek/material,Frank3K/material,jelbourn/material,isaaclyman/material,Todd-Werelius/material,dmitriz/material,vertazzar/material,HipsterZipster/material,graingert/material,hodeyp/material,DevVersion/material,DerekLouie/material,programmist/material,crisbeto/material,jadjoubran/material,pwistbac/material,angular/material,acoreyj/material,crisbeto/material,daniel-nagy/material,gkalpak/material,HarrisCorp/material,DevVersion/material,JonFerrera/material,david-gang/material,graingert/material,miguelcobain/material,SamDLT/material,j3ski/material,kamilkisiela/material,welkinhealth/material,jadjoubran/material,HipsterZipster/material,HarrisCorp/material,welkinhealth/material,isaaclyman/material,imjoeco/material,kamilkisiela/material,2947721120/angular-material,angular/material,Frank3K/material,robertmesserle/material,Todd-Werelius/material,welkinhealth/material,daniel-nagy/material,clshortfuse/material,ErinCoughlan/material,david-gang/material,ilovett/material,gkalpak/material,DevVersion/material,crisbeto/material,hodeyp/material,kamilkisiela/material,clshortfuse/material,programmist/material,DerekLouie/material,SamDLT/material,bluebirdtech/material,acoreyj/material,daniel-nagy/material,david-gang/material,profoundry-us/material,imjoeco/material,DerekLouie/material,epelc/material,crisbeto/material,vertazzar/material,bluebirdtech/material,jelbourn/material,colinskow/material,jadjoubran/material,oostmeijer/material,Splaktar/material,ServiceManagementGroup/material,ErinCoughlan/material,Todd-Werelius/material,graingert/material,imjoeco/material,robertmesserle/material,colinskow/material,oostmeijer/material,hodeyp/material,Splaktar/material,profoundry-us/material,miguelcobain/material,ServiceManagementGroup/material,marekmicek/material,2947721120/angular-material,hayloft/material,HarrisCorp/material,bluebirdtech/material,j3ski/material,ErinCoughlan/material,JonFerrera/material,profoundry-us/material,marekmicek/material,HarrisCorp/material,hayloft/material,robertmesserle/material,jadjoubran/material,programmist/material,pwistbac/material,Splaktar/material,vertazzar/material,2947721120/angular-material,epelc/material,jelbourn/material,epelc/material,gkalpak/material,gmoothart/material,david-gang/material,isaaclyman/material,hayloft/material,daniel-nagy/material,j3ski/material,dmitriz/material,HipsterZipster/material,SamDLT/material,DevVersion/material,angular/material,ErinCoughlan/material,hodeyp/material,JonFerrera/material,gmoothart/material,dmitriz/material,hayloft/material,ServiceManagementGroup/material,clshortfuse/material,acoreyj/material,acoreyj/material,welkinhealth/material,epelc/material,kamilkisiela/material,ilovett/material,pwistbac/material,marekmicek/material,colinskow/material,Frank3K/material,robertmesserle/material,miguelcobain/material,j3ski/material,pwistbac/material,bluebirdtech/material,programmist/material,ilovett/material,JonFerrera/material,HipsterZipster/material,clshortfuse/material,Splaktar/material,ServiceManagementGroup/material,oostmeijer/material,oostmeijer/material,Frank3K/material,SamDLT/material,imjoeco/material,miguelcobain/material,vertazzar/material,graingert/material,DerekLouie/material,2947721120/angular-material,Todd-Werelius/material,profoundry-us/material,gmoothart/material,ilovett/material,colinskow/material
/** * @ngdoc module * @name material.components.sidenav * * @description * A Sidenav QP component. */ angular .module('material.components.sidenav', [ 'material.core', 'material.components.backdrop' ]) .factory('$mdSidenav', SidenavService ) .directive('mdSidenav', SidenavDirective) .directive('mdSidenavFocus', SidenavFocusDirective) .controller('$mdSidenavController', SidenavController); /** * @ngdoc service * @name $mdSidenav * @module material.components.sidenav * * @description * `$mdSidenav` makes it easy to interact with multiple sidenavs * in an app. * * @usage * <hljs lang="js"> * // Async lookup for sidenav instance; will resolve when the instance is available * $mdSidenav(componentId).then(function(instance) { * $log.debug( componentId + "is now ready" ); * }); * // Async toggle the given sidenav; * // when instance is known ready and lazy lookup is not needed. * $mdSidenav(componentId) * .toggle() * .then(function(){ * $log.debug('toggled'); * }); * // Async open the given sidenav * $mdSidenav(componentId) * .open() * .then(function(){ * $log.debug('opened'); * }); * // Async close the given sidenav * $mdSidenav(componentId) * .close() * .then(function(){ * $log.debug('closed'); * }); * // Sync check to see if the specified sidenav is set to be open * $mdSidenav(componentId).isOpen(); * // Sync check to whether given sidenav is locked open * // If this is true, the sidenav will be open regardless of close() * $mdSidenav(componentId).isLockedOpen(); * </hljs> */ function SidenavService($mdComponentRegistry, $q) { return function(handle) { // Lookup the controller instance for the specified sidNav instance var self; var errorMsg = "SideNav '" + handle + "' is not available!"; var instance = $mdComponentRegistry.get(handle); if(!instance) { $mdComponentRegistry.notFoundError(handle); } return self = { // ----------------- // Sync methods // ----------------- isOpen: function() { return instance && instance.isOpen(); }, isLockedOpen: function() { return instance && instance.isLockedOpen(); }, // ----------------- // Async methods // ----------------- toggle: function() { return instance ? instance.toggle() : $q.reject(errorMsg); }, open: function() { return instance ? instance.open() : $q.reject(errorMsg); }, close: function() { return instance ? instance.close() : $q.reject(errorMsg); }, then : function( callbackFn ) { var promise = instance ? $q.when(instance) : waitForInstance(); return promise.then( callbackFn || angular.noop ); } }; /** * Deferred lookup of component instance using $component registry */ function waitForInstance() { return $mdComponentRegistry .when(handle) .then(function( it ){ instance = it; return it; }); } }; } /** * @ngdoc directive * @name mdSidenavFocus * @module material.components.sidenav * * @restrict A * * @description * `mdSidenavFocus` provides a way to specify the focused element when a sidenav opens. * This is completely optional, as the sidenav itself is focused by default. * * @usage * <hljs lang="html"> * <md-sidenav> * <form> * <md-input-container> * <label for="testInput">Label</label> * <input id="testInput" type="text" md-sidenav-focus> * </md-input-container> * </form> * </md-sidenav> * </hljs> **/ function SidenavFocusDirective() { return { restrict: 'A', require: '^mdSidenav', link: function(scope, element, attr, sidenavCtrl) { // @see $mdUtil.findFocusTarget(...) } }; } /** * @ngdoc directive * @name mdSidenav * @module material.components.sidenav * @restrict E * * @description * * A Sidenav component that can be opened and closed programatically. * * By default, upon opening it will slide out on top of the main content area. * * For keyboard and screen reader accessibility, focus is sent to the sidenav wrapper by default. * It can be overridden with the `md-autofocus` directive on the child element you want focused. * * @usage * <hljs lang="html"> * <div layout="row" ng-controller="MyController"> * <md-sidenav md-component-id="left" class="md-sidenav-left"> * Left Nav! * </md-sidenav> * * <md-content> * Center Content * <md-button ng-click="openLeftMenu()"> * Open Left Menu * </md-button> * </md-content> * * <md-sidenav md-component-id="right" * md-is-locked-open="$mdMedia('min-width: 333px')" * class="md-sidenav-right"> * <form> * <md-input-container> * <label for="testInput">Test input</label> * <input id="testInput" type="text" * ng-model="data" md-autofocus> * </md-input-container> * </form> * </md-sidenav> * </div> * </hljs> * * <hljs lang="js"> * var app = angular.module('myApp', ['ngMaterial']); * app.controller('MyController', function($scope, $mdSidenav) { * $scope.openLeftMenu = function() { * $mdSidenav('left').toggle(); * }; * }); * </hljs> * * @param {expression=} md-is-open A model bound to whether the sidenav is opened. * @param {string=} md-component-id componentId to use with $mdSidenav service. * @param {expression=} md-is-locked-open When this expression evalutes to true, * the sidenav 'locks open': it falls into the content's flow instead * of appearing over it. This overrides the `md-is-open` attribute. * * The $mdMedia() service is exposed to the is-locked-open attribute, which * can be given a media query or one of the `sm`, `gt-sm`, `md`, `gt-md`, `lg` or `gt-lg` presets. * Examples: * * - `<md-sidenav md-is-locked-open="shouldLockOpen"></md-sidenav>` * - `<md-sidenav md-is-locked-open="$mdMedia('min-width: 1000px')"></md-sidenav>` * - `<md-sidenav md-is-locked-open="$mdMedia('sm')"></md-sidenav>` (locks open on small screens) */ function SidenavDirective($mdMedia, $mdUtil, $mdConstant, $mdTheming, $animate, $compile, $parse, $log, $q, $document) { return { restrict: 'E', scope: { isOpen: '=?mdIsOpen' }, controller: '$mdSidenavController', compile: function(element) { element.addClass('md-closed'); element.attr('tabIndex', '-1'); return postLink; } }; /** * Directive Post Link function... */ function postLink(scope, element, attr, sidenavCtrl) { var lastParentOverFlow; var triggeringElement = null; var promise = $q.when(true); var isLockedOpenParsed = $parse(attr.mdIsLockedOpen); var isLocked = function() { return isLockedOpenParsed(scope.$parent, { $media: function(arg) { $log.warn("$media is deprecated for is-locked-open. Use $mdMedia instead."); return $mdMedia(arg); }, $mdMedia: $mdMedia }); }; var backdrop = $mdUtil.createBackdrop(scope, "md-sidenav-backdrop md-opaque ng-enter"); $mdTheming.inherit(backdrop, element); element.on('$destroy', function() { backdrop.remove(); sidenavCtrl.destroy(); }); scope.$on('$destroy', function(){ backdrop.remove() }); scope.$watch(isLocked, updateIsLocked); scope.$watch('isOpen', updateIsOpen); // Publish special accessor for the Controller instance sidenavCtrl.$toggleOpen = toggleOpen; /** * Toggle the DOM classes to indicate `locked` * @param isLocked */ function updateIsLocked(isLocked, oldValue) { scope.isLockedOpen = isLocked; if (isLocked === oldValue) { element.toggleClass('md-locked-open', !!isLocked); } else { $animate[isLocked ? 'addClass' : 'removeClass'](element, 'md-locked-open'); } backdrop.toggleClass('md-locked-open', !!isLocked); } /** * Toggle the SideNav view and attach/detach listeners * @param isOpen */ function updateIsOpen(isOpen) { // Support deprecated md-sidenav-focus attribute as fallback var focusEl = $mdUtil.findFocusTarget(element) || $mdUtil.findFocusTarget(element,'[md-sidenav-focus]') || element; var parent = element.parent(); parent[isOpen ? 'on' : 'off']('keydown', onKeyDown); backdrop[isOpen ? 'on' : 'off']('click', close); if ( isOpen ) { // Capture upon opening.. triggeringElement = $document[0].activeElement; } disableParentScroll(isOpen); return promise = $q.all([ isOpen ? $animate.enter(backdrop, parent) : $animate.leave(backdrop), $animate[isOpen ? 'removeClass' : 'addClass'](element, 'md-closed') ]) .then(function() { // Perform focus when animations are ALL done... if (scope.isOpen) { focusEl && focusEl.focus(); } }); } /** * Prevent parent scrolling (when the SideNav is open) */ function disableParentScroll(disabled) { var parent = element.parent(); if ( disabled && !lastParentOverFlow ) { lastParentOverFlow = parent.css('overflow'); parent.css('overflow', 'hidden'); } else if (angular.isDefined(lastParentOverFlow)) { parent.css('overflow', lastParentOverFlow); lastParentOverFlow = undefined; } } /** * Toggle the sideNav view and publish a promise to be resolved when * the view animation finishes. * * @param isOpen * @returns {*} */ function toggleOpen( isOpen ) { if (scope.isOpen == isOpen ) { return $q.when(true); } else { return $q(function(resolve){ // Toggle value to force an async `updateIsOpen()` to run scope.isOpen = isOpen; $mdUtil.nextTick(function() { // When the current `updateIsOpen()` animation finishes promise.then(function(result) { if ( !scope.isOpen ) { // reset focus to originating element (if available) upon close triggeringElement && triggeringElement.focus(); triggeringElement = null; } resolve(result); }); }); }); } } /** * Auto-close sideNav when the `escape` key is pressed. * @param evt */ function onKeyDown(ev) { var isEscape = (ev.keyCode === $mdConstant.KEY_CODE.ESCAPE); return isEscape ? close(ev) : $q.when(true); } /** * With backdrop `clicks` or `escape` key-press, immediately * apply the CSS close transition... Then notify the controller * to close() and perform its own actions. */ function close(ev) { ev.preventDefault(); return sidenavCtrl.close(); } } } /* * @private * @ngdoc controller * @name SidenavController * @module material.components.sidenav * */ function SidenavController($scope, $element, $attrs, $mdComponentRegistry, $q) { var self = this; // Use Default internal method until overridden by directive postLink // Synchronous getters self.isOpen = function() { return !!$scope.isOpen; }; self.isLockedOpen = function() { return !!$scope.isLockedOpen; }; // Async actions self.open = function() { return self.$toggleOpen( true ); }; self.close = function() { return self.$toggleOpen( false ); }; self.toggle = function() { return self.$toggleOpen( !$scope.isOpen ); }; self.$toggleOpen = function(value) { return $q.when($scope.isOpen = value); }; self.destroy = $mdComponentRegistry.register(self, $attrs.mdComponentId); }
src/components/sidenav/sidenav.js
/** * @ngdoc module * @name material.components.sidenav * * @description * A Sidenav QP component. */ angular .module('material.components.sidenav', [ 'material.core', 'material.components.backdrop' ]) .factory('$mdSidenav', SidenavService ) .directive('mdSidenav', SidenavDirective) .directive('mdSidenavFocus', SidenavFocusDirective) .controller('$mdSidenavController', SidenavController); /** * @ngdoc service * @name $mdSidenav * @module material.components.sidenav * * @description * `$mdSidenav` makes it easy to interact with multiple sidenavs * in an app. * * @usage * <hljs lang="js"> * // Async lookup for sidenav instance; will resolve when the instance is available * $mdSidenav(componentId).then(function(instance) { * $log.debug( componentId + "is now ready" ); * }); * // Async toggle the given sidenav; * // when instance is known ready and lazy lookup is not needed. * $mdSidenav(componentId) * .toggle() * .then(function(){ * $log.debug('toggled'); * }); * // Async open the given sidenav * $mdSidenav(componentId) * .open() * .then(function(){ * $log.debug('opened'); * }); * // Async close the given sidenav * $mdSidenav(componentId) * .close() * .then(function(){ * $log.debug('closed'); * }); * // Sync check to see if the specified sidenav is set to be open * $mdSidenav(componentId).isOpen(); * // Sync check to whether given sidenav is locked open * // If this is true, the sidenav will be open regardless of close() * $mdSidenav(componentId).isLockedOpen(); * </hljs> */ function SidenavService($mdComponentRegistry, $q) { return function(handle) { // Lookup the controller instance for the specified sidNav instance var self; var errorMsg = "SideNav '" + handle + "' is not available!"; var instance = $mdComponentRegistry.get(handle); if(!instance) { $mdComponentRegistry.notFoundError(handle); } return self = { // ----------------- // Sync methods // ----------------- isOpen: function() { return instance && instance.isOpen(); }, isLockedOpen: function() { return instance && instance.isLockedOpen(); }, // ----------------- // Async methods // ----------------- toggle: function() { return instance ? instance.toggle() : $q.reject(errorMsg); }, open: function() { return instance ? instance.open() : $q.reject(errorMsg); }, close: function() { return instance ? instance.close() : $q.reject(errorMsg); }, then : function( callbackFn ) { var promise = instance ? $q.when(instance) : waitForInstance(); return promise.then( callbackFn || angular.noop ); } }; /** * Deferred lookup of component instance using $component registry */ function waitForInstance() { return $mdComponentRegistry .when(handle) .then(function( it ){ instance = it; return it; }); } }; } /** * @ngdoc directive * @name mdSidenavFocus * @module material.components.sidenav * * @restrict A * * @description * `mdSidenavFocus` provides a way to specify the focused element when a sidenav opens. * This is completely optional, as the sidenav itself is focused by default. * * @usage * <hljs lang="html"> * <md-sidenav> * <form> * <md-input-container> * <label for="testInput">Label</label> * <input id="testInput" type="text" md-sidenav-focus> * </md-input-container> * </form> * </md-sidenav> * </hljs> **/ function SidenavFocusDirective() { return { restrict: 'A', require: '^mdSidenav', link: function(scope, element, attr, sidenavCtrl) { // @see $mdUtil.findFocusTarget(...) } }; } /** * @ngdoc directive * @name mdSidenav * @module material.components.sidenav * @restrict E * * @description * * A Sidenav component that can be opened and closed programatically. * * By default, upon opening it will slide out on top of the main content area. * * For keyboard and screen reader accessibility, focus is sent to the sidenav wrapper by default. * It can be overridden with the `md-autofocus` directive on the child element you want focused. * * @usage * <hljs lang="html"> * <div layout="row" ng-controller="MyController"> * <md-sidenav md-component-id="left" class="md-sidenav-left"> * Left Nav! * </md-sidenav> * * <md-content> * Center Content * <md-button ng-click="openLeftMenu()"> * Open Left Menu * </md-button> * </md-content> * * <md-sidenav md-component-id="right" * md-is-locked-open="$mdMedia('min-width: 333px')" * class="md-sidenav-right"> * <form> * <md-input-container> * <label for="testInput">Test input</label> * <input id="testInput" type="text" * ng-model="data" md-autofocus> * </md-input-container> * </form> * </md-sidenav> * </div> * </hljs> * * <hljs lang="js"> * var app = angular.module('myApp', ['ngMaterial']); * app.controller('MyController', function($scope, $mdSidenav) { * $scope.openLeftMenu = function() { * $mdSidenav('left').toggle(); * }; * }); * </hljs> * * @param {expression=} md-is-open A model bound to whether the sidenav is opened. * @param {string=} md-component-id componentId to use with $mdSidenav service. * @param {expression=} md-is-locked-open When this expression evalutes to true, * the sidenav 'locks open': it falls into the content's flow instead * of appearing over it. This overrides the `is-open` attribute. * * The $mdMedia() service is exposed to the is-locked-open attribute, which * can be given a media query or one of the `sm`, `gt-sm`, `md`, `gt-md`, `lg` or `gt-lg` presets. * Examples: * * - `<md-sidenav md-is-locked-open="shouldLockOpen"></md-sidenav>` * - `<md-sidenav md-is-locked-open="$mdMedia('min-width: 1000px')"></md-sidenav>` * - `<md-sidenav md-is-locked-open="$mdMedia('sm')"></md-sidenav>` (locks open on small screens) */ function SidenavDirective($mdMedia, $mdUtil, $mdConstant, $mdTheming, $animate, $compile, $parse, $log, $q, $document) { return { restrict: 'E', scope: { isOpen: '=?mdIsOpen' }, controller: '$mdSidenavController', compile: function(element) { element.addClass('md-closed'); element.attr('tabIndex', '-1'); return postLink; } }; /** * Directive Post Link function... */ function postLink(scope, element, attr, sidenavCtrl) { var lastParentOverFlow; var triggeringElement = null; var promise = $q.when(true); var isLockedOpenParsed = $parse(attr.mdIsLockedOpen); var isLocked = function() { return isLockedOpenParsed(scope.$parent, { $media: function(arg) { $log.warn("$media is deprecated for is-locked-open. Use $mdMedia instead."); return $mdMedia(arg); }, $mdMedia: $mdMedia }); }; var backdrop = $mdUtil.createBackdrop(scope, "md-sidenav-backdrop md-opaque ng-enter"); $mdTheming.inherit(backdrop, element); element.on('$destroy', function() { backdrop.remove(); sidenavCtrl.destroy(); }); scope.$on('$destroy', function(){ backdrop.remove() }); scope.$watch(isLocked, updateIsLocked); scope.$watch('isOpen', updateIsOpen); // Publish special accessor for the Controller instance sidenavCtrl.$toggleOpen = toggleOpen; /** * Toggle the DOM classes to indicate `locked` * @param isLocked */ function updateIsLocked(isLocked, oldValue) { scope.isLockedOpen = isLocked; if (isLocked === oldValue) { element.toggleClass('md-locked-open', !!isLocked); } else { $animate[isLocked ? 'addClass' : 'removeClass'](element, 'md-locked-open'); } backdrop.toggleClass('md-locked-open', !!isLocked); } /** * Toggle the SideNav view and attach/detach listeners * @param isOpen */ function updateIsOpen(isOpen) { // Support deprecated md-sidenav-focus attribute as fallback var focusEl = $mdUtil.findFocusTarget(element) || $mdUtil.findFocusTarget(element,'[md-sidenav-focus]') || element; var parent = element.parent(); parent[isOpen ? 'on' : 'off']('keydown', onKeyDown); backdrop[isOpen ? 'on' : 'off']('click', close); if ( isOpen ) { // Capture upon opening.. triggeringElement = $document[0].activeElement; } disableParentScroll(isOpen); return promise = $q.all([ isOpen ? $animate.enter(backdrop, parent) : $animate.leave(backdrop), $animate[isOpen ? 'removeClass' : 'addClass'](element, 'md-closed') ]) .then(function() { // Perform focus when animations are ALL done... if (scope.isOpen) { focusEl && focusEl.focus(); } }); } /** * Prevent parent scrolling (when the SideNav is open) */ function disableParentScroll(disabled) { var parent = element.parent(); if ( disabled && !lastParentOverFlow ) { lastParentOverFlow = parent.css('overflow'); parent.css('overflow', 'hidden'); } else if (angular.isDefined(lastParentOverFlow)) { parent.css('overflow', lastParentOverFlow); lastParentOverFlow = undefined; } } /** * Toggle the sideNav view and publish a promise to be resolved when * the view animation finishes. * * @param isOpen * @returns {*} */ function toggleOpen( isOpen ) { if (scope.isOpen == isOpen ) { return $q.when(true); } else { return $q(function(resolve){ // Toggle value to force an async `updateIsOpen()` to run scope.isOpen = isOpen; $mdUtil.nextTick(function() { // When the current `updateIsOpen()` animation finishes promise.then(function(result) { if ( !scope.isOpen ) { // reset focus to originating element (if available) upon close triggeringElement && triggeringElement.focus(); triggeringElement = null; } resolve(result); }); }); }); } } /** * Auto-close sideNav when the `escape` key is pressed. * @param evt */ function onKeyDown(ev) { var isEscape = (ev.keyCode === $mdConstant.KEY_CODE.ESCAPE); return isEscape ? close(ev) : $q.when(true); } /** * With backdrop `clicks` or `escape` key-press, immediately * apply the CSS close transition... Then notify the controller * to close() and perform its own actions. */ function close(ev) { ev.preventDefault(); return sidenavCtrl.close(); } } } /* * @private * @ngdoc controller * @name SidenavController * @module material.components.sidenav * */ function SidenavController($scope, $element, $attrs, $mdComponentRegistry, $q) { var self = this; // Use Default internal method until overridden by directive postLink // Synchronous getters self.isOpen = function() { return !!$scope.isOpen; }; self.isLockedOpen = function() { return !!$scope.isLockedOpen; }; // Async actions self.open = function() { return self.$toggleOpen( true ); }; self.close = function() { return self.$toggleOpen( false ); }; self.toggle = function() { return self.$toggleOpen( !$scope.isOpen ); }; self.$toggleOpen = function(value) { return $q.when($scope.isOpen = value); }; self.destroy = $mdComponentRegistry.register(self, $attrs.mdComponentId); }
md-sidenav fix for documentation is-open -> md-is-open Closes #6846
src/components/sidenav/sidenav.js
md-sidenav fix for documentation
<ide><path>rc/components/sidenav/sidenav.js <ide> * @param {string=} md-component-id componentId to use with $mdSidenav service. <ide> * @param {expression=} md-is-locked-open When this expression evalutes to true, <ide> * the sidenav 'locks open': it falls into the content's flow instead <del> * of appearing over it. This overrides the `is-open` attribute. <add> * of appearing over it. This overrides the `md-is-open` attribute. <ide> * <ide> * The $mdMedia() service is exposed to the is-locked-open attribute, which <ide> * can be given a media query or one of the `sm`, `gt-sm`, `md`, `gt-md`, `lg` or `gt-lg` presets.
Java
epl-1.0
e624008b02da7d86c99176b00d16c560e20a7e47
0
bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs,bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs,bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs
/******************************************************************************* * Copyright (c) 2005, 2009 SAP. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 * which accompanies this distribution. * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * SAP - initial API and implementation ******************************************************************************/ package org.eclipse.persistence.testing.tests.wdf.jpa1.entitymanager; import java.sql.Connection; import java.sql.Date; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashSet; import java.util.Set; import javax.persistence.EntityManager; import javax.persistence.EntityNotFoundException; import javax.persistence.FlushModeType; import javax.persistence.Query; import javax.persistence.TransactionRequiredException; import org.eclipse.persistence.testing.framework.wdf.Bugzilla; import org.eclipse.persistence.testing.framework.wdf.JPAEnvironment; import org.eclipse.persistence.testing.models.wdf.jpa1.employee.Department; import org.eclipse.persistence.testing.models.wdf.jpa1.employee.Employee; import org.eclipse.persistence.testing.models.wdf.jpa1.employee.Review; import org.eclipse.persistence.testing.tests.wdf.jpa1.JPA1Base; import org.junit.Ignore; import org.junit.Test; import static org.junit.Assert.fail; public class TestRefresh extends JPA1Base { @Test public void testRefreshNew() { /* * Refresh on an entity that is not under control of the entity manager * should throw an IllegalArgumentException. */ final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); int id; Department dep; try { id = 1; dep = new Department(id, "NEW"); env.beginTransaction(em); try { em.refresh(dep); flop("refresh did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { verify(true, ""); } env.rollbackTransactionAndClear(em); } finally { closeEntityManager(em); } } @Test @Bugzilla(bugid = 309681) public void testRefreshManagedNew() throws SQLException { /* * Note: The specification doesn't state explicitly how to behave in * this case, so we test our interpretation: - If the entity doesn't * exist on the database, nothing is changed - If the entity exists on * the database, the data is loaded and the state changes from * FOR_INSERT to FOR_UPDATE (in order to avoid errors at flush time) */ final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); int id; Department dep; try { // case 2: state MANAGED_NEW, but exists on DB (inserted in // different tx) id = 12; dep = new Department(id, "MANAGED_NEW"); Department depInserted = new Department(id, "INSERTED"); env.beginTransaction(em); em.persist(dep); insertDepartmentIntoDatabase(depInserted); verifyExistenceOnDatabase(id); // entity is now in state MANAGED_NEW, but record exists on db em.refresh(dep); checkDepartment(dep, id, "INSERTED"); // this should now be in state // MANAGED verify(em.contains(dep), "Department is not managed"); dep.setName("UPDATED"); env.commitTransactionAndClear(em); // verify that updated name present on db dep = em.find(Department.class, new Integer(id)); checkDepartment(dep, id, "UPDATED"); } finally { closeEntityManager(em); } } @Test @Bugzilla(bugid = 309681) public void testRefreshManagedNewNotOnDB() throws SQLException { /* * Note: The specification doesn't state explicitly how to behave in * this case, so we test our interpretation: - If the entity doesn't * exist on the database, nothing is changed - If the entity exists on * the database, the data is loaded and the state changes from * FOR_INSERT to FOR_UPDATE (in order to avoid errors at flush time) */ final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); int id; Department dep; try { // case 1: state MANAGED_NEW and does not exist on DB id = 11; dep = new Department(id, "MANAGED_NEW"); env.beginTransaction(em); em.persist(dep); // this is now in state MANAGED_NEW, but not on db em.refresh(dep); // nothing should happen verify(em.contains(dep), "Department is not managed"); env.commitTransactionAndClear(em); verifyExistenceOnDatabase(id); } finally { closeEntityManager(em); } } @Test public void testRefreshManaged() throws SQLException { final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); int id; Department dep; Department updatedDep; try { // case 1: undo own changes id = 21; dep = new Department(id, "MANAGED"); env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); dep = em.find(Department.class, new Integer(id)); // this is now in // state MANAGED dep.setName("UPDATED"); em.refresh(dep); checkDepartment(dep, id, "MANAGED"); verify(em.contains(dep), "Department is not managed"); env.commitTransactionAndClear(em); // verify that original name present on db dep = em.find(Department.class, new Integer(id)); checkDepartment(dep, id, "MANAGED"); // case 2: refresh with data changed on db in a different tx id = 22; dep = new Department(id, "MANAGED"); updatedDep = new Department(id, "UPDATED"); env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); dep = em.find(Department.class, new Integer(id)); // this is now in // state MANAGED updateDepartmentOnDatabase(updatedDep); em.refresh(dep); checkDepartment(dep, id, "UPDATED"); verify(em.contains(dep), "Department is not managed"); dep.setName("MANAGED"); env.commitTransactionAndClear(em); // verify that original name present on db dep = em.find(Department.class, new Integer(id)); checkDepartment(dep, id, "MANAGED"); } finally { closeEntityManager(em); } } @Test @Bugzilla(bugid = 309681) public void testRefreshManagedCheckContains() throws SQLException { final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); int id; Department dep; try { // case 3: try to refresh, but record has been deleted on db in a // different tx /* * We expect an EntityNotFoundException. However, the specification * does not state explicitly in which state the managed entity * should be after the exception. We are going to remove the entity * from the persistence context, so it is detached afterwards. */ id = 23; dep = new Department(id, "MANAGED"); env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); dep = em.find(Department.class, new Integer(id)); // this is now in // state MANAGED deleteDepartmentFromDatabase(id); verifyAbsenceFromDatabase(em, id); try { em.refresh(dep); flop("refresh did not throw EntityNotFoundException"); } catch (EntityNotFoundException e) { verify(true, ""); } verify(!em.contains(dep), "entity still managed after EntityNotFoundException"); env.rollbackTransactionAndClear(em); } finally { closeEntityManager(em); } } private void doRefreshDeleted(int id, boolean flush) throws SQLException { final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); try { Department dep = new Department(id, "DELETED"); env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); dep = em.find(Department.class, new Integer(id)); em.remove(dep); if (flush) { em.flush(); // this is now in state DELETE_EXECUTED verifyAbsenceFromDatabase(em, id); } try { em.refresh(dep); fail("refresh did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { // expected } if (env.isTransactionActive(em)) { env.rollbackTransactionAndClear(em); } } finally { closeEntityManager(em); } } /* * Refreshing an entity in state "removed" should raise an * IllegalArgumentException */ @Test public void testRefreshDeleted() throws SQLException { doRefreshDeleted(31, false); doRefreshDeleted(32, true); } @Test public void testRefreshDetached() { /* * Refresh on a detached entity should throw an * IllegalArgumentException. */ final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); int id; Department dep; Department detachedDep; try { // case 1: entity exists on DB, but not contained in persistence // context id = 41; dep = new Department(id, "DETACHED"); // firstly, we create a department on the database env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); try { em.refresh(dep); flop("refresh did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { verify(true, ""); } env.rollbackTransactionAndClear(em); // case 2: entity is contained in persistence context, but object to // be merged has different object identity // case 2a: state of known object: MANAGED_NEW id = 42; dep = new Department(id, "MANAGED_NEW"); detachedDep = new Department(id, "DETACHED"); env.beginTransaction(em); em.persist(dep); // this is now in state new try { em.refresh(detachedDep); // this object is detached flop("refresh did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { verify(true, ""); } env.rollbackTransactionAndClear(em); // case 2b: state of known object: MANAGED id = 43; dep = new Department(id, "MANAGED"); detachedDep = new Department(id, "DETACHED"); env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); dep = em.find(Department.class, new Integer(id)); // this is now in // state MANAGED try { em.refresh(detachedDep); // this object is detached flop("refresh did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { verify(true, ""); } env.rollbackTransactionAndClear(em); // case 2c: state of known object: DELETED id = 44; dep = new Department(id, "DELETED"); detachedDep = new Department(id, "DETACHED"); env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); dep = em.find(Department.class, new Integer(id)); em.remove(dep); // this is now in state DELETED try { em.refresh(detachedDep); // this object is detached flop("refresh did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { verify(true, ""); } env.rollbackTransactionAndClear(em); } finally { closeEntityManager(em); } } @Test public void testNotAnEntity() { final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); try { env.beginTransaction(em); try { em.refresh("Hutzliputz"); flop("no IllegalArgumentException "); } catch (IllegalArgumentException e) { verify(true, ""); } finally { env.rollbackTransactionAndClear(em); } env.beginTransaction(em); try { em.refresh(null); flop("no IllegalArgumentException "); } catch (IllegalArgumentException e) { verify(true, ""); } finally { env.rollbackTransactionAndClear(em); } } finally { closeEntityManager(em); } } @Ignore // @TestProperties(unsupportedEnvironments = { // JTANonSharedPCEnvironment.class, ResourceLocalEnvironment.class }) public void testNoTransaction() { final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); int id; Department dep; try { id = 61; dep = new Department(id, "NO_TX"); verify(!env.isTransactionActive(em), "transaction is active, can't execute test"); try { em.refresh(dep); flop("refresh did not throw TransactionRequiredException"); } catch (TransactionRequiredException e) { verify(true, ""); } } finally { closeEntityManager(em); } } @Test public void testRefreshManagedWithRelationships() { final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); try { // case 1: undo own changes Department dep = new Department(101, "Evangelists"); Employee emp = new Employee(102, "First", "Last", dep); Review rev1 = new Review(103, Date.valueOf("2006-02-03"), "Code inspection"); Review rev2 = new Review(104, Date.valueOf("2006-02-04"), "Design review"); emp.addReview(rev1); emp.addReview(rev2); env.beginTransaction(em); em.persist(dep); em.persist(emp); em.persist(rev1); em.persist(rev2); env.commitTransactionAndClear(em); env.beginTransaction(em); emp = em.find(Employee.class, new Integer(emp.getId())); rev1 = em.find(Review.class, new Integer(rev1.getId())); Review rev3 = new Review(105, Date.valueOf("2006-02-05"), "Test coverage"); Set<Review> reviews = new HashSet<Review>(); reviews.add(rev1); reviews.add(rev3); emp.setReviews(reviews); rev1.setReviewText("UPDATED"); em.refresh(emp); verify(em.contains(emp), "Employee is not managed"); Set<Review> reviewsAfterRefresh = emp.getReviews(); verify(reviewsAfterRefresh.size() == 2, "Employee contains wrong number of reviews: " + reviewsAfterRefresh.size()); for (Review rev : reviewsAfterRefresh) { int id = rev.getId(); verify(id == rev1.getId() || id == rev2.getId(), "Employee has wrong review: " + id); verify(em.contains(rev), "Review " + id + " is not managed"); } env.commitTransactionAndClear(em); // verify that original name present on db rev1 = em.find(Review.class, new Integer(rev1.getId())); verify("UPDATED".equals(rev1.getReviewText()), "Rev1 has wrong text: " + rev1.getReviewText()); } finally { closeEntityManager(em); } } @Test public void testTransactionMarkedForRollback() { final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); Department dep = new Department(111, "dep111"); try { env.beginTransaction(em); em.persist(dep); env.commitTransaction(em); em.clear(); env.beginTransaction(em); dep = em.find(Department.class, Integer.valueOf(dep.getId())); dep.setName("updated"); env.markTransactionForRollback(em); em.refresh(dep); checkDepartment(dep, dep.getId(), "dep111"); verify(em.contains(dep), "entity not contained in persistence context"); env.rollbackTransaction(em); } finally { closeEntityManager(em); } } private void verifyExistenceOnDatabase(int departmentId) throws SQLException { Connection conn = getEnvironment().getDataSource().getConnection(); try { PreparedStatement stmt = conn.prepareStatement("select ID, NAME from TMP_DEP where ID = ?"); try { stmt.setInt(1, departmentId); ResultSet rs = stmt.executeQuery(); try { verify(rs.next(), "no department with id " + departmentId + " found using JDBC."); } finally { rs.close(); } } finally { stmt.close(); } } finally { conn.close(); } } private void verifyAbsenceFromDatabase(EntityManager em, int id) { Query query = em.createQuery("SELECT d.id from Department d where d.id = ?1"); query.setFlushMode(FlushModeType.COMMIT); query.setParameter(1, Integer.valueOf(id)); verify(query.getResultList().size() == 0, "wrong result list size"); } private void deleteDepartmentFromDatabase(int departmentId) throws SQLException { Connection conn = getEnvironment().getDataSource().getConnection(); try { PreparedStatement stmt = conn.prepareStatement("delete from TMP_DEP where ID = ?"); try { stmt.setInt(1, departmentId); stmt.executeUpdate(); } finally { stmt.close(); } } finally { conn.close(); } } private void insertDepartmentIntoDatabase(Department department) throws SQLException { Connection conn = getEnvironment().getDataSource().getConnection(); try { PreparedStatement stmt = conn.prepareStatement("insert into TMP_DEP (ID, NAME, VERSION) values (?, ?, ?)"); try { stmt.setInt(1, department.getId()); stmt.setString(2, department.getName()); stmt.setShort(3, (short) 0); stmt.executeUpdate(); } finally { stmt.close(); } } finally { conn.close(); } } private void updateDepartmentOnDatabase(Department department) throws SQLException { Connection conn = getEnvironment().getDataSource().getConnection(); try { PreparedStatement stmt = conn.prepareStatement("update TMP_DEP set NAME = ? where ID = ?"); try { stmt.setString(1, department.getName()); stmt.setInt(2, department.getId()); stmt.executeUpdate(); } finally { stmt.close(); } } finally { conn.close(); } } private void checkDepartment(Department department, int id, String name) { verify(department != null, "department is null"); verify(id == department.getId(), "department has wrong id: " + department.getId()); verify(name.equals(department.getName()), "department has wrong name: " + department.getName()); } }
jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/tests/wdf/jpa1/entitymanager/TestRefresh.java
/******************************************************************************* * Copyright (c) 2005, 2009 SAP. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 * which accompanies this distribution. * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * SAP - initial API and implementation ******************************************************************************/ package org.eclipse.persistence.testing.tests.wdf.jpa1.entitymanager; import java.sql.Connection; import java.sql.Date; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashSet; import java.util.Set; import javax.persistence.EntityManager; import javax.persistence.EntityNotFoundException; import javax.persistence.FlushModeType; import javax.persistence.Query; import javax.persistence.TransactionRequiredException; import org.eclipse.persistence.testing.framework.wdf.Bugzilla; import org.eclipse.persistence.testing.framework.wdf.JPAEnvironment; import org.eclipse.persistence.testing.models.wdf.jpa1.employee.Department; import org.eclipse.persistence.testing.models.wdf.jpa1.employee.Employee; import org.eclipse.persistence.testing.models.wdf.jpa1.employee.Review; import org.eclipse.persistence.testing.tests.wdf.jpa1.JPA1Base; import org.junit.Ignore; import org.junit.Test; public class TestRefresh extends JPA1Base { @Test public void testRefreshNew() { /* * Refresh on an entity that is not under control of the entity manager should throw an IllegalArgumentException. */ final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); int id; Department dep; try { id = 1; dep = new Department(id, "NEW"); env.beginTransaction(em); try { em.refresh(dep); flop("refresh did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { verify(true, ""); } env.rollbackTransactionAndClear(em); } finally { closeEntityManager(em); } } @Test @Bugzilla(bugid=309681) public void testRefreshManagedNew() throws SQLException { /* * Note: The specification doesn't state explicitly how to behave in this case, so we test our interpretation: - If the * entity doesn't exist on the database, nothing is changed - If the entity exists on the database, the data is loaded * and the state changes from FOR_INSERT to FOR_UPDATE (in order to avoid errors at flush time) */ final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); int id; Department dep; try { // case 2: state MANAGED_NEW, but exists on DB (inserted in different tx) id = 12; dep = new Department(id, "MANAGED_NEW"); Department depInserted = new Department(id, "INSERTED"); env.beginTransaction(em); em.persist(dep); insertDepartmentIntoDatabase(depInserted); verifyExistenceOnDatabase(id); // entity is now in state MANAGED_NEW, but record exists on db em.refresh(dep); checkDepartment(dep, id, "INSERTED"); // this should now be in state MANAGED verify(em.contains(dep), "Department is not managed"); dep.setName("UPDATED"); env.commitTransactionAndClear(em); // verify that updated name present on db dep = em.find(Department.class, new Integer(id)); checkDepartment(dep, id, "UPDATED"); } finally { closeEntityManager(em); } } @Test @Bugzilla(bugid=309681) public void testRefreshManagedNewNotOnDB() throws SQLException { /* * Note: The specification doesn't state explicitly how to behave in this case, so we test our interpretation: - If the * entity doesn't exist on the database, nothing is changed - If the entity exists on the database, the data is loaded * and the state changes from FOR_INSERT to FOR_UPDATE (in order to avoid errors at flush time) */ final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); int id; Department dep; try { // case 1: state MANAGED_NEW and does not exist on DB id = 11; dep = new Department(id, "MANAGED_NEW"); env.beginTransaction(em); em.persist(dep); // this is now in state MANAGED_NEW, but not on db em.refresh(dep); // nothing should happen verify(em.contains(dep), "Department is not managed"); env.commitTransactionAndClear(em); verifyExistenceOnDatabase(id); } finally { closeEntityManager(em); } } @Test public void testRefreshManaged() throws SQLException { final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); int id; Department dep; Department updatedDep; try { // case 1: undo own changes id = 21; dep = new Department(id, "MANAGED"); env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); dep = em.find(Department.class, new Integer(id)); // this is now in state MANAGED dep.setName("UPDATED"); em.refresh(dep); checkDepartment(dep, id, "MANAGED"); verify(em.contains(dep), "Department is not managed"); env.commitTransactionAndClear(em); // verify that original name present on db dep = em.find(Department.class, new Integer(id)); checkDepartment(dep, id, "MANAGED"); // case 2: refresh with data changed on db in a different tx id = 22; dep = new Department(id, "MANAGED"); updatedDep = new Department(id, "UPDATED"); env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); dep = em.find(Department.class, new Integer(id)); // this is now in state MANAGED updateDepartmentOnDatabase(updatedDep); em.refresh(dep); checkDepartment(dep, id, "UPDATED"); verify(em.contains(dep), "Department is not managed"); dep.setName("MANAGED"); env.commitTransactionAndClear(em); // verify that original name present on db dep = em.find(Department.class, new Integer(id)); checkDepartment(dep, id, "MANAGED"); } finally { closeEntityManager(em); } } @Test @Bugzilla(bugid=309681) public void testRefreshManagedCheckContains() throws SQLException { final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); int id; Department dep; try { // case 3: try to refresh, but record has been deleted on db in a different tx /* * We expect an EntityNotFoundException. However, the specification does not state explicitly in which state the * managed entity should be after the exception. We are going to remove the entity from the persistence context, so * it is detached afterwards. */ id = 23; dep = new Department(id, "MANAGED"); env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); dep = em.find(Department.class, new Integer(id)); // this is now in state MANAGED deleteDepartmentFromDatabase(id); verifyAbsenceFromDatabase(em, id); try { em.refresh(dep); flop("refresh did not throw EntityNotFoundException"); } catch (EntityNotFoundException e) { verify(true, ""); } verify(!em.contains(dep), "entity still managed after EntityNotFoundException"); env.rollbackTransactionAndClear(em); } finally { closeEntityManager(em); } } @Test @Bugzilla(bugid=309681) public void testRefreshDeleted() throws SQLException { final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); int id; Department dep; Department updatedDep; try { // case 1: undo own changes id = 31; dep = new Department(id, "DELETED"); env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); dep = em.find(Department.class, new Integer(id)); em.remove(dep); // this is now in state DELETED dep.setName("UPDATED"); em.refresh(dep); checkDepartment(dep, id, "DELETED"); verify(!em.contains(dep), "Department is managed"); env.commitTransactionAndClear(em); verifyAbsenceFromDatabase(em, id); // case 2: refresh with data changed on db in a different tx id = 32; dep = new Department(id, "DELETED"); updatedDep = new Department(id, "UPDATED"); env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); dep = em.find(Department.class, new Integer(id)); em.remove(dep); // this is now in state DELETED updateDepartmentOnDatabase(updatedDep); em.refresh(dep); checkDepartment(dep, id, "UPDATED"); verify(!em.contains(dep), "Department is managed"); env.commitTransactionAndClear(em); verifyAbsenceFromDatabase(em, id); // case 3: try to refresh, but record has been deleted on db in a different tx /* * We expect an EntityNotFoundException. However, the specification does not state explicitly in which state the * managed entity should be after the exception. In our implementation, the entity is kept in the persistence * context in state DELETE_EXECUTED. */ id = 33; dep = new Department(id, "DELETED"); env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); dep = em.find(Department.class, new Integer(id)); em.remove(dep); // this is now in state DELETED deleteDepartmentFromDatabase(id); verifyAbsenceFromDatabase(em, id); try { em.refresh(dep); flop("refresh did not throw EntityNotFoundException"); } catch (EntityNotFoundException e) { verify(true, ""); } verifyAbsenceFromDatabase(em, id); env.rollbackTransactionAndClear(em); // case 4: try to refresh, but record has been deleted on db by flushing the remove operation id = 34; dep = new Department(id, "DELETED"); env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); dep = em.find(Department.class, new Integer(id)); em.remove(dep); em.flush(); // this is now in state DELETE_EXECUTED verifyAbsenceFromDatabase(em, id); try { em.refresh(dep); flop("refresh did not throw EntityNotFoundException"); } catch (EntityNotFoundException e) { verify(true, ""); } env.rollbackTransactionAndClear(em); verifyExistenceOnDatabase(id); } finally { closeEntityManager(em); } } @Test public void testRefreshDetached() { /* * Refresh on a detached entity should throw an IllegalArgumentException. */ final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); int id; Department dep; Department detachedDep; try { // case 1: entity exists on DB, but not contained in persistence context id = 41; dep = new Department(id, "DETACHED"); // firstly, we create a department on the database env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); try { em.refresh(dep); flop("refresh did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { verify(true, ""); } env.rollbackTransactionAndClear(em); // case 2: entity is contained in persistence context, but object to be merged has different object identity // case 2a: state of known object: MANAGED_NEW id = 42; dep = new Department(id, "MANAGED_NEW"); detachedDep = new Department(id, "DETACHED"); env.beginTransaction(em); em.persist(dep); // this is now in state new try { em.refresh(detachedDep); // this object is detached flop("refresh did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { verify(true, ""); } env.rollbackTransactionAndClear(em); // case 2b: state of known object: MANAGED id = 43; dep = new Department(id, "MANAGED"); detachedDep = new Department(id, "DETACHED"); env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); dep = em.find(Department.class, new Integer(id)); // this is now in state MANAGED try { em.refresh(detachedDep); // this object is detached flop("refresh did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { verify(true, ""); } env.rollbackTransactionAndClear(em); // case 2c: state of known object: DELETED id = 44; dep = new Department(id, "DELETED"); detachedDep = new Department(id, "DETACHED"); env.beginTransaction(em); em.persist(dep); env.commitTransactionAndClear(em); env.beginTransaction(em); dep = em.find(Department.class, new Integer(id)); em.remove(dep); // this is now in state DELETED try { em.refresh(detachedDep); // this object is detached flop("refresh did not throw IllegalArgumentException"); } catch (IllegalArgumentException e) { verify(true, ""); } env.rollbackTransactionAndClear(em); } finally { closeEntityManager(em); } } @Test public void testNotAnEntity() { final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); try { env.beginTransaction(em); try { em.refresh("Hutzliputz"); flop("no IllegalArgumentException "); } catch (IllegalArgumentException e) { verify(true, ""); } finally { env.rollbackTransactionAndClear(em); } env.beginTransaction(em); try { em.refresh(null); flop("no IllegalArgumentException "); } catch (IllegalArgumentException e) { verify(true, ""); } finally { env.rollbackTransactionAndClear(em); } } finally { closeEntityManager(em); } } @Ignore // @TestProperties(unsupportedEnvironments = { JTANonSharedPCEnvironment.class, ResourceLocalEnvironment.class }) public void testNoTransaction() { final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); int id; Department dep; try { id = 61; dep = new Department(id, "NO_TX"); verify(!env.isTransactionActive(em), "transaction is active, can't execute test"); try { em.refresh(dep); flop("refresh did not throw TransactionRequiredException"); } catch (TransactionRequiredException e) { verify(true, ""); } } finally { closeEntityManager(em); } } @Test public void testRefreshManagedWithRelationships() { final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); try { // case 1: undo own changes Department dep = new Department(101, "Evangelists"); Employee emp = new Employee(102, "First", "Last", dep); Review rev1 = new Review(103, Date.valueOf("2006-02-03"), "Code inspection"); Review rev2 = new Review(104, Date.valueOf("2006-02-04"), "Design review"); emp.addReview(rev1); emp.addReview(rev2); env.beginTransaction(em); em.persist(dep); em.persist(emp); em.persist(rev1); em.persist(rev2); env.commitTransactionAndClear(em); env.beginTransaction(em); emp = em.find(Employee.class, new Integer(emp.getId())); rev1 = em.find(Review.class, new Integer(rev1.getId())); Review rev3 = new Review(105, Date.valueOf("2006-02-05"), "Test coverage"); Set<Review> reviews = new HashSet<Review>(); reviews.add(rev1); reviews.add(rev3); emp.setReviews(reviews); rev1.setReviewText("UPDATED"); em.refresh(emp); verify(em.contains(emp), "Employee is not managed"); Set<Review> reviewsAfterRefresh = emp.getReviews(); verify(reviewsAfterRefresh.size() == 2, "Employee contains wrong number of reviews: " + reviewsAfterRefresh.size()); for (Review rev : reviewsAfterRefresh) { int id = rev.getId(); verify(id == rev1.getId() || id == rev2.getId(), "Employee has wrong review: " + id); verify(em.contains(rev), "Review " + id + " is not managed"); } env.commitTransactionAndClear(em); // verify that original name present on db rev1 = em.find(Review.class, new Integer(rev1.getId())); verify("UPDATED".equals(rev1.getReviewText()), "Rev1 has wrong text: " + rev1.getReviewText()); } finally { closeEntityManager(em); } } @Test public void testTransactionMarkedForRollback() { final JPAEnvironment env = getEnvironment(); final EntityManager em = env.getEntityManager(); Department dep = new Department(111, "dep111"); try { env.beginTransaction(em); em.persist(dep); env.commitTransaction(em); em.clear(); env.beginTransaction(em); dep = em.find(Department.class, Integer.valueOf(dep.getId())); dep.setName("updated"); env.markTransactionForRollback(em); em.refresh(dep); checkDepartment(dep, dep.getId(), "dep111"); verify(em.contains(dep), "entity not contained in persistence context"); env.rollbackTransaction(em); } finally { closeEntityManager(em); } } private void verifyExistenceOnDatabase(int departmentId) throws SQLException { Connection conn = getEnvironment().getDataSource().getConnection(); try { PreparedStatement stmt = conn.prepareStatement("select ID, NAME from TMP_DEP where ID = ?"); try { stmt.setInt(1, departmentId); ResultSet rs = stmt.executeQuery(); try { verify(rs.next(), "no department with id " + departmentId + " found using JDBC."); } finally { rs.close(); } } finally { stmt.close(); } } finally { conn.close(); } } private void verifyAbsenceFromDatabase(EntityManager em, int id) { Query query = em.createQuery("SELECT d.id from Department d where d.id = ?1"); query.setFlushMode(FlushModeType.COMMIT); query.setParameter(1, Integer.valueOf(id)); verify(query.getResultList().size() == 0, "wrong result list size"); } private void deleteDepartmentFromDatabase(int departmentId) throws SQLException { Connection conn = getEnvironment().getDataSource().getConnection(); try { PreparedStatement stmt = conn.prepareStatement("delete from TMP_DEP where ID = ?"); try { stmt.setInt(1, departmentId); stmt.executeUpdate(); } finally { stmt.close(); } } finally { conn.close(); } } private void insertDepartmentIntoDatabase(Department department) throws SQLException { Connection conn = getEnvironment().getDataSource().getConnection(); try { PreparedStatement stmt = conn.prepareStatement("insert into TMP_DEP (ID, NAME, VERSION) values (?, ?, ?)"); try { stmt.setInt(1, department.getId()); stmt.setString(2, department.getName()); stmt.setShort(3, (short) 0); stmt.executeUpdate(); } finally { stmt.close(); } } finally { conn.close(); } } private void updateDepartmentOnDatabase(Department department) throws SQLException { Connection conn = getEnvironment().getDataSource().getConnection(); try { PreparedStatement stmt = conn.prepareStatement("update TMP_DEP set NAME = ? where ID = ?"); try { stmt.setString(1, department.getName()); stmt.setInt(2, department.getId()); stmt.executeUpdate(); } finally { stmt.close(); } } finally { conn.close(); } } private void checkDepartment(Department department, int id, String name) { verify(department != null, "department is null"); verify(id == department.getId(), "department has wrong id: " + department.getId()); verify(name.equals(department.getName()), "department has wrong name: " + department.getName()); } }
bug 311868 - fix test TestRefresh.testRefreshDeleted to conform with spec Former-commit-id: 22ce29395a9d2cecf9370d2666b771ec99d28690
jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/tests/wdf/jpa1/entitymanager/TestRefresh.java
bug 311868 - fix test TestRefresh.testRefreshDeleted to conform with spec
<ide><path>pa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/tests/wdf/jpa1/entitymanager/TestRefresh.java <ide> package org.eclipse.persistence.testing.tests.wdf.jpa1.entitymanager; <ide> <ide> import java.sql.Connection; <add> <ide> import java.sql.Date; <ide> import java.sql.PreparedStatement; <ide> import java.sql.ResultSet; <ide> import org.eclipse.persistence.testing.tests.wdf.jpa1.JPA1Base; <ide> import org.junit.Ignore; <ide> import org.junit.Test; <add>import static org.junit.Assert.fail; <ide> <ide> public class TestRefresh extends JPA1Base { <ide> <ide> @Test <ide> public void testRefreshNew() { <ide> /* <del> * Refresh on an entity that is not under control of the entity manager should throw an IllegalArgumentException. <add> * Refresh on an entity that is not under control of the entity manager <add> * should throw an IllegalArgumentException. <ide> */ <ide> final JPAEnvironment env = getEnvironment(); <ide> final EntityManager em = env.getEntityManager(); <ide> } <ide> <ide> @Test <del> @Bugzilla(bugid=309681) <add> @Bugzilla(bugid = 309681) <ide> public void testRefreshManagedNew() throws SQLException { <ide> /* <del> * Note: The specification doesn't state explicitly how to behave in this case, so we test our interpretation: - If the <del> * entity doesn't exist on the database, nothing is changed - If the entity exists on the database, the data is loaded <del> * and the state changes from FOR_INSERT to FOR_UPDATE (in order to avoid errors at flush time) <add> * Note: The specification doesn't state explicitly how to behave in <add> * this case, so we test our interpretation: - If the entity doesn't <add> * exist on the database, nothing is changed - If the entity exists on <add> * the database, the data is loaded and the state changes from <add> * FOR_INSERT to FOR_UPDATE (in order to avoid errors at flush time) <ide> */ <ide> final JPAEnvironment env = getEnvironment(); <ide> final EntityManager em = env.getEntityManager(); <ide> int id; <ide> Department dep; <ide> try { <del> // case 2: state MANAGED_NEW, but exists on DB (inserted in different tx) <add> // case 2: state MANAGED_NEW, but exists on DB (inserted in <add> // different tx) <ide> id = 12; <ide> dep = new Department(id, "MANAGED_NEW"); <ide> Department depInserted = new Department(id, "INSERTED"); <ide> verifyExistenceOnDatabase(id); <ide> // entity is now in state MANAGED_NEW, but record exists on db <ide> em.refresh(dep); <del> checkDepartment(dep, id, "INSERTED"); // this should now be in state MANAGED <add> checkDepartment(dep, id, "INSERTED"); // this should now be in state <add> // MANAGED <ide> verify(em.contains(dep), "Department is not managed"); <ide> dep.setName("UPDATED"); <ide> env.commitTransactionAndClear(em); <ide> } <ide> <ide> @Test <del> @Bugzilla(bugid=309681) <add> @Bugzilla(bugid = 309681) <ide> public void testRefreshManagedNewNotOnDB() throws SQLException { <ide> /* <del> * Note: The specification doesn't state explicitly how to behave in this case, so we test our interpretation: - If the <del> * entity doesn't exist on the database, nothing is changed - If the entity exists on the database, the data is loaded <del> * and the state changes from FOR_INSERT to FOR_UPDATE (in order to avoid errors at flush time) <add> * Note: The specification doesn't state explicitly how to behave in <add> * this case, so we test our interpretation: - If the entity doesn't <add> * exist on the database, nothing is changed - If the entity exists on <add> * the database, the data is loaded and the state changes from <add> * FOR_INSERT to FOR_UPDATE (in order to avoid errors at flush time) <ide> */ <ide> final JPAEnvironment env = getEnvironment(); <ide> final EntityManager em = env.getEntityManager(); <ide> em.persist(dep); <ide> env.commitTransactionAndClear(em); <ide> env.beginTransaction(em); <del> dep = em.find(Department.class, new Integer(id)); // this is now in state MANAGED <add> dep = em.find(Department.class, new Integer(id)); // this is now in <add> // state MANAGED <ide> dep.setName("UPDATED"); <ide> em.refresh(dep); <ide> checkDepartment(dep, id, "MANAGED"); <ide> em.persist(dep); <ide> env.commitTransactionAndClear(em); <ide> env.beginTransaction(em); <del> dep = em.find(Department.class, new Integer(id)); // this is now in state MANAGED <add> dep = em.find(Department.class, new Integer(id)); // this is now in <add> // state MANAGED <ide> updateDepartmentOnDatabase(updatedDep); <ide> em.refresh(dep); <ide> checkDepartment(dep, id, "UPDATED"); <ide> } <ide> <ide> @Test <del> @Bugzilla(bugid=309681) <add> @Bugzilla(bugid = 309681) <ide> public void testRefreshManagedCheckContains() throws SQLException { <ide> final JPAEnvironment env = getEnvironment(); <ide> final EntityManager em = env.getEntityManager(); <ide> int id; <ide> Department dep; <ide> try { <del> // case 3: try to refresh, but record has been deleted on db in a different tx <add> // case 3: try to refresh, but record has been deleted on db in a <add> // different tx <ide> /* <del> * We expect an EntityNotFoundException. However, the specification does not state explicitly in which state the <del> * managed entity should be after the exception. We are going to remove the entity from the persistence context, so <del> * it is detached afterwards. <add> * We expect an EntityNotFoundException. However, the specification <add> * does not state explicitly in which state the managed entity <add> * should be after the exception. We are going to remove the entity <add> * from the persistence context, so it is detached afterwards. <ide> */ <ide> id = 23; <ide> dep = new Department(id, "MANAGED"); <ide> em.persist(dep); <ide> env.commitTransactionAndClear(em); <ide> env.beginTransaction(em); <del> dep = em.find(Department.class, new Integer(id)); // this is now in state MANAGED <add> dep = em.find(Department.class, new Integer(id)); // this is now in <add> // state MANAGED <ide> deleteDepartmentFromDatabase(id); <ide> verifyAbsenceFromDatabase(em, id); <ide> try { <ide> } <ide> } <ide> <del> @Test <del> @Bugzilla(bugid=309681) <del> public void testRefreshDeleted() throws SQLException { <del> final JPAEnvironment env = getEnvironment(); <del> final EntityManager em = env.getEntityManager(); <del> int id; <del> Department dep; <del> Department updatedDep; <del> try { <del> // case 1: undo own changes <del> id = 31; <del> dep = new Department(id, "DELETED"); <del> env.beginTransaction(em); <del> em.persist(dep); <del> env.commitTransactionAndClear(em); <del> env.beginTransaction(em); <del> dep = em.find(Department.class, new Integer(id)); <del> em.remove(dep); // this is now in state DELETED <del> dep.setName("UPDATED"); <del> em.refresh(dep); <del> checkDepartment(dep, id, "DELETED"); <del> verify(!em.contains(dep), "Department is managed"); <del> env.commitTransactionAndClear(em); <del> verifyAbsenceFromDatabase(em, id); <del> // case 2: refresh with data changed on db in a different tx <del> id = 32; <del> dep = new Department(id, "DELETED"); <del> updatedDep = new Department(id, "UPDATED"); <del> env.beginTransaction(em); <del> em.persist(dep); <del> env.commitTransactionAndClear(em); <del> env.beginTransaction(em); <del> dep = em.find(Department.class, new Integer(id)); <del> em.remove(dep); // this is now in state DELETED <del> updateDepartmentOnDatabase(updatedDep); <del> em.refresh(dep); <del> checkDepartment(dep, id, "UPDATED"); <del> verify(!em.contains(dep), "Department is managed"); <del> env.commitTransactionAndClear(em); <del> verifyAbsenceFromDatabase(em, id); <del> // case 3: try to refresh, but record has been deleted on db in a different tx <del> /* <del> * We expect an EntityNotFoundException. However, the specification does not state explicitly in which state the <del> * managed entity should be after the exception. In our implementation, the entity is kept in the persistence <del> * context in state DELETE_EXECUTED. <del> */ <del> id = 33; <del> dep = new Department(id, "DELETED"); <del> env.beginTransaction(em); <del> em.persist(dep); <del> env.commitTransactionAndClear(em); <del> env.beginTransaction(em); <del> dep = em.find(Department.class, new Integer(id)); <del> em.remove(dep); // this is now in state DELETED <del> deleteDepartmentFromDatabase(id); <del> verifyAbsenceFromDatabase(em, id); <del> try { <del> em.refresh(dep); <del> flop("refresh did not throw EntityNotFoundException"); <del> } catch (EntityNotFoundException e) { <del> verify(true, ""); <del> } <del> verifyAbsenceFromDatabase(em, id); <del> env.rollbackTransactionAndClear(em); <del> // case 4: try to refresh, but record has been deleted on db by flushing the remove operation <del> id = 34; <del> dep = new Department(id, "DELETED"); <del> env.beginTransaction(em); <del> em.persist(dep); <del> env.commitTransactionAndClear(em); <add> private void doRefreshDeleted(int id, boolean flush) throws SQLException { <add> final JPAEnvironment env = getEnvironment(); <add> final EntityManager em = env.getEntityManager(); <add> try { <add> Department dep = new Department(id, "DELETED"); <add> env.beginTransaction(em); <add> em.persist(dep); <add> env.commitTransactionAndClear(em); <add> <ide> env.beginTransaction(em); <ide> dep = em.find(Department.class, new Integer(id)); <ide> em.remove(dep); <del> em.flush(); // this is now in state DELETE_EXECUTED <del> verifyAbsenceFromDatabase(em, id); <add> if (flush) { <add> em.flush(); // this is now in state DELETE_EXECUTED <add> verifyAbsenceFromDatabase(em, id); <add> } <ide> try { <ide> em.refresh(dep); <del> flop("refresh did not throw EntityNotFoundException"); <del> } catch (EntityNotFoundException e) { <del> verify(true, ""); <del> } <del> env.rollbackTransactionAndClear(em); <del> verifyExistenceOnDatabase(id); <del> } finally { <del> closeEntityManager(em); <del> } <add> fail("refresh did not throw IllegalArgumentException"); <add> } catch (IllegalArgumentException e) { <add> // expected <add> } <add> if (env.isTransactionActive(em)) { <add> env.rollbackTransactionAndClear(em); <add> } <add> } finally { <add> closeEntityManager(em); <add> } <add> } <add> <add> /* <add> * Refreshing an entity in state "removed" should raise an <add> * IllegalArgumentException <add> */ <add> @Test <add> public void testRefreshDeleted() throws SQLException { <add> doRefreshDeleted(31, false); <add> doRefreshDeleted(32, true); <ide> } <ide> <ide> @Test <ide> public void testRefreshDetached() { <ide> /* <del> * Refresh on a detached entity should throw an IllegalArgumentException. <add> * Refresh on a detached entity should throw an <add> * IllegalArgumentException. <ide> */ <ide> final JPAEnvironment env = getEnvironment(); <ide> final EntityManager em = env.getEntityManager(); <ide> Department dep; <ide> Department detachedDep; <ide> try { <del> // case 1: entity exists on DB, but not contained in persistence context <add> // case 1: entity exists on DB, but not contained in persistence <add> // context <ide> id = 41; <ide> dep = new Department(id, "DETACHED"); <ide> // firstly, we create a department on the database <ide> verify(true, ""); <ide> } <ide> env.rollbackTransactionAndClear(em); <del> // case 2: entity is contained in persistence context, but object to be merged has different object identity <add> // case 2: entity is contained in persistence context, but object to <add> // be merged has different object identity <ide> // case 2a: state of known object: MANAGED_NEW <ide> id = 42; <ide> dep = new Department(id, "MANAGED_NEW"); <ide> em.persist(dep); <ide> env.commitTransactionAndClear(em); <ide> env.beginTransaction(em); <del> dep = em.find(Department.class, new Integer(id)); // this is now in state MANAGED <add> dep = em.find(Department.class, new Integer(id)); // this is now in <add> // state MANAGED <ide> try { <ide> em.refresh(detachedDep); // this object is detached <ide> flop("refresh did not throw IllegalArgumentException"); <ide> } <ide> } <ide> <del> @Ignore // @TestProperties(unsupportedEnvironments = { JTANonSharedPCEnvironment.class, ResourceLocalEnvironment.class }) <add> @Ignore <add> // @TestProperties(unsupportedEnvironments = { <add> // JTANonSharedPCEnvironment.class, ResourceLocalEnvironment.class }) <ide> public void testNoTransaction() { <ide> final JPAEnvironment env = getEnvironment(); <ide> final EntityManager em = env.getEntityManager();
Java
apache-2.0
6144ff22db545921b7523f2b3ca813cc3be70c2c
0
gdi-by/downloadclient,gdi-by/downloadclient,gdi-by/downloadclient,Intevation/downloadclient,JuergenWeichand/downloadclient,JuergenWeichand/downloadclient,gdi-by/downloadclient,JuergenWeichand/downloadclient,JuergenWeichand/downloadclient,Intevation/downloadclient,Intevation/downloadclient,Intevation/downloadclient
/* * DownloadClient Geodateninfrastruktur Bayern * * (c) 2016 GSt. GDI-BY (gdi.bayern.de) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package de.bayern.gdi.gui; import com.vividsolutions.jts.geom.Geometry; import de.bayern.gdi.model.DownloadStep; import de.bayern.gdi.model.MIMEType; import de.bayern.gdi.model.MIMETypes; import de.bayern.gdi.model.Option; import de.bayern.gdi.model.Parameter; import de.bayern.gdi.model.ProcessingStep; import de.bayern.gdi.model.ProcessingStepConfiguration; import de.bayern.gdi.processor.ConverterException; import de.bayern.gdi.processor.DownloadStepConverter; import de.bayern.gdi.processor.JobList; import de.bayern.gdi.processor.Processor; import de.bayern.gdi.processor.ProcessorEvent; import de.bayern.gdi.processor.ProcessorListener; import de.bayern.gdi.services.Atom; import de.bayern.gdi.services.ServiceType; import de.bayern.gdi.services.WFSMeta; import de.bayern.gdi.services.WFSMetaExtractor; import de.bayern.gdi.services.WebService; import de.bayern.gdi.utils.Config; import de.bayern.gdi.utils.I18n; import de.bayern.gdi.utils.Misc; import de.bayern.gdi.utils.ServiceChecker; import de.bayern.gdi.utils.ServiceSetting; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import javafx.application.Platform; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.concurrent.Task; import javafx.event.ActionEvent; import javafx.event.Event; import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.scene.Cursor; import javafx.scene.Group; import javafx.scene.Node; import javafx.scene.control.Alert; import javafx.scene.control.Button; import javafx.scene.control.ButtonBar.ButtonData; import javafx.scene.control.ButtonType; import javafx.scene.control.CheckBox; import javafx.scene.control.ComboBox; import javafx.scene.control.Label; import javafx.scene.control.ListView; import javafx.scene.control.MenuBar; import javafx.scene.control.ProgressIndicator; import javafx.scene.control.TextField; import javafx.scene.input.KeyEvent; import javafx.scene.input.MouseButton; import javafx.scene.input.MouseEvent; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.scene.web.WebEngine; import javafx.scene.web.WebView; import javafx.stage.DirectoryChooser; import javafx.stage.FileChooser; import javafx.stage.Stage; import javafx.stage.WindowEvent; import org.geotools.geometry.Envelope2D; import org.geotools.geometry.jts.ReferencedEnvelope; import org.geotools.referencing.CRS; import org.opengis.referencing.FactoryException; import org.opengis.referencing.crs.CoordinateReferenceSystem; /** * @author Jochen Saalfeld ([email protected]) */ public class Controller { private static final int MAP_WIDTH = 350; private static final int MAP_HEIGHT = 250; private static final int BGCOLOR = 244; private static final String INITIAL_CRS_DISPLAY = "EPSG:4326"; private static final String ATOM_CRS_STRING = "EPSG:4326"; private CoordinateReferenceSystem atomCRS; // DataBean private DataBean dataBean; private Stage primaryStage; private UIFactory factory; private boolean catalogReachable; @FXML private Button buttonClose; @FXML private MenuBar mainMenu; @FXML private ListView serviceList; @FXML private TextField searchField; @FXML private TextField serviceURL; @FXML private CheckBox serviceAuthenticationCbx; @FXML private CheckBox chkChain; @FXML private TextField serviceUser; @FXML private TextField servicePW; @FXML private Label statusBarText; @FXML private ComboBox<ItemModel> serviceTypeChooser; @FXML private ComboBox atomVariationChooser; @FXML private ComboBox dataFormatChooser; @FXML private ComboBox<CRSModel> referenceSystemChooser; @FXML private VBox simpleWFSContainer; @FXML private VBox basicWFSContainer; @FXML private VBox atomContainer; @FXML private VBox chainContainer; @FXML private Group mapNodeWFS; @FXML private Group mapNodeAtom; @FXML private TextField basicX1; @FXML private TextField basicY1; @FXML private TextField basicX2; @FXML private TextField basicY2; @FXML private TextField atomX1; @FXML private TextField atomY1; @FXML private TextField atomX2; @FXML private TextField atomY2; @FXML private Label labelURL; @FXML private Label labelUser; @FXML private Label labelPassword; @FXML private Label labelSelectType; @FXML private Label labelPostProcess; @FXML private WebView valueAtomDescr; @FXML private Label valueAtomFormat; @FXML private Label valueAtomRefsys; @FXML private Button serviceSelection; @FXML private Button buttonDownload; @FXML private Button buttonSaveConfig; @FXML private Button addChainItem; @FXML private ProgressIndicator progressSearch; @FXML private HBox processStepContainter; @FXML private HBox basicWFSX1Y1; @FXML private HBox basicWFSX2Y2; @FXML private Label referenceSystemChooserLabel; private WMSMapSwing mapAtom; private WMSMapSwing mapWFS; /** * Handler to close the application. * * @param event The event. */ @FXML protected void handleCloseApp(ActionEvent event) { Alert closeDialog = new Alert(Alert.AlertType.CONFIRMATION); closeDialog.setTitle(I18n.getMsg("gui.confirm-exit")); closeDialog.setContentText(I18n.getMsg("gui.want-to-quit")); ButtonType confirm = new ButtonType(I18n.getMsg("gui.exit")); ButtonType cancel = new ButtonType(I18n.getMsg("gui.cancel"), ButtonData.CANCEL_CLOSE); closeDialog.getButtonTypes().setAll(confirm, cancel); Optional<ButtonType> res = closeDialog.showAndWait(); if (res.get() == confirm) { Stage stage = (Stage) buttonClose.getScene().getWindow(); stage.fireEvent(new WindowEvent( stage, WindowEvent.WINDOW_CLOSE_REQUEST )); } } /** * Handle the service selection. * * @param event The mouse click event. */ @FXML protected void handleServiceSelectButton(MouseEvent event) { if (event.getButton().equals(MouseButton.PRIMARY)) { chooseService(); } } /** * Handle search and filter the service list. * * @param event the event */ @FXML protected void handleSearch(KeyEvent event) { if (!catalogReachable) { statusBarText.setText(I18n.getMsg("status.catalog-not-available")); } String currentText = this.searchField.getText(); this.serviceList.getItems().clear(); this.dataBean.reset(); if ("".equals(currentText) || currentText == null) { this.serviceList.setItems(this.dataBean.getServicesAsList()); } String searchValue = currentText.toUpperCase(); ObservableList<ServiceModel> subentries = FXCollections.observableArrayList(); ObservableList<ServiceModel> all = this.dataBean.getServicesAsList(); for (ServiceModel entry : all) { boolean match = true; if (!entry.getName().toUpperCase().contains(searchValue)) { match = false; } if (match) { subentries.add(entry); } } if (currentText.length() > 2) { Task task = new Task() { @Override protected Integer call() throws Exception { Platform.runLater(() -> { progressSearch.setVisible(true); }); if (catalogReachable) { List<ServiceModel> catalog = dataBean.getCatalogService() .getServicesByFilter(currentText); for (ServiceModel entry : catalog) { dataBean.addCatalogServiceToList(entry); } Platform.runLater(() -> { subentries.addAll(catalog); }); } Platform.runLater(() -> { progressSearch.setVisible(false); }); return 0; } }; Thread th = new Thread(task); if (catalogReachable) { statusBarText.setText(I18n.getMsg("status.calling-service")); } th.setDaemon(true); th.start(); } this.serviceList.setItems(subentries); } private void clearUserNamePassword() { this.serviceUser.setText(""); this.servicePW.setText(""); } /** * Handle the service selection. * * @param event The mouse click event. */ @FXML protected void handleServiceSelect(MouseEvent event) { if (event.getButton().equals(MouseButton.PRIMARY) && event.getClickCount() > 1 ) { clearUserNamePassword(); chooseService(); } else if (event.getButton().equals(MouseButton.PRIMARY) && event.getClickCount() == 1 ) { if (this.serviceList.getSelectionModel().getSelectedItems().get(0) != null ) { ServiceModel service = (ServiceModel)this.serviceList.getSelectionModel() .getSelectedItems().get(0); String url = service.getUrl(); if (!url.equals(this.serviceURL.getText())) { clearUserNamePassword(); } if (!ServiceChecker.isReachable(url)) { statusBarText.setText( I18n.format("status.service-not-available") ); return; } try { URL servUrl = new URL(url); service.setRestricted(ServiceChecker.isRestricted(servUrl)); } catch (MalformedURLException e) { log.log(Level.SEVERE, e.getMessage(), e); } this.serviceURL.setText(url); if (service.isRestricted()) { statusBarText.setText( I18n.format("status.service-needs-auth") ); this.serviceAuthenticationCbx.setSelected(true); this.serviceUser.setDisable(false); this.servicePW.setDisable(false); } else { this.serviceAuthenticationCbx.setSelected(false); this.serviceUser.setDisable(true); this.servicePW.setDisable(true); } } } } /** * Handle authentication required selection. * @param event the event */ @FXML protected void handleAuthenticationRequired(ActionEvent event) { if (this.serviceAuthenticationCbx.isSelected()) { this.serviceUser.setDisable(false); this.servicePW.setDisable(false); } else { this.serviceUser.setDisable(true); this.servicePW.setDisable(true); } } /** * Handle the service type selection. * * @param event The event */ @FXML protected void handleServiceTypeSelect(ActionEvent event) { ItemModel item = this.serviceTypeChooser. getSelectionModel().getSelectedItem(); if (item != null) { dataBean.setDataType(item); dataBean.setAttributes(new ArrayList<DataBean.Attribute>()); chooseType(item); } } /** * Handle the dataformat selection. * * @param event The event */ @FXML protected void handleDataformatSelect(ActionEvent event) { ComboBox source = (ComboBox) event.getSource(); dataBean.addAttribute("outputformat", source.getValue() != null ? source.getValue().toString() : "", ""); } /** * Handle the dataformat selection. * * @param event The event */ @FXML protected void handleAddChainItem(ActionEvent event) { factory.addChainAttribute(this.dataBean, chainContainer); } /** * Handle the reference system selection. * * @param event The event */ @FXML protected void handleReferenceSystemSelect(ActionEvent event) { this.dataBean.addAttribute("srsName", referenceSystemChooser.getValue() != null ? referenceSystemChooser. getValue().getOldName() : "EPSG:4326", ""); if (mapWFS != null && referenceSystemChooser.getValue() != null) { this.mapWFS.setDisplayCRS( referenceSystemChooser.getValue().getCRS()); } else if (mapWFS != null) { try { this.mapWFS.setDisplayCRS( this.dataBean.getAttributeValue("srsName")); } catch (FactoryException e) { log.log(Level.SEVERE, e.getMessage(), e); } } } /** * Handle the variation selection. * * @param event The event */ @FXML protected void handleVariationSelect(ActionEvent event) { this.dataBean.addAttribute("VARIATION", this.atomVariationChooser.getValue() != null ? this.atomVariationChooser.getValue().toString() : "", ""); ItemModel im = (ItemModel) serviceTypeChooser.getSelectionModel() .getSelectedItem(); Atom.Item item = (Atom.Item) im.getItem(); List <Atom.Field> fields = item.fields; for (Atom.Field field: fields) { if (field.type.equals(this.atomVariationChooser.getValue())) { this.valueAtomFormat.setText(field.format); this.valueAtomRefsys.setText(field.crs); this.dataBean.addAttribute("outputformat", field.format, ""); break; } } } private ArrayList<ProcessingStep> extractProcessingSteps() { ArrayList<ProcessingStep> steps = new ArrayList<>(); if (!this.chkChain.isSelected()) { return steps; } Set<Node> parameter = this.chainContainer.lookupAll("#process_parameter"); if (parameter.isEmpty()) { return steps; } String format = this.dataBean.getAttributeValue("outputformat"); if (format == null || format.isEmpty()) { statusBarText.setText(I18n.getMsg("gui.process.no.format")); return steps; } MIMETypes mtypes = Config.getInstance().getMimeTypes(); MIMEType mtype = mtypes.findByName(format); if (mtype == null) { statusBarText.setText(I18n.getMsg("gui.process.format.not.found")); return steps; } for (Node n: parameter) { Set<Node> vars = n.lookupAll("#process_var"); Node nameNode = n.lookup("#process_name"); ComboBox namebox = (ComboBox)nameNode; ProcessingStepConfiguration psc = (ProcessingStepConfiguration)namebox.getValue(); String name = psc.getName(); if (!psc.isCompatibleWithFormat(mtype.getType())) { statusBarText.setText( I18n.format("gui.process.not.compatible", name)); continue; } ProcessingStep step = new ProcessingStep(); steps.add(step); step.setName(name); ArrayList<Parameter> parameters = new ArrayList<>(); step.setParameters(parameters); for (Node v: vars) { String varName = null; String varValue = null; if (v instanceof TextField) { TextField input = (TextField)v; varName = input.getUserData().toString(); varValue = input.getText(); } else if (v instanceof ComboBox) { ComboBox input = (ComboBox)v; varName = input.getUserData().toString(); varValue = input.getValue() != null ? ((Option)input.getValue()).getValue() : null; } if (varName != null && varValue != null) { Parameter p = new Parameter(varName, varValue); parameters.add(p); } } } return steps; } private void extractStoredQuery() { ItemModel data = this.dataBean.getDatatype(); if (data instanceof StoredQueryModel) { this.dataBean.setAttributes(new ArrayList<DataBean.Attribute>()); ObservableList<Node> children = this.simpleWFSContainer.getChildren(); for (Node n: children) { if (n.getClass() == HBox.class) { HBox hbox = (HBox) n; ObservableList<Node> hboxChildren = hbox.getChildren(); String value = ""; String name = ""; String type = ""; Label l1 = null; Label l2 = null; TextField tf = null; ComboBox cb = null; for (Node hn: hboxChildren) { if (hn.getClass() == ComboBox.class) { cb = (ComboBox) hn; } if (hn.getClass() == TextField.class) { tf = (TextField) hn; } if (hn.getClass() == Label.class) { if (l1 == null) { l1 = (Label) hn; } if (l1 != (Label) hn) { l2 = (Label) hn; } } if (tf != null && (l1 != null || l2 != null)) { name = tf.getUserData().toString(); value = tf.getText(); if (l2 != null && l1.getText().equals(name)) { type = l2.getText(); } else { type = l1.getText(); } } if (cb != null && (l1 != null || l2 != null)) { if (cb.getId().equals( UIFactory.getDataFormatID()) ) { name = "outputformat"; value = cb.getSelectionModel() .getSelectedItem().toString(); type = ""; } } if (!name.isEmpty() && !value.isEmpty()) { this.dataBean.addAttribute( name, value, type); } } } } } } private void extractBoundingBox() { String bbox = ""; Envelope2D envelope = null; switch (this.dataBean.getServiceType()) { case Atom: //in Atom the bboxes are given by the extend of every dataset break; case WFSOne: case WFSTwo: if (mapWFS != null) { envelope = this.mapWFS.getBounds( referenceSystemChooser. getSelectionModel(). getSelectedItem(). getCRS()); } else { envelope = mapWFS.calculateBBox(basicX1, basicX2, basicY1, basicY2, referenceSystemChooser. getSelectionModel(). getSelectedItem(). getCRS()); } break; default: break; } if (envelope != null) { bbox += envelope.getX() + ","; bbox += envelope.getY() + ","; bbox += (envelope.getX() + envelope.getWidth()) + ","; bbox += (envelope.getY() + envelope.getHeight()); CRSModel model = referenceSystemChooser.getValue(); if (model != null) { bbox += "," + model.getOldName(); } this.dataBean.addAttribute("bbox", bbox, ""); } else { // Raise an error? } } private boolean validateInput() { String failed = ""; ArrayList<DataBean.Attribute> attributes = this.dataBean.getAttributes(); Validator validator = Validator.getInstance(); for (DataBean.Attribute attribute: attributes) { if (!attribute.type.equals("")) { if (!validator.isValid(attribute.type, attribute.value)) { if (failed.equals("")) { failed = attribute.name; } else { failed = failed + ", " + attribute.name; } } } } if (!failed.equals("")) { statusBarText.setText( I18n.format("status.validation-fail", failed)); return false; } return true; } /** * Start the download. * * @param event The event */ @FXML protected void handleDownload(ActionEvent event) { extractStoredQuery(); extractBoundingBox(); if (validateInput()) { DirectoryChooser dirChooser = new DirectoryChooser(); dirChooser.setTitle(I18n.getMsg("gui.save-dir")); File selectedDir = dirChooser.showDialog(getPrimaryStage()); if (selectedDir == null) { return; } this.dataBean.setProcessingSteps(extractProcessingSteps()); String savePath = selectedDir.getPath(); DownloadStep ds = dataBean.convertToDownloadStep(savePath); try { DownloadStepConverter dsc = new DownloadStepConverter( dataBean.getUserName(), dataBean.getPassword()); JobList jl = dsc.convert(ds); Processor p = Processor.getInstance(); p.addJob(jl); } catch (ConverterException ce) { statusBarText.setText(ce.getMessage()); } } } /** * Handle events on the process Chain Checkbox. * @param event the event */ @FXML protected void handleChainCheckbox(ActionEvent event) { if (chkChain.isSelected()) { processStepContainter.setVisible(true); } else { factory.removeAllChainAttributes(this.dataBean, chainContainer); processStepContainter.setVisible(false); } } /** * Handle config saving. * @param event The event. */ @FXML protected void handleSaveConfig(ActionEvent event) { extractStoredQuery(); extractBoundingBox(); if (validateInput()) { DirectoryChooser dirChooser = new DirectoryChooser(); dirChooser.setTitle(I18n.getMsg("gui.save-dir")); File downloadDir = dirChooser.showDialog(getPrimaryStage()); if (downloadDir == null) { return; } FileChooser fileChooser = new FileChooser(); fileChooser.setInitialDirectory(downloadDir); FileChooser.ExtensionFilter xmlFilter = new FileChooser.ExtensionFilter("xml files (*.xml)", "xml"); File uniqueName = Misc.uniqueFile(downloadDir, "config", "xml" , null); fileChooser.setInitialFileName(uniqueName.getName()); fileChooser.getExtensionFilters().add(xmlFilter); fileChooser.setSelectedExtensionFilter(xmlFilter); fileChooser.setTitle(I18n.getMsg("gui.save-conf")); File configFile = fileChooser.showSaveDialog(getPrimaryStage()); if (!configFile.toString().endsWith(".xml")) { configFile = new File(configFile.toString() + ".xml"); } if (configFile == null) { return; } this.dataBean.setProcessingSteps(extractProcessingSteps()); String savePath = downloadDir.getPath(); DownloadStep ds = dataBean.convertToDownloadStep(savePath); try { ds.write(configFile); } catch (IOException ex) { log.log(Level.WARNING, ex.getMessage(), ex); } } } /** * Use selection to request the service data and fill th UI. */ private void chooseService() { Task task = new Task() { private void setAuth() { setStatusTextUI( I18n.format("status.service-needs-auth")); serviceURL.getScene().setCursor(Cursor.DEFAULT); serviceAuthenticationCbx.setSelected(true); serviceUser.setDisable(false); servicePW.setDisable(false); } private void unsetAuth() { setStatusTextUI( I18n.format("status.calling-service")); serviceAuthenticationCbx.setSelected(false); serviceUser.setDisable(true); servicePW.setDisable(true); } private void setUnreachable() { setStatusTextUI( I18n.format("status.service-not-available")); serviceURL.getScene().setCursor(Cursor.DEFAULT); } @Override protected Integer call() throws Exception { serviceURL.getScene().setCursor(Cursor.WAIT); unsetAuth(); String url = null; String username = null; String password = null; url = serviceURL.getText(); if (!ServiceChecker.isReachable(url)) { setUnreachable(); return 0; } if (serviceAuthenticationCbx.isSelected()) { username = serviceUser.getText(); dataBean.setUsername(username); password = servicePW.getText(); dataBean.setPassword(password); } if ((username == null && password == null) || (username.equals("") && password.equals(""))) { if (ServiceChecker.isRestricted(new URL(url))) { String pw = dataBean.getPassword(); String un = dataBean.getUserName(); if ((pw == null && un == null) || (pw.isEmpty() && un.isEmpty())) { setAuth(); return 0; } } else { serviceAuthenticationCbx.setSelected(false); serviceUser.setDisable(true); servicePW.setDisable(true); } } if (url != null && !"".equals(url)) { ServiceType st = ServiceChecker.checkService( url, dataBean.getUserName(), dataBean.getPassword()); WebService ws = null; //Check for null, since switch breaks on a null value if (st == null) { log.log(Level.WARNING, "Could not determine " + "Service Type" , st); setStatusTextUI( I18n.getMsg("status.no-service-type")); } else { switch (st) { case Atom: //TODO: Check deep if user/pw was correct setStatusTextUI( I18n.getMsg("status.type.atom")); Atom atom = new Atom(url, dataBean.getUserName(), dataBean.getPassword()); dataBean.setAtomService(atom); break; case WFSOne: setStatusTextUI( I18n.getMsg("status.type.wfsone")); WFSMetaExtractor wfsOne = new WFSMetaExtractor(url, dataBean.getUserName(), dataBean.getPassword()); WFSMeta metaOne = wfsOne.parse(); dataBean.setWFSService(metaOne); break; case WFSTwo: setStatusTextUI( I18n.getMsg("status.type.wfstwo")); WFSMetaExtractor extractor = new WFSMetaExtractor(url, dataBean.getUserName(), dataBean.getPassword()); WFSMeta meta = extractor.parse(); dataBean.setWFSService(meta); break; default: log.log(Level.WARNING, "Could not determine URL" , st); setStatusTextUI(I18n.getMsg("status.no-url")); break; } } Platform.runLater(() -> { setServiceTypes(); serviceTypeChooser. getSelectionModel().select(0); statusBarText.setText(I18n.getMsg("status.ready")); }); } else { setStatusTextUI(I18n.getMsg("status.no-url")); } serviceURL.getScene().setCursor(Cursor.DEFAULT); return 0; } }; Thread th = new Thread(task); statusBarText.setText(I18n.getMsg("status.calling-service")); th.setDaemon(true); th.start(); } /** * Sets the Service Types. */ public void setServiceTypes() { if (dataBean.isWebServiceSet()) { switch (dataBean.getServiceType()) { case WFSOne: case WFSTwo: ReferencedEnvelope extendWFS = null; List<WFSMeta.Feature> features = dataBean.getWFSService().features; List<WFSMeta.StoredQuery> queries = dataBean.getWFSService().storedQueries; ObservableList<ItemModel> types = FXCollections.observableArrayList(); for (WFSMeta.Feature f : features) { types.add(new FeatureModel(f)); if (f.bbox != null) { if (extendWFS == null) { extendWFS = f.bbox; } else { extendWFS.expandToInclude(f.bbox); } } } if (extendWFS != null) { mapWFS.setExtend(extendWFS); } for (WFSMeta.StoredQuery s : queries) { types.add(new StoredQueryModel(s)); } serviceTypeChooser.getItems().retainAll(); serviceTypeChooser.setItems(types); serviceTypeChooser.setValue(types.get(0)); chooseType(serviceTypeChooser.getValue()); break; case Atom: List<Atom.Item> items = dataBean.getAtomService().getItems(); ObservableList<ItemModel> opts = FXCollections.observableArrayList(); List<WMSMapSwing.FeaturePolygon> polygonList = new ArrayList<WMSMapSwing.FeaturePolygon>(); //Polygons are always epsg:4326 // (http://www.georss.org/gml.html) try { ReferencedEnvelope extendATOM = null; atomCRS = CRS.decode(ATOM_CRS_STRING); Geometry all = null; for (Atom.Item i : items) { opts.add(new AtomItemModel(i)); WMSMapSwing.FeaturePolygon polygon = new WMSMapSwing.FeaturePolygon( i.polygon, i.title, i.id, this.atomCRS); polygonList.add(polygon); all = all == null ? i.polygon : all.union(i.polygon); } if (mapAtom != null) { if (all != null) { extendATOM = new ReferencedEnvelope( all.getEnvelopeInternal(), atomCRS); mapAtom.setExtend(extendATOM); } mapAtom.drawPolygons(polygonList); } } catch (FactoryException e) { log.log(Level.SEVERE, e.getMessage(), e); } serviceTypeChooser.getItems().retainAll(); serviceTypeChooser.setItems(opts); if (!opts.isEmpty()) { serviceTypeChooser.setValue(opts.get(0)); chooseType(serviceTypeChooser.getValue()); } default: } } } private void chooseType(ItemModel data) { ServiceType type = this.dataBean.getServiceType(); if (type == ServiceType.Atom) { statusBarText.setText(I18n.format("status.ready")); Atom.Item item = (Atom.Item)data.getItem(); item.load(); if (mapAtom != null) { mapAtom.highlightSelectedPolygon(item.id); } List<Atom.Field> fields = item.fields; ObservableList<String> list = FXCollections.observableArrayList(); for (Atom.Field f : fields) { list.add(f.type); } this.atomVariationChooser.setItems(list); WebEngine engine = this.valueAtomDescr.getEngine(); java.lang.reflect.Field f; try { f = engine.getClass().getDeclaredField("page"); f.setAccessible(true); com.sun.webkit.WebPage page = (com.sun.webkit.WebPage) f.get(engine); page.setBackgroundColor( (new java.awt.Color(BGCOLOR, BGCOLOR, BGCOLOR)).getRGB()); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { // Displays the webview with white background... } engine.loadContent(item.description); this.simpleWFSContainer.setVisible(false); this.basicWFSContainer.setVisible(false); this.atomContainer.setVisible(true); } else if (type == ServiceType.WFSTwo) { if (data instanceof FeatureModel) { this.simpleWFSContainer.setVisible(false); this.basicWFSContainer.setVisible(true); this.mapNodeWFS.setVisible(true); this.atomContainer.setVisible(false); this.basicWFSX1Y1.setVisible(true); this.basicWFSX2Y2.setVisible(true); this.referenceSystemChooser.setVisible(true); this.referenceSystemChooserLabel.setVisible(true); WFSMeta.Feature feature = (WFSMeta.Feature)data.getItem(); mapWFS.setExtend(feature.bbox); ArrayList<String> list = new ArrayList<String>(); list.add(feature.defaultCRS); list.addAll(feature.otherCRSs); ObservableList<CRSModel> crsList = FXCollections.observableArrayList(); for (String crsStr: list) { try { String newcrsStr = crsStr; String seperator = null; if (newcrsStr.contains("::")) { seperator = "::"; } else if (newcrsStr.contains("/")) { seperator = "/"; } if (seperator != null) { newcrsStr = "EPSG:" + newcrsStr.substring( newcrsStr.lastIndexOf(seperator) + seperator.length(), newcrsStr.length()); } CoordinateReferenceSystem crs = CRS.decode(newcrsStr); CRSModel crsm = new CRSModel(crs); crsm.setOldName(crsStr); crsList.add(crsm); } catch (FactoryException e) { log.log(Level.SEVERE, e.getMessage(), e); } } if (!crsList.isEmpty()) { this.referenceSystemChooser.setItems(crsList); CRSModel crsm = crsList.get(0); try { CoordinateReferenceSystem initCRS = CRS.decode( INITIAL_CRS_DISPLAY); CRSModel initCRSM = new CRSModel(initCRS); for (int i = 0; i < crsList.size(); i++) { if (crsList.get(i).equals(initCRSM)) { crsm = crsList.get(i); break; } } } catch (FactoryException e) { log.log(Level.SEVERE, e.getMessage(), e); } this.referenceSystemChooser.setValue(crsm); } List<String> outputFormats = feature.outputFormats; outputFormats = this.dataBean.getWFSService() .findOperation("GetFeature").outputFormats; if (outputFormats.isEmpty()) { outputFormats = this.dataBean.getWFSService().outputFormats; } ObservableList<String> formats = FXCollections.observableArrayList(outputFormats); this.dataFormatChooser.setItems(formats); } else if (data instanceof StoredQueryModel) { List<String> outputFormats = this.dataBean.getWFSService() .findOperation("GetFeature").outputFormats; if (outputFormats.isEmpty()) { outputFormats = this.dataBean.getWFSService().outputFormats; } factory.fillSimpleWFS( dataBean, this.simpleWFSContainer, (WFSMeta.StoredQuery)data.getItem(), outputFormats); this.atomContainer.setVisible(false); this.simpleWFSContainer.setVisible(true); this.basicWFSContainer.setVisible(false); } } } /** * Set the DataBean and fill the UI with initial data objects. * * @param dataBean The DataBean object. */ public void setDataBean(DataBean dataBean) { this.dataBean = dataBean; this.serviceList.setItems(this.dataBean.getServicesAsList()); ServiceSetting serviceSetting = Config.getInstance().getServices(); catalogReachable = dataBean.getCatalogService() != null && ServiceChecker.isReachable( dataBean.getCatalogService().getUrl()); URL url = null; try { url = new URL(serviceSetting.getWMSUrl()); } catch (MalformedURLException e) { log.log(Level.SEVERE, e.getMessage(), e); } if (url != null && ServiceChecker.isReachable( WMSMapSwing.getCapabiltiesURL(url)) ) { mapWFS = new WMSMapSwing(url, MAP_WIDTH, MAP_HEIGHT, serviceSetting.getWMSLayer(), serviceSetting.getWMSSource()); mapWFS.setCoordinateDisplay(basicX1, basicY1, basicX2, basicY2); this.mapNodeWFS.getChildren().add(mapWFS); mapAtom = new WMSMapSwing(url, MAP_WIDTH, MAP_HEIGHT, serviceSetting.getWMSLayer(), serviceSetting.getWMSSource()); mapAtom.addEventHandler(PolygonClickedEvent.ANY, new SelectedAtomPolygon()); mapAtom.setCoordinateDisplay(atomX1, atomY1, atomX2, atomY2); this.mapNodeAtom.getChildren().add(mapAtom); } else { statusBarText.setText(I18n.format("status.wms-not-available")); } this.atomContainer.setVisible(false); this.progressSearch.setVisible(false); this.simpleWFSContainer.setVisible(false); this.basicWFSContainer.setVisible(false); this.serviceUser.setDisable(true); this.servicePW.setDisable(true); this.processStepContainter.setVisible(false); } /** * Handels the Action, when a polygon is selected. */ public class SelectedAtomPolygon implements EventHandler<Event> { @Override public void handle(Event event) { if (mapAtom != null) { if (event instanceof PolygonClickedEvent) { PolygonClickedEvent pce = (PolygonClickedEvent) event; WMSMapSwing.PolygonInfos polygonInfos = pce.getPolygonInfos(); String polygonName = polygonInfos.getName(); String polygonID = polygonInfos.getID(); if (polygonName != null && polygonID != null) { if (polygonName.equals("#@#")) { statusBarText.setText(I18n.format( "status.polygon-intersect", polygonID)); return; } ObservableList<ItemModel> items = serviceTypeChooser.getItems(); int i = 0; for (i = 0; i < items.size(); i++) { AtomItemModel item = (AtomItemModel) items.get(i); Atom.Item aitem = (Atom.Item) item.getItem(); if (aitem.id.equals(polygonID)) { break; } } Atom.Item oldItem = (Atom.Item) serviceTypeChooser .getSelectionModel() .getSelectedItem().getItem(); if (i < items.size() && !oldItem.id.equals(polygonID)) { serviceTypeChooser.setValue(items.get(i)); chooseType(serviceTypeChooser.getValue()); } } } } } } private static final Logger log = Logger.getLogger(Controller.class.getName()); /** * @return the primaryStage */ public Stage getPrimaryStage() { return primaryStage; } /** * @param primaryStage the primaryStage to set */ public void setPrimaryStage(Stage primaryStage) { this.primaryStage = primaryStage; } /** * Creates the Controller. */ public Controller() { this.factory = new UIFactory(); Processor.getInstance().addListener(new DownloadListener()); } /** Set the text of the status bar in UI thread. * @param msg the text to set. */ public void setStatusTextUI(String msg) { Platform.runLater(() -> { statusBarText.setText(msg); }); } /** Keeps track of download progression and errors. */ private class DownloadListener implements ProcessorListener, Runnable { private String message; private synchronized void setMessage(String message) { this.message = message; } private synchronized String getMessage() { return this.message; } @Override public void run() { statusBarText.setText(getMessage()); } @Override public void receivedException(ProcessorEvent pe) { setMessage( I18n.format( "status.error", pe.getException().getMessage())); Platform.runLater(this); } @Override public void receivedMessage(ProcessorEvent pe) { setMessage(pe.getMessage()); Platform.runLater(this); } } }
src/main/java/de/bayern/gdi/gui/Controller.java
/* * DownloadClient Geodateninfrastruktur Bayern * * (c) 2016 GSt. GDI-BY (gdi.bayern.de) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package de.bayern.gdi.gui; import com.vividsolutions.jts.geom.Geometry; import de.bayern.gdi.model.DownloadStep; import de.bayern.gdi.model.MIMEType; import de.bayern.gdi.model.MIMETypes; import de.bayern.gdi.model.Option; import de.bayern.gdi.model.Parameter; import de.bayern.gdi.model.ProcessingStep; import de.bayern.gdi.model.ProcessingStepConfiguration; import de.bayern.gdi.processor.ConverterException; import de.bayern.gdi.processor.DownloadStepConverter; import de.bayern.gdi.processor.JobList; import de.bayern.gdi.processor.Processor; import de.bayern.gdi.processor.ProcessorEvent; import de.bayern.gdi.processor.ProcessorListener; import de.bayern.gdi.services.Atom; import de.bayern.gdi.services.ServiceType; import de.bayern.gdi.services.WFSMeta; import de.bayern.gdi.services.WFSMetaExtractor; import de.bayern.gdi.services.WebService; import de.bayern.gdi.utils.Config; import de.bayern.gdi.utils.I18n; import de.bayern.gdi.utils.Misc; import de.bayern.gdi.utils.ServiceChecker; import de.bayern.gdi.utils.ServiceSetting; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import javafx.application.Platform; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.concurrent.Task; import javafx.event.ActionEvent; import javafx.event.Event; import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.scene.Cursor; import javafx.scene.Group; import javafx.scene.Node; import javafx.scene.control.Alert; import javafx.scene.control.Button; import javafx.scene.control.ButtonBar.ButtonData; import javafx.scene.control.ButtonType; import javafx.scene.control.CheckBox; import javafx.scene.control.ComboBox; import javafx.scene.control.Label; import javafx.scene.control.ListView; import javafx.scene.control.MenuBar; import javafx.scene.control.ProgressIndicator; import javafx.scene.control.TextField; import javafx.scene.input.KeyEvent; import javafx.scene.input.MouseButton; import javafx.scene.input.MouseEvent; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.scene.web.WebEngine; import javafx.scene.web.WebView; import javafx.stage.DirectoryChooser; import javafx.stage.FileChooser; import javafx.stage.Stage; import javafx.stage.WindowEvent; import org.geotools.geometry.Envelope2D; import org.geotools.geometry.jts.ReferencedEnvelope; import org.geotools.referencing.CRS; import org.opengis.referencing.FactoryException; import org.opengis.referencing.crs.CoordinateReferenceSystem; /** * @author Jochen Saalfeld ([email protected]) */ public class Controller { private static final int MAP_WIDTH = 350; private static final int MAP_HEIGHT = 250; private static final int BGCOLOR = 244; private static final String INITIAL_CRS_DISPLAY = "EPSG:4326"; private static final String ATOM_CRS_STRING = "EPSG:4326"; private CoordinateReferenceSystem atomCRS; // DataBean private DataBean dataBean; private Stage primaryStage; private UIFactory factory; private boolean catalogReachable; @FXML private Button buttonClose; @FXML private MenuBar mainMenu; @FXML private ListView serviceList; @FXML private TextField searchField; @FXML private TextField serviceURL; @FXML private CheckBox serviceAuthenticationCbx; @FXML private CheckBox chkChain; @FXML private TextField serviceUser; @FXML private TextField servicePW; @FXML private Label statusBarText; @FXML private ComboBox<ItemModel> serviceTypeChooser; @FXML private ComboBox atomVariationChooser; @FXML private ComboBox dataFormatChooser; @FXML private ComboBox<CRSModel> referenceSystemChooser; @FXML private VBox simpleWFSContainer; @FXML private VBox basicWFSContainer; @FXML private VBox atomContainer; @FXML private VBox chainContainer; @FXML private Group mapNodeWFS; @FXML private Group mapNodeAtom; @FXML private TextField basicX1; @FXML private TextField basicY1; @FXML private TextField basicX2; @FXML private TextField basicY2; @FXML private TextField atomX1; @FXML private TextField atomY1; @FXML private TextField atomX2; @FXML private TextField atomY2; @FXML private Label labelURL; @FXML private Label labelUser; @FXML private Label labelPassword; @FXML private Label labelSelectType; @FXML private Label labelPostProcess; @FXML private WebView valueAtomDescr; @FXML private Label valueAtomFormat; @FXML private Label valueAtomRefsys; @FXML private Button serviceSelection; @FXML private Button buttonDownload; @FXML private Button buttonSaveConfig; @FXML private Button addChainItem; @FXML private ProgressIndicator progressSearch; @FXML private HBox processStepContainter; @FXML private HBox basicWFSX1Y1; @FXML private HBox basicWFSX2Y2; @FXML private Label referenceSystemChooserLabel; private WMSMapSwing mapAtom; private WMSMapSwing mapWFS; /** * Handler to close the application. * * @param event The event. */ @FXML protected void handleCloseApp(ActionEvent event) { Alert closeDialog = new Alert(Alert.AlertType.CONFIRMATION); closeDialog.setTitle(I18n.getMsg("gui.confirm-exit")); closeDialog.setContentText(I18n.getMsg("gui.want-to-quit")); ButtonType confirm = new ButtonType(I18n.getMsg("gui.exit")); ButtonType cancel = new ButtonType(I18n.getMsg("gui.cancel"), ButtonData.CANCEL_CLOSE); closeDialog.getButtonTypes().setAll(confirm, cancel); Optional<ButtonType> res = closeDialog.showAndWait(); if (res.get() == confirm) { Stage stage = (Stage) buttonClose.getScene().getWindow(); stage.fireEvent(new WindowEvent( stage, WindowEvent.WINDOW_CLOSE_REQUEST )); } } /** * Handle the service selection. * * @param event The mouse click event. */ @FXML protected void handleServiceSelectButton(MouseEvent event) { if (event.getButton().equals(MouseButton.PRIMARY)) { chooseService(); } } /** * Handle search and filter the service list. * * @param event the event */ @FXML protected void handleSearch(KeyEvent event) { if (!catalogReachable) { statusBarText.setText(I18n.getMsg("status.catalog-not-available")); } String currentText = this.searchField.getText(); this.serviceList.getItems().clear(); this.dataBean.reset(); if ("".equals(currentText) || currentText == null) { this.serviceList.setItems(this.dataBean.getServicesAsList()); } String searchValue = currentText.toUpperCase(); ObservableList<ServiceModel> subentries = FXCollections.observableArrayList(); ObservableList<ServiceModel> all = this.dataBean.getServicesAsList(); for (ServiceModel entry : all) { boolean match = true; if (!entry.getName().toUpperCase().contains(searchValue)) { match = false; } if (match) { subentries.add(entry); } } if (currentText.length() > 2) { Task task = new Task() { @Override protected Integer call() throws Exception { Platform.runLater(() -> { progressSearch.setVisible(true); }); if (catalogReachable) { List<ServiceModel> catalog = dataBean.getCatalogService() .getServicesByFilter(currentText); for (ServiceModel entry : catalog) { dataBean.addCatalogServiceToList(entry); } Platform.runLater(() -> { subentries.addAll(catalog); }); } Platform.runLater(() -> { progressSearch.setVisible(false); }); return 0; } }; Thread th = new Thread(task); if (catalogReachable) { statusBarText.setText(I18n.getMsg("status.calling-service")); } th.setDaemon(true); th.start(); } this.serviceList.setItems(subentries); } private void clearUserNamePassword() { this.serviceUser.setText(""); this.servicePW.setText(""); } /** * Handle the service selection. * * @param event The mouse click event. */ @FXML protected void handleServiceSelect(MouseEvent event) { if (event.getButton().equals(MouseButton.PRIMARY) && event.getClickCount() > 1 ) { clearUserNamePassword(); chooseService(); } else if (event.getButton().equals(MouseButton.PRIMARY) && event.getClickCount() == 1 ) { if (this.serviceList.getSelectionModel().getSelectedItems().get(0) != null ) { ServiceModel service = (ServiceModel)this.serviceList.getSelectionModel() .getSelectedItems().get(0); String url = service.getUrl(); if (!url.equals(this.serviceURL.getText())) { clearUserNamePassword(); } if (!ServiceChecker.isReachable(url)) { statusBarText.setText( I18n.format("status.service-not-available") ); return; } try { URL servUrl = new URL(url); service.setRestricted(ServiceChecker.isRestricted(servUrl)); } catch (MalformedURLException e) { log.log(Level.SEVERE, e.getMessage(), e); } this.serviceURL.setText(url); if (service.isRestricted()) { statusBarText.setText( I18n.format("status.service-needs-auth") ); this.serviceAuthenticationCbx.setSelected(true); this.serviceUser.setDisable(false); this.servicePW.setDisable(false); } else { this.serviceAuthenticationCbx.setSelected(false); this.serviceUser.setDisable(true); this.servicePW.setDisable(true); } } } } /** * Handle authentication required selection. * @param event the event */ @FXML protected void handleAuthenticationRequired(ActionEvent event) { if (this.serviceAuthenticationCbx.isSelected()) { this.serviceUser.setDisable(false); this.servicePW.setDisable(false); } else { this.serviceUser.setDisable(true); this.servicePW.setDisable(true); } } /** * Handle the service type selection. * * @param event The event */ @FXML protected void handleServiceTypeSelect(ActionEvent event) { ItemModel item = this.serviceTypeChooser. getSelectionModel().getSelectedItem(); if (item != null) { dataBean.setDataType(item); dataBean.setAttributes(new ArrayList<DataBean.Attribute>()); chooseType(item); } } /** * Handle the dataformat selection. * * @param event The event */ @FXML protected void handleDataformatSelect(ActionEvent event) { ComboBox source = (ComboBox) event.getSource(); dataBean.addAttribute("outputformat", source.getValue() != null ? source.getValue().toString() : "", ""); } /** * Handle the dataformat selection. * * @param event The event */ @FXML protected void handleAddChainItem(ActionEvent event) { factory.addChainAttribute(this.dataBean, chainContainer); } /** * Handle the reference system selection. * * @param event The event */ @FXML protected void handleReferenceSystemSelect(ActionEvent event) { this.dataBean.addAttribute("srsName", referenceSystemChooser.getValue() != null ? referenceSystemChooser. getValue().getOldName() : "EPSG:4326", ""); if (mapWFS != null && referenceSystemChooser.getValue() != null) { this.mapWFS.setDisplayCRS( referenceSystemChooser.getValue().getCRS()); } else if (mapWFS != null) { try { this.mapWFS.setDisplayCRS( this.dataBean.getAttributeValue("srsName")); } catch (FactoryException e) { log.log(Level.SEVERE, e.getMessage(), e); } } } /** * Handle the variation selection. * * @param event The event */ @FXML protected void handleVariationSelect(ActionEvent event) { this.dataBean.addAttribute("VARIATION", this.atomVariationChooser.getValue() != null ? this.atomVariationChooser.getValue().toString() : "", ""); ItemModel im = (ItemModel) serviceTypeChooser.getSelectionModel() .getSelectedItem(); Atom.Item item = (Atom.Item) im.getItem(); List <Atom.Field> fields = item.fields; for (Atom.Field field: fields) { if (field.type.equals(this.atomVariationChooser.getValue())) { this.valueAtomFormat.setText(field.format); this.valueAtomRefsys.setText(field.crs); this.dataBean.addAttribute("outputformat", field.format, ""); break; } } } private ArrayList<ProcessingStep> extractProcessingSteps() { ArrayList<ProcessingStep> steps = new ArrayList<>(); if (!this.chkChain.isSelected()) { return steps; } Set<Node> parameter = this.chainContainer.lookupAll("#process_parameter"); if (parameter.isEmpty()) { return steps; } String format = this.dataBean.getAttributeValue("outputformat"); if (format == null || format.isEmpty()) { statusBarText.setText(I18n.getMsg("gui.process.no.format")); return steps; } MIMETypes mtypes = Config.getInstance().getMimeTypes(); MIMEType mtype = mtypes.findByName(format); if (mtype == null) { statusBarText.setText(I18n.getMsg("gui.process.format.not.found")); return steps; } for (Node n: parameter) { Set<Node> vars = n.lookupAll("#process_var"); Node nameNode = n.lookup("#process_name"); ComboBox namebox = (ComboBox)nameNode; ProcessingStepConfiguration psc = (ProcessingStepConfiguration)namebox.getValue(); String name = psc.getName(); if (!psc.isCompatibleWithFormat(mtype.getType())) { statusBarText.setText( I18n.format("gui.process.not.compatible", name)); continue; } ProcessingStep step = new ProcessingStep(); steps.add(step); step.setName(name); ArrayList<Parameter> parameters = new ArrayList<>(); step.setParameters(parameters); for (Node v: vars) { String varName = null; String varValue = null; if (v instanceof TextField) { TextField input = (TextField)v; varName = input.getUserData().toString(); varValue = input.getText(); } else if (v instanceof ComboBox) { ComboBox input = (ComboBox)v; varName = input.getUserData().toString(); varValue = input.getValue() != null ? ((Option)input.getValue()).getValue() : null; } if (varName != null && varValue != null) { Parameter p = new Parameter(varName, varValue); parameters.add(p); } } } return steps; } private void extractStoredQuery() { ItemModel data = this.dataBean.getDatatype(); if (data instanceof StoredQueryModel) { this.dataBean.setAttributes(new ArrayList<DataBean.Attribute>()); ObservableList<Node> children = this.simpleWFSContainer.getChildren(); for (Node n: children) { if (n.getClass() == HBox.class) { HBox hbox = (HBox) n; ObservableList<Node> hboxChildren = hbox.getChildren(); String value = ""; String name = ""; String type = ""; Label l1 = null; Label l2 = null; TextField tf = null; ComboBox cb = null; for (Node hn: hboxChildren) { if (hn.getClass() == ComboBox.class) { cb = (ComboBox) hn; } if (hn.getClass() == TextField.class) { tf = (TextField) hn; } if (hn.getClass() == Label.class) { if (l1 == null) { l1 = (Label) hn; } if (l1 != (Label) hn) { l2 = (Label) hn; } } if (tf != null && (l1 != null || l2 != null)) { name = tf.getUserData().toString(); value = tf.getText(); if (l2 != null && l1.getText().equals(name)) { type = l2.getText(); } else { type = l1.getText(); } } if (cb != null && (l1 != null || l2 != null)) { if (cb.getId().equals( UIFactory.getDataFormatID()) ) { name = "outputformat"; value = cb.getSelectionModel() .getSelectedItem().toString(); type = ""; } } if (!name.isEmpty() && !value.isEmpty()) { this.dataBean.addAttribute( name, value, type); } } } } } } private void extractBoundingBox() { String bbox = ""; Envelope2D envelope = null; switch (this.dataBean.getServiceType()) { case Atom: //in Atom the bboxes are given by the extend of every dataset break; case WFSOne: case WFSTwo: if (mapWFS != null) { envelope = this.mapWFS.getBounds( referenceSystemChooser. getSelectionModel(). getSelectedItem(). getCRS()); } else { envelope = mapWFS.calculateBBox(basicX1, basicX2, basicY1, basicY2, referenceSystemChooser. getSelectionModel(). getSelectedItem(). getCRS()); } break; default: break; } if (envelope != null) { bbox += envelope.getX() + ","; bbox += envelope.getY() + ","; bbox += (envelope.getX() + envelope.getWidth()) + ","; bbox += (envelope.getY() + envelope.getHeight()); CRSModel model = referenceSystemChooser.getValue(); if (model != null) { bbox += "," + model.getOldName(); } this.dataBean.addAttribute("bbox", bbox, ""); } else { // Raise an error? } } private boolean validateInput() { String failed = ""; ArrayList<DataBean.Attribute> attributes = this.dataBean.getAttributes(); Validator validator = Validator.getInstance(); for (DataBean.Attribute attribute: attributes) { if (!attribute.type.equals("")) { if (!validator.isValid(attribute.type, attribute.value)) { if (failed.equals("")) { failed = attribute.name; } else { failed = failed + ", " + attribute.name; } } } } if (!failed.equals("")) { statusBarText.setText( I18n.format("status.validation-fail", failed)); return false; } return true; } /** * Start the download. * * @param event The event */ @FXML protected void handleDownload(ActionEvent event) { extractStoredQuery(); extractBoundingBox(); if (validateInput()) { DirectoryChooser dirChooser = new DirectoryChooser(); dirChooser.setTitle(I18n.getMsg("gui.save-dir")); File selectedDir = dirChooser.showDialog(getPrimaryStage()); if (selectedDir == null) { return; } this.dataBean.setProcessingSteps(extractProcessingSteps()); String savePath = selectedDir.getPath(); DownloadStep ds = dataBean.convertToDownloadStep(savePath); try { DownloadStepConverter dsc = new DownloadStepConverter( dataBean.getUserName(), dataBean.getPassword()); JobList jl = dsc.convert(ds); Processor p = Processor.getInstance(); p.addJob(jl); } catch (ConverterException ce) { statusBarText.setText(ce.getMessage()); } } } /** * Handle events on the process Chain Checkbox. * @param event the event */ @FXML protected void handleChainCheckbox(ActionEvent event) { if (chkChain.isSelected()) { processStepContainter.setVisible(true); } else { factory.removeAllChainAttributes(this.dataBean, chainContainer); processStepContainter.setVisible(false); } } /** * Handle config saving. * @param event The event. */ @FXML protected void handleSaveConfig(ActionEvent event) { extractStoredQuery(); extractBoundingBox(); if (validateInput()) { DirectoryChooser dirChooser = new DirectoryChooser(); dirChooser.setTitle(I18n.getMsg("gui.save-dir")); File downloadDir = dirChooser.showDialog(getPrimaryStage()); if (downloadDir == null) { return; } FileChooser fileChooser = new FileChooser(); fileChooser.setInitialDirectory(downloadDir); FileChooser.ExtensionFilter xmlFilter = new FileChooser.ExtensionFilter("xml files (*.xml)", "xml"); File uniqueName = Misc.uniqueFile(downloadDir, "config", "xml" , null); fileChooser.setInitialFileName(uniqueName.getName()); fileChooser.getExtensionFilters().add(xmlFilter); fileChooser.setSelectedExtensionFilter(xmlFilter); fileChooser.setTitle(I18n.getMsg("gui.save-conf")); File configFile = fileChooser.showSaveDialog(getPrimaryStage()); if (!configFile.toString().endsWith(".xml")) { configFile = new File(configFile.toString() + ".xml"); } if (configFile == null) { return; } this.dataBean.setProcessingSteps(extractProcessingSteps()); String savePath = downloadDir.getPath(); DownloadStep ds = dataBean.convertToDownloadStep(savePath); try { ds.write(configFile); } catch (IOException ex) { log.log(Level.WARNING, ex.getMessage(), ex); } } } /** * Use selection to request the service data and fill th UI. */ private void chooseService() { Task task = new Task() { private void setAuth() { setStatusTextUI( I18n.format("status.service-needs-auth")); serviceURL.getScene().setCursor(Cursor.DEFAULT); serviceAuthenticationCbx.setSelected(true); serviceUser.setDisable(false); servicePW.setDisable(false); } private void setUnreachable() { setStatusTextUI( I18n.format("status.service-not-available")); serviceURL.getScene().setCursor(Cursor.DEFAULT); } @Override protected Integer call() throws Exception { serviceURL.getScene().setCursor(Cursor.WAIT); String url = null; String username = null; String password = null; url = serviceURL.getText(); if (!ServiceChecker.isReachable(url)) { setUnreachable(); return 0; } if (serviceAuthenticationCbx.isSelected()) { username = serviceUser.getText(); dataBean.setUsername(username); password = servicePW.getText(); dataBean.setPassword(password); } if ((username == null && password == null) || (username.equals("") && password.equals(""))) { if (ServiceChecker.isRestricted(new URL(url))) { String pw = dataBean.getPassword(); String un = dataBean.getUserName(); if ((pw == null && un == null) || (pw.isEmpty() && un.isEmpty())) { setAuth(); return 0; } } else { serviceAuthenticationCbx.setSelected(false); serviceUser.setDisable(true); servicePW.setDisable(true); } } if (url != null && !"".equals(url)) { ServiceType st = ServiceChecker.checkService( url, dataBean.getUserName(), dataBean.getPassword()); WebService ws = null; //Check for null, since switch breaks on a null value if (st == null) { log.log(Level.WARNING, "Could not determine " + "Service Type" , st); setStatusTextUI( I18n.getMsg("status.no-service-type")); } else { switch (st) { case Atom: //TODO: Check deep if user/pw was correct setStatusTextUI( I18n.getMsg("status.type.atom")); Atom atom = new Atom(url, dataBean.getUserName(), dataBean.getPassword()); dataBean.setAtomService(atom); break; case WFSOne: setStatusTextUI( I18n.getMsg("status.type.wfsone")); WFSMetaExtractor wfsOne = new WFSMetaExtractor(url, dataBean.getUserName(), dataBean.getPassword()); WFSMeta metaOne = wfsOne.parse(); dataBean.setWFSService(metaOne); break; case WFSTwo: setStatusTextUI( I18n.getMsg("status.type.wfstwo")); WFSMetaExtractor extractor = new WFSMetaExtractor(url, dataBean.getUserName(), dataBean.getPassword()); WFSMeta meta = extractor.parse(); dataBean.setWFSService(meta); break; default: log.log(Level.WARNING, "Could not determine URL" , st); setStatusTextUI(I18n.getMsg("status.no-url")); break; } } Platform.runLater(() -> { setServiceTypes(); serviceTypeChooser. getSelectionModel().select(0); statusBarText.setText(I18n.getMsg("status.ready")); }); } else { setStatusTextUI(I18n.getMsg("status.no-url")); } serviceURL.getScene().setCursor(Cursor.DEFAULT); return 0; } }; Thread th = new Thread(task); statusBarText.setText(I18n.getMsg("status.calling-service")); th.setDaemon(true); th.start(); } /** * Sets the Service Types. */ public void setServiceTypes() { if (dataBean.isWebServiceSet()) { switch (dataBean.getServiceType()) { case WFSOne: case WFSTwo: ReferencedEnvelope extendWFS = null; List<WFSMeta.Feature> features = dataBean.getWFSService().features; List<WFSMeta.StoredQuery> queries = dataBean.getWFSService().storedQueries; ObservableList<ItemModel> types = FXCollections.observableArrayList(); for (WFSMeta.Feature f : features) { types.add(new FeatureModel(f)); if (f.bbox != null) { if (extendWFS == null) { extendWFS = f.bbox; } else { extendWFS.expandToInclude(f.bbox); } } } if (extendWFS != null) { mapWFS.setExtend(extendWFS); } for (WFSMeta.StoredQuery s : queries) { types.add(new StoredQueryModel(s)); } serviceTypeChooser.getItems().retainAll(); serviceTypeChooser.setItems(types); serviceTypeChooser.setValue(types.get(0)); chooseType(serviceTypeChooser.getValue()); break; case Atom: List<Atom.Item> items = dataBean.getAtomService().getItems(); ObservableList<ItemModel> opts = FXCollections.observableArrayList(); List<WMSMapSwing.FeaturePolygon> polygonList = new ArrayList<WMSMapSwing.FeaturePolygon>(); //Polygons are always epsg:4326 // (http://www.georss.org/gml.html) try { ReferencedEnvelope extendATOM = null; atomCRS = CRS.decode(ATOM_CRS_STRING); Geometry all = null; for (Atom.Item i : items) { opts.add(new AtomItemModel(i)); WMSMapSwing.FeaturePolygon polygon = new WMSMapSwing.FeaturePolygon( i.polygon, i.title, i.id, this.atomCRS); polygonList.add(polygon); all = all == null ? i.polygon : all.union(i.polygon); } if (mapAtom != null) { if (all != null) { extendATOM = new ReferencedEnvelope( all.getEnvelopeInternal(), atomCRS); mapAtom.setExtend(extendATOM); } mapAtom.drawPolygons(polygonList); } } catch (FactoryException e) { log.log(Level.SEVERE, e.getMessage(), e); } serviceTypeChooser.getItems().retainAll(); serviceTypeChooser.setItems(opts); if (!opts.isEmpty()) { serviceTypeChooser.setValue(opts.get(0)); chooseType(serviceTypeChooser.getValue()); } default: } } } private void chooseType(ItemModel data) { ServiceType type = this.dataBean.getServiceType(); if (type == ServiceType.Atom) { statusBarText.setText(I18n.format("status.ready")); Atom.Item item = (Atom.Item)data.getItem(); item.load(); if (mapAtom != null) { mapAtom.highlightSelectedPolygon(item.id); } List<Atom.Field> fields = item.fields; ObservableList<String> list = FXCollections.observableArrayList(); for (Atom.Field f : fields) { list.add(f.type); } this.atomVariationChooser.setItems(list); WebEngine engine = this.valueAtomDescr.getEngine(); java.lang.reflect.Field f; try { f = engine.getClass().getDeclaredField("page"); f.setAccessible(true); com.sun.webkit.WebPage page = (com.sun.webkit.WebPage) f.get(engine); page.setBackgroundColor( (new java.awt.Color(BGCOLOR, BGCOLOR, BGCOLOR)).getRGB()); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { // Displays the webview with white background... } engine.loadContent(item.description); this.simpleWFSContainer.setVisible(false); this.basicWFSContainer.setVisible(false); this.atomContainer.setVisible(true); } else if (type == ServiceType.WFSTwo) { if (data instanceof FeatureModel) { this.simpleWFSContainer.setVisible(false); this.basicWFSContainer.setVisible(true); this.mapNodeWFS.setVisible(true); this.atomContainer.setVisible(false); this.basicWFSX1Y1.setVisible(true); this.basicWFSX2Y2.setVisible(true); this.referenceSystemChooser.setVisible(true); this.referenceSystemChooserLabel.setVisible(true); WFSMeta.Feature feature = (WFSMeta.Feature)data.getItem(); mapWFS.setExtend(feature.bbox); ArrayList<String> list = new ArrayList<String>(); list.add(feature.defaultCRS); list.addAll(feature.otherCRSs); ObservableList<CRSModel> crsList = FXCollections.observableArrayList(); for (String crsStr: list) { try { String newcrsStr = crsStr; String seperator = null; if (newcrsStr.contains("::")) { seperator = "::"; } else if (newcrsStr.contains("/")) { seperator = "/"; } if (seperator != null) { newcrsStr = "EPSG:" + newcrsStr.substring( newcrsStr.lastIndexOf(seperator) + seperator.length(), newcrsStr.length()); } CoordinateReferenceSystem crs = CRS.decode(newcrsStr); CRSModel crsm = new CRSModel(crs); crsm.setOldName(crsStr); crsList.add(crsm); } catch (FactoryException e) { log.log(Level.SEVERE, e.getMessage(), e); } } if (!crsList.isEmpty()) { this.referenceSystemChooser.setItems(crsList); CRSModel crsm = crsList.get(0); try { CoordinateReferenceSystem initCRS = CRS.decode( INITIAL_CRS_DISPLAY); CRSModel initCRSM = new CRSModel(initCRS); for (int i = 0; i < crsList.size(); i++) { if (crsList.get(i).equals(initCRSM)) { crsm = crsList.get(i); break; } } } catch (FactoryException e) { log.log(Level.SEVERE, e.getMessage(), e); } this.referenceSystemChooser.setValue(crsm); } List<String> outputFormats = feature.outputFormats; outputFormats = this.dataBean.getWFSService() .findOperation("GetFeature").outputFormats; if (outputFormats.isEmpty()) { outputFormats = this.dataBean.getWFSService().outputFormats; } ObservableList<String> formats = FXCollections.observableArrayList(outputFormats); this.dataFormatChooser.setItems(formats); } else if (data instanceof StoredQueryModel) { List<String> outputFormats = this.dataBean.getWFSService() .findOperation("GetFeature").outputFormats; if (outputFormats.isEmpty()) { outputFormats = this.dataBean.getWFSService().outputFormats; } factory.fillSimpleWFS( dataBean, this.simpleWFSContainer, (WFSMeta.StoredQuery)data.getItem(), outputFormats); this.atomContainer.setVisible(false); this.simpleWFSContainer.setVisible(true); this.basicWFSContainer.setVisible(false); } } } /** * Set the DataBean and fill the UI with initial data objects. * * @param dataBean The DataBean object. */ public void setDataBean(DataBean dataBean) { this.dataBean = dataBean; this.serviceList.setItems(this.dataBean.getServicesAsList()); ServiceSetting serviceSetting = Config.getInstance().getServices(); catalogReachable = dataBean.getCatalogService() != null && ServiceChecker.isReachable( dataBean.getCatalogService().getUrl()); URL url = null; try { url = new URL(serviceSetting.getWMSUrl()); } catch (MalformedURLException e) { log.log(Level.SEVERE, e.getMessage(), e); } if (url != null && ServiceChecker.isReachable( WMSMapSwing.getCapabiltiesURL(url)) ) { mapWFS = new WMSMapSwing(url, MAP_WIDTH, MAP_HEIGHT, serviceSetting.getWMSLayer(), serviceSetting.getWMSSource()); mapWFS.setCoordinateDisplay(basicX1, basicY1, basicX2, basicY2); this.mapNodeWFS.getChildren().add(mapWFS); mapAtom = new WMSMapSwing(url, MAP_WIDTH, MAP_HEIGHT, serviceSetting.getWMSLayer(), serviceSetting.getWMSSource()); mapAtom.addEventHandler(PolygonClickedEvent.ANY, new SelectedAtomPolygon()); mapAtom.setCoordinateDisplay(atomX1, atomY1, atomX2, atomY2); this.mapNodeAtom.getChildren().add(mapAtom); } else { statusBarText.setText(I18n.format("status.wms-not-available")); } this.atomContainer.setVisible(false); this.progressSearch.setVisible(false); this.simpleWFSContainer.setVisible(false); this.basicWFSContainer.setVisible(false); this.serviceUser.setDisable(true); this.servicePW.setDisable(true); this.processStepContainter.setVisible(false); } /** * Handels the Action, when a polygon is selected. */ public class SelectedAtomPolygon implements EventHandler<Event> { @Override public void handle(Event event) { if (mapAtom != null) { if (event instanceof PolygonClickedEvent) { PolygonClickedEvent pce = (PolygonClickedEvent) event; WMSMapSwing.PolygonInfos polygonInfos = pce.getPolygonInfos(); String polygonName = polygonInfos.getName(); String polygonID = polygonInfos.getID(); if (polygonName != null && polygonID != null) { if (polygonName.equals("#@#")) { statusBarText.setText(I18n.format( "status.polygon-intersect", polygonID)); return; } ObservableList<ItemModel> items = serviceTypeChooser.getItems(); int i = 0; for (i = 0; i < items.size(); i++) { AtomItemModel item = (AtomItemModel) items.get(i); Atom.Item aitem = (Atom.Item) item.getItem(); if (aitem.id.equals(polygonID)) { break; } } Atom.Item oldItem = (Atom.Item) serviceTypeChooser .getSelectionModel() .getSelectedItem().getItem(); if (i < items.size() && !oldItem.id.equals(polygonID)) { serviceTypeChooser.setValue(items.get(i)); chooseType(serviceTypeChooser.getValue()); } } } } } } private static final Logger log = Logger.getLogger(Controller.class.getName()); /** * @return the primaryStage */ public Stage getPrimaryStage() { return primaryStage; } /** * @param primaryStage the primaryStage to set */ public void setPrimaryStage(Stage primaryStage) { this.primaryStage = primaryStage; } /** * Creates the Controller. */ public Controller() { this.factory = new UIFactory(); Processor.getInstance().addListener(new DownloadListener()); } /** Set the text of the status bar in UI thread. * @param msg the text to set. */ public void setStatusTextUI(String msg) { Platform.runLater(() -> { statusBarText.setText(msg); }); } /** Keeps track of download progression and errors. */ private class DownloadListener implements ProcessorListener, Runnable { private String message; private synchronized void setMessage(String message) { this.message = message; } private synchronized String getMessage() { return this.message; } @Override public void run() { statusBarText.setText(getMessage()); } @Override public void receivedException(ProcessorEvent pe) { setMessage( I18n.format( "status.error", pe.getException().getMessage())); Platform.runLater(this); } @Override public void receivedMessage(ProcessorEvent pe) { setMessage(pe.getMessage()); Platform.runLater(this); } } }
resetting statusbar and auth status when changing service
src/main/java/de/bayern/gdi/gui/Controller.java
resetting statusbar and auth status when changing service
<ide><path>rc/main/java/de/bayern/gdi/gui/Controller.java <ide> servicePW.setDisable(false); <ide> } <ide> <add> private void unsetAuth() { <add> setStatusTextUI( <add> I18n.format("status.calling-service")); <add> serviceAuthenticationCbx.setSelected(false); <add> serviceUser.setDisable(true); <add> servicePW.setDisable(true); <add> } <add> <ide> private void setUnreachable() { <ide> setStatusTextUI( <ide> I18n.format("status.service-not-available")); <ide> @Override <ide> protected Integer call() throws Exception { <ide> serviceURL.getScene().setCursor(Cursor.WAIT); <add> unsetAuth(); <ide> String url = null; <ide> String username = null; <ide> String password = null;
Java
lgpl-2.1
85ed2d8de41cba8db6a93b8273d5acb6bfdafe7d
0
gallardo/opencms-core,gallardo/opencms-core,alkacon/opencms-core,gallardo/opencms-core,alkacon/opencms-core,alkacon/opencms-core,alkacon/opencms-core,gallardo/opencms-core
/* * File : $Source$ * Date : $Date$ * Version: $Revision$ * * This library is part of OpenCms - * the Open Source Content Management System * * Copyright (C) 2002 - 2009 Alkacon Software (http://www.alkacon.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * For further information about Alkacon Software, please see the * company website: http://www.alkacon.com * * For further information about OpenCms, please see the * project website: http://www.opencms.org * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.opencms.search.solr; import org.opencms.configuration.CmsConfigurationException; import org.opencms.configuration.CmsParameterConfiguration; import org.opencms.file.CmsFile; import org.opencms.file.CmsObject; import org.opencms.file.CmsProject; import org.opencms.file.CmsPropertyDefinition; import org.opencms.file.CmsResource; import org.opencms.file.CmsResourceFilter; import org.opencms.file.types.CmsResourceTypeXmlContainerPage; import org.opencms.file.types.CmsResourceTypeXmlContent; import org.opencms.i18n.CmsEncoder; import org.opencms.i18n.CmsLocaleManager; import org.opencms.main.CmsException; import org.opencms.main.CmsIllegalArgumentException; import org.opencms.main.CmsLog; import org.opencms.main.OpenCms; import org.opencms.report.I_CmsReport; import org.opencms.search.CmsSearchException; import org.opencms.search.CmsSearchIndex; import org.opencms.search.CmsSearchIndexSource; import org.opencms.search.CmsSearchManager; import org.opencms.search.CmsSearchParameters; import org.opencms.search.CmsSearchResource; import org.opencms.search.CmsSearchResultList; import org.opencms.search.I_CmsIndexWriter; import org.opencms.search.I_CmsSearchDocument; import org.opencms.search.documents.I_CmsDocumentFactory; import org.opencms.search.fields.CmsSearchField; import org.opencms.search.galleries.CmsGallerySearchParameters; import org.opencms.search.galleries.CmsGallerySearchResult; import org.opencms.search.galleries.CmsGallerySearchResultList; import org.opencms.security.CmsRole; import org.opencms.security.CmsRoleViolationException; import org.opencms.util.CmsFileUtil; import org.opencms.util.CmsRequestUtil; import org.opencms.util.CmsStringUtil; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; import java.io.Writer; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Optional; import java.util.Set; import java.util.stream.Stream; import javax.servlet.ServletResponse; import org.apache.commons.logging.Log; import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer; import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.common.SolrDocument; import org.apache.solr.common.SolrDocumentList; import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.util.ContentStreamBase; import org.apache.solr.common.util.NamedList; import org.apache.solr.core.CoreContainer; import org.apache.solr.core.SolrCore; import org.apache.solr.handler.ReplicationHandler; import org.apache.solr.request.LocalSolrQueryRequest; import org.apache.solr.request.SolrQueryRequest; import org.apache.solr.request.SolrRequestHandler; import org.apache.solr.response.BinaryQueryResponseWriter; import org.apache.solr.response.QueryResponseWriter; import org.apache.solr.response.SolrQueryResponse; import org.apache.solr.util.FastWriter; import com.google.common.base.Objects; /** * Implements the search within an Solr index.<p> * * @since 8.5.0 */ public class CmsSolrIndex extends CmsSearchIndex { /** The serial version id. */ private static final long serialVersionUID = -1570077792574476721L; /** The name of the default Solr Offline index. */ public static final String DEFAULT_INDEX_NAME_OFFLINE = "Solr Offline"; /** The name of the default Solr Online index. */ public static final String DEFAULT_INDEX_NAME_ONLINE = "Solr Online"; /** Constant for additional parameter to set the post processor class name. */ public static final String POST_PROCESSOR = "search.solr.postProcessor"; /** * Constant for additional parameter to set the maximally processed results (start + rows) for searches with this index. * It overwrites the global configuration from {@link CmsSolrConfiguration#getMaxProcessedResults()} for this index. **/ public static final String SOLR_SEARCH_MAX_PROCESSED_RESULTS = "search.solr.maxProcessedResults"; /** Constant for additional parameter to set the fields the select handler should return at maximum. */ public static final String SOLR_HANDLER_ALLOWED_FIELDS = "handle.solr.allowedFields"; /** Constant for additional parameter to set the number results the select handler should return at maxium per request. */ public static final String SOLR_HANDLER_MAX_ALLOWED_RESULTS_PER_PAGE = "handle.solr.maxAllowedResultsPerPage"; /** Constant for additional parameter to set the maximal number of a result, the select handler should return. */ public static final String SOLR_HANDLER_MAX_ALLOWED_RESULTS_AT_ALL = "handle.solr.maxAllowedResultsAtAll"; /** Constant for additional parameter to disable the select handler (except for debug mode). */ private static final String SOLR_HANDLER_DISABLE_SELECT = "handle.solr.disableSelectHandler"; /** Constant for additional parameter to set the VFS path to the file holding the debug secret. */ private static final String SOLR_HANDLER_DEBUG_SECRET_FILE = "handle.solr.debugSecretFile"; /** Constant for additional parameter to disable the spell handler (except for debug mode). */ private static final String SOLR_HANDLER_DISABLE_SPELL = "handle.solr.disableSpellHandler"; /** The solr exclude property. */ public static final String PROPERTY_SEARCH_EXCLUDE_VALUE_SOLR = "solr"; /** Indicates the maximum number of documents from the complete result set to return. */ public static final int ROWS_MAX = 50; /** The constant for an unlimited maximum number of results to return in a Solr search. */ public static final int MAX_RESULTS_UNLIMITED = -1; /** The constant for an unlimited maximum number of results to return in a Solr search. */ public static final int MAX_RESULTS_GALLERY = 10000; /** A constant for debug formatting output. */ protected static final int DEBUG_PADDING_RIGHT = 50; /** The name for the parameters key of the response header. */ private static final String HEADER_PARAMS_NAME = "params"; /** The log object for this class. */ private static final Log LOG = CmsLog.getLog(CmsSolrIndex.class); /** Pseudo resource used for not permission checked indexes. */ private static final CmsResource PSEUDO_RES = new CmsResource( null, null, null, 0, false, 0, null, null, 0L, null, 0L, null, 0L, 0L, 0, 0, 0L, 0); /** The name of the key that is used for the result documents inside the Solr query response. */ private static final String QUERY_RESPONSE_NAME = "response"; /** The name of the key that is used for the query time. */ private static final String QUERY_TIME_NAME = "QTime"; /** The name of the key that is used for the query time. */ private static final String QUERY_HIGHLIGHTING_NAME = "highlighting"; /** A constant for UTF-8 charset. */ private static final Charset UTF8 = Charset.forName("UTF-8"); /** The name of the request parameter holding the debug secret. */ private static final String REQUEST_PARAM_DEBUG_SECRET = "_debug"; /** The name of the query parameter enabling spell checking. */ private static final String QUERY_SPELLCHECK_NAME = "spellcheck"; /** The name of the query parameter sorting. */ private static final String QUERY_SORT_NAME = "sort"; /** The name of the query parameter expand. */ private static final String QUERY_PARAM_EXPAND = "expand"; /** The embedded Solr client for this index. */ transient SolrClient m_solr; /** The post document manipulator. */ private transient I_CmsSolrPostSearchProcessor m_postProcessor; /** The core name for the index. */ private transient String m_coreName; /** The list of allowed fields to return. */ private String[] m_handlerAllowedFields; /** The number of maximally allowed results per page when using the handler. */ private int m_handlerMaxAllowedResultsPerPage = -1; /** The number of maximally allowed results at all when using the handler. */ private int m_handlerMaxAllowedResultsAtAll = -1; /** Flag, indicating if the handler only works in debug mode. */ private boolean m_handlerSelectDisabled; /** Path to the secret file. Must be under /system/.../ or /shared/.../ and readable by all users that should be able to debug. */ private String m_handlerDebugSecretFile; /** Flag, indicating if the spellcheck handler is disabled for the index. */ private boolean m_handlerSpellDisabled; /** The maximal number of results to process for search queries. */ int m_maxProcessedResults = -2; // special value for not initialized. /** * Default constructor.<p> */ public CmsSolrIndex() { super(); } /** * Public constructor to create a Solr index.<p> * * @param name the name for this index.<p> * * @throws CmsIllegalArgumentException if something goes wrong */ public CmsSolrIndex(String name) throws CmsIllegalArgumentException { super(name); } /** * Returns the resource type for the given root path.<p> * * @param cms the current CMS context * @param rootPath the root path of the resource to get the type for * * @return the resource type for the given root path */ public static final String getType(CmsObject cms, String rootPath) { String type = null; CmsSolrIndex index = CmsSearchManager.getIndexSolr(cms, null); if (index != null) { I_CmsSearchDocument doc = index.getDocument(CmsSearchField.FIELD_PATH, rootPath); if (doc != null) { type = doc.getFieldValueAsString(CmsSearchField.FIELD_TYPE); } } return type; } /** * @see org.opencms.search.CmsSearchIndex#addConfigurationParameter(java.lang.String, java.lang.String) */ @Override public void addConfigurationParameter(String key, String value) { switch (key) { case POST_PROCESSOR: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { try { setPostProcessor((I_CmsSolrPostSearchProcessor)Class.forName(value).newInstance()); } catch (Exception e) { CmsException ex = new CmsException( Messages.get().container(Messages.LOG_SOLR_ERR_POST_PROCESSOR_NOT_EXIST_1, value), e); LOG.error(ex.getMessage(), ex); } } break; case SOLR_HANDLER_ALLOWED_FIELDS: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { m_handlerAllowedFields = Stream.of(value.split(",")).map(v -> v.trim()).toArray(String[]::new); } break; case SOLR_HANDLER_MAX_ALLOWED_RESULTS_PER_PAGE: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { try { m_handlerMaxAllowedResultsPerPage = Integer.parseInt(value); } catch (NumberFormatException e) { LOG.warn( "Could not parse parameter \"" + SOLR_HANDLER_MAX_ALLOWED_RESULTS_PER_PAGE + "\" for index \"" + getName() + "\". Results per page will not be restricted."); } } break; case SOLR_HANDLER_MAX_ALLOWED_RESULTS_AT_ALL: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { try { m_handlerMaxAllowedResultsAtAll = Integer.parseInt(value); } catch (NumberFormatException e) { LOG.warn( "Could not parse parameter \"" + SOLR_HANDLER_MAX_ALLOWED_RESULTS_AT_ALL + "\" for index \"" + getName() + "\". Results per page will not be restricted."); } } break; case SOLR_HANDLER_DISABLE_SELECT: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { m_handlerSelectDisabled = value.trim().toLowerCase().equals("true"); } break; case SOLR_HANDLER_DEBUG_SECRET_FILE: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { m_handlerDebugSecretFile = value.trim(); } break; case SOLR_HANDLER_DISABLE_SPELL: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { m_handlerSpellDisabled = value.trim().toLowerCase().equals("true"); } break; case SOLR_SEARCH_MAX_PROCESSED_RESULTS: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { try { m_maxProcessedResults = Integer.parseInt(value); } catch (NumberFormatException e) { LOG.warn( "Could not parse parameter \"" + SOLR_SEARCH_MAX_PROCESSED_RESULTS + "\" for index \"" + getName() + "\". The global configuration will be used instead."); } } break; default: super.addConfigurationParameter(key, value); break; } } /** * @see org.opencms.search.CmsSearchIndex#createEmptyDocument(org.opencms.file.CmsResource) */ @Override public I_CmsSearchDocument createEmptyDocument(CmsResource resource) { CmsSolrDocument doc = new CmsSolrDocument(new SolrInputDocument()); doc.setId(resource.getStructureId()); return doc; } /** * @see org.opencms.search.CmsSearchIndex#createIndexWriter(boolean, org.opencms.report.I_CmsReport) */ @Override public I_CmsIndexWriter createIndexWriter(boolean create, I_CmsReport report) { return new CmsSolrIndexWriter(m_solr, this); } /** * @see org.opencms.search.CmsSearchIndex#excludeFromIndex(CmsObject, CmsResource) */ @Override public boolean excludeFromIndex(CmsObject cms, CmsResource resource) { if (resource.isFolder() || resource.isTemporaryFile()) { // don't index folders or temporary files for galleries, but pretty much everything else return true; } // If this is the default offline index than it is used for gallery search that needs all resources indexed. if (this.getName().equals(DEFAULT_INDEX_NAME_OFFLINE)) { return false; } boolean isOnlineIndex = getProject().equals(CmsProject.ONLINE_PROJECT_NAME); if (isOnlineIndex && (resource.getDateExpired() <= System.currentTimeMillis())) { return true; } try { // do property lookup with folder search String propValue = cms.readPropertyObject( resource, CmsPropertyDefinition.PROPERTY_SEARCH_EXCLUDE, true).getValue(); if (propValue != null) { if (!("false".equalsIgnoreCase(propValue.trim()))) { return true; } } } catch (CmsException e) { if (LOG.isDebugEnabled()) { LOG.debug( org.opencms.search.Messages.get().getBundle().key( org.opencms.search.Messages.LOG_UNABLE_TO_READ_PROPERTY_1, resource.getRootPath())); } } if (!USE_ALL_LOCALE.equalsIgnoreCase(getLocale().getLanguage())) { // check if any resource default locale has a match with the index locale, if not skip resource List<Locale> locales = OpenCms.getLocaleManager().getDefaultLocales(cms, resource); Locale match = OpenCms.getLocaleManager().getFirstMatchingLocale( Collections.singletonList(getLocale()), locales); return (match == null); } return false; } /** * Performs a search with according to the gallery search parameters.<p> * * @param cms the cms context * @param params the search parameters * * @return the search result */ public CmsGallerySearchResultList gallerySearch(CmsObject cms, CmsGallerySearchParameters params) { CmsGallerySearchResultList resultList = new CmsGallerySearchResultList(); try { CmsSolrResultList list = search( cms, params.getQuery(cms), false, null, true, CmsResourceFilter.ONLY_VISIBLE_NO_DELETED, MAX_RESULTS_GALLERY); // ignore the maximally searched number of contents. if (null == list) { return null; } resultList.setHitCount(Long.valueOf(list.getNumFound()).intValue()); for (CmsSearchResource resource : list) { I_CmsSearchDocument document = resource.getDocument(); Locale locale = CmsLocaleManager.getLocale(params.getLocale()); CmsGallerySearchResult result = new CmsGallerySearchResult( document, cms, (int)document.getScore(), locale); resultList.add(result); } } catch (CmsSearchException e) { LOG.error(e.getMessage(), e); } return resultList; } /** * @see org.opencms.search.CmsSearchIndex#getConfiguration() */ @Override public CmsParameterConfiguration getConfiguration() { CmsParameterConfiguration result = super.getConfiguration(); if (getPostProcessor() != null) { result.put(POST_PROCESSOR, getPostProcessor().getClass().getName()); } return result; } /** * Returns the name of the core of the index. * NOTE: Index and core name differ since OpenCms 10.5 due to new naming rules for cores in SOLR. * * @return the name of the core of the index. */ public String getCoreName() { return m_coreName; } /** * @see org.opencms.search.CmsSearchIndex#getDocument(java.lang.String, java.lang.String) */ @Override public synchronized I_CmsSearchDocument getDocument(String fieldname, String term) { return getDocument(fieldname, term, null); } /** * Version of {@link org.opencms.search.CmsSearchIndex#getDocument(java.lang.String, java.lang.String)} where * the returned fields can be restricted. * * @param fieldname the field to query in * @param term the query * @param fls the returned fields. * @return the document. */ public synchronized I_CmsSearchDocument getDocument(String fieldname, String term, String[] fls) { try { SolrQuery query = new SolrQuery(); if (CmsSearchField.FIELD_PATH.equals(fieldname)) { query.setQuery(fieldname + ":\"" + term + "\""); } else { query.setQuery(fieldname + ":" + term); } query.addFilterQuery("{!collapse field=" + fieldname + "}"); if (null != fls) { query.setFields(fls); } QueryResponse res = m_solr.query(query); if (res != null) { SolrDocumentList sdl = m_solr.query(query).getResults(); if ((sdl.getNumFound() > 0L) && (sdl.get(0) != null)) { return new CmsSolrDocument(sdl.get(0)); } } } catch (Exception e) { // ignore and assume that the document could not be found LOG.error(e.getMessage(), e); } return null; } /** * @see org.opencms.search.CmsSearchIndex#getDocumentFactory(org.opencms.file.CmsResource) */ @Override public I_CmsDocumentFactory getDocumentFactory(CmsResource res) { if (isIndexing(res)) { I_CmsDocumentFactory defaultFactory = super.getDocumentFactory(res); if (null == defaultFactory) { if (OpenCms.getResourceManager().getResourceType(res) instanceof CmsResourceTypeXmlContainerPage) { return OpenCms.getSearchManager().getDocumentFactory( CmsSolrDocumentContainerPage.TYPE_CONTAINERPAGE_SOLR, "text/html"); } if (CmsResourceTypeXmlContent.isXmlContent(res)) { return OpenCms.getSearchManager().getDocumentFactory( CmsSolrDocumentXmlContent.TYPE_XMLCONTENT_SOLR, "text/html"); } } return defaultFactory; } return null; } /** * Returns the language locale for the given resource in this index.<p> * * @param cms the current OpenCms user context * @param resource the resource to check * @param availableLocales a list of locales supported by the resource * * @return the language locale for the given resource in this index */ @Override public Locale getLocaleForResource(CmsObject cms, CmsResource resource, List<Locale> availableLocales) { Locale result = null; List<Locale> defaultLocales = OpenCms.getLocaleManager().getDefaultLocales(cms, resource); if ((availableLocales != null) && (availableLocales.size() > 0)) { result = OpenCms.getLocaleManager().getBestMatchingLocale( defaultLocales.get(0), defaultLocales, availableLocales); } if (result == null) { result = ((availableLocales != null) && availableLocales.isEmpty()) ? availableLocales.get(0) : defaultLocales.get(0); } return result; } /** * Returns the maximal number of results (start + rows) that are processed for each search query unless another * maximum is explicitly specified in {@link #search(CmsObject, CmsSolrQuery, boolean, ServletResponse, boolean, CmsResourceFilter, int)}. * * @return the maximal number of results (start + rows) that are processed for a search query. */ public int getMaxProcessedResults() { return m_maxProcessedResults; } /** * Returns the search post processor.<p> * * @return the post processor to use */ public I_CmsSolrPostSearchProcessor getPostProcessor() { return m_postProcessor; } /** * @see org.opencms.search.CmsSearchIndex#initialize() */ @Override public void initialize() throws CmsSearchException { super.initialize(); if (m_maxProcessedResults == -2) { m_maxProcessedResults = OpenCms.getSearchManager().getSolrServerConfiguration().getMaxProcessedResults(); } try { OpenCms.getSearchManager().registerSolrIndex(this); } catch (CmsConfigurationException ex) { LOG.error(ex.getMessage(), ex); setEnabled(false); } } /** Returns a flag, indicating if the Solr server is not yet set. * @return a flag, indicating if the Solr server is not yet set. */ public boolean isNoSolrServerSet() { return null == m_solr; } /** * Not yet implemented for Solr.<p> * * <code> * #################<br> * ### DON'T USE ###<br> * #################<br> * </code> * * @deprecated Use {@link #search(CmsObject, SolrQuery)} or {@link #search(CmsObject, String)} instead */ @Override @Deprecated public synchronized CmsSearchResultList search(CmsObject cms, CmsSearchParameters params) { throw new UnsupportedOperationException(); } /** * Default search method.<p> * * @param cms the current CMS object * @param query the query * * @return the results * * @throws CmsSearchException if something goes wrong * * @see #search(CmsObject, String) */ public CmsSolrResultList search(CmsObject cms, CmsSolrQuery query) throws CmsSearchException { return search(cms, query, false); } /** * Performs a search.<p> * * Returns a list of 'OpenCms resource documents' * ({@link CmsSearchResource}) encapsulated within the class {@link CmsSolrResultList}. * This list can be accessed exactly like an {@link List} which entries are * {@link CmsSearchResource} that extend {@link CmsResource} and holds the Solr * implementation of {@link I_CmsSearchDocument} as member. <b>This enables you to deal * with the resulting list as you do with well known {@link List} and work on it's entries * like you do on {@link CmsResource}.</b> * * <h4>What will be done with the Solr search result?</h4> * <ul> * <li>Although it can happen, that there are less results returned than rows were requested * (imagine an index containing less documents than requested rows) we try to guarantee * the requested amount of search results and to provide a working pagination with * security check.</li> * * <li>To be sure we get enough documents left even the permission check reduces the amount * of found documents, the rows are multiplied by <code>'5'</code> and the current page * additionally the offset is added. The count of documents we don't have enough * permissions for grows with increasing page number, that's why we also multiply * the rows by the current page count.</li> * * <li>Also make sure we perform the permission check for all found documents, so start with * the first found doc.</li> * </ul> * * <b>NOTE:</b> If latter pages than the current one are containing protected documents the * total hit count will be incorrect, because the permission check ends if we have * enough results found for the page to display. With other words latter pages than * the current can contain documents that will first be checked if those pages are * requested to be displayed, what causes a incorrect hit count.<p> * * @param cms the current OpenCms context * @param ignoreMaxRows <code>true</code> to return all all requested rows, <code>false</code> to use max rows * @param query the OpenCms Solr query * * @return the list of found documents * * @throws CmsSearchException if something goes wrong * * @see org.opencms.search.solr.CmsSolrResultList * @see org.opencms.search.CmsSearchResource * @see org.opencms.search.I_CmsSearchDocument * @see org.opencms.search.solr.CmsSolrQuery */ public CmsSolrResultList search(CmsObject cms, final CmsSolrQuery query, boolean ignoreMaxRows) throws CmsSearchException { return search(cms, query, ignoreMaxRows, null, false, null); } /** * Like {@link #search(CmsObject, CmsSolrQuery, boolean)}, but additionally a resource filter can be specified. * By default, the filter depends on the index. * * @param cms the current OpenCms context * @param ignoreMaxRows <code>true</code> to return all all requested rows, <code>false</code> to use max rows * @param query the OpenCms Solr query * @param filter the resource filter to use for post-processing. * * @return the list of documents found. * * @throws CmsSearchException if something goes wrong */ public CmsSolrResultList search( CmsObject cms, final CmsSolrQuery query, boolean ignoreMaxRows, final CmsResourceFilter filter) throws CmsSearchException { return search(cms, query, ignoreMaxRows, null, false, filter); } /** * Performs the actual search.<p> * * @param cms the current OpenCms context * @param query the OpenCms Solr query * @param ignoreMaxRows <code>true</code> to return all all requested rows, <code>false</code> to use max rows * @param response the servlet response to write the query result to, may also be <code>null</code> * @param ignoreSearchExclude if set to false, only contents with search_exclude unset or "false" will be found - typical for the the non-gallery case * @param filter the resource filter to use * * @return the found documents * * @throws CmsSearchException if something goes wrong * * @see #search(CmsObject, CmsSolrQuery, boolean) */ public CmsSolrResultList search( CmsObject cms, final CmsSolrQuery query, boolean ignoreMaxRows, ServletResponse response, boolean ignoreSearchExclude, CmsResourceFilter filter) throws CmsSearchException { return search(cms, query, ignoreMaxRows, response, ignoreSearchExclude, filter, getMaxProcessedResults()); } /** * Performs the actual search.<p> * * To provide for correct permissions two queries are performed and the response is fused from that queries: * <ol> * <li>a query for permission checking, where fl, start and rows is adjusted. From this query result we take for the response: * <ul> * <li>facets</li> * <li>spellcheck</li> * <li>suggester</li> * <li>morelikethis</li> * <li>clusters</li> * </ul> * </li> * <li>a query that collects only the resources determined by the first query and performs highlighting. From this query we take for the response: * <li>result</li> * <li>highlighting</li> * </li> *</ol> * * Currently not or only partly supported Solr features are: * <ul> * <li>groups</li> * <li>collapse - representatives of the collapsed group might be filtered by the permission check</li> * <li>expand is disabled</li> * </ul> * * @param cms the current OpenCms context * @param query the OpenCms Solr query * @param ignoreMaxRows <code>true</code> to return all requested rows, <code>false</code> to use max rows * @param response the servlet response to write the query result to, may also be <code>null</code> * @param ignoreSearchExclude if set to false, only contents with search_exclude unset or "false" will be found - typical for the the non-gallery case * @param filter the resource filter to use * @param maxNumResults the maximal number of results to search for * * @return the found documents * * @throws CmsSearchException if something goes wrong * * @see #search(CmsObject, CmsSolrQuery, boolean) */ @SuppressWarnings("unchecked") public CmsSolrResultList search( CmsObject cms, final CmsSolrQuery query, boolean ignoreMaxRows, ServletResponse response, boolean ignoreSearchExclude, CmsResourceFilter filter, int maxNumResults) throws CmsSearchException { CmsSolrResultList result = null; long startTime = System.currentTimeMillis(); // TODO: // - fall back to "last found results" if none are present at the "last page"? // - deal with cursorMarks? // - deal with groups? // - deal with result clustering? // - remove max score calculation? if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_SOLR_DEBUG_ORIGINAL_QUERY_2, query, getName())); } // change thread priority in order to reduce search impact on overall system performance int previousPriority = Thread.currentThread().getPriority(); if (getPriority() > 0) { Thread.currentThread().setPriority(getPriority()); } // check if the user is allowed to access this index checkOfflineAccess(cms); if (!ignoreSearchExclude) { if (LOG.isInfoEnabled()) { LOG.info( Messages.get().getBundle().key( Messages.LOG_SOLR_INFO_ADDING_SEARCH_EXCLUDE_FILTER_FOR_QUERY_2, query, getName())); } query.addFilterQuery(CmsSearchField.FIELD_SEARCH_EXCLUDE + ":\"false\""); } // get start parameter from the request int start = null == query.getStart() ? 0 : query.getStart().intValue(); // correct negative start values to 0. if (start < 0) { query.setStart(Integer.valueOf(0)); start = 0; } // Adjust the maximal number of results to process in case it is unlimited. if (maxNumResults < 0) { maxNumResults = Integer.MAX_VALUE; if (LOG.isInfoEnabled()) { LOG.info( Messages.get().getBundle().key( Messages.LOG_SOLR_INFO_LIMITING_MAX_PROCESSED_RESULTS_3, query, getName(), Integer.valueOf(maxNumResults))); } } // Correct the rows parameter // Set the default rows, if rows are not set in the original query. int rows = null == query.getRows() ? CmsSolrQuery.DEFAULT_ROWS.intValue() : query.getRows().intValue(); // Restrict the rows, such that the maximal number of queryable results is not exceeded. if ((((rows + start) > maxNumResults) || ((rows + start) < 0))) { rows = maxNumResults - start; } // Restrict the rows to the maximally allowed number, if they should be restricted. if (!ignoreMaxRows && (rows > ROWS_MAX)) { if (LOG.isInfoEnabled()) { LOG.info( Messages.get().getBundle().key( Messages.LOG_SOLR_INFO_LIMITING_MAX_ROWS_4, new Object[] {query, getName(), Integer.valueOf(rows), Integer.valueOf(ROWS_MAX)})); } rows = ROWS_MAX; } // If start is higher than maxNumResults, the rows could be negative here - correct this. if (rows < 0) { if (LOG.isInfoEnabled()) { LOG.info( Messages.get().getBundle().key( Messages.LOG_SOLR_INFO_CORRECTING_ROWS_4, new Object[] {query, getName(), Integer.valueOf(rows), Integer.valueOf(0)})); } rows = 0; } // Set the corrected rows for the query. query.setRows(Integer.valueOf(rows)); // remove potentially set expand parameter if (null != query.getParams(QUERY_PARAM_EXPAND)) { LOG.info(Messages.get().getBundle().key(Messages.LOG_SOLR_INFO_REMOVING_EXPAND_2, query, getName())); query.remove("expand"); } float maxScore = 0; LocalSolrQueryRequest solrQueryRequest = null; SolrCore core = null; String[] sortParamValues = query.getParams(QUERY_SORT_NAME); boolean sortByScoreDesc = (null == sortParamValues) || (sortParamValues.length == 0) || Objects.equal(sortParamValues[0], "score desc"); try { // initialize the search context CmsObject searchCms = OpenCms.initCmsObject(cms); //////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////// QUERY FOR PERMISSION CHECK, FACETS, SPELLCHECK, SUGGESTIONS /////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Clone the query and keep the original one CmsSolrQuery checkQuery = query.clone(); // Initialize rows, offset, end and the current page. int end = start + rows; int itemsToCheck = Math.max(10, end + (end / 5)); // request 20 percent more, but at least 10 results if permissions are filtered // use a set to prevent double entries if multiple check queries are performed. Set<String> resultSolrIds = new HashSet<>(rows); // rows are set before definitely. // counter for the documents found and accessible int cnt = 0; long hitCount = 0; long visibleHitCount = 0; int processedResults = 0; long solrPermissionTime = 0; // disable highlighting - it's done in the next query. checkQuery.setHighlight(false); // adjust rows and start for the permission check. checkQuery.setRows(Integer.valueOf(Math.min(maxNumResults - processedResults, itemsToCheck))); checkQuery.setStart(Integer.valueOf(processedResults)); // return only the fields required for the permission check and for scoring checkQuery.setFields(CmsSearchField.FIELD_TYPE, CmsSearchField.FIELD_SOLR_ID, CmsSearchField.FIELD_PATH); List<String> originalFields = Arrays.asList(query.getFields().split(",")); if (originalFields.contains(CmsSearchField.FIELD_SCORE)) { checkQuery.addField(CmsSearchField.FIELD_SCORE); } if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_SOLR_DEBUG_CHECK_QUERY_2, checkQuery, getName())); } // perform the permission check Solr query and remember the response and time Solr took. long solrCheckTime = System.currentTimeMillis(); QueryResponse checkQueryResponse = m_solr.query(checkQuery); solrCheckTime = System.currentTimeMillis() - solrCheckTime; solrPermissionTime += solrCheckTime; // initialize the counts hitCount = checkQueryResponse.getResults().getNumFound(); int maxToProcess = Long.valueOf(Math.min(hitCount, maxNumResults)).intValue(); visibleHitCount = hitCount; // process found documents for (SolrDocument doc : checkQueryResponse.getResults()) { try { CmsSolrDocument searchDoc = new CmsSolrDocument(doc); if (needsPermissionCheck(searchDoc) && !hasPermissions(searchCms, searchDoc, filter)) { visibleHitCount--; } else { if (cnt >= start) { resultSolrIds.add(searchDoc.getFieldValueAsString(CmsSearchField.FIELD_SOLR_ID)); } if (sortByScoreDesc && (searchDoc.getScore() > maxScore)) { maxScore = searchDoc.getScore(); } if (++cnt >= end) { break; } } } catch (Exception e) { // should not happen, but if it does we want to go on with the next result nevertheless visibleHitCount--; LOG.warn(Messages.get().getBundle().key(Messages.LOG_SOLR_ERR_RESULT_ITERATION_FAILED_0), e); } } processedResults += checkQueryResponse.getResults().size(); if ((resultSolrIds.size() < rows) && (processedResults < maxToProcess)) { CmsSolrQuery secondCheckQuery = checkQuery.clone(); // disable all features not necessary, since results are present from the first check query. secondCheckQuery.setFacet(false); secondCheckQuery.setMoreLikeThis(false); secondCheckQuery.set(QUERY_SPELLCHECK_NAME, false); do { // query directly more under certain conditions to reduce number of queries itemsToCheck = itemsToCheck < 3000 ? itemsToCheck * 4 : itemsToCheck; // adjust rows and start for the permission check. secondCheckQuery.setRows( Integer.valueOf( Long.valueOf(Math.min(maxToProcess - processedResults, itemsToCheck)).intValue())); secondCheckQuery.setStart(Integer.valueOf(processedResults)); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_SOLR_DEBUG_SECONDCHECK_QUERY_2, secondCheckQuery, getName())); } long solrSecondCheckTime = System.currentTimeMillis(); QueryResponse secondCheckQueryResponse = m_solr.query(secondCheckQuery); processedResults += secondCheckQueryResponse.getResults().size(); solrSecondCheckTime = System.currentTimeMillis() - solrSecondCheckTime; solrPermissionTime += solrCheckTime; // process found documents for (SolrDocument doc : secondCheckQueryResponse.getResults()) { try { CmsSolrDocument searchDoc = new CmsSolrDocument(doc); String docSolrId = searchDoc.getFieldValueAsString(CmsSearchField.FIELD_SOLR_ID); if ((needsPermissionCheck(searchDoc) && !hasPermissions(searchCms, searchDoc, filter)) || resultSolrIds.contains(docSolrId)) { visibleHitCount--; } else { if (cnt >= start) { resultSolrIds.add(docSolrId); } if (sortByScoreDesc && (searchDoc.getScore() > maxScore)) { maxScore = searchDoc.getScore(); } if (++cnt >= end) { break; } } } catch (Exception e) { // should not happen, but if it does we want to go on with the next result nevertheless visibleHitCount--; LOG.warn( Messages.get().getBundle().key(Messages.LOG_SOLR_ERR_RESULT_ITERATION_FAILED_0), e); } } } while ((resultSolrIds.size() < rows) && (processedResults < maxToProcess)); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////// QUERY FOR RESULTS AND HIGHLIGHTING //////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////// // the lists storing the found documents that will be returned List<CmsSearchResource> resourceDocumentList = new ArrayList<CmsSearchResource>(resultSolrIds.size()); SolrDocumentList solrDocumentList = new SolrDocumentList(); long solrResultTime = 0; // If we're using a post-processor, (re-)initialize it before using it if (m_postProcessor != null) { m_postProcessor.init(); } // build the query for getting the results SolrQuery queryForResults = new SolrQuery(); queryForResults.setFields(query.getFields()); queryForResults.setQuery(query.getQuery()); // we add an additional filter, such that we can only find the documents we want to retrieve, as we figured out in the check query. if (!resultSolrIds.isEmpty()) { Optional<String> queryFilterString = resultSolrIds.stream().map(a -> '"' + a + '"').reduce( (a, b) -> a + " OR " + b); queryForResults.addFilterQuery(CmsSearchField.FIELD_SOLR_ID + ":(" + queryFilterString.get() + ")"); } queryForResults.setRows(Integer.valueOf(resultSolrIds.size())); queryForResults.setStart(Integer.valueOf(0)); // use sorting as in the original query. queryForResults.setSorts(query.getSorts()); if (null != sortParamValues) { queryForResults.add(QUERY_SORT_NAME, sortParamValues); } // Take over highlighting part, if the original query had highlighting enabled. if (query.getHighlight()) { for (String paramName : query.getParameterNames()) { if (paramName.startsWith("hl")) { queryForResults.add(paramName, query.getParams(paramName)); } } } if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_SOLR_DEBUG_RESULT_QUERY_2, queryForResults, getName())); } // perform the result query. solrResultTime = System.currentTimeMillis(); QueryResponse resultQueryResponse = m_solr.query(queryForResults); solrResultTime = System.currentTimeMillis() - solrResultTime; // List containing solr ids of filtered contents for which highlighting has to be removed. // Since we checked permissions just a few milliseconds ago, this should typically stay empty. List<String> filteredResultIds = new ArrayList<>(5); for (SolrDocument doc : resultQueryResponse.getResults()) { try { CmsSolrDocument searchDoc = new CmsSolrDocument(doc); if (needsPermissionCheck(searchDoc)) { CmsResource resource = filter == null ? getResource(searchCms, searchDoc) : getResource(searchCms, searchDoc, filter); if (null != resource) { if (m_postProcessor != null) { doc = m_postProcessor.process( searchCms, resource, (SolrInputDocument)searchDoc.getDocument()); } resourceDocumentList.add(new CmsSearchResource(resource, searchDoc)); solrDocumentList.add(doc); } else { filteredResultIds.add(searchDoc.getFieldValueAsString(CmsSearchField.FIELD_SOLR_ID)); } } else { // should not happen unless the index has changed since the first query. resourceDocumentList.add(new CmsSearchResource(PSEUDO_RES, searchDoc)); solrDocumentList.add(doc); visibleHitCount--; } } catch (Exception e) { // should not happen, but if it does we want to go on with the next result nevertheless visibleHitCount--; LOG.warn(Messages.get().getBundle().key(Messages.LOG_SOLR_ERR_RESULT_ITERATION_FAILED_0), e); } } long processTime = System.currentTimeMillis() - startTime - solrPermissionTime - solrResultTime; //////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////// CREATE THE FINAL RESPONSE ///////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////// // we are manipulating the checkQueryResponse to set up the final response, we want to deliver. // adjust start, max score and hit count displayed in the result list. solrDocumentList.setStart(start); Float finalMaxScore = sortByScoreDesc ? new Float(maxScore) : checkQueryResponse.getResults().getMaxScore(); solrDocumentList.setMaxScore(finalMaxScore); solrDocumentList.setNumFound(visibleHitCount); // Exchange the search parameters in the response header by the ones from the (adjusted) original query. NamedList<Object> params = ((NamedList<Object>)(checkQueryResponse.getHeader().get(HEADER_PARAMS_NAME))); params.clear(); for (String paramName : query.getParameterNames()) { params.add(paramName, query.get(paramName)); } // Fill in the documents to return. checkQueryResponse.getResponse().setVal( checkQueryResponse.getResponse().indexOf(QUERY_RESPONSE_NAME, 0), solrDocumentList); // Fill in the time, the overall query took, including processing and permission check. checkQueryResponse.getResponseHeader().setVal( checkQueryResponse.getResponseHeader().indexOf(QUERY_TIME_NAME, 0), new Integer(new Long(System.currentTimeMillis() - startTime).intValue())); // Fill in the highlighting information from the result query. if (query.getHighlight()) { NamedList<Object> highlighting = (NamedList<Object>)resultQueryResponse.getResponse().get( QUERY_HIGHLIGHTING_NAME); // filter out highlighting for documents where access is not permitted. for (String filteredId : filteredResultIds) { highlighting.remove(filteredId); } NamedList<Object> completeResponse = new NamedList<Object>(1); completeResponse.addAll(checkQueryResponse.getResponse()); completeResponse.add(QUERY_HIGHLIGHTING_NAME, highlighting); checkQueryResponse.setResponse(completeResponse); } // build the result result = new CmsSolrResultList( query, checkQueryResponse, solrDocumentList, resourceDocumentList, start, new Integer(rows), end, rows > 0 ? (start / rows) + 1 : 0, //page - but matches only in case of equally sized pages and is zero for rows=0 (because this was this way before!?!) visibleHitCount, finalMaxScore, startTime, System.currentTimeMillis()); if (LOG.isDebugEnabled()) { Object[] logParams = new Object[] { new Long(System.currentTimeMillis() - startTime), new Long(result.getNumFound()), new Long(solrPermissionTime + solrResultTime), new Long(processTime), new Long(result.getHighlightEndTime() != 0 ? result.getHighlightEndTime() - startTime : 0)}; LOG.debug( query.toString() + "\n" + Messages.get().getBundle().key(Messages.LOG_SOLR_SEARCH_EXECUTED_5, logParams)); } // write the response for the handler if (response != null) { // create and return the result core = m_solr instanceof EmbeddedSolrServer ? ((EmbeddedSolrServer)m_solr).getCoreContainer().getCore(getCoreName()) : null; solrQueryRequest = new LocalSolrQueryRequest(core, query); SolrQueryResponse solrQueryResponse = new SolrQueryResponse(); solrQueryResponse.setAllValues(checkQueryResponse.getResponse()); writeResp(response, solrQueryRequest, solrQueryResponse); } } catch ( Exception e) { throw new CmsSearchException( Messages.get().container( Messages.LOG_SOLR_ERR_SEARCH_EXECUTION_FAILD_1, CmsEncoder.decode(query.toString()), e), e); } finally { if (solrQueryRequest != null) { solrQueryRequest.close(); } if (null != core) { core.close(); } // re-set thread to previous priority Thread.currentThread().setPriority(previousPriority); } return result; } /** * Default search method.<p> * * @param cms the current CMS object * @param query the query * * @return the results * * @throws CmsSearchException if something goes wrong * * @see #search(CmsObject, String) */ public CmsSolrResultList search(CmsObject cms, SolrQuery query) throws CmsSearchException { return search(cms, CmsEncoder.decode(query.toString())); } /** * Performs a search.<p> * * @param cms the cms object * @param solrQuery the Solr query * * @return a list of documents * * @throws CmsSearchException if something goes wrong * * @see #search(CmsObject, CmsSolrQuery, boolean) */ public CmsSolrResultList search(CmsObject cms, String solrQuery) throws CmsSearchException { return search(cms, new CmsSolrQuery(null, CmsRequestUtil.createParameterMap(solrQuery)), false); } /** * Writes the response into the writer.<p> * * NOTE: Currently not available for HTTP server.<p> * * @param response the servlet response * @param cms the CMS object to use for search * @param query the Solr query * @param ignoreMaxRows if to return unlimited results * * @throws Exception if there is no embedded server */ public void select(ServletResponse response, CmsObject cms, CmsSolrQuery query, boolean ignoreMaxRows) throws Exception { throwExceptionIfSafetyRestrictionsAreViolated(cms, query, false); boolean isOnline = cms.getRequestContext().getCurrentProject().isOnlineProject(); CmsResourceFilter filter = isOnline ? null : CmsResourceFilter.IGNORE_EXPIRATION; search(cms, query, ignoreMaxRows, response, false, filter); } /** * Sets the logical key/name of this search index.<p> * * @param name the logical key/name of this search index * * @throws CmsIllegalArgumentException if the given name is null, empty or already taken by another search index */ @Override public void setName(String name) throws CmsIllegalArgumentException { super.setName(name); updateCoreName(); } /** * Sets the search post processor.<p> * * @param postProcessor the search post processor to set */ public void setPostProcessor(I_CmsSolrPostSearchProcessor postProcessor) { m_postProcessor = postProcessor; } /** * Sets the Solr server used by this index.<p> * * @param client the server to set */ public void setSolrServer(SolrClient client) { m_solr = client; } /** * Executes a spell checking Solr query and returns the Solr query response.<p> * * @param res the servlet response * @param cms the CMS object * @param q the query * * @throws CmsSearchException if something goes wrong */ public void spellCheck(ServletResponse res, CmsObject cms, CmsSolrQuery q) throws CmsSearchException { throwExceptionIfSafetyRestrictionsAreViolated(cms, q, true); SolrCore core = null; LocalSolrQueryRequest solrQueryRequest = null; try { q.setRequestHandler("/spell"); QueryResponse queryResponse = m_solr.query(q); List<CmsSearchResource> resourceDocumentList = new ArrayList<CmsSearchResource>(); SolrDocumentList solrDocumentList = new SolrDocumentList(); if (m_postProcessor != null) { for (int i = 0; (i < queryResponse.getResults().size()); i++) { try { SolrDocument doc = queryResponse.getResults().get(i); CmsSolrDocument searchDoc = new CmsSolrDocument(doc); if (needsPermissionCheck(searchDoc)) { // only if the document is an OpenCms internal resource perform the permission check CmsResource resource = getResource(cms, searchDoc); if (resource != null) { // permission check performed successfully: the user has read permissions! if (m_postProcessor != null) { doc = m_postProcessor.process( cms, resource, (SolrInputDocument)searchDoc.getDocument()); } resourceDocumentList.add(new CmsSearchResource(resource, searchDoc)); solrDocumentList.add(doc); } } } catch (Exception e) { // should not happen, but if it does we want to go on with the next result nevertheless LOG.warn(Messages.get().getBundle().key(Messages.LOG_SOLR_ERR_RESULT_ITERATION_FAILED_0), e); } } queryResponse.getResponse().setVal( queryResponse.getResponse().indexOf(QUERY_RESPONSE_NAME, 0), solrDocumentList); } // create and return the result core = m_solr instanceof EmbeddedSolrServer ? ((EmbeddedSolrServer)m_solr).getCoreContainer().getCore(getCoreName()) : null; SolrQueryResponse solrQueryResponse = new SolrQueryResponse(); solrQueryResponse.setAllValues(queryResponse.getResponse()); // create and initialize the solr request solrQueryRequest = new LocalSolrQueryRequest(core, solrQueryResponse.getResponseHeader()); // set the OpenCms Solr query as parameters to the request solrQueryRequest.setParams(q); writeResp(res, solrQueryRequest, solrQueryResponse); } catch (Exception e) { throw new CmsSearchException( Messages.get().container(Messages.LOG_SOLR_ERR_SEARCH_EXECUTION_FAILD_1, q), e); } finally { if (solrQueryRequest != null) { solrQueryRequest.close(); } if (core != null) { core.close(); } } } /** * @see org.opencms.search.CmsSearchIndex#createIndexBackup() */ @Override protected String createIndexBackup() { if (!isBackupReindexing()) { // if no backup is generated we don't need to do anything return null; } if (m_solr instanceof EmbeddedSolrServer) { EmbeddedSolrServer ser = (EmbeddedSolrServer)m_solr; CoreContainer con = ser.getCoreContainer(); SolrCore core = con.getCore(getCoreName()); if (core != null) { try { SolrRequestHandler h = core.getRequestHandler("/replication"); if (h instanceof ReplicationHandler) { h.handleRequest( new LocalSolrQueryRequest(core, CmsRequestUtil.createParameterMap("?command=backup")), new SolrQueryResponse()); } } finally { core.close(); } } } return null; } /** * Check, if the current user has permissions on the document's resource. * @param cms the context * @param doc the solr document (from the search result) * @param filter the resource filter to use for checking permissions * @return <code>true</code> iff the resource mirrored by the search result can be read by the current user. */ protected boolean hasPermissions(CmsObject cms, CmsSolrDocument doc, CmsResourceFilter filter) { return null != (filter == null ? getResource(cms, doc) : getResource(cms, doc, filter)); } /** * @see org.opencms.search.CmsSearchIndex#indexSearcherClose() */ @SuppressWarnings("sync-override") @Override protected void indexSearcherClose() { // nothing to do here } /** * @see org.opencms.search.CmsSearchIndex#indexSearcherOpen(java.lang.String) */ @SuppressWarnings("sync-override") @Override protected void indexSearcherOpen(final String path) { // nothing to do here } /** * @see org.opencms.search.CmsSearchIndex#indexSearcherUpdate() */ @SuppressWarnings("sync-override") @Override protected void indexSearcherUpdate() { // nothing to do here } /** * Checks if the given resource should be indexed by this index or not.<p> * * @param res the resource candidate * * @return <code>true</code> if the given resource should be indexed or <code>false</code> if not */ @Override protected boolean isIndexing(CmsResource res) { if ((res != null) && (getSources() != null)) { I_CmsDocumentFactory result = OpenCms.getSearchManager().getDocumentFactory(res); for (CmsSearchIndexSource source : getSources()) { if (source.isIndexing(res.getRootPath(), CmsSolrDocumentContainerPage.TYPE_CONTAINERPAGE_SOLR) || source.isIndexing(res.getRootPath(), CmsSolrDocumentXmlContent.TYPE_XMLCONTENT_SOLR) || source.isIndexing(res.getRootPath(), result.getName())) { return true; } } } return false; } /** * Checks if the current user is allowed to access non-online indexes.<p> * * To access non-online indexes the current user must be a workplace user at least.<p> * * @param cms the CMS object initialized with the current request context / user * * @throws CmsSearchException thrown if the access is not permitted */ private void checkOfflineAccess(CmsObject cms) throws CmsSearchException { // If an offline index is being selected, check permissions if (!CmsProject.ONLINE_PROJECT_NAME.equals(getProject())) { // only if the user has the role Workplace user, he is allowed to access the Offline index try { OpenCms.getRoleManager().checkRole(cms, CmsRole.ELEMENT_AUTHOR); } catch (CmsRoleViolationException e) { throw new CmsSearchException( Messages.get().container( Messages.LOG_SOLR_ERR_SEARCH_PERMISSION_VIOLATION_2, getName(), cms.getRequestContext().getCurrentUser()), e); } } } /** * Generates a valid core name from the provided name (the index name). * @param name the index name. * @return the core name */ private String generateCoreName(final String name) { if (name != null) { return name.replace(" ", "-"); } return null; } /** * Checks if the query should be executed using the debug mode where the security restrictions do not apply. * @param cms the current context. * @param query the query to execute. * @return a flag, indicating, if the query should be performed in debug mode. */ private boolean isDebug(CmsObject cms, CmsSolrQuery query) { String[] debugSecretValues = query.remove(REQUEST_PARAM_DEBUG_SECRET); String debugSecret = (debugSecretValues == null) || (debugSecretValues.length < 1) ? null : debugSecretValues[0]; if ((null != debugSecret) && !debugSecret.trim().isEmpty() && (null != m_handlerDebugSecretFile)) { try { CmsFile secretFile = cms.readFile(m_handlerDebugSecretFile); String secret = new String(secretFile.getContents(), CmsFileUtil.getEncoding(cms, secretFile)); return secret.trim().equals(debugSecret.trim()); } catch (Exception e) { LOG.info( "Failed to read secret file for index \"" + getName() + "\" at path \"" + m_handlerDebugSecretFile + "\"."); } } return false; } /** * Throws an exception if the request can for security reasons not be performed. * Security restrictions can be set via parameters of the index. * * @param cms the current context. * @param query the query. * @param isSpell flag, indicating if the spellcheck handler is requested. * @throws CmsSearchException thrown if the query cannot be executed due to security reasons. */ private void throwExceptionIfSafetyRestrictionsAreViolated(CmsObject cms, CmsSolrQuery query, boolean isSpell) throws CmsSearchException { if (!isDebug(cms, query)) { if (isSpell) { if (m_handlerSpellDisabled) { throw new CmsSearchException(Messages.get().container(Messages.GUI_HANDLER_REQUEST_NOT_ALLOWED_0)); } } else { if (m_handlerSelectDisabled) { throw new CmsSearchException(Messages.get().container(Messages.GUI_HANDLER_REQUEST_NOT_ALLOWED_0)); } int start = null != query.getStart() ? query.getStart().intValue() : 0; int rows = null != query.getRows() ? query.getRows().intValue() : CmsSolrQuery.DEFAULT_ROWS.intValue(); if ((m_handlerMaxAllowedResultsAtAll >= 0) && ((rows + start) > m_handlerMaxAllowedResultsAtAll)) { throw new CmsSearchException( Messages.get().container( Messages.GUI_HANDLER_TOO_MANY_RESULTS_REQUESTED_AT_ALL_2, Integer.valueOf(m_handlerMaxAllowedResultsAtAll), Integer.valueOf(rows + start))); } if ((m_handlerMaxAllowedResultsPerPage >= 0) && (rows > m_handlerMaxAllowedResultsPerPage)) { throw new CmsSearchException( Messages.get().container( Messages.GUI_HANDLER_TOO_MANY_RESULTS_REQUESTED_PER_PAGE_2, Integer.valueOf(m_handlerMaxAllowedResultsPerPage), Integer.valueOf(rows))); } if ((null != m_handlerAllowedFields) && (Stream.of(m_handlerAllowedFields).anyMatch(x -> true))) { if (query.getFields().equals(CmsSolrQuery.ALL_RETURN_FIELDS)) { query.setFields(m_handlerAllowedFields); } else { for (String requestedField : query.getFields().split(",")) { if (Stream.of(m_handlerAllowedFields).noneMatch( allowedField -> allowedField.equals(requestedField))) { throw new CmsSearchException( Messages.get().container( Messages.GUI_HANDLER_REQUESTED_FIELD_NOT_ALLOWED_2, requestedField, Stream.of(m_handlerAllowedFields).reduce("", (a, b) -> a + "," + b))); } } } } } } } /** * Updates the core name to be in sync with the index name. */ private void updateCoreName() { m_coreName = generateCoreName(getName()); } /** * Writes the Solr response.<p> * * @param response the servlet response * @param queryRequest the Solr request * @param queryResponse the Solr response to write * * @throws IOException if sth. goes wrong * @throws UnsupportedEncodingException if sth. goes wrong */ private void writeResp(ServletResponse response, SolrQueryRequest queryRequest, SolrQueryResponse queryResponse) throws IOException, UnsupportedEncodingException { if (m_solr instanceof EmbeddedSolrServer) { SolrCore core = ((EmbeddedSolrServer)m_solr).getCoreContainer().getCore(getCoreName()); Writer out = null; try { QueryResponseWriter responseWriter = core.getQueryResponseWriter(queryRequest); final String ct = responseWriter.getContentType(queryRequest, queryResponse); if (null != ct) { response.setContentType(ct); } if (responseWriter instanceof BinaryQueryResponseWriter) { BinaryQueryResponseWriter binWriter = (BinaryQueryResponseWriter)responseWriter; binWriter.write(response.getOutputStream(), queryRequest, queryResponse); } else { String charset = ContentStreamBase.getCharsetFromContentType(ct); out = ((charset == null) || charset.equalsIgnoreCase(UTF8.toString())) ? new OutputStreamWriter(response.getOutputStream(), UTF8) : new OutputStreamWriter(response.getOutputStream(), charset); out = new FastWriter(out); responseWriter.write(out, queryRequest, queryResponse); out.flush(); } } finally { core.close(); if (out != null) { out.close(); } } } else { throw new UnsupportedOperationException(); } } }
src/org/opencms/search/solr/CmsSolrIndex.java
/* * File : $Source$ * Date : $Date$ * Version: $Revision$ * * This library is part of OpenCms - * the Open Source Content Management System * * Copyright (C) 2002 - 2009 Alkacon Software (http://www.alkacon.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * For further information about Alkacon Software, please see the * company website: http://www.alkacon.com * * For further information about OpenCms, please see the * project website: http://www.opencms.org * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.opencms.search.solr; import org.opencms.configuration.CmsConfigurationException; import org.opencms.configuration.CmsParameterConfiguration; import org.opencms.file.CmsFile; import org.opencms.file.CmsObject; import org.opencms.file.CmsProject; import org.opencms.file.CmsPropertyDefinition; import org.opencms.file.CmsResource; import org.opencms.file.CmsResourceFilter; import org.opencms.file.types.CmsResourceTypeXmlContainerPage; import org.opencms.file.types.CmsResourceTypeXmlContent; import org.opencms.i18n.CmsEncoder; import org.opencms.i18n.CmsLocaleManager; import org.opencms.main.CmsException; import org.opencms.main.CmsIllegalArgumentException; import org.opencms.main.CmsLog; import org.opencms.main.OpenCms; import org.opencms.report.I_CmsReport; import org.opencms.search.CmsSearchException; import org.opencms.search.CmsSearchIndex; import org.opencms.search.CmsSearchIndexSource; import org.opencms.search.CmsSearchManager; import org.opencms.search.CmsSearchParameters; import org.opencms.search.CmsSearchResource; import org.opencms.search.CmsSearchResultList; import org.opencms.search.I_CmsIndexWriter; import org.opencms.search.I_CmsSearchDocument; import org.opencms.search.documents.I_CmsDocumentFactory; import org.opencms.search.fields.CmsSearchField; import org.opencms.search.galleries.CmsGallerySearchParameters; import org.opencms.search.galleries.CmsGallerySearchResult; import org.opencms.search.galleries.CmsGallerySearchResultList; import org.opencms.security.CmsRole; import org.opencms.security.CmsRoleViolationException; import org.opencms.util.CmsFileUtil; import org.opencms.util.CmsRequestUtil; import org.opencms.util.CmsStringUtil; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; import java.io.Writer; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Optional; import java.util.Set; import java.util.stream.Stream; import javax.servlet.ServletResponse; import org.apache.commons.logging.Log; import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer; import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.common.SolrDocument; import org.apache.solr.common.SolrDocumentList; import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.util.ContentStreamBase; import org.apache.solr.common.util.NamedList; import org.apache.solr.core.CoreContainer; import org.apache.solr.core.SolrCore; import org.apache.solr.handler.ReplicationHandler; import org.apache.solr.request.LocalSolrQueryRequest; import org.apache.solr.request.SolrQueryRequest; import org.apache.solr.request.SolrRequestHandler; import org.apache.solr.response.BinaryQueryResponseWriter; import org.apache.solr.response.QueryResponseWriter; import org.apache.solr.response.SolrQueryResponse; import org.apache.solr.util.FastWriter; import com.google.common.base.Objects; /** * Implements the search within an Solr index.<p> * * @since 8.5.0 */ public class CmsSolrIndex extends CmsSearchIndex { /** The serial version id. */ private static final long serialVersionUID = -1570077792574476721L; /** The name of the default Solr Offline index. */ public static final String DEFAULT_INDEX_NAME_OFFLINE = "Solr Offline"; /** The name of the default Solr Online index. */ public static final String DEFAULT_INDEX_NAME_ONLINE = "Solr Online"; /** Constant for additional parameter to set the post processor class name. */ public static final String POST_PROCESSOR = "search.solr.postProcessor"; /** * Constant for additional parameter to set the maximally processed results (start + rows) for searches with this index. * It overwrites the global configuration from {@link CmsSolrConfiguration#getMaxProcessedResults()} for this index. **/ public static final String SOLR_SEARCH_MAX_PROCESSED_RESULTS = "search.solr.maxProcessedResults"; /** Constant for additional parameter to set the fields the select handler should return at maximum. */ public static final String SOLR_HANDLER_ALLOWED_FIELDS = "handle.solr.allowedFields"; /** Constant for additional parameter to set the number results the select handler should return at maxium per request. */ public static final String SOLR_HANDLER_MAX_ALLOWED_RESULTS_PER_PAGE = "handle.solr.maxAllowedResultsPerPage"; /** Constant for additional parameter to set the maximal number of a result, the select handler should return. */ public static final String SOLR_HANDLER_MAX_ALLOWED_RESULTS_AT_ALL = "handle.solr.maxAllowedResultsAtAll"; /** Constant for additional parameter to disable the select handler (except for debug mode). */ private static final String SOLR_HANDLER_DISABLE_SELECT = "handle.solr.disableSelectHandler"; /** Constant for additional parameter to set the VFS path to the file holding the debug secret. */ private static final String SOLR_HANDLER_DEBUG_SECRET_FILE = "handle.solr.debugSecretFile"; /** Constant for additional parameter to disable the spell handler (except for debug mode). */ private static final String SOLR_HANDLER_DISABLE_SPELL = "handle.solr.disableSpellHandler"; /** The solr exclude property. */ public static final String PROPERTY_SEARCH_EXCLUDE_VALUE_SOLR = "solr"; /** Indicates the maximum number of documents from the complete result set to return. */ public static final int ROWS_MAX = 50; /** The constant for an unlimited maximum number of results to return in a Solr search. */ public static final int MAX_RESULTS_UNLIMITED = -1; /** The constant for an unlimited maximum number of results to return in a Solr search. */ public static final int MAX_RESULTS_GALLERY = 10000; /** A constant for debug formatting output. */ protected static final int DEBUG_PADDING_RIGHT = 50; /** The name for the parameters key of the response header. */ private static final String HEADER_PARAMS_NAME = "params"; /** The log object for this class. */ private static final Log LOG = CmsLog.getLog(CmsSolrIndex.class); /** Pseudo resource used for not permission checked indexes. */ private static final CmsResource PSEUDO_RES = new CmsResource( null, null, null, 0, false, 0, null, null, 0L, null, 0L, null, 0L, 0L, 0, 0, 0L, 0); /** The name of the key that is used for the result documents inside the Solr query response. */ private static final String QUERY_RESPONSE_NAME = "response"; /** The name of the key that is used for the query time. */ private static final String QUERY_TIME_NAME = "QTime"; /** The name of the key that is used for the query time. */ private static final String QUERY_HIGHLIGHTING_NAME = "highlighting"; /** A constant for UTF-8 charset. */ private static final Charset UTF8 = Charset.forName("UTF-8"); /** The name of the request parameter holding the debug secret. */ private static final String REQUEST_PARAM_DEBUG_SECRET = "_debug"; /** The name of the query parameter enabling spell checking. */ private static final String QUERY_SPELLCHECK_NAME = "spellcheck"; /** The name of the query parameter sorting. */ private static final String QUERY_SORT_NAME = "sort"; /** The name of the query parameter expand. */ private static final String QUERY_PARAM_EXPAND = "expand"; /** The embedded Solr client for this index. */ transient SolrClient m_solr; /** The post document manipulator. */ private transient I_CmsSolrPostSearchProcessor m_postProcessor; /** The core name for the index. */ private transient String m_coreName; /** The list of allowed fields to return. */ private String[] m_handlerAllowedFields; /** The number of maximally allowed results per page when using the handler. */ private int m_handlerMaxAllowedResultsPerPage = -1; /** The number of maximally allowed results at all when using the handler. */ private int m_handlerMaxAllowedResultsAtAll = -1; /** Flag, indicating if the handler only works in debug mode. */ private boolean m_handlerSelectDisabled; /** Path to the secret file. Must be under /system/.../ or /shared/.../ and readable by all users that should be able to debug. */ private String m_handlerDebugSecretFile; /** Flag, indicating if the spellcheck handler is disabled for the index. */ private boolean m_handlerSpellDisabled; /** The maximal number of results to process for search queries. */ int m_maxProcessedResults = -2; // special value for not initialized. /** * Default constructor.<p> */ public CmsSolrIndex() { super(); } /** * Public constructor to create a Solr index.<p> * * @param name the name for this index.<p> * * @throws CmsIllegalArgumentException if something goes wrong */ public CmsSolrIndex(String name) throws CmsIllegalArgumentException { super(name); } /** * Returns the resource type for the given root path.<p> * * @param cms the current CMS context * @param rootPath the root path of the resource to get the type for * * @return the resource type for the given root path */ public static final String getType(CmsObject cms, String rootPath) { String type = null; CmsSolrIndex index = CmsSearchManager.getIndexSolr(cms, null); if (index != null) { I_CmsSearchDocument doc = index.getDocument(CmsSearchField.FIELD_PATH, rootPath); if (doc != null) { type = doc.getFieldValueAsString(CmsSearchField.FIELD_TYPE); } } return type; } /** * @see org.opencms.search.CmsSearchIndex#addConfigurationParameter(java.lang.String, java.lang.String) */ @Override public void addConfigurationParameter(String key, String value) { switch (key) { case POST_PROCESSOR: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { try { setPostProcessor((I_CmsSolrPostSearchProcessor)Class.forName(value).newInstance()); } catch (Exception e) { CmsException ex = new CmsException( Messages.get().container(Messages.LOG_SOLR_ERR_POST_PROCESSOR_NOT_EXIST_1, value), e); LOG.error(ex.getMessage(), ex); } } break; case SOLR_HANDLER_ALLOWED_FIELDS: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { m_handlerAllowedFields = Stream.of(value.split(",")).map(v -> v.trim()).toArray(String[]::new); } break; case SOLR_HANDLER_MAX_ALLOWED_RESULTS_PER_PAGE: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { try { m_handlerMaxAllowedResultsPerPage = Integer.parseInt(value); } catch (NumberFormatException e) { LOG.warn( "Could not parse parameter \"" + SOLR_HANDLER_MAX_ALLOWED_RESULTS_PER_PAGE + "\" for index \"" + getName() + "\". Results per page will not be restricted."); } } break; case SOLR_HANDLER_MAX_ALLOWED_RESULTS_AT_ALL: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { try { m_handlerMaxAllowedResultsAtAll = Integer.parseInt(value); } catch (NumberFormatException e) { LOG.warn( "Could not parse parameter \"" + SOLR_HANDLER_MAX_ALLOWED_RESULTS_AT_ALL + "\" for index \"" + getName() + "\". Results per page will not be restricted."); } } break; case SOLR_HANDLER_DISABLE_SELECT: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { m_handlerSelectDisabled = value.trim().toLowerCase().equals("true"); } break; case SOLR_HANDLER_DEBUG_SECRET_FILE: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { m_handlerDebugSecretFile = value.trim(); } break; case SOLR_HANDLER_DISABLE_SPELL: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { m_handlerSpellDisabled = value.trim().toLowerCase().equals("true"); } break; case SOLR_SEARCH_MAX_PROCESSED_RESULTS: if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { try { m_maxProcessedResults = Integer.parseInt(value); } catch (NumberFormatException e) { LOG.warn( "Could not parse parameter \"" + SOLR_SEARCH_MAX_PROCESSED_RESULTS + "\" for index \"" + getName() + "\". The global configuration will be used instead."); } } break; default: super.addConfigurationParameter(key, value); break; } } /** * @see org.opencms.search.CmsSearchIndex#createEmptyDocument(org.opencms.file.CmsResource) */ @Override public I_CmsSearchDocument createEmptyDocument(CmsResource resource) { CmsSolrDocument doc = new CmsSolrDocument(new SolrInputDocument()); doc.setId(resource.getStructureId()); return doc; } /** * @see org.opencms.search.CmsSearchIndex#createIndexWriter(boolean, org.opencms.report.I_CmsReport) */ @Override public I_CmsIndexWriter createIndexWriter(boolean create, I_CmsReport report) { return new CmsSolrIndexWriter(m_solr, this); } /** * @see org.opencms.search.CmsSearchIndex#excludeFromIndex(CmsObject, CmsResource) */ @Override public boolean excludeFromIndex(CmsObject cms, CmsResource resource) { if (resource.isFolder() || resource.isTemporaryFile()) { // don't index folders or temporary files for galleries, but pretty much everything else return true; } // If this is the default offline index than it is used for gallery search that needs all resources indexed. if (this.getName().equals(DEFAULT_INDEX_NAME_OFFLINE)) { return false; } boolean isOnlineIndex = getProject().equals(CmsProject.ONLINE_PROJECT_NAME); if (isOnlineIndex && (resource.getDateExpired() <= System.currentTimeMillis())) { return true; } try { // do property lookup with folder search String propValue = cms.readPropertyObject( resource, CmsPropertyDefinition.PROPERTY_SEARCH_EXCLUDE, true).getValue(); if (propValue != null) { if (!("false".equalsIgnoreCase(propValue.trim()))) { return true; } } } catch (CmsException e) { if (LOG.isDebugEnabled()) { LOG.debug( org.opencms.search.Messages.get().getBundle().key( org.opencms.search.Messages.LOG_UNABLE_TO_READ_PROPERTY_1, resource.getRootPath())); } } if (!USE_ALL_LOCALE.equalsIgnoreCase(getLocale().getLanguage())) { // check if any resource default locale has a match with the index locale, if not skip resource List<Locale> locales = OpenCms.getLocaleManager().getDefaultLocales(cms, resource); Locale match = OpenCms.getLocaleManager().getFirstMatchingLocale( Collections.singletonList(getLocale()), locales); return (match == null); } return false; } /** * Performs a search with according to the gallery search parameters.<p> * * @param cms the cms context * @param params the search parameters * * @return the search result */ public CmsGallerySearchResultList gallerySearch(CmsObject cms, CmsGallerySearchParameters params) { CmsGallerySearchResultList resultList = new CmsGallerySearchResultList(); try { CmsSolrResultList list = search( cms, params.getQuery(cms), false, null, true, CmsResourceFilter.ONLY_VISIBLE_NO_DELETED, MAX_RESULTS_GALLERY); // ignore the maximally searched number of contents. if (null == list) { return null; } resultList.setHitCount(Long.valueOf(list.getNumFound()).intValue()); for (CmsSearchResource resource : list) { I_CmsSearchDocument document = resource.getDocument(); Locale locale = CmsLocaleManager.getLocale(params.getLocale()); CmsGallerySearchResult result = new CmsGallerySearchResult( document, cms, (int)document.getScore(), locale); resultList.add(result); } } catch (CmsSearchException e) { LOG.error(e.getMessage(), e); } return resultList; } /** * @see org.opencms.search.CmsSearchIndex#getConfiguration() */ @Override public CmsParameterConfiguration getConfiguration() { CmsParameterConfiguration result = super.getConfiguration(); if (getPostProcessor() != null) { result.put(POST_PROCESSOR, getPostProcessor().getClass().getName()); } return result; } /** * Returns the name of the core of the index. * NOTE: Index and core name differ since OpenCms 10.5 due to new naming rules for cores in SOLR. * * @return the name of the core of the index. */ public String getCoreName() { return m_coreName; } /** * @see org.opencms.search.CmsSearchIndex#getDocument(java.lang.String, java.lang.String) */ @Override public synchronized I_CmsSearchDocument getDocument(String fieldname, String term) { return getDocument(fieldname, term, null); } /** * Version of {@link org.opencms.search.CmsSearchIndex#getDocument(java.lang.String, java.lang.String)} where * the returned fields can be restricted. * * @param fieldname the field to query in * @param term the query * @param fls the returned fields. * @return the document. */ public synchronized I_CmsSearchDocument getDocument(String fieldname, String term, String[] fls) { try { SolrQuery query = new SolrQuery(); if (CmsSearchField.FIELD_PATH.equals(fieldname)) { query.setQuery(fieldname + ":\"" + term + "\""); } else { query.setQuery(fieldname + ":" + term); } query.addFilterQuery("{!collapse field=" + fieldname + "}"); if (null != fls) { query.setFields(fls); } QueryResponse res = m_solr.query(query); if (res != null) { SolrDocumentList sdl = m_solr.query(query).getResults(); if ((sdl.getNumFound() > 0L) && (sdl.get(0) != null)) { return new CmsSolrDocument(sdl.get(0)); } } } catch (Exception e) { // ignore and assume that the document could not be found LOG.error(e.getMessage(), e); } return null; } /** * @see org.opencms.search.CmsSearchIndex#getDocumentFactory(org.opencms.file.CmsResource) */ @Override public I_CmsDocumentFactory getDocumentFactory(CmsResource res) { if (isIndexing(res)) { I_CmsDocumentFactory defaultFactory = super.getDocumentFactory(res); if (null == defaultFactory) { if (OpenCms.getResourceManager().getResourceType(res) instanceof CmsResourceTypeXmlContainerPage) { return OpenCms.getSearchManager().getDocumentFactory( CmsSolrDocumentContainerPage.TYPE_CONTAINERPAGE_SOLR, "text/html"); } if (CmsResourceTypeXmlContent.isXmlContent(res)) { return OpenCms.getSearchManager().getDocumentFactory( CmsSolrDocumentXmlContent.TYPE_XMLCONTENT_SOLR, "text/html"); } } return defaultFactory; } return null; } /** * Returns the language locale for the given resource in this index.<p> * * @param cms the current OpenCms user context * @param resource the resource to check * @param availableLocales a list of locales supported by the resource * * @return the language locale for the given resource in this index */ @Override public Locale getLocaleForResource(CmsObject cms, CmsResource resource, List<Locale> availableLocales) { Locale result = null; List<Locale> defaultLocales = OpenCms.getLocaleManager().getDefaultLocales(cms, resource); if ((availableLocales != null) && (availableLocales.size() > 0)) { result = OpenCms.getLocaleManager().getBestMatchingLocale( defaultLocales.get(0), defaultLocales, availableLocales); } if (result == null) { result = ((availableLocales != null) && availableLocales.isEmpty()) ? availableLocales.get(0) : defaultLocales.get(0); } return result; } /** * Returns the maximal number of results (start + rows) that are processed for each search query unless another * maximum is explicitly specified in {@link #search(CmsObject, CmsSolrQuery, boolean, ServletResponse, boolean, CmsResourceFilter, int)}. * * @return the maximal number of results (start + rows) that are processed for a search query. */ public int getMaxProcessedResults() { return m_maxProcessedResults; } /** * Returns the search post processor.<p> * * @return the post processor to use */ public I_CmsSolrPostSearchProcessor getPostProcessor() { return m_postProcessor; } /** * @see org.opencms.search.CmsSearchIndex#initialize() */ @Override public void initialize() throws CmsSearchException { super.initialize(); if (m_maxProcessedResults == -2) { m_maxProcessedResults = OpenCms.getSearchManager().getSolrServerConfiguration().getMaxProcessedResults(); } try { OpenCms.getSearchManager().registerSolrIndex(this); } catch (CmsConfigurationException ex) { LOG.error(ex.getMessage(), ex); setEnabled(false); } } /** Returns a flag, indicating if the Solr server is not yet set. * @return a flag, indicating if the Solr server is not yet set. */ public boolean isNoSolrServerSet() { return null == m_solr; } /** * Not yet implemented for Solr.<p> * * <code> * #################<br> * ### DON'T USE ###<br> * #################<br> * </code> * * @deprecated Use {@link #search(CmsObject, SolrQuery)} or {@link #search(CmsObject, String)} instead */ @Override @Deprecated public synchronized CmsSearchResultList search(CmsObject cms, CmsSearchParameters params) { throw new UnsupportedOperationException(); } /** * Default search method.<p> * * @param cms the current CMS object * @param query the query * * @return the results * * @throws CmsSearchException if something goes wrong * * @see #search(CmsObject, String) */ public CmsSolrResultList search(CmsObject cms, CmsSolrQuery query) throws CmsSearchException { return search(cms, query, false); } /** * Performs a search.<p> * * Returns a list of 'OpenCms resource documents' * ({@link CmsSearchResource}) encapsulated within the class {@link CmsSolrResultList}. * This list can be accessed exactly like an {@link List} which entries are * {@link CmsSearchResource} that extend {@link CmsResource} and holds the Solr * implementation of {@link I_CmsSearchDocument} as member. <b>This enables you to deal * with the resulting list as you do with well known {@link List} and work on it's entries * like you do on {@link CmsResource}.</b> * * <h4>What will be done with the Solr search result?</h4> * <ul> * <li>Although it can happen, that there are less results returned than rows were requested * (imagine an index containing less documents than requested rows) we try to guarantee * the requested amount of search results and to provide a working pagination with * security check.</li> * * <li>To be sure we get enough documents left even the permission check reduces the amount * of found documents, the rows are multiplied by <code>'5'</code> and the current page * additionally the offset is added. The count of documents we don't have enough * permissions for grows with increasing page number, that's why we also multiply * the rows by the current page count.</li> * * <li>Also make sure we perform the permission check for all found documents, so start with * the first found doc.</li> * </ul> * * <b>NOTE:</b> If latter pages than the current one are containing protected documents the * total hit count will be incorrect, because the permission check ends if we have * enough results found for the page to display. With other words latter pages than * the current can contain documents that will first be checked if those pages are * requested to be displayed, what causes a incorrect hit count.<p> * * @param cms the current OpenCms context * @param ignoreMaxRows <code>true</code> to return all all requested rows, <code>false</code> to use max rows * @param query the OpenCms Solr query * * @return the list of found documents * * @throws CmsSearchException if something goes wrong * * @see org.opencms.search.solr.CmsSolrResultList * @see org.opencms.search.CmsSearchResource * @see org.opencms.search.I_CmsSearchDocument * @see org.opencms.search.solr.CmsSolrQuery */ public CmsSolrResultList search(CmsObject cms, final CmsSolrQuery query, boolean ignoreMaxRows) throws CmsSearchException { return search(cms, query, ignoreMaxRows, null, false, null); } /** * Like {@link #search(CmsObject, CmsSolrQuery, boolean)}, but additionally a resource filter can be specified. * By default, the filter depends on the index. * * @param cms the current OpenCms context * @param ignoreMaxRows <code>true</code> to return all all requested rows, <code>false</code> to use max rows * @param query the OpenCms Solr query * @param filter the resource filter to use for post-processing. * * @return the list of documents found. * * @throws CmsSearchException if something goes wrong */ public CmsSolrResultList search( CmsObject cms, final CmsSolrQuery query, boolean ignoreMaxRows, final CmsResourceFilter filter) throws CmsSearchException { return search(cms, query, ignoreMaxRows, null, false, filter); } /** * Performs the actual search.<p> * * @param cms the current OpenCms context * @param query the OpenCms Solr query * @param ignoreMaxRows <code>true</code> to return all all requested rows, <code>false</code> to use max rows * @param response the servlet response to write the query result to, may also be <code>null</code> * @param ignoreSearchExclude if set to false, only contents with search_exclude unset or "false" will be found - typical for the the non-gallery case * @param filter the resource filter to use * * @return the found documents * * @throws CmsSearchException if something goes wrong * * @see #search(CmsObject, CmsSolrQuery, boolean) */ public CmsSolrResultList search( CmsObject cms, final CmsSolrQuery query, boolean ignoreMaxRows, ServletResponse response, boolean ignoreSearchExclude, CmsResourceFilter filter) throws CmsSearchException { return search(cms, query, ignoreMaxRows, response, ignoreSearchExclude, filter, getMaxProcessedResults()); } /** * Performs the actual search.<p> * * To provide for correct permissions two queries are performed and the response is fused from that queries: * <ol> * <li>a query for permission checking, where fl, start and rows is adjusted. From this query result we take for the response: * <ul> * <li>facets</li> * <li>spellcheck</li> * <li>suggester</li> * <li>morelikethis</li> * <li>clusters</li> * </ul> * </li> * <li>a query that collects only the resources determined by the first query and performs highlighting. From this query we take for the response: * <li>result</li> * <li>highlighting</li> * </li> *</ol> * * Currently not or only partly supported Solr features are: * <ul> * <li>groups</li> * <li>collapse - representatives of the collapsed group might be filtered by the permission check</li> * <li>expand is disabled</li> * </ul> * * @param cms the current OpenCms context * @param query the OpenCms Solr query * @param ignoreMaxRows <code>true</code> to return all requested rows, <code>false</code> to use max rows * @param response the servlet response to write the query result to, may also be <code>null</code> * @param ignoreSearchExclude if set to false, only contents with search_exclude unset or "false" will be found - typical for the the non-gallery case * @param filter the resource filter to use * @param maxNumResults the maximal number of results to search for * * @return the found documents * * @throws CmsSearchException if something goes wrong * * @see #search(CmsObject, CmsSolrQuery, boolean) */ @SuppressWarnings("unchecked") public CmsSolrResultList search( CmsObject cms, final CmsSolrQuery query, boolean ignoreMaxRows, ServletResponse response, boolean ignoreSearchExclude, CmsResourceFilter filter, int maxNumResults) throws CmsSearchException { CmsSolrResultList result = null; long startTime = System.currentTimeMillis(); // TODO: // - fall back to "last found results" if none are present at the "last page"? // - deal with cursorMarks? // - deal with groups? // - deal with result clustering? // - remove max score calculation? if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_SOLR_DEBUG_ORIGINAL_QUERY_2, query, getName())); } // change thread priority in order to reduce search impact on overall system performance int previousPriority = Thread.currentThread().getPriority(); if (getPriority() > 0) { Thread.currentThread().setPriority(getPriority()); } // check if the user is allowed to access this index checkOfflineAccess(cms); if (!ignoreSearchExclude) { if (LOG.isInfoEnabled()) { LOG.info( Messages.get().getBundle().key( Messages.LOG_SOLR_INFO_ADDING_SEARCH_EXCLUDE_FILTER_FOR_QUERY_2, query, getName())); } query.addFilterQuery(CmsSearchField.FIELD_SEARCH_EXCLUDE + ":\"false\""); } // get start parameter from the request int start = null == query.getStart() ? 0 : query.getStart().intValue(); // correct negative start values to 0. if (start < 0) { query.setStart(Integer.valueOf(0)); start = 0; } // Adjust the maximal number of results to process in case it is unlimited. if (maxNumResults < 0) { maxNumResults = Integer.MAX_VALUE; if (LOG.isInfoEnabled()) { LOG.info( Messages.get().getBundle().key( Messages.LOG_SOLR_INFO_LIMITING_MAX_PROCESSED_RESULTS_3, query, getName(), Integer.valueOf(maxNumResults))); } } // Correct the rows parameter // Set the default rows, if rows are not set in the original query. int rows = null == query.getRows() ? CmsSolrQuery.DEFAULT_ROWS.intValue() : query.getRows().intValue(); // Restrict the rows, such that the maximal number of queryable results is not exceeded. if ((((rows + start) > maxNumResults) || ((rows + start) < 0))) { rows = maxNumResults - start; } // Restrict the rows to the maximally allowed number, if they should be restricted. if (!ignoreMaxRows && (rows > ROWS_MAX)) { if (LOG.isInfoEnabled()) { LOG.info( Messages.get().getBundle().key( Messages.LOG_SOLR_INFO_LIMITING_MAX_ROWS_4, new Object[] {query, getName(), Integer.valueOf(rows), Integer.valueOf(ROWS_MAX)})); } rows = ROWS_MAX; } // If start is higher than maxNumResults, the rows could be negative here - correct this. if (rows < 0) { if (LOG.isInfoEnabled()) { LOG.info( Messages.get().getBundle().key( Messages.LOG_SOLR_INFO_CORRECTING_ROWS_4, new Object[] {query, getName(), Integer.valueOf(rows), Integer.valueOf(0)})); } rows = 0; } // Set the corrected rows for the query. query.setRows(Integer.valueOf(rows)); // remove potentially set expand parameter if (null != query.getParams(QUERY_PARAM_EXPAND)) { LOG.info(Messages.get().getBundle().key(Messages.LOG_SOLR_INFO_REMOVING_EXPAND_2, query, getName())); query.remove("expand"); } float maxScore = 0; LocalSolrQueryRequest solrQueryRequest = null; SolrCore core = null; String[] sortParamValues = query.getParams(QUERY_SORT_NAME); boolean sortByScoreDesc = (null == sortParamValues) || (sortParamValues.length == 0) || Objects.equal(sortParamValues[0], "score desc"); try { // initialize the search context CmsObject searchCms = OpenCms.initCmsObject(cms); //////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////// QUERY FOR PERMISSION CHECK, FACETS, SPELLCHECK, SUGGESTIONS /////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Clone the query and keep the original one CmsSolrQuery checkQuery = query.clone(); // Initialize rows, offset, end and the current page. int end = start + rows; int itemsToCheck = Math.max(10, end + (end / 5)); // request 20 percent more, but at least 10 results if permissions are filtered // use a set to prevent double entries if multiple check queries are performed. Set<String> resultSolrIds = new HashSet<>(rows); // rows are set before definitely. // counter for the documents found and accessible int cnt = 0; long hitCount = 0; long visibleHitCount = 0; int processedResults = 0; long solrPermissionTime = 0; // disable highlighting - it's done in the next query. checkQuery.setHighlight(false); // adjust rows and start for the permission check. checkQuery.setRows(Integer.valueOf(Math.min(maxNumResults - processedResults, itemsToCheck))); checkQuery.setStart(Integer.valueOf(processedResults)); // return only the fields required for the permission check and for scoring checkQuery.setFields(CmsSearchField.FIELD_TYPE, CmsSearchField.FIELD_SOLR_ID, CmsSearchField.FIELD_PATH); List<String> originalFields = Arrays.asList(query.getFields().split(",")); if (originalFields.contains(CmsSearchField.FIELD_SCORE)) { checkQuery.addField(CmsSearchField.FIELD_SCORE); } if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_SOLR_DEBUG_CHECK_QUERY_2, checkQuery, getName())); } // perform the permission check Solr query and remember the response and time Solr took. long solrCheckTime = System.currentTimeMillis(); QueryResponse checkQueryResponse = m_solr.query(checkQuery); solrCheckTime = System.currentTimeMillis() - solrCheckTime; solrPermissionTime += solrCheckTime; // initialize the counts hitCount = checkQueryResponse.getResults().getNumFound(); int maxToProcess = Long.valueOf(Math.min(hitCount, maxNumResults)).intValue(); visibleHitCount = hitCount; // process found documents for (SolrDocument doc : checkQueryResponse.getResults()) { try { CmsSolrDocument searchDoc = new CmsSolrDocument(doc); if (needsPermissionCheck(searchDoc) && !hasPermissions(searchCms, searchDoc, filter)) { visibleHitCount--; } else { if (cnt >= start) { resultSolrIds.add(searchDoc.getFieldValueAsString(CmsSearchField.FIELD_SOLR_ID)); } if (sortByScoreDesc && (searchDoc.getScore() > maxScore)) { maxScore = searchDoc.getScore(); } if (++cnt >= end) { break; } } } catch (Exception e) { // should not happen, but if it does we want to go on with the next result nevertheless visibleHitCount--; LOG.warn(Messages.get().getBundle().key(Messages.LOG_SOLR_ERR_RESULT_ITERATION_FAILED_0), e); } } processedResults += checkQueryResponse.getResults().size(); if ((resultSolrIds.size() < rows) && (processedResults < maxToProcess)) { CmsSolrQuery secondCheckQuery = checkQuery.clone(); // disable all features not necessary, since results are present from the first check query. secondCheckQuery.setFacet(false); secondCheckQuery.setMoreLikeThis(false); secondCheckQuery.set(QUERY_SPELLCHECK_NAME, false); do { // query directly more under certain conditions to reduce number of queries itemsToCheck = itemsToCheck < 3000 ? itemsToCheck * 4 : itemsToCheck; // adjust rows and start for the permission check. secondCheckQuery.setRows( Integer.valueOf( Long.valueOf(Math.min(maxToProcess - processedResults, itemsToCheck)).intValue())); secondCheckQuery.setStart(Integer.valueOf(processedResults)); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_SOLR_DEBUG_SECONDCHECK_QUERY_2, secondCheckQuery, getName())); } long solrSecondCheckTime = System.currentTimeMillis(); QueryResponse secondCheckQueryResponse = m_solr.query(secondCheckQuery); processedResults += secondCheckQueryResponse.getResults().size(); solrSecondCheckTime = System.currentTimeMillis() - solrSecondCheckTime; solrPermissionTime += solrCheckTime; // process found documents for (SolrDocument doc : secondCheckQueryResponse.getResults()) { try { CmsSolrDocument searchDoc = new CmsSolrDocument(doc); String docSolrId = searchDoc.getFieldValueAsString(CmsSearchField.FIELD_SOLR_ID); if ((needsPermissionCheck(searchDoc) && !hasPermissions(searchCms, searchDoc, filter)) || resultSolrIds.contains(docSolrId)) { visibleHitCount--; } else { if (cnt >= start) { resultSolrIds.add(docSolrId); } if (sortByScoreDesc && (searchDoc.getScore() > maxScore)) { maxScore = searchDoc.getScore(); } if (++cnt >= end) { break; } } } catch (Exception e) { // should not happen, but if it does we want to go on with the next result nevertheless visibleHitCount--; LOG.warn( Messages.get().getBundle().key(Messages.LOG_SOLR_ERR_RESULT_ITERATION_FAILED_0), e); } } } while ((resultSolrIds.size() < rows) && (processedResults < maxToProcess)); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////// QUERY FOR RESULTS AND HIGHLIGHTING //////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////// // the lists storing the found documents that will be returned List<CmsSearchResource> resourceDocumentList = new ArrayList<CmsSearchResource>(resultSolrIds.size()); SolrDocumentList solrDocumentList = new SolrDocumentList(); long solrResultTime = 0; // If we're using a post-processor, (re-)initialize it before using it if (m_postProcessor != null) { m_postProcessor.init(); } // build the query for getting the results SolrQuery queryForResults = new SolrQuery(); queryForResults.setFields(query.getFields()); queryForResults.setQuery(query.getQuery()); // we add an additional filter, such that we can only find the documents we want to retrieve, as we figured out in the check query. if (!resultSolrIds.isEmpty()) { Optional<String> queryFilterString = resultSolrIds.stream().map(a -> '"' + a + '"').reduce( (a, b) -> a + " OR " + b); queryForResults.addFilterQuery(CmsSearchField.FIELD_SOLR_ID + ":(" + queryFilterString.get() + ")"); } queryForResults.setRows(Integer.valueOf(resultSolrIds.size())); queryForResults.setStart(Integer.valueOf(0)); // use sorting as in the original query. queryForResults.setSorts(query.getSorts()); if (null != sortParamValues) { queryForResults.add(QUERY_SORT_NAME, sortParamValues); } // Take over highlighting part, if the original query had highlighting enabled. if (query.getHighlight()) { for (String paramName : query.getParameterNames()) { if (paramName.startsWith("hl")) { queryForResults.add(paramName, query.getParams(paramName)); } } } if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_SOLR_DEBUG_RESULT_QUERY_2, queryForResults, getName())); } // perform the result query. solrResultTime = System.currentTimeMillis(); QueryResponse resultQueryResponse = m_solr.query(queryForResults); solrResultTime = System.currentTimeMillis() - solrResultTime; // List containing solr ids of filtered contents for which highlighting has to be removed. // Since we checked permissions just a few milliseconds ago, this should typically stay empty. List<String> filteredResultIds = new ArrayList<>(5); for (SolrDocument doc : resultQueryResponse.getResults()) { try { CmsSolrDocument searchDoc = new CmsSolrDocument(doc); if (needsPermissionCheck(searchDoc)) { CmsResource resource = filter == null ? getResource(searchCms, searchDoc) : getResource(searchCms, searchDoc, filter); if (null != resource) { if (m_postProcessor != null) { doc = m_postProcessor.process( searchCms, resource, (SolrInputDocument)searchDoc.getDocument()); } resourceDocumentList.add(new CmsSearchResource(resource, searchDoc)); solrDocumentList.add(doc); } else { filteredResultIds.add(searchDoc.getFieldValueAsString(CmsSearchField.FIELD_SOLR_ID)); } } else { // should not happen unless the index has changed since the first query. resourceDocumentList.add(new CmsSearchResource(PSEUDO_RES, searchDoc)); solrDocumentList.add(doc); visibleHitCount--; } } catch (Exception e) { // should not happen, but if it does we want to go on with the next result nevertheless visibleHitCount--; LOG.warn(Messages.get().getBundle().key(Messages.LOG_SOLR_ERR_RESULT_ITERATION_FAILED_0), e); } } long processTime = System.currentTimeMillis() - startTime - solrPermissionTime - solrResultTime; //////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////// CREATE THE FINAL RESPONSE ///////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////// // we are manipulating the checkQueryResponse to set up the final response, we want to deliver. // adjust start, max score and hit count displayed in the result list. solrDocumentList.setStart(start); Float finalMaxScore = sortByScoreDesc ? new Float(maxScore) : checkQueryResponse.getResults().getMaxScore(); solrDocumentList.setMaxScore(finalMaxScore); solrDocumentList.setNumFound(visibleHitCount); // Exchange the search parameters in the response header by the ones from the (adjusted) original query. NamedList<Object> params = ((NamedList<Object>)(checkQueryResponse.getHeader().get(HEADER_PARAMS_NAME))); params.clear(); for (String paramName : query.getParameterNames()) { params.add(paramName, query.get(paramName)); } // Fill in the documents to return. checkQueryResponse.getResponse().setVal( checkQueryResponse.getResponse().indexOf(QUERY_RESPONSE_NAME, 0), solrDocumentList); // Fill in the time, the overall query took, including processing and permission check. checkQueryResponse.getResponseHeader().setVal( checkQueryResponse.getResponseHeader().indexOf(QUERY_TIME_NAME, 0), new Integer(new Long(System.currentTimeMillis() - startTime).intValue())); // Fill in the highlighting information from the result query. if (query.getHighlight()) { NamedList<Object> highlighting = (NamedList<Object>)resultQueryResponse.getResponse().get( QUERY_HIGHLIGHTING_NAME); // filter out highlighting for documents where access is not permitted. for (String filteredId : filteredResultIds) { highlighting.remove(filteredId); } checkQueryResponse.getResponse().add("highlighting", highlighting); } // build the result result = new CmsSolrResultList( query, checkQueryResponse, solrDocumentList, resourceDocumentList, start, new Integer(rows), end, rows > 0 ? (start / rows) + 1 : 0, //page - but matches only in case of equally sized pages and is zero for rows=0 (because this was this way before!?!) visibleHitCount, finalMaxScore, startTime, System.currentTimeMillis()); if (LOG.isDebugEnabled()) { Object[] logParams = new Object[] { new Long(System.currentTimeMillis() - startTime), new Long(result.getNumFound()), new Long(solrPermissionTime + solrResultTime), new Long(processTime), new Long(result.getHighlightEndTime() != 0 ? result.getHighlightEndTime() - startTime : 0)}; LOG.debug( query.toString() + "\n" + Messages.get().getBundle().key(Messages.LOG_SOLR_SEARCH_EXECUTED_5, logParams)); } // write the response for the handler if (response != null) { // create and return the result core = m_solr instanceof EmbeddedSolrServer ? ((EmbeddedSolrServer)m_solr).getCoreContainer().getCore(getCoreName()) : null; solrQueryRequest = new LocalSolrQueryRequest(core, query); SolrQueryResponse solrQueryResponse = new SolrQueryResponse(); solrQueryResponse.setAllValues(checkQueryResponse.getResponse()); writeResp(response, solrQueryRequest, solrQueryResponse); } } catch ( Exception e) { throw new CmsSearchException( Messages.get().container( Messages.LOG_SOLR_ERR_SEARCH_EXECUTION_FAILD_1, CmsEncoder.decode(query.toString()), e), e); } finally { if (solrQueryRequest != null) { solrQueryRequest.close(); } if (null != core) { core.close(); } // re-set thread to previous priority Thread.currentThread().setPriority(previousPriority); } return result; } /** * Default search method.<p> * * @param cms the current CMS object * @param query the query * * @return the results * * @throws CmsSearchException if something goes wrong * * @see #search(CmsObject, String) */ public CmsSolrResultList search(CmsObject cms, SolrQuery query) throws CmsSearchException { return search(cms, CmsEncoder.decode(query.toString())); } /** * Performs a search.<p> * * @param cms the cms object * @param solrQuery the Solr query * * @return a list of documents * * @throws CmsSearchException if something goes wrong * * @see #search(CmsObject, CmsSolrQuery, boolean) */ public CmsSolrResultList search(CmsObject cms, String solrQuery) throws CmsSearchException { return search(cms, new CmsSolrQuery(null, CmsRequestUtil.createParameterMap(solrQuery)), false); } /** * Writes the response into the writer.<p> * * NOTE: Currently not available for HTTP server.<p> * * @param response the servlet response * @param cms the CMS object to use for search * @param query the Solr query * @param ignoreMaxRows if to return unlimited results * * @throws Exception if there is no embedded server */ public void select(ServletResponse response, CmsObject cms, CmsSolrQuery query, boolean ignoreMaxRows) throws Exception { throwExceptionIfSafetyRestrictionsAreViolated(cms, query, false); boolean isOnline = cms.getRequestContext().getCurrentProject().isOnlineProject(); CmsResourceFilter filter = isOnline ? null : CmsResourceFilter.IGNORE_EXPIRATION; search(cms, query, ignoreMaxRows, response, false, filter); } /** * Sets the logical key/name of this search index.<p> * * @param name the logical key/name of this search index * * @throws CmsIllegalArgumentException if the given name is null, empty or already taken by another search index */ @Override public void setName(String name) throws CmsIllegalArgumentException { super.setName(name); updateCoreName(); } /** * Sets the search post processor.<p> * * @param postProcessor the search post processor to set */ public void setPostProcessor(I_CmsSolrPostSearchProcessor postProcessor) { m_postProcessor = postProcessor; } /** * Sets the Solr server used by this index.<p> * * @param client the server to set */ public void setSolrServer(SolrClient client) { m_solr = client; } /** * Executes a spell checking Solr query and returns the Solr query response.<p> * * @param res the servlet response * @param cms the CMS object * @param q the query * * @throws CmsSearchException if something goes wrong */ public void spellCheck(ServletResponse res, CmsObject cms, CmsSolrQuery q) throws CmsSearchException { throwExceptionIfSafetyRestrictionsAreViolated(cms, q, true); SolrCore core = null; LocalSolrQueryRequest solrQueryRequest = null; try { q.setRequestHandler("/spell"); QueryResponse queryResponse = m_solr.query(q); List<CmsSearchResource> resourceDocumentList = new ArrayList<CmsSearchResource>(); SolrDocumentList solrDocumentList = new SolrDocumentList(); if (m_postProcessor != null) { for (int i = 0; (i < queryResponse.getResults().size()); i++) { try { SolrDocument doc = queryResponse.getResults().get(i); CmsSolrDocument searchDoc = new CmsSolrDocument(doc); if (needsPermissionCheck(searchDoc)) { // only if the document is an OpenCms internal resource perform the permission check CmsResource resource = getResource(cms, searchDoc); if (resource != null) { // permission check performed successfully: the user has read permissions! if (m_postProcessor != null) { doc = m_postProcessor.process( cms, resource, (SolrInputDocument)searchDoc.getDocument()); } resourceDocumentList.add(new CmsSearchResource(resource, searchDoc)); solrDocumentList.add(doc); } } } catch (Exception e) { // should not happen, but if it does we want to go on with the next result nevertheless LOG.warn(Messages.get().getBundle().key(Messages.LOG_SOLR_ERR_RESULT_ITERATION_FAILED_0), e); } } queryResponse.getResponse().setVal( queryResponse.getResponse().indexOf(QUERY_RESPONSE_NAME, 0), solrDocumentList); } // create and return the result core = m_solr instanceof EmbeddedSolrServer ? ((EmbeddedSolrServer)m_solr).getCoreContainer().getCore(getCoreName()) : null; SolrQueryResponse solrQueryResponse = new SolrQueryResponse(); solrQueryResponse.setAllValues(queryResponse.getResponse()); // create and initialize the solr request solrQueryRequest = new LocalSolrQueryRequest(core, solrQueryResponse.getResponseHeader()); // set the OpenCms Solr query as parameters to the request solrQueryRequest.setParams(q); writeResp(res, solrQueryRequest, solrQueryResponse); } catch (Exception e) { throw new CmsSearchException( Messages.get().container(Messages.LOG_SOLR_ERR_SEARCH_EXECUTION_FAILD_1, q), e); } finally { if (solrQueryRequest != null) { solrQueryRequest.close(); } if (core != null) { core.close(); } } } /** * @see org.opencms.search.CmsSearchIndex#createIndexBackup() */ @Override protected String createIndexBackup() { if (!isBackupReindexing()) { // if no backup is generated we don't need to do anything return null; } if (m_solr instanceof EmbeddedSolrServer) { EmbeddedSolrServer ser = (EmbeddedSolrServer)m_solr; CoreContainer con = ser.getCoreContainer(); SolrCore core = con.getCore(getCoreName()); if (core != null) { try { SolrRequestHandler h = core.getRequestHandler("/replication"); if (h instanceof ReplicationHandler) { h.handleRequest( new LocalSolrQueryRequest(core, CmsRequestUtil.createParameterMap("?command=backup")), new SolrQueryResponse()); } } finally { core.close(); } } } return null; } /** * Check, if the current user has permissions on the document's resource. * @param cms the context * @param doc the solr document (from the search result) * @param filter the resource filter to use for checking permissions * @return <code>true</code> iff the resource mirrored by the search result can be read by the current user. */ protected boolean hasPermissions(CmsObject cms, CmsSolrDocument doc, CmsResourceFilter filter) { return null != (filter == null ? getResource(cms, doc) : getResource(cms, doc, filter)); } /** * @see org.opencms.search.CmsSearchIndex#indexSearcherClose() */ @SuppressWarnings("sync-override") @Override protected void indexSearcherClose() { // nothing to do here } /** * @see org.opencms.search.CmsSearchIndex#indexSearcherOpen(java.lang.String) */ @SuppressWarnings("sync-override") @Override protected void indexSearcherOpen(final String path) { // nothing to do here } /** * @see org.opencms.search.CmsSearchIndex#indexSearcherUpdate() */ @SuppressWarnings("sync-override") @Override protected void indexSearcherUpdate() { // nothing to do here } /** * Checks if the given resource should be indexed by this index or not.<p> * * @param res the resource candidate * * @return <code>true</code> if the given resource should be indexed or <code>false</code> if not */ @Override protected boolean isIndexing(CmsResource res) { if ((res != null) && (getSources() != null)) { I_CmsDocumentFactory result = OpenCms.getSearchManager().getDocumentFactory(res); for (CmsSearchIndexSource source : getSources()) { if (source.isIndexing(res.getRootPath(), CmsSolrDocumentContainerPage.TYPE_CONTAINERPAGE_SOLR) || source.isIndexing(res.getRootPath(), CmsSolrDocumentXmlContent.TYPE_XMLCONTENT_SOLR) || source.isIndexing(res.getRootPath(), result.getName())) { return true; } } } return false; } /** * Checks if the current user is allowed to access non-online indexes.<p> * * To access non-online indexes the current user must be a workplace user at least.<p> * * @param cms the CMS object initialized with the current request context / user * * @throws CmsSearchException thrown if the access is not permitted */ private void checkOfflineAccess(CmsObject cms) throws CmsSearchException { // If an offline index is being selected, check permissions if (!CmsProject.ONLINE_PROJECT_NAME.equals(getProject())) { // only if the user has the role Workplace user, he is allowed to access the Offline index try { OpenCms.getRoleManager().checkRole(cms, CmsRole.ELEMENT_AUTHOR); } catch (CmsRoleViolationException e) { throw new CmsSearchException( Messages.get().container( Messages.LOG_SOLR_ERR_SEARCH_PERMISSION_VIOLATION_2, getName(), cms.getRequestContext().getCurrentUser()), e); } } } /** * Generates a valid core name from the provided name (the index name). * @param name the index name. * @return the core name */ private String generateCoreName(final String name) { if (name != null) { return name.replace(" ", "-"); } return null; } /** * Checks if the query should be executed using the debug mode where the security restrictions do not apply. * @param cms the current context. * @param query the query to execute. * @return a flag, indicating, if the query should be performed in debug mode. */ private boolean isDebug(CmsObject cms, CmsSolrQuery query) { String[] debugSecretValues = query.remove(REQUEST_PARAM_DEBUG_SECRET); String debugSecret = (debugSecretValues == null) || (debugSecretValues.length < 1) ? null : debugSecretValues[0]; if ((null != debugSecret) && !debugSecret.trim().isEmpty() && (null != m_handlerDebugSecretFile)) { try { CmsFile secretFile = cms.readFile(m_handlerDebugSecretFile); String secret = new String(secretFile.getContents(), CmsFileUtil.getEncoding(cms, secretFile)); return secret.trim().equals(debugSecret.trim()); } catch (Exception e) { LOG.info( "Failed to read secret file for index \"" + getName() + "\" at path \"" + m_handlerDebugSecretFile + "\"."); } } return false; } /** * Throws an exception if the request can for security reasons not be performed. * Security restrictions can be set via parameters of the index. * * @param cms the current context. * @param query the query. * @param isSpell flag, indicating if the spellcheck handler is requested. * @throws CmsSearchException thrown if the query cannot be executed due to security reasons. */ private void throwExceptionIfSafetyRestrictionsAreViolated(CmsObject cms, CmsSolrQuery query, boolean isSpell) throws CmsSearchException { if (!isDebug(cms, query)) { if (isSpell) { if (m_handlerSpellDisabled) { throw new CmsSearchException(Messages.get().container(Messages.GUI_HANDLER_REQUEST_NOT_ALLOWED_0)); } } else { if (m_handlerSelectDisabled) { throw new CmsSearchException(Messages.get().container(Messages.GUI_HANDLER_REQUEST_NOT_ALLOWED_0)); } int start = null != query.getStart() ? query.getStart().intValue() : 0; int rows = null != query.getRows() ? query.getRows().intValue() : CmsSolrQuery.DEFAULT_ROWS.intValue(); if ((m_handlerMaxAllowedResultsAtAll >= 0) && ((rows + start) > m_handlerMaxAllowedResultsAtAll)) { throw new CmsSearchException( Messages.get().container( Messages.GUI_HANDLER_TOO_MANY_RESULTS_REQUESTED_AT_ALL_2, Integer.valueOf(m_handlerMaxAllowedResultsAtAll), Integer.valueOf(rows + start))); } if ((m_handlerMaxAllowedResultsPerPage >= 0) && (rows > m_handlerMaxAllowedResultsPerPage)) { throw new CmsSearchException( Messages.get().container( Messages.GUI_HANDLER_TOO_MANY_RESULTS_REQUESTED_PER_PAGE_2, Integer.valueOf(m_handlerMaxAllowedResultsPerPage), Integer.valueOf(rows))); } if ((null != m_handlerAllowedFields) && (Stream.of(m_handlerAllowedFields).anyMatch(x -> true))) { if (query.getFields().equals(CmsSolrQuery.ALL_RETURN_FIELDS)) { query.setFields(m_handlerAllowedFields); } else { for (String requestedField : query.getFields().split(",")) { if (Stream.of(m_handlerAllowedFields).noneMatch( allowedField -> allowedField.equals(requestedField))) { throw new CmsSearchException( Messages.get().container( Messages.GUI_HANDLER_REQUESTED_FIELD_NOT_ALLOWED_2, requestedField, Stream.of(m_handlerAllowedFields).reduce("", (a, b) -> a + "," + b))); } } } } } } } /** * Updates the core name to be in sync with the index name. */ private void updateCoreName() { m_coreName = generateCoreName(getName()); } /** * Writes the Solr response.<p> * * @param response the servlet response * @param queryRequest the Solr request * @param queryResponse the Solr response to write * * @throws IOException if sth. goes wrong * @throws UnsupportedEncodingException if sth. goes wrong */ private void writeResp(ServletResponse response, SolrQueryRequest queryRequest, SolrQueryResponse queryResponse) throws IOException, UnsupportedEncodingException { if (m_solr instanceof EmbeddedSolrServer) { SolrCore core = ((EmbeddedSolrServer)m_solr).getCoreContainer().getCore(getCoreName()); Writer out = null; try { QueryResponseWriter responseWriter = core.getQueryResponseWriter(queryRequest); final String ct = responseWriter.getContentType(queryRequest, queryResponse); if (null != ct) { response.setContentType(ct); } if (responseWriter instanceof BinaryQueryResponseWriter) { BinaryQueryResponseWriter binWriter = (BinaryQueryResponseWriter)responseWriter; binWriter.write(response.getOutputStream(), queryRequest, queryResponse); } else { String charset = ContentStreamBase.getCharsetFromContentType(ct); out = ((charset == null) || charset.equalsIgnoreCase(UTF8.toString())) ? new OutputStreamWriter(response.getOutputStream(), UTF8) : new OutputStreamWriter(response.getOutputStream(), charset); out = new FastWriter(out); responseWriter.write(out, queryRequest, queryResponse); out.flush(); } } finally { core.close(); if (out != null) { out.close(); } } } else { throw new UnsupportedOperationException(); } } }
Solr: Fixed issue with highlighting not correctly returned.
src/org/opencms/search/solr/CmsSolrIndex.java
Solr: Fixed issue with highlighting not correctly returned.
<ide><path>rc/org/opencms/search/solr/CmsSolrIndex.java <ide> for (String filteredId : filteredResultIds) { <ide> highlighting.remove(filteredId); <ide> } <del> checkQueryResponse.getResponse().add("highlighting", highlighting); <add> NamedList<Object> completeResponse = new NamedList<Object>(1); <add> completeResponse.addAll(checkQueryResponse.getResponse()); <add> completeResponse.add(QUERY_HIGHLIGHTING_NAME, highlighting); <add> checkQueryResponse.setResponse(completeResponse); <ide> } <ide> <ide> // build the result
Java
mit
63e48ae86517eaa4b15dd5950babd68f4680ed46
0
wangyikai/jenkins,mcanthony/jenkins,Krasnyanskiy/jenkins,tastatur/jenkins,MadsNielsen/jtemp,liorhson/jenkins,lvotypko/jenkins2,sathiya-mit/jenkins,shahharsh/jenkins,hemantojhaa/jenkins,dbroady1/jenkins,duzifang/my-jenkins,synopsys-arc-oss/jenkins,amruthsoft9/Jenkis,jpbriend/jenkins,chbiel/jenkins,wuwen5/jenkins,khmarbaise/jenkins,MarkEWaite/jenkins,ikedam/jenkins,synopsys-arc-oss/jenkins,jcarrothers-sap/jenkins,kohsuke/hudson,dariver/jenkins,Wilfred/jenkins,Ykus/jenkins,maikeffi/hudson,nandan4/Jenkins,khmarbaise/jenkins,iterate/coding-dojo,lvotypko/jenkins3,AustinKwang/jenkins,deadmoose/jenkins,DoctorQ/jenkins,tfennelly/jenkins,protazy/jenkins,khmarbaise/jenkins,verbitan/jenkins,h4ck3rm1k3/jenkins,khmarbaise/jenkins,patbos/jenkins,lvotypko/jenkins2,mcanthony/jenkins,seanlin816/jenkins,mpeltonen/jenkins,stephenc/jenkins,FTG-003/jenkins,godfath3r/jenkins,oleg-nenashev/jenkins,akshayabd/jenkins,duzifang/my-jenkins,1and1/jenkins,aquarellian/jenkins,my7seven/jenkins,gorcz/jenkins,v1v/jenkins,andresrc/jenkins,daniel-beck/jenkins,escoem/jenkins,evernat/jenkins,arunsingh/jenkins,NehemiahMi/jenkins,elkingtonmcb/jenkins,Jochen-A-Fuerbacher/jenkins,synopsys-arc-oss/jenkins,aheritier/jenkins,patbos/jenkins,kohsuke/hudson,arunsingh/jenkins,escoem/jenkins,kzantow/jenkins,jcarrothers-sap/jenkins,chbiel/jenkins,batmat/jenkins,jk47/jenkins,ydubreuil/jenkins,bpzhang/jenkins,lilyJi/jenkins,recena/jenkins,keyurpatankar/hudson,svanoort/jenkins,aduprat/jenkins,rsandell/jenkins,brunocvcunha/jenkins,godfath3r/jenkins,lvotypko/jenkins,msrb/jenkins,mrobinet/jenkins,tastatur/jenkins,stefanbrausch/hudson-main,mpeltonen/jenkins,samatdav/jenkins,intelchen/jenkins,soenter/jenkins,nandan4/Jenkins,vijayto/jenkins,daspilker/jenkins,Ykus/jenkins,jpbriend/jenkins,intelchen/jenkins,Wilfred/jenkins,mrooney/jenkins,AustinKwang/jenkins,6WIND/jenkins,tfennelly/jenkins,gitaccountforprashant/gittest,sathiya-mit/jenkins,DanielWeber/jenkins,DoctorQ/jenkins,h4ck3rm1k3/jenkins,lilyJi/jenkins,jpederzolli/jenkins-1,FTG-003/jenkins,thomassuckow/jenkins,MichaelPranovich/jenkins_sc,godfath3r/jenkins,rashmikanta-1984/jenkins,paulmillar/jenkins,daniel-beck/jenkins,jglick/jenkins,synopsys-arc-oss/jenkins,csimons/jenkins,wuwen5/jenkins,ikedam/jenkins,ajshastri/jenkins,kzantow/jenkins,mattclark/jenkins,ndeloof/jenkins,lvotypko/jenkins,vivek/hudson,damianszczepanik/jenkins,elkingtonmcb/jenkins,aldaris/jenkins,MichaelPranovich/jenkins_sc,FTG-003/jenkins,chbiel/jenkins,hemantojhaa/jenkins,noikiy/jenkins,jk47/jenkins,wuwen5/jenkins,verbitan/jenkins,sathiya-mit/jenkins,6WIND/jenkins,aheritier/jenkins,NehemiahMi/jenkins,varmenise/jenkins,ydubreuil/jenkins,godfath3r/jenkins,keyurpatankar/hudson,mrooney/jenkins,viqueen/jenkins,kzantow/jenkins,amuniz/jenkins,protazy/jenkins,292388900/jenkins,CodeShane/jenkins,iqstack/jenkins,ajshastri/jenkins,CodeShane/jenkins,shahharsh/jenkins,iqstack/jenkins,sathiya-mit/jenkins,everyonce/jenkins,vvv444/jenkins,singh88/jenkins,rlugojr/jenkins,ajshastri/jenkins,nandan4/Jenkins,Jochen-A-Fuerbacher/jenkins,Krasnyanskiy/jenkins,vjuranek/jenkins,keyurpatankar/hudson,gusreiber/jenkins,aduprat/jenkins,pjanouse/jenkins,iterate/coding-dojo,noikiy/jenkins,jglick/jenkins,gorcz/jenkins,SenolOzer/jenkins,andresrc/jenkins,dariver/jenkins,ydubreuil/jenkins,aldaris/jenkins,gorcz/jenkins,gitaccountforprashant/gittest,liupugong/jenkins,batmat/jenkins,kohsuke/hudson,ErikVerheul/jenkins,AustinKwang/jenkins,goldchang/jenkins,KostyaSha/jenkins,jpederzolli/jenkins-1,hashar/jenkins,protazy/jenkins,paulwellnerbou/jenkins,ikedam/jenkins,aldaris/jenkins,my7seven/jenkins,brunocvcunha/jenkins,msrb/jenkins,tangkun75/jenkins,bpzhang/jenkins,github-api-test-org/jenkins,oleg-nenashev/jenkins,gorcz/jenkins,guoxu0514/jenkins,damianszczepanik/jenkins,elkingtonmcb/jenkins,verbitan/jenkins,amuniz/jenkins,alvarolobato/jenkins,vlajos/jenkins,DoctorQ/jenkins,gorcz/jenkins,amuniz/jenkins,paulwellnerbou/jenkins,gusreiber/jenkins,Krasnyanskiy/jenkins,bkmeneguello/jenkins,kohsuke/hudson,Jimilian/jenkins,albers/jenkins,andresrc/jenkins,pjanouse/jenkins,sathiya-mit/jenkins,pselle/jenkins,daspilker/jenkins,h4ck3rm1k3/jenkins,petermarcoen/jenkins,guoxu0514/jenkins,Jochen-A-Fuerbacher/jenkins,SebastienGllmt/jenkins,github-api-test-org/jenkins,292388900/jenkins,jpederzolli/jenkins-1,ErikVerheul/jenkins,jpbriend/jenkins,Jimilian/jenkins,stephenc/jenkins,lordofthejars/jenkins,lvotypko/jenkins,vvv444/jenkins,lvotypko/jenkins,MichaelPranovich/jenkins_sc,goldchang/jenkins,pselle/jenkins,scoheb/jenkins,Ykus/jenkins,dbroady1/jenkins,MadsNielsen/jtemp,shahharsh/jenkins,chbiel/jenkins,aquarellian/jenkins,deadmoose/jenkins,jpbriend/jenkins,noikiy/jenkins,evernat/jenkins,huybrechts/hudson,aduprat/jenkins,escoem/jenkins,tangkun75/jenkins,aheritier/jenkins,jk47/jenkins,msrb/jenkins,vijayto/jenkins,292388900/jenkins,oleg-nenashev/jenkins,tangkun75/jenkins,amruthsoft9/Jenkis,1and1/jenkins,evernat/jenkins,vvv444/jenkins,MadsNielsen/jtemp,bkmeneguello/jenkins,recena/jenkins,ndeloof/jenkins,varmenise/jenkins,protazy/jenkins,MadsNielsen/jtemp,gitaccountforprashant/gittest,yonglehou/jenkins,deadmoose/jenkins,morficus/jenkins,svanoort/jenkins,ChrisA89/jenkins,hudson/hudson-2.x,maikeffi/hudson,thomassuckow/jenkins,akshayabd/jenkins,deadmoose/jenkins,dariver/jenkins,arunsingh/jenkins,deadmoose/jenkins,pantheon-systems/jenkins,ikedam/jenkins,gitaccountforprashant/gittest,recena/jenkins,MichaelPranovich/jenkins_sc,vivek/hudson,pjanouse/jenkins,andresrc/jenkins,jpbriend/jenkins,lvotypko/jenkins,ydubreuil/jenkins,dbroady1/jenkins,lordofthejars/jenkins,morficus/jenkins,CodeShane/jenkins,ikedam/jenkins,jzjzjzj/jenkins,liupugong/jenkins,kzantow/jenkins,dariver/jenkins,MarkEWaite/jenkins,shahharsh/jenkins,hashar/jenkins,vlajos/jenkins,mdonohue/jenkins,brunocvcunha/jenkins,h4ck3rm1k3/jenkins,ErikVerheul/jenkins,aldaris/jenkins,SenolOzer/jenkins,everyonce/jenkins,luoqii/jenkins,ChrisA89/jenkins,liorhson/jenkins,pantheon-systems/jenkins,petermarcoen/jenkins,fbelzunc/jenkins,jcsirot/jenkins,yonglehou/jenkins,mcanthony/jenkins,jhoblitt/jenkins,soenter/jenkins,alvarolobato/jenkins,SenolOzer/jenkins,ydubreuil/jenkins,azweb76/jenkins,ajshastri/jenkins,stephenc/jenkins,ikedam/jenkins,my7seven/jenkins,damianszczepanik/jenkins,paulmillar/jenkins,samatdav/jenkins,albers/jenkins,dariver/jenkins,recena/jenkins,liorhson/jenkins,gitaccountforprashant/gittest,vlajos/jenkins,jpbriend/jenkins,lordofthejars/jenkins,kzantow/jenkins,petermarcoen/jenkins,elkingtonmcb/jenkins,vjuranek/jenkins,arcivanov/jenkins,escoem/jenkins,gusreiber/jenkins,mcanthony/jenkins,albers/jenkins,CodeShane/jenkins,lindzh/jenkins,v1v/jenkins,rsandell/jenkins,292388900/jenkins,lordofthejars/jenkins,ChrisA89/jenkins,ndeloof/jenkins,luoqii/jenkins,FTG-003/jenkins,everyonce/jenkins,maikeffi/hudson,singh88/jenkins,fbelzunc/jenkins,goldchang/jenkins,daspilker/jenkins,ErikVerheul/jenkins,dbroady1/jenkins,bpzhang/jenkins,rashmikanta-1984/jenkins,iterate/coding-dojo,vivek/hudson,mattclark/jenkins,Jimilian/jenkins,SebastienGllmt/jenkins,arunsingh/jenkins,maikeffi/hudson,huybrechts/hudson,rashmikanta-1984/jenkins,thomassuckow/jenkins,seanlin816/jenkins,brunocvcunha/jenkins,yonglehou/jenkins,lindzh/jenkins,lvotypko/jenkins2,varmenise/jenkins,jk47/jenkins,sathiya-mit/jenkins,hplatou/jenkins,ChrisA89/jenkins,SebastienGllmt/jenkins,jzjzjzj/jenkins,v1v/jenkins,tastatur/jenkins,jpederzolli/jenkins-1,tfennelly/jenkins,wuwen5/jenkins,christ66/jenkins,olivergondza/jenkins,damianszczepanik/jenkins,csimons/jenkins,MarkEWaite/jenkins,hplatou/jenkins,FarmGeek4Life/jenkins,Ykus/jenkins,mrooney/jenkins,v1v/jenkins,SenolOzer/jenkins,guoxu0514/jenkins,goldchang/jenkins,DanielWeber/jenkins,lvotypko/jenkins3,elkingtonmcb/jenkins,alvarolobato/jenkins,hplatou/jenkins,jcarrothers-sap/jenkins,hemantojhaa/jenkins,kohsuke/hudson,jenkinsci/jenkins,SebastienGllmt/jenkins,godfath3r/jenkins,rlugojr/jenkins,github-api-test-org/jenkins,msrb/jenkins,ydubreuil/jenkins,jcsirot/jenkins,paulmillar/jenkins,seanlin816/jenkins,pantheon-systems/jenkins,mdonohue/jenkins,ajshastri/jenkins,AustinKwang/jenkins,tastatur/jenkins,albers/jenkins,jenkinsci/jenkins,lindzh/jenkins,damianszczepanik/jenkins,NehemiahMi/jenkins,christ66/jenkins,mdonohue/jenkins,jcarrothers-sap/jenkins,shahharsh/jenkins,daspilker/jenkins,liorhson/jenkins,jk47/jenkins,csimons/jenkins,csimons/jenkins,KostyaSha/jenkins,jhoblitt/jenkins,h4ck3rm1k3/jenkins,FTG-003/jenkins,wangyikai/jenkins,wangyikai/jenkins,soenter/jenkins,everyonce/jenkins,liupugong/jenkins,jzjzjzj/jenkins,duzifang/my-jenkins,fbelzunc/jenkins,iqstack/jenkins,rlugojr/jenkins,jpederzolli/jenkins-1,dennisjlee/jenkins,dbroady1/jenkins,svanoort/jenkins,6WIND/jenkins,protazy/jenkins,KostyaSha/jenkins,liupugong/jenkins,ErikVerheul/jenkins,iqstack/jenkins,pselle/jenkins,recena/jenkins,Krasnyanskiy/jenkins,olivergondza/jenkins,intelchen/jenkins,azweb76/jenkins,thomassuckow/jenkins,liupugong/jenkins,viqueen/jenkins,Wilfred/jenkins,samatdav/jenkins,CodeShane/jenkins,iterate/coding-dojo,KostyaSha/jenkins,wangyikai/jenkins,lvotypko/jenkins3,fbelzunc/jenkins,arcivanov/jenkins,elkingtonmcb/jenkins,NehemiahMi/jenkins,albers/jenkins,noikiy/jenkins,aquarellian/jenkins,vlajos/jenkins,msrb/jenkins,vlajos/jenkins,Wilfred/jenkins,vvv444/jenkins,paulmillar/jenkins,akshayabd/jenkins,stefanbrausch/hudson-main,mdonohue/jenkins,wuwen5/jenkins,my7seven/jenkins,escoem/jenkins,bkmeneguello/jenkins,escoem/jenkins,lvotypko/jenkins2,oleg-nenashev/jenkins,lvotypko/jenkins2,jglick/jenkins,mrooney/jenkins,singh88/jenkins,alvarolobato/jenkins,patbos/jenkins,rsandell/jenkins,mattclark/jenkins,mdonohue/jenkins,Vlatombe/jenkins,huybrechts/hudson,lordofthejars/jenkins,batmat/jenkins,github-api-test-org/jenkins,daniel-beck/jenkins,pselle/jenkins,SebastienGllmt/jenkins,MadsNielsen/jtemp,svanoort/jenkins,mpeltonen/jenkins,hashar/jenkins,Krasnyanskiy/jenkins,jk47/jenkins,daspilker/jenkins,petermarcoen/jenkins,Vlatombe/jenkins,Wilfred/jenkins,akshayabd/jenkins,maikeffi/hudson,rsandell/jenkins,gorcz/jenkins,hudson/hudson-2.x,FarmGeek4Life/jenkins,wangyikai/jenkins,amruthsoft9/Jenkis,sathiya-mit/jenkins,hudson/hudson-2.x,amuniz/jenkins,daspilker/jenkins,jglick/jenkins,duzifang/my-jenkins,dbroady1/jenkins,mattclark/jenkins,amuniz/jenkins,everyonce/jenkins,keyurpatankar/hudson,varmenise/jenkins,jtnord/jenkins,keyurpatankar/hudson,jhoblitt/jenkins,csimons/jenkins,goldchang/jenkins,h4ck3rm1k3/jenkins,thomassuckow/jenkins,liorhson/jenkins,hemantojhaa/jenkins,ChrisA89/jenkins,abayer/jenkins,iqstack/jenkins,everyonce/jenkins,rashmikanta-1984/jenkins,mrobinet/jenkins,jcarrothers-sap/jenkins,keyurpatankar/hudson,abayer/jenkins,patbos/jenkins,keyurpatankar/hudson,goldchang/jenkins,jcarrothers-sap/jenkins,verbitan/jenkins,my7seven/jenkins,Vlatombe/jenkins,stefanbrausch/hudson-main,jcarrothers-sap/jenkins,292388900/jenkins,ns163/jenkins,gitaccountforprashant/gittest,pjanouse/jenkins,keyurpatankar/hudson,aquarellian/jenkins,christ66/jenkins,evernat/jenkins,1and1/jenkins,hplatou/jenkins,tangkun75/jenkins,rsandell/jenkins,stefanbrausch/hudson-main,mrobinet/jenkins,daniel-beck/jenkins,hplatou/jenkins,6WIND/jenkins,luoqii/jenkins,ns163/jenkins,khmarbaise/jenkins,jhoblitt/jenkins,nandan4/Jenkins,varmenise/jenkins,nandan4/Jenkins,pselle/jenkins,ns163/jenkins,jcsirot/jenkins,shahharsh/jenkins,mattclark/jenkins,bkmeneguello/jenkins,singh88/jenkins,msrb/jenkins,amuniz/jenkins,pjanouse/jenkins,morficus/jenkins,KostyaSha/jenkins,alvarolobato/jenkins,abayer/jenkins,verbitan/jenkins,mattclark/jenkins,arcivanov/jenkins,github-api-test-org/jenkins,scoheb/jenkins,maikeffi/hudson,scoheb/jenkins,ydubreuil/jenkins,recena/jenkins,lilyJi/jenkins,chbiel/jenkins,morficus/jenkins,viqueen/jenkins,csimons/jenkins,yonglehou/jenkins,jk47/jenkins,vjuranek/jenkins,gusreiber/jenkins,vijayto/jenkins,paulmillar/jenkins,wangyikai/jenkins,MarkEWaite/jenkins,FarmGeek4Life/jenkins,stephenc/jenkins,DanielWeber/jenkins,arunsingh/jenkins,tfennelly/jenkins,my7seven/jenkins,mdonohue/jenkins,tfennelly/jenkins,fbelzunc/jenkins,rsandell/jenkins,seanlin816/jenkins,jenkinsci/jenkins,scoheb/jenkins,olivergondza/jenkins,DoctorQ/jenkins,jtnord/jenkins,MichaelPranovich/jenkins_sc,ns163/jenkins,Jimilian/jenkins,amruthsoft9/Jenkis,akshayabd/jenkins,lilyJi/jenkins,batmat/jenkins,luoqii/jenkins,pantheon-systems/jenkins,azweb76/jenkins,AustinKwang/jenkins,iqstack/jenkins,aheritier/jenkins,paulmillar/jenkins,jzjzjzj/jenkins,arcivanov/jenkins,oleg-nenashev/jenkins,varmenise/jenkins,FarmGeek4Life/jenkins,rsandell/jenkins,goldchang/jenkins,MarkEWaite/jenkins,olivergondza/jenkins,rashmikanta-1984/jenkins,Jimilian/jenkins,stefanbrausch/hudson-main,daspilker/jenkins,ajshastri/jenkins,KostyaSha/jenkins,vjuranek/jenkins,seanlin816/jenkins,chbiel/jenkins,DoctorQ/jenkins,stephenc/jenkins,6WIND/jenkins,Vlatombe/jenkins,akshayabd/jenkins,verbitan/jenkins,varmenise/jenkins,NehemiahMi/jenkins,vvv444/jenkins,escoem/jenkins,christ66/jenkins,pjanouse/jenkins,deadmoose/jenkins,singh88/jenkins,daniel-beck/jenkins,hudson/hudson-2.x,Jochen-A-Fuerbacher/jenkins,soenter/jenkins,FTG-003/jenkins,batmat/jenkins,aheritier/jenkins,DoctorQ/jenkins,jzjzjzj/jenkins,SenolOzer/jenkins,SenolOzer/jenkins,hplatou/jenkins,jzjzjzj/jenkins,my7seven/jenkins,khmarbaise/jenkins,andresrc/jenkins,amruthsoft9/Jenkis,bkmeneguello/jenkins,jglick/jenkins,aduprat/jenkins,olivergondza/jenkins,petermarcoen/jenkins,samatdav/jenkins,dennisjlee/jenkins,hashar/jenkins,mcanthony/jenkins,ChrisA89/jenkins,wuwen5/jenkins,kohsuke/hudson,aldaris/jenkins,AustinKwang/jenkins,github-api-test-org/jenkins,iterate/coding-dojo,vivek/hudson,mattclark/jenkins,liorhson/jenkins,maikeffi/hudson,hashar/jenkins,scoheb/jenkins,noikiy/jenkins,lordofthejars/jenkins,lvotypko/jenkins,bkmeneguello/jenkins,ndeloof/jenkins,FarmGeek4Life/jenkins,aquarellian/jenkins,daniel-beck/jenkins,mpeltonen/jenkins,v1v/jenkins,ndeloof/jenkins,arcivanov/jenkins,rsandell/jenkins,dariver/jenkins,intelchen/jenkins,petermarcoen/jenkins,mrooney/jenkins,jcsirot/jenkins,albers/jenkins,dennisjlee/jenkins,lvotypko/jenkins2,amruthsoft9/Jenkis,synopsys-arc-oss/jenkins,lindzh/jenkins,CodeShane/jenkins,gusreiber/jenkins,deadmoose/jenkins,synopsys-arc-oss/jenkins,synopsys-arc-oss/jenkins,protazy/jenkins,DanielWeber/jenkins,alvarolobato/jenkins,kohsuke/hudson,mpeltonen/jenkins,noikiy/jenkins,abayer/jenkins,Krasnyanskiy/jenkins,Ykus/jenkins,Krasnyanskiy/jenkins,tastatur/jenkins,DoctorQ/jenkins,csimons/jenkins,jcsirot/jenkins,rashmikanta-1984/jenkins,fbelzunc/jenkins,hudson/hudson-2.x,godfath3r/jenkins,elkingtonmcb/jenkins,Vlatombe/jenkins,evernat/jenkins,evernat/jenkins,stephenc/jenkins,duzifang/my-jenkins,noikiy/jenkins,ErikVerheul/jenkins,lvotypko/jenkins,MarkEWaite/jenkins,KostyaSha/jenkins,ndeloof/jenkins,tangkun75/jenkins,jcsirot/jenkins,DanielWeber/jenkins,jpbriend/jenkins,andresrc/jenkins,jhoblitt/jenkins,iterate/coding-dojo,vlajos/jenkins,rlugojr/jenkins,yonglehou/jenkins,mrobinet/jenkins,singh88/jenkins,NehemiahMi/jenkins,tangkun75/jenkins,MichaelPranovich/jenkins_sc,stefanbrausch/hudson-main,jtnord/jenkins,vjuranek/jenkins,daniel-beck/jenkins,christ66/jenkins,viqueen/jenkins,jcarrothers-sap/jenkins,jglick/jenkins,aheritier/jenkins,wuwen5/jenkins,tastatur/jenkins,damianszczepanik/jenkins,ikedam/jenkins,samatdav/jenkins,paulwellnerbou/jenkins,nandan4/Jenkins,hemantojhaa/jenkins,tangkun75/jenkins,SenolOzer/jenkins,rashmikanta-1984/jenkins,tfennelly/jenkins,yonglehou/jenkins,alvarolobato/jenkins,Vlatombe/jenkins,lvotypko/jenkins3,huybrechts/hudson,pantheon-systems/jenkins,luoqii/jenkins,Jimilian/jenkins,christ66/jenkins,jenkinsci/jenkins,intelchen/jenkins,mpeltonen/jenkins,amuniz/jenkins,stephenc/jenkins,dennisjlee/jenkins,svanoort/jenkins,jtnord/jenkins,Wilfred/jenkins,luoqii/jenkins,morficus/jenkins,vivek/hudson,hemantojhaa/jenkins,vijayto/jenkins,jtnord/jenkins,ns163/jenkins,hplatou/jenkins,viqueen/jenkins,Ykus/jenkins,patbos/jenkins,6WIND/jenkins,stefanbrausch/hudson-main,kohsuke/hudson,maikeffi/hudson,jenkinsci/jenkins,jglick/jenkins,jzjzjzj/jenkins,shahharsh/jenkins,vivek/hudson,FTG-003/jenkins,gusreiber/jenkins,lindzh/jenkins,albers/jenkins,hudson/hudson-2.x,292388900/jenkins,batmat/jenkins,huybrechts/hudson,dennisjlee/jenkins,ikedam/jenkins,patbos/jenkins,lordofthejars/jenkins,1and1/jenkins,arcivanov/jenkins,Jochen-A-Fuerbacher/jenkins,vvv444/jenkins,azweb76/jenkins,DanielWeber/jenkins,vijayto/jenkins,jenkinsci/jenkins,CodeShane/jenkins,mrooney/jenkins,brunocvcunha/jenkins,kzantow/jenkins,Jochen-A-Fuerbacher/jenkins,bpzhang/jenkins,morficus/jenkins,Vlatombe/jenkins,damianszczepanik/jenkins,hashar/jenkins,duzifang/my-jenkins,pselle/jenkins,v1v/jenkins,paulmillar/jenkins,jenkinsci/jenkins,dennisjlee/jenkins,DanielWeber/jenkins,iqstack/jenkins,vijayto/jenkins,SebastienGllmt/jenkins,vivek/hudson,guoxu0514/jenkins,bpzhang/jenkins,pjanouse/jenkins,v1v/jenkins,Jimilian/jenkins,lindzh/jenkins,FarmGeek4Life/jenkins,luoqii/jenkins,viqueen/jenkins,1and1/jenkins,evernat/jenkins,dbroady1/jenkins,olivergondza/jenkins,arunsingh/jenkins,yonglehou/jenkins,abayer/jenkins,patbos/jenkins,lilyJi/jenkins,khmarbaise/jenkins,pselle/jenkins,FarmGeek4Life/jenkins,mrobinet/jenkins,6WIND/jenkins,jzjzjzj/jenkins,aldaris/jenkins,dariver/jenkins,christ66/jenkins,morficus/jenkins,oleg-nenashev/jenkins,azweb76/jenkins,paulwellnerbou/jenkins,guoxu0514/jenkins,tfennelly/jenkins,aduprat/jenkins,lindzh/jenkins,1and1/jenkins,mrooney/jenkins,jhoblitt/jenkins,fbelzunc/jenkins,rlugojr/jenkins,vjuranek/jenkins,aduprat/jenkins,recena/jenkins,dennisjlee/jenkins,1and1/jenkins,pantheon-systems/jenkins,msrb/jenkins,lvotypko/jenkins3,paulwellnerbou/jenkins,gorcz/jenkins,github-api-test-org/jenkins,thomassuckow/jenkins,ChrisA89/jenkins,damianszczepanik/jenkins,MadsNielsen/jtemp,seanlin816/jenkins,svanoort/jenkins,github-api-test-org/jenkins,guoxu0514/jenkins,MarkEWaite/jenkins,daniel-beck/jenkins,scoheb/jenkins,batmat/jenkins,arunsingh/jenkins,soenter/jenkins,amruthsoft9/Jenkis,brunocvcunha/jenkins,thomassuckow/jenkins,oleg-nenashev/jenkins,jhoblitt/jenkins,huybrechts/hudson,AustinKwang/jenkins,intelchen/jenkins,andresrc/jenkins,NehemiahMi/jenkins,mrobinet/jenkins,olivergondza/jenkins,chbiel/jenkins,aldaris/jenkins,Jochen-A-Fuerbacher/jenkins,verbitan/jenkins,gusreiber/jenkins,goldchang/jenkins,MarkEWaite/jenkins,everyonce/jenkins,292388900/jenkins,nandan4/Jenkins,ns163/jenkins,SebastienGllmt/jenkins,azweb76/jenkins,akshayabd/jenkins,lilyJi/jenkins,ns163/jenkins,jenkinsci/jenkins,lvotypko/jenkins3,samatdav/jenkins,duzifang/my-jenkins,MadsNielsen/jtemp,h4ck3rm1k3/jenkins,mpeltonen/jenkins,jtnord/jenkins,aquarellian/jenkins,ajshastri/jenkins,jtnord/jenkins,lilyJi/jenkins,vlajos/jenkins,bpzhang/jenkins,bpzhang/jenkins,iterate/coding-dojo,vivek/hudson,MichaelPranovich/jenkins_sc,scoheb/jenkins,protazy/jenkins,Ykus/jenkins,rlugojr/jenkins,abayer/jenkins,rlugojr/jenkins,paulwellnerbou/jenkins,Wilfred/jenkins,mrobinet/jenkins,seanlin816/jenkins,liorhson/jenkins,aduprat/jenkins,jpederzolli/jenkins-1,mdonohue/jenkins,aquarellian/jenkins,ErikVerheul/jenkins,wangyikai/jenkins,kzantow/jenkins,jpederzolli/jenkins-1,lvotypko/jenkins2,petermarcoen/jenkins,KostyaSha/jenkins,pantheon-systems/jenkins,intelchen/jenkins,ndeloof/jenkins,hashar/jenkins,lvotypko/jenkins3,jcsirot/jenkins,tastatur/jenkins,aheritier/jenkins,DoctorQ/jenkins,vijayto/jenkins,gitaccountforprashant/gittest,guoxu0514/jenkins,mcanthony/jenkins,azweb76/jenkins,huybrechts/hudson,paulwellnerbou/jenkins,liupugong/jenkins,svanoort/jenkins,viqueen/jenkins,abayer/jenkins,singh88/jenkins,soenter/jenkins,gorcz/jenkins,brunocvcunha/jenkins,vvv444/jenkins,arcivanov/jenkins,shahharsh/jenkins,godfath3r/jenkins,vjuranek/jenkins,liupugong/jenkins,mcanthony/jenkins,bkmeneguello/jenkins,samatdav/jenkins,hemantojhaa/jenkins,soenter/jenkins
/* * The MIT License * * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Eric Lefevre-Ardant, Erik Ramfelt, Michael B. Donohue * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package hudson; import hudson.Launcher.LocalLauncher; import hudson.Launcher.RemoteLauncher; import hudson.model.Hudson; import hudson.model.TaskListener; import hudson.model.AbstractProject; import hudson.model.Item; import hudson.remoting.Callable; import hudson.remoting.Channel; import hudson.remoting.DelegatingCallable; import hudson.remoting.Future; import hudson.remoting.Pipe; import hudson.remoting.RemoteOutputStream; import hudson.remoting.VirtualChannel; import hudson.remoting.RemoteInputStream; import hudson.util.IOException2; import hudson.util.HeadBufferingStream; import hudson.util.FormValidation; import static hudson.util.jna.GNUCLibrary.LIBC; import static hudson.Util.fixEmpty; import static hudson.FilePath.TarCompression.GZIP; import hudson.os.PosixAPI; import hudson.org.apache.tools.tar.TarOutputStream; import hudson.org.apache.tools.tar.TarInputStream; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DirectoryScanner; import org.apache.tools.ant.Project; import org.apache.tools.ant.taskdefs.Copy; import org.apache.tools.ant.types.FileSet; import org.apache.tools.tar.TarEntry; import org.apache.tools.zip.ZipOutputStream; import org.apache.tools.zip.ZipEntry; import org.apache.commons.io.IOUtils; import org.apache.commons.io.input.CountingInputStream; import org.apache.commons.fileupload.FileItem; import org.kohsuke.stapler.Stapler; import org.jvnet.robust_http_client.RetryableHttpStream; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileFilter; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.OutputStream; import java.io.Serializable; import java.io.Writer; import java.io.OutputStreamWriter; import java.io.Closeable; import java.net.URI; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; import java.util.Arrays; import java.util.Comparator; import java.util.regex.Pattern; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.zip.GZIPOutputStream; import java.util.zip.GZIPInputStream; import java.util.zip.ZipInputStream; import com.sun.jna.Native; /** * {@link File} like object with remoting support. * * <p> * Unlike {@link File}, which always implies a file path on the current computer, * {@link FilePath} represents a file path on a specific slave or the master. * * Despite that, {@link FilePath} can be used much like {@link File}. It exposes * a bunch of operations (and we should add more operations as long as they are * generally useful), and when invoked against a file on a remote node, {@link FilePath} * executes the necessary code remotely, thereby providing semi-transparent file * operations. * * <h2>Using {@link FilePath} smartly</h2> * <p> * The transparency makes it easy to write plugins without worrying too much about * remoting, by making it works like NFS, where remoting happens at the file-system * later. * * <p> * But one should note that such use of remoting may not be optional. Sometimes, * it makes more sense to move some computation closer to the data, as opposed to * move the data to the computation. For example, if you are just computing a MD5 * digest of a file, then it would make sense to do the digest on the host where * the file is located, as opposed to send the whole data to the master and do MD5 * digesting there. * * <p> * {@link FilePath} supports this "code migration" by in the * {@link #act(FileCallable)} method. One can pass in a custom implementation * of {@link FileCallable}, to be executed on the node where the data is located. * The following code shows the example: * * <pre> * FilePath file = ...; * * // make 'file' a fresh empty directory. * file.act(new FileCallable&lt;Void>() { * // if 'file' is on a different node, this FileCallable will * // be transfered to that node and executed there. * public Void invoke(File f,VirtualChannel channel) { * // f and file represents the same thing * f.deleteContents(); * f.mkdirs(); * } * }); * </pre> * * <p> * When {@link FileCallable} is transfered to a remote node, it will be done so * by using the same Java serialization scheme that the remoting module uses. * See {@link Channel} for more about this. * * <p> * {@link FilePath} itself can be sent over to a remote node as a part of {@link Callable} * serialization. For example, sending a {@link FilePath} of a remote node to that * node causes {@link FilePath} to become "local". Similarly, sending a * {@link FilePath} that represents the local computer causes it to become "remote." * * @author Kohsuke Kawaguchi */ public final class FilePath implements Serializable { /** * When this {@link FilePath} represents the remote path, * this field is always non-null on master (the field represents * the channel to the remote slave.) When transferred to a slave via remoting, * this field reverts back to null, since it's transient. * * When this {@link FilePath} represents a path on the master, * this field is null on master. When transferred to a slave via remoting, * this field becomes non-null, representing the {@link Channel} * back to the master. * * This is used to determine whether we are running on the master or the slave. */ private transient VirtualChannel channel; // since the platform of the slave might be different, can't use java.io.File private final String remote; /** * Creates a {@link FilePath} that represents a path on the given node. * * @param channel * To create a path that represents a remote path, pass in a {@link Channel} * that's connected to that machine. If null, that means the local file path. */ public FilePath(VirtualChannel channel, String remote) { this.channel = channel; this.remote = remote; } /** * To create {@link FilePath} that represents a "local" path. * * <p> * A "local" path means a file path on the computer where the * constructor invocation happened. */ public FilePath(File localPath) { this.channel = null; this.remote = localPath.getPath(); } /** * Construct a path starting with a base location. * @param base starting point for resolution, and defines channel * @param rel a path which if relative will be resolved against base */ public FilePath(FilePath base, String rel) { this.channel = base.channel; if(isAbsolute(rel)) { // absolute this.remote = rel; } else if(base.isUnix()) { this.remote = base.remote+'/'+rel; } else { this.remote = base.remote+'\\'+rel; } } private static boolean isAbsolute(String rel) { return rel.startsWith("/") || DRIVE_PATTERN.matcher(rel).matches(); } private static final Pattern DRIVE_PATTERN = Pattern.compile("[A-Za-z]:\\\\.*"); /** * Checks if the remote path is Unix. */ private boolean isUnix() { // if the path represents a local path, there' no need to guess. if(!isRemote()) return File.pathSeparatorChar!=';'; // note that we can't use the usual File.pathSeparator and etc., as the OS of // the machine where this code runs and the OS that this FilePath refers to may be different. // Windows absolute path is 'X:\...', so this is usually a good indication of Windows path if(remote.length()>3 && remote.charAt(1)==':' && remote.charAt(2)=='\\') return false; // Windows can handle '/' as a path separator but Unix can't, // so err on Unix side return remote.indexOf("\\")==-1; } public String getRemote() { return remote; } /** * Creates a zip file from this directory or a file and sends that to the given output stream. * * @deprecated as of 1.315. Use {@link #zip(OutputStream)} that has more consistent name. */ public void createZipArchive(OutputStream os) throws IOException, InterruptedException { zip(os); } /** * Creates a zip file from this directory or a file and sends that to the given output stream. */ public void zip(OutputStream os) throws IOException, InterruptedException { zip(os,(FileFilter)null); } /** * Creates a zip file from this directory by using the specified filter, * and sends the result to the given output stream. * * @param filter * Must be serializable since it may be executed remotely. Can be null to add all files. * * @since 1.315 */ public void zip(OutputStream os, FileFilter filter) throws IOException, InterruptedException { archive(new ZipArchiverFactory(),os,filter); } /** * Creates a zip file from this directory by only including the files that match the given glob. * * @param glob * Ant style glob, like "**&#x2F;*.xml". If empty or null, this method * works like {@link #createZipArchive(OutputStream)} * * @since 1.129 * @deprecated as of 1.315 * Use {@link #zip(OutputStream,String)} that has more consistent name. */ public void createZipArchive(OutputStream os, final String glob) throws IOException, InterruptedException { archive(new ZipArchiverFactory(),os,glob); } /** * Creates a zip file from this directory by only including the files that match the given glob. * * @param glob * Ant style glob, like "**&#x2F;*.xml". If empty or null, this method * works like {@link #createZipArchive(OutputStream)} * * @since 1.315 */ public void zip(OutputStream os, final String glob) throws IOException, InterruptedException { archive(new ZipArchiverFactory(),os,glob); } /** * Archives this directory into the specified archive format, to the given {@link OutputStream}, by using * {@link DirScanner} to choose what files to include. * * @return * number of files/directories archived. This is only really useful to check for a situation where nothing * is archived. */ private int archive(final ArchiverFactory factory, OutputStream os, final DirScanner scanner) throws IOException, InterruptedException { final OutputStream out = (channel!=null)?new RemoteOutputStream(os):os; return act(new FileCallable<Integer>() { public Integer invoke(File f, VirtualChannel channel) throws IOException { Archiver a = factory.create(out); try { scanner.scan(f,a); } finally { a.close(); } return a.countEntries(); } private static final long serialVersionUID = 1L; }); } private int archive(final ArchiverFactory factory, OutputStream os, final FileFilter filter) throws IOException, InterruptedException { return archive(factory,os,new DirScanner.Filter(filter)); } private int archive(final ArchiverFactory factory, OutputStream os, final String glob) throws IOException, InterruptedException { return archive(factory,os,new DirScanner.Glob(glob,null)); } /** * When this {@link FilePath} represents a zip file, extracts that zip file. * * @param target * Target directory to expand files to. All the necessary directories will be created. * @since 1.248 * @see #unzipFrom(InputStream) */ public void unzip(final FilePath target) throws IOException, InterruptedException { target.act(new FileCallable<Void>() { public Void invoke(File dir, VirtualChannel channel) throws IOException { unzip(dir,FilePath.this.read()); return null; } private static final long serialVersionUID = 1L; }); } /** * When this {@link FilePath} represents a tar file, extracts that tar file. * * @param target * Target directory to expand files to. All the necessary directories will be created. * @param compression * Compression mode of this tar file. * @since 1.292 * @see #untarFrom(InputStream, TarCompression) */ public void untar(final FilePath target, final TarCompression compression) throws IOException, InterruptedException { target.act(new FileCallable<Void>() { public Void invoke(File dir, VirtualChannel channel) throws IOException { readFromTar(FilePath.this.getName(),dir,compression.extract(FilePath.this.read())); return null; } private static final long serialVersionUID = 1L; }); } /** * Reads the given InputStream as a zip file and extracts it into this directory. * * @param _in * The stream will be closed by this method after it's fully read. * @since 1.283 * @see #unzip(FilePath) */ public void unzipFrom(InputStream _in) throws IOException, InterruptedException { final InputStream in = new RemoteInputStream(_in); act(new FileCallable<Void>() { public Void invoke(File dir, VirtualChannel channel) throws IOException { unzip(dir, in); return null; } private static final long serialVersionUID = 1L; }); } private void unzip(File dir, InputStream in) throws IOException { dir = dir.getAbsoluteFile(); // without absolutization, getParentFile below seems to fail ZipInputStream zip = new ZipInputStream(new BufferedInputStream(in)); java.util.zip.ZipEntry e; try { while((e=zip.getNextEntry())!=null) { File f = new File(dir,e.getName()); if(e.isDirectory()) { f.mkdirs(); } else { File p = f.getParentFile(); if(p!=null) p.mkdirs(); FileOutputStream out = new FileOutputStream(f); try { IOUtils.copy(zip, out); } finally { out.close(); } f.setLastModified(e.getTime()); zip.closeEntry(); } } } finally { zip.close(); } } /** * Absolutizes this {@link FilePath} and returns the new one. */ public FilePath absolutize() throws IOException, InterruptedException { return new FilePath(channel,act(new FileCallable<String>() { public String invoke(File f, VirtualChannel channel) throws IOException { return f.getAbsolutePath(); } })); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FilePath that = (FilePath) o; if (channel != null ? !channel.equals(that.channel) : that.channel != null) return false; return remote.equals(that.remote); } @Override public int hashCode() { return 31 * (channel != null ? channel.hashCode() : 0) + remote.hashCode(); } /** * Supported tar file compression methods. */ public enum TarCompression { NONE { public InputStream extract(InputStream in) { return in; } public OutputStream compress(OutputStream out) { return out; } }, GZIP { public InputStream extract(InputStream _in) throws IOException { HeadBufferingStream in = new HeadBufferingStream(_in,SIDE_BUFFER_SIZE); try { return new GZIPInputStream(in,8192); } catch (IOException e) { // various people reported "java.io.IOException: Not in GZIP format" here, so diagnose this problem better in.fillSide(); throw new IOException2(e.getMessage()+"\nstream="+Util.toHexString(in.getSideBuffer()),e); } } public OutputStream compress(OutputStream out) throws IOException { return new GZIPOutputStream(new BufferedOutputStream(out)); } }; public abstract InputStream extract(InputStream in) throws IOException; public abstract OutputStream compress(OutputStream in) throws IOException; } /** * Reads the given InputStream as a tar file and extracts it into this directory. * * @param _in * The stream will be closed by this method after it's fully read. * @param compression * The compression method in use. * @since 1.292 */ public void untarFrom(InputStream _in, final TarCompression compression) throws IOException, InterruptedException { try { final InputStream in = new RemoteInputStream(_in); act(new FileCallable<Void>() { public Void invoke(File dir, VirtualChannel channel) throws IOException { readFromTar("input stream",dir, compression.extract(in)); return null; } private static final long serialVersionUID = 1L; }); } finally { IOUtils.closeQuietly(_in); } } /** * Given a tgz/zip file, extracts it to the given target directory, if necessary. * * <p> * This method is a convenience method designed for installing a binary package to a location * that supports upgrade and downgrade. Specifically, * * <ul> * <li>If the target directory doesn't exist {@linkplain #mkdirs() it'll be created}. * <li>The timestamp of the .tgz file is left in the installation directory upon extraction. * <li>If the timestamp left in the directory doesn't match with the timestamp of the current archive file, * the directory contents will be discarded and the archive file will be re-extracted. * <li>If the connection is refused but the target directory already exists, it is left alone. * </ul> * * @param archive * The resource that represents the tgz/zip file. This URL must support the "Last-Modified" header. * (Most common usage is to get this from {@link ClassLoader#getResource(String)}) * @param listener * If non-null, a message will be printed to this listener once this method decides to * extract an archive. * @return * true if the archive was extracted. false if the extraction was skipped because the target directory * was considered up to date. * @since 1.299 */ public boolean installIfNecessaryFrom(URL archive, TaskListener listener, String message) throws IOException, InterruptedException { URLConnection con; try { con = archive.openConnection(); con.connect(); } catch (IOException x) { if (this.exists()) { // Cannot connect now, so assume whatever was last unpacked is still OK. if (listener != null) { listener.getLogger().println("Skipping installation of " + archive + " to " + remote + ": " + x); } return false; } else { throw x; } } long sourceTimestamp = con.getLastModified(); FilePath timestamp = this.child(".timestamp"); if(this.exists()) { if(timestamp.exists() && sourceTimestamp ==timestamp.lastModified()) return false; // already up to date this.deleteContents(); } else { this.mkdirs(); } if(listener!=null) listener.getLogger().println(message); // for HTTP downloads, enable automatic retry for added resilience InputStream in = archive.getProtocol().equals("http") ? new RetryableHttpStream(archive) : con.getInputStream(); CountingInputStream cis = new CountingInputStream(in); try { if(archive.toExternalForm().endsWith(".zip")) unzipFrom(cis); else untarFrom(cis,GZIP); } catch (IOException e) { throw new IOException2(String.format("Failed to unpack %s (%d bytes read of total %d)", archive,cis.getByteCount(),con.getContentLength()),e); } timestamp.touch(sourceTimestamp); return true; } /** * Reads the URL on the current VM, and writes all the data to this {@link FilePath} * (this is different from resolving URL remotely.) * * @since 1.293 */ public void copyFrom(URL url) throws IOException, InterruptedException { InputStream in = url.openStream(); try { copyFrom(in); } finally { in.close(); } } /** * Replaces the content of this file by the data from the given {@link InputStream}. * * @since 1.293 */ public void copyFrom(InputStream in) throws IOException, InterruptedException { OutputStream os = write(); try { IOUtils.copy(in, os); } finally { os.close(); } } /** * Conveniene method to call {@link FilePath#copyTo(FilePath)}. * * @since 1.311 */ public void copyFrom(FilePath src) throws IOException, InterruptedException { src.copyTo(this); } /** * Place the data from {@link FileItem} into the file location specified by this {@link FilePath} object. */ public void copyFrom(FileItem file) throws IOException, InterruptedException { if(channel==null) { try { file.write(new File(remote)); } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException2(e); } } else { InputStream i = file.getInputStream(); OutputStream o = write(); try { IOUtils.copy(i,o); } finally { o.close(); i.close(); } } } /** * Code that gets executed on the machine where the {@link FilePath} is local. * Used to act on {@link FilePath}. * * @see FilePath#act(FileCallable) */ public static interface FileCallable<T> extends Serializable { /** * Performs the computational task on the node where the data is located. * * @param f * {@link File} that represents the local file that {@link FilePath} has represented. * @param channel * The "back pointer" of the {@link Channel} that represents the communication * with the node from where the code was sent. */ T invoke(File f, VirtualChannel channel) throws IOException; } /** * Executes some program on the machine that this {@link FilePath} exists, * so that one can perform local file operations. */ public <T> T act(final FileCallable<T> callable) throws IOException, InterruptedException { return act(callable,callable.getClass().getClassLoader()); } private <T> T act(final FileCallable<T> callable, ClassLoader cl) throws IOException, InterruptedException { if(channel!=null) { // run this on a remote system try { return channel.call(new FileCallableWrapper<T>(callable,cl)); } catch (AbortException e) { throw e; // pass through so that the caller can catch it as AbortException } catch (IOException e) { // wrap it into a new IOException so that we get the caller's stack trace as well. throw new IOException2("remote file operation failed",e); } } else { // the file is on the local machine. return callable.invoke(new File(remote), Hudson.MasterComputer.localChannel); } } /** * Executes some program on the machine that this {@link FilePath} exists, * so that one can perform local file operations. */ public <T> Future<T> actAsync(final FileCallable<T> callable) throws IOException, InterruptedException { try { return (channel!=null ? channel : Hudson.MasterComputer.localChannel) .callAsync(new FileCallableWrapper<T>(callable)); } catch (IOException e) { // wrap it into a new IOException so that we get the caller's stack trace as well. throw new IOException2("remote file operation failed",e); } } /** * Executes some program on the machine that this {@link FilePath} exists, * so that one can perform local file operations. */ public <V,E extends Throwable> V act(Callable<V,E> callable) throws IOException, InterruptedException, E { if(channel!=null) { // run this on a remote system return channel.call(callable); } else { // the file is on the local machine return callable.call(); } } /** * Converts this file to the URI, relative to the machine * on which this file is available. */ public URI toURI() throws IOException, InterruptedException { return act(new FileCallable<URI>() { public URI invoke(File f, VirtualChannel channel) { return f.toURI(); } }); } /** * Creates this directory. */ public void mkdirs() throws IOException, InterruptedException { if(!act(new FileCallable<Boolean>() { public Boolean invoke(File f, VirtualChannel channel) throws IOException { if(f.mkdirs() || f.exists()) return true; // OK // following Ant <mkdir> task to avoid possible race condition. try { Thread.sleep(10); } catch (InterruptedException e) { // ignore } return f.mkdirs() || f.exists(); } })) throw new IOException("Failed to mkdirs: "+remote); } /** * Deletes this directory, including all its contents recursively. */ public void deleteRecursive() throws IOException, InterruptedException { act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { Util.deleteRecursive(f); return null; } }); } /** * Deletes all the contents of this directory, but not the directory itself */ public void deleteContents() throws IOException, InterruptedException { act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { Util.deleteContentsRecursive(f); return null; } }); } /** * Gets the file name portion except the extension. * * For example, "foo" for "foo.txt" and "foo.tar" for "foo.tar.gz". */ public String getBaseName() { String n = getName(); int idx = n.lastIndexOf('.'); if (idx<0) return n; return n.substring(0,idx); } /** * Gets just the file name portion. * * This method assumes that the file name is the same between local and remote. */ public String getName() { String r = remote; if(r.endsWith("\\") || r.endsWith("/")) r = r.substring(0,r.length()-1); int len = r.length()-1; while(len>=0) { char ch = r.charAt(len); if(ch=='\\' || ch=='/') break; len--; } return r.substring(len+1); } /** * Short for {@code getParent().child(rel)}. Useful for getting other files in the same directory. */ public FilePath sibling(String rel) { return getParent().child(rel); } /** * Returns a {@link FilePath} by adding the given suffix to this path name. */ public FilePath withSuffix(String suffix) { return new FilePath(channel,remote+suffix); } /** * The same as {@link FilePath#FilePath(FilePath,String)} but more OO. * @param rel a relative or absolute path * @return a file on the same channel */ public FilePath child(String rel) { return new FilePath(this,rel); } /** * Gets the parent file. */ public FilePath getParent() { int len = remote.length()-1; while(len>=0) { char ch = remote.charAt(len); if(ch=='\\' || ch=='/') break; len--; } return new FilePath( channel, remote.substring(0,len) ); } /** * Creates a temporary file in the directory that this {@link FilePath} object designates. */ public FilePath createTempFile(final String prefix, final String suffix) throws IOException, InterruptedException { try { return new FilePath(this,act(new FileCallable<String>() { public String invoke(File dir, VirtualChannel channel) throws IOException { File f = File.createTempFile(prefix, suffix, dir); return f.getName(); } })); } catch (IOException e) { throw new IOException2("Failed to create a temp file on "+remote,e); } } /** * Creates a temporary file in this directory and set the contents by the * given text (encoded in the platform default encoding) */ public FilePath createTextTempFile(final String prefix, final String suffix, final String contents) throws IOException, InterruptedException { return createTextTempFile(prefix,suffix,contents,true); } /** * Creates a temporary file in this directory and set the contents by the * given text (encoded in the platform default encoding) */ public FilePath createTextTempFile(final String prefix, final String suffix, final String contents, final boolean inThisDirectory) throws IOException, InterruptedException { try { return new FilePath(channel,act(new FileCallable<String>() { public String invoke(File dir, VirtualChannel channel) throws IOException { if(!inThisDirectory) dir = new File(System.getProperty("java.io.tmpdir")); else dir.mkdirs(); File f; try { f = File.createTempFile(prefix, suffix, dir); } catch (IOException e) { throw new IOException2("Failed to create a temporary directory in "+dir,e); } Writer w = new FileWriter(f); w.write(contents); w.close(); return f.getAbsolutePath(); } })); } catch (IOException e) { throw new IOException2("Failed to create a temp file on "+remote,e); } } /** * Creates a temporary directory inside the directory represented by 'this' * @since 1.311 */ public FilePath createTempDir(final String prefix, final String suffix) throws IOException, InterruptedException { try { return new FilePath(this,act(new FileCallable<String>() { public String invoke(File dir, VirtualChannel channel) throws IOException { File f = File.createTempFile(prefix, suffix, dir); f.delete(); f.mkdir(); return f.getName(); } })); } catch (IOException e) { throw new IOException2("Failed to create a temp directory on "+remote,e); } } /** * Deletes this file. * @throws IOException if it exists but could not be successfully deleted * @return true, for a modicum of compatibility */ public boolean delete() throws IOException, InterruptedException { act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { Util.deleteFile(f); return null; } }); return true; } /** * Checks if the file exists. */ public boolean exists() throws IOException, InterruptedException { return act(new FileCallable<Boolean>() { public Boolean invoke(File f, VirtualChannel channel) throws IOException { return f.exists(); } }); } /** * Gets the last modified time stamp of this file, by using the clock * of the machine where this file actually resides. * * @see File#lastModified() * @see #touch(long) */ public long lastModified() throws IOException, InterruptedException { return act(new FileCallable<Long>() { public Long invoke(File f, VirtualChannel channel) throws IOException { return f.lastModified(); } }); } /** * Creates a file (if not already exist) and sets the timestamp. * * @since 1.299 */ public void touch(final long timestamp) throws IOException, InterruptedException { act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { if(!f.exists()) new FileOutputStream(f).close(); if(!f.setLastModified(timestamp)) throw new IOException("Failed to set the timestamp of "+f+" to "+timestamp); return null; } }); } /** * Checks if the file is a directory. */ public boolean isDirectory() throws IOException, InterruptedException { return act(new FileCallable<Boolean>() { public Boolean invoke(File f, VirtualChannel channel) throws IOException { return f.isDirectory(); } }); } /** * Returns the file size in bytes. * * @since 1.129 */ public long length() throws IOException, InterruptedException { return act(new FileCallable<Long>() { public Long invoke(File f, VirtualChannel channel) throws IOException { return f.length(); } }); } /** * Sets the file permission. * * On Windows, no-op. * * @param mask * File permission mask. To simplify the permission copying, * if the parameter is -1, this method becomes no-op. * @since 1.303 * @see #mode() */ public void chmod(final int mask) throws IOException, InterruptedException { if(!isUnix() || mask==-1) return; act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { if(LIBC.chmod(f.getAbsolutePath(),mask)!=0) throw new IOException("Failed to chmod "+f+" : "+LIBC.strerror(Native.getLastError())); return null; } }); } /** * Gets the file permission bit mask. * * @return * -1 on Windows, since such a concept doesn't make sense. * @since 1.311 * @see #chmod(int) */ public int mode() throws IOException, InterruptedException { if(!isUnix()) return -1; return act(new FileCallable<Integer>() { public Integer invoke(File f, VirtualChannel channel) throws IOException { return PosixAPI.get().stat(f.getPath()).mode(); } }); } /** * List up files and directories in this directory. * * <p> * This method returns direct children of the directory denoted by the 'this' object. */ public List<FilePath> list() throws IOException, InterruptedException { return list((FileFilter)null); } /** * List up subdirectories. * * @return can be empty but never null. Doesn't contain "." and ".." */ public List<FilePath> listDirectories() throws IOException, InterruptedException { return list(new DirectoryFilter()); } private static final class DirectoryFilter implements FileFilter, Serializable { public boolean accept(File f) { return f.isDirectory(); } private static final long serialVersionUID = 1L; } /** * List up files in this directory, just like {@link File#listFiles(FileFilter)}. * * @param filter * The optional filter used to narrow down the result. * If non-null, must be {@link Serializable}. * If this {@link FilePath} represents a remote path, * the filter object will be executed on the remote machine. */ public List<FilePath> list(final FileFilter filter) throws IOException, InterruptedException { if (filter != null && !(filter instanceof Serializable)) { throw new IllegalArgumentException("Non-serializable filter of " + filter.getClass()); } return act(new FileCallable<List<FilePath>>() { public List<FilePath> invoke(File f, VirtualChannel channel) throws IOException { File[] children = f.listFiles(filter); if(children ==null) return null; ArrayList<FilePath> r = new ArrayList<FilePath>(children.length); for (File child : children) r.add(new FilePath(child)); return r; } }, (filter!=null?filter:this).getClass().getClassLoader()); } /** * List up files in this directory that matches the given Ant-style filter. * * @param includes * See {@link FileSet} for the syntax. String like "foo/*.zip" or "foo/*&#42;/*.xml" * @return * can be empty but always non-null. */ public FilePath[] list(final String includes) throws IOException, InterruptedException { return act(new FileCallable<FilePath[]>() { public FilePath[] invoke(File f, VirtualChannel channel) throws IOException { String[] files = glob(f,includes); FilePath[] r = new FilePath[files.length]; for( int i=0; i<r.length; i++ ) r[i] = new FilePath(new File(f,files[i])); return r; } }); } /** * Runs Ant glob expansion. * * @return * A set of relative file names from the base directory. */ private static String[] glob(File dir, String includes) throws IOException { if(isAbsolute(includes)) throw new IOException("Expecting Ant GLOB pattern, but saw '"+includes+"'. See http://ant.apache.org/manual/CoreTypes/fileset.html for syntax"); FileSet fs = Util.createFileSet(dir,includes); DirectoryScanner ds = fs.getDirectoryScanner(new Project()); String[] files = ds.getIncludedFiles(); return files; } /** * Reads this file. */ public InputStream read() throws IOException { if(channel==null) return new FileInputStream(new File(remote)); final Pipe p = Pipe.createRemoteToLocal(); channel.callAsync(new Callable<Void,IOException>() { public Void call() throws IOException { FileInputStream fis=null; try { fis = new FileInputStream(new File(remote)); Util.copyStream(fis,p.getOut()); return null; } finally { IOUtils.closeQuietly(fis); IOUtils.closeQuietly(p.getOut()); } } }); return p.getIn(); } /** * Reads this file into a string, by using the current system encoding. */ public String readToString() throws IOException { InputStream in = read(); try { return IOUtils.toString(in); } finally { in.close(); } } /** * Writes to this file. * If this file already exists, it will be overwritten. * If the directory doesn't exist, it will be created. */ public OutputStream write() throws IOException, InterruptedException { if(channel==null) { File f = new File(remote).getAbsoluteFile(); f.getParentFile().mkdirs(); return new FileOutputStream(f); } return channel.call(new Callable<OutputStream,IOException>() { public OutputStream call() throws IOException { File f = new File(remote).getAbsoluteFile(); f.getParentFile().mkdirs(); FileOutputStream fos = new FileOutputStream(f); return new RemoteOutputStream(fos); } }); } /** * Overwrites this file by placing the given String as the content. * * @param encoding * Null to use the platform default encoding. * @since 1.105 */ public void write(final String content, final String encoding) throws IOException, InterruptedException { act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { f.getParentFile().mkdirs(); FileOutputStream fos = new FileOutputStream(f); Writer w = encoding != null ? new OutputStreamWriter(fos, encoding) : new OutputStreamWriter(fos); try { w.write(content); } finally { w.close(); } return null; } }); } /** * Computes the MD5 digest of the file in hex string. */ public String digest() throws IOException, InterruptedException { return act(new FileCallable<String>() { public String invoke(File f, VirtualChannel channel) throws IOException { return Util.getDigestOf(new FileInputStream(f)); } }); } /** * Rename this file/directory to the target filepath. This FilePath and the target must * be on the some host */ public void renameTo(final FilePath target) throws IOException, InterruptedException { if(this.channel != target.channel) { throw new IOException("renameTo target must be on the same host"); } act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { f.renameTo(new File(target.remote)); return null; } }); } /** * Moves all the contents of this directory into the specified directory, then delete this directory itself. * * @since 1.308. */ public void moveAllChildrenTo(final FilePath target) throws IOException, InterruptedException { if(this.channel != target.channel) { throw new IOException("pullUpTo target must be on the same host"); } act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { File t = new File(target.getRemote()); for(File child : f.listFiles()) { File target = new File(t, child.getName()); if(!child.renameTo(target)) throw new IOException("Failed to rename "+child+" to "+target); } f.delete(); return null; } }); } /** * Copies this file to the specified target. */ public void copyTo(FilePath target) throws IOException, InterruptedException { try { OutputStream out = target.write(); try { copyTo(out); } finally { out.close(); } } catch (IOException e) { throw new IOException2("Failed to copy "+this+" to "+target,e); } } /** * Copies this file to the specified target, with file permissions intact. * @since 1.311 */ public void copyToWithPermission(FilePath target) throws IOException, InterruptedException { copyTo(target); // copy file permission target.chmod(mode()); } /** * Sends the contents of this file into the given {@link OutputStream}. */ public void copyTo(OutputStream os) throws IOException, InterruptedException { final OutputStream out = new RemoteOutputStream(os); act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { FileInputStream fis = null; try { fis = new FileInputStream(f); Util.copyStream(fis,out); return null; } finally { IOUtils.closeQuietly(fis); IOUtils.closeQuietly(out); } } }); } /** * Remoting interface used for {@link FilePath#copyRecursiveTo(String, FilePath)}. * * TODO: this might not be the most efficient way to do the copy. */ interface RemoteCopier { /** * @param fileName * relative path name to the output file. Path separator must be '/'. */ void open(String fileName) throws IOException; void write(byte[] buf, int len) throws IOException; void close() throws IOException; } /** * Copies the contents of this directory recursively into the specified target directory. * @since 1.312 */ public int copyRecursiveTo(FilePath target) throws IOException, InterruptedException { return copyRecursiveTo("**/*",target); } public int copyRecursiveTo(String fileMask, FilePath target) throws IOException, InterruptedException { return copyRecursiveTo(fileMask,null,target); } /** * Copies the files that match the given file mask to the specified target node. * * @param fileMask * Ant GLOB pattern. * String like "foo/bar/*.xml" Multiple patterns can be separated * by ',', and whitespace can surround ',' (so that you can write * "abc, def" and "abc,def" to mean the same thing. * @param excludes * Files to be excluded. Can be null. * @return * the number of files copied. */ public int copyRecursiveTo(final String fileMask, final String excludes, final FilePath target) throws IOException, InterruptedException { if(this.channel==target.channel) { // local to local copy. return act(new FileCallable<Integer>() { public Integer invoke(File base, VirtualChannel channel) throws IOException { if(!base.exists()) return 0; assert target.channel==null; try { class CopyImpl extends Copy { private int copySize; public CopyImpl() { setProject(new org.apache.tools.ant.Project()); } @Override protected void doFileOperations() { copySize = super.fileCopyMap.size(); super.doFileOperations(); } public int getNumCopied() { return copySize; } } CopyImpl copyTask = new CopyImpl(); copyTask.setTodir(new File(target.remote)); copyTask.addFileset(Util.createFileSet(base,fileMask,excludes)); copyTask.setIncludeEmptyDirs(false); copyTask.execute(); return copyTask.getNumCopied(); } catch (BuildException e) { throw new IOException2("Failed to copy "+base+"/"+fileMask+" to "+target,e); } } }); } else if(this.channel==null) { // local -> remote copy final Pipe pipe = Pipe.createLocalToRemote(); Future<Void> future = target.actAsync(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { try { readFromTar(remote+'/'+fileMask, f,TarCompression.GZIP.extract(pipe.getIn())); return null; } finally { pipe.getIn().close(); } } }); int r = writeToTar(new File(remote),fileMask,excludes,TarCompression.GZIP.compress(pipe.getOut())); try { future.get(); } catch (ExecutionException e) { throw new IOException2(e); } return r; } else { // remote -> local copy final Pipe pipe = Pipe.createRemoteToLocal(); Future<Integer> future = actAsync(new FileCallable<Integer>() { public Integer invoke(File f, VirtualChannel channel) throws IOException { try { return writeToTar(f,fileMask,excludes,TarCompression.GZIP.compress(pipe.getOut())); } finally { pipe.getOut().close(); } } }); try { readFromTar(remote+'/'+fileMask,new File(target.remote),TarCompression.GZIP.extract(pipe.getIn())); } catch (IOException e) {// BuildException or IOException try { future.get(3,TimeUnit.SECONDS); throw e; // the remote side completed successfully, so the error must be local } catch (ExecutionException x) { // report both errors throw new IOException2(Functions.printThrowable(e),x); } catch (TimeoutException _) { // remote is hanging throw e; } } try { return future.get(); } catch (ExecutionException e) { throw new IOException2(e); } } } private static abstract class DirScanner implements Serializable { abstract void scan(File dir, FileVisitor visitor) throws IOException; /** * Scans everything recursively. */ private static class Full extends DirScanner { private void scan(File f, String path, FileVisitor visitor) throws IOException { if (f.canRead()) { visitor.visit(f,path+f.getName()); if(f.isDirectory()) { for( File child : f.listFiles() ) scan(child,path+f.getName()+'/',visitor); } } } void scan(File dir, FileVisitor visitor) throws IOException { scan(dir,"",visitor); } private static final long serialVersionUID = 1L; } /** * Scans by filtering things out from {@link FileFilter} */ private static class Filter extends Full { private final FileFilter filter; Filter(FileFilter filter) { this.filter = filter; } @Override void scan(File dir, FileVisitor visitor) throws IOException { super.scan(dir,visitor.with(filter)); } private static final long serialVersionUID = 1L; } /** * Scans by using Ant GLOB syntax. */ private static class Glob extends DirScanner { private final String includes, excludes; private Glob(String includes, String excludes) { this.includes = includes; this.excludes = excludes; } void scan(File dir, FileVisitor visitor) throws IOException { if(fixEmpty(includes)==null && excludes==null) { // optimization new Full().scan(dir,visitor); return; } FileSet fs = Util.createFileSet(dir,includes,excludes); if(dir.exists()) { DirectoryScanner ds = fs.getDirectoryScanner(new org.apache.tools.ant.Project()); for( String f : ds.getIncludedFiles()) { File file = new File(dir, f); visitor.visit(file,f); } } } private static final long serialVersionUID = 1L; } private static final long serialVersionUID = 1L; } /** * Visits files in a directory recursively. * Primarily used for building an archive with various filtering. */ private static abstract class FileVisitor { /** * Caleld for each file and directory that matches the criteria. * * @param relativePath * The file/directory name in question */ abstract void visit(File f, String relativePath) throws IOException; /** * Decorates by a given filter. */ FileVisitor with(FileFilter f) { if(f==null) return this; return new FilterFileVisitor(f,this); } } private static final class FilterFileVisitor extends FileVisitor implements Serializable { private final FileFilter filter; private final FileVisitor visitor; private FilterFileVisitor(FileFilter filter, FileVisitor visitor) { this.filter = filter!=null ? filter : PASS_THROUGH; this.visitor = visitor; } public void visit(File f, String relativePath) throws IOException { if(f.isDirectory() || filter.accept(f)) visitor.visit(f,relativePath); } private static final FileFilter PASS_THROUGH = new FileFilter() { public boolean accept(File pathname) { return true; } }; private static final long serialVersionUID = 1L; } private static interface ArchiverFactory extends Serializable { Archiver create(OutputStream out); } private static final class TarArchiverFactory implements ArchiverFactory, Serializable { public Archiver create(OutputStream out) { return new TarWriter(out); } private static final long serialVersionUID = 1L; } private static final class ZipArchiverFactory implements ArchiverFactory, Serializable { public Archiver create(OutputStream out) { return new ZipWriter(out); } private static final long serialVersionUID = 1L; } /** * Base for {@link TarWriter} and {@link ZipWriter}. */ private static abstract class Archiver extends FileVisitor implements Closeable { protected int entriesWritten =0; /** * Number of files/directories archived. */ public int countEntries() { return entriesWritten; } } /** * {@link FileVisitor} that creates a tar archive. */ private static final class TarWriter extends Archiver { private final byte[] buf = new byte[8192]; private final TarOutputStream tar; private TarWriter(OutputStream out) { tar = new TarOutputStream(new BufferedOutputStream(out) { // TarOutputStream uses TarBuffer internally, // which flushes the stream for each block. this creates unnecessary // data stream fragmentation, and flush request to a remote, which slows things down. @Override public void flush() throws IOException { // so don't do anything in flush } }); tar.setLongFileMode(TarOutputStream.LONGFILE_GNU); } public void visit(File file, String relativePath) throws IOException { if(Functions.isWindows()) relativePath = relativePath.replace('\\','/'); if(file.isDirectory()) relativePath+='/'; TarEntry te = new TarEntry(relativePath); te.setModTime(file.lastModified()); if(!file.isDirectory()) te.setSize(file.length()); tar.putNextEntry(te); if (!file.isDirectory()) { FileInputStream in = new FileInputStream(file); int len; while((len=in.read(buf))>=0) tar.write(buf,0,len); in.close(); } tar.closeEntry(); entriesWritten++; } public void close() throws IOException { tar.close(); } } /** * {@link FileVisitor} that creates a zip archive. */ private static final class ZipWriter extends Archiver { private final byte[] buf = new byte[8192]; private final ZipOutputStream zip; private ZipWriter(OutputStream out) { zip = new ZipOutputStream(out); zip.setEncoding(System.getProperty("file.encoding")); } public void visit(File f, String relativePath) throws IOException { if(f.isDirectory()) { ZipEntry dirZipEntry = new ZipEntry(relativePath+'/'); // Setting this bit explicitly is needed by some unzipping applications (see HUDSON-3294). dirZipEntry.setExternalAttributes(BITMASK_IS_DIRECTORY); zip.putNextEntry(dirZipEntry); zip.closeEntry(); } else { zip.putNextEntry(new ZipEntry(relativePath)); FileInputStream in = new FileInputStream(f); int len; while((len=in.read(buf))>0) zip.write(buf,0,len); in.close(); zip.closeEntry(); } entriesWritten++; } public void close() throws IOException { zip.close(); } // Bitmask indicating directories in 'external attributes' of a ZIP archive entry. private static final long BITMASK_IS_DIRECTORY = 1<<4; } /** * Writes files in 'this' directory to a tar stream. * * @param glob * Ant file pattern mask, like "**&#x2F;*.java". */ public int tar(OutputStream out, final String glob) throws IOException, InterruptedException { return archive(new TarArchiverFactory(), out, glob); } public int tar(OutputStream out, FileFilter filter) throws IOException, InterruptedException { return archive(new TarArchiverFactory(), out, filter); } /** * Writes to a tar stream and stores obtained files to the base dir. * * @return * number of files/directories that are written. */ private Integer writeToTar(File baseDir, String fileMask, String excludes, OutputStream out) throws IOException { TarWriter tw = new TarWriter(out); try { new DirScanner.Glob(fileMask,excludes).scan(baseDir,tw); } finally { tw.close(); } return tw.entriesWritten; } /** * Reads from a tar stream and stores obtained files to the base dir. */ private static void readFromTar(String name, File baseDir, InputStream in) throws IOException { TarInputStream t = new TarInputStream(in); try { TarEntry te; while ((te = t.getNextEntry()) != null) { File f = new File(baseDir,te.getName()); if(te.isDirectory()) { f.mkdirs(); } else { File parent = f.getParentFile(); if (parent != null) parent.mkdirs(); OutputStream fos = new FileOutputStream(f); try { IOUtils.copy(t,fos); } finally { fos.close(); } f.setLastModified(te.getModTime().getTime()); int mode = te.getMode()&0777; if(mode!=0 && !Hudson.isWindows()) // be defensive try { LIBC.chmod(f.getPath(),mode); } catch (NoClassDefFoundError e) { // be defensive. see http://www.nabble.com/-3.0.6--Site-copy-problem%3A-hudson.util.IOException2%3A--java.lang.NoClassDefFoundError%3A-Could-not-initialize-class--hudson.util.jna.GNUCLibrary-td23588879.html } } } } catch(IOException e) { throw new IOException2("Failed to extract "+name,e); } finally { t.close(); } } /** * Creates a {@link Launcher} for starting processes on the node * that has this file. * @since 1.89 */ public Launcher createLauncher(TaskListener listener) throws IOException, InterruptedException { if(channel==null) return new LocalLauncher(listener); else return new RemoteLauncher(listener,channel,channel.call(new IsUnix())); } private static final class IsUnix implements Callable<Boolean,IOException> { public Boolean call() throws IOException { return File.pathSeparatorChar==':'; } private static final long serialVersionUID = 1L; } /** * Validates the ant file mask (like "foo/bar/*.txt, zot/*.jar") * against this directory, and try to point out the problem. * * <p> * This is useful in conjunction with {@link FormValidation}. * * @return * null if no error was found. Otherwise returns a human readable error message. * @since 1.90 * @see #validateFileMask(FilePath, String) */ public String validateAntFileMask(final String fileMasks) throws IOException, InterruptedException { return act(new FileCallable<String>() { public String invoke(File dir, VirtualChannel channel) throws IOException { if(fileMasks.startsWith("~")) return Messages.FilePath_TildaDoesntWork(); StringTokenizer tokens = new StringTokenizer(fileMasks,","); while(tokens.hasMoreTokens()) { final String fileMask = tokens.nextToken().trim(); if(hasMatch(dir,fileMask)) continue; // no error on this portion // in 1.172 we introduced an incompatible change to stop using ' ' as the separator // so see if we can match by using ' ' as the separator if(fileMask.contains(" ")) { boolean matched = true; for (String token : Util.tokenize(fileMask)) matched &= hasMatch(dir,token); if(matched) return Messages.FilePath_validateAntFileMask_whitespaceSeprator(); } // a common mistake is to assume the wrong base dir, and there are two variations // to this: (1) the user gave us aa/bb/cc/dd where cc/dd was correct // and (2) the user gave us cc/dd where aa/bb/cc/dd was correct. {// check the (1) above first String f=fileMask; while(true) { int idx = findSeparator(f); if(idx==-1) break; f=f.substring(idx+1); if(hasMatch(dir,f)) return Messages.FilePath_validateAntFileMask_doesntMatchAndSuggest(fileMask,f); } } {// check the (2) above next as this is more expensive. // Try prepending "**/" to see if that results in a match FileSet fs = Util.createFileSet(dir,"**/"+fileMask); DirectoryScanner ds = fs.getDirectoryScanner(new Project()); if(ds.getIncludedFilesCount()!=0) { // try shorter name first so that the suggestion results in least amount of changes String[] names = ds.getIncludedFiles(); Arrays.sort(names,SHORTER_STRING_FIRST); for( String f : names) { // now we want to decompose f to the leading portion that matched "**" // and the trailing portion that matched the file mask, so that // we can suggest the user error. // // this is not a very efficient/clever way to do it, but it's relatively simple String prefix=""; while(true) { int idx = findSeparator(f); if(idx==-1) break; prefix+=f.substring(0,idx)+'/'; f=f.substring(idx+1); if(hasMatch(dir,prefix+fileMask)) return Messages.FilePath_validateAntFileMask_doesntMatchAndSuggest(fileMask, prefix+fileMask); } } } } {// finally, see if we can identify any sub portion that's valid. Otherwise bail out String previous = null; String pattern = fileMask; while(true) { if(hasMatch(dir,pattern)) { // found a match if(previous==null) return Messages.FilePath_validateAntFileMask_portionMatchAndSuggest(fileMask,pattern); else return Messages.FilePath_validateAntFileMask_portionMatchButPreviousNotMatchAndSuggest(fileMask,pattern,previous); } int idx = findSeparator(pattern); if(idx<0) {// no more path component left to go back if(pattern.equals(fileMask)) return Messages.FilePath_validateAntFileMask_doesntMatchAnything(fileMask); else return Messages.FilePath_validateAntFileMask_doesntMatchAnythingAndSuggest(fileMask,pattern); } // cut off the trailing component and try again previous = pattern; pattern = pattern.substring(0,idx); } } } return null; // no error } private boolean hasMatch(File dir, String pattern) { FileSet fs = Util.createFileSet(dir,pattern); DirectoryScanner ds = fs.getDirectoryScanner(new Project()); return ds.getIncludedFilesCount()!=0 || ds.getIncludedDirsCount()!=0; } /** * Finds the position of the first path separator. */ private int findSeparator(String pattern) { int idx1 = pattern.indexOf('\\'); int idx2 = pattern.indexOf('/'); if(idx1==-1) return idx2; if(idx2==-1) return idx1; return Math.min(idx1,idx2); } }); } /** * Shortcut for {@link #validateFileMask(String)} in case the left-hand side can be null. */ public static FormValidation validateFileMask(FilePath pathOrNull, String value) throws IOException { if(pathOrNull==null) return FormValidation.ok(); return pathOrNull.validateFileMask(value); } /** * Short for {@code validateFileMask(value,true)} */ public FormValidation validateFileMask(String value) throws IOException { return validateFileMask(value,true); } /** * Checks the GLOB-style file mask. See {@link #validateAntFileMask(String)}. * Requires configure permission on ancestor AbstractProject object in request. * @since 1.294 */ public FormValidation validateFileMask(String value, boolean errorIfNotExist) throws IOException { AbstractProject subject = Stapler.getCurrentRequest().findAncestorObject(AbstractProject.class); subject.checkPermission(Item.CONFIGURE); value = fixEmpty(value); if(value==null) return FormValidation.ok(); try { if(!exists()) // no workspace. can't check return FormValidation.ok(); String msg = validateAntFileMask(value); if(errorIfNotExist) return FormValidation.error(msg); else return FormValidation.warning(msg); } catch (InterruptedException e) { return FormValidation.ok(); } } /** * Validates a relative file path from this {@link FilePath}. * Requires configure permission on ancestor AbstractProject object in request. * * @param value * The relative path being validated. * @param errorIfNotExist * If true, report an error if the given relative path doesn't exist. Otherwise it's a warning. * @param expectingFile * If true, we expect the relative path to point to a file. * Otherwise, the relative path is expected to be pointing to a directory. */ public FormValidation validateRelativePath(String value, boolean errorIfNotExist, boolean expectingFile) throws IOException { AbstractProject subject = Stapler.getCurrentRequest().findAncestorObject(AbstractProject.class); subject.checkPermission(Item.CONFIGURE); value = fixEmpty(value); // none entered yet, or something is seriously wrong if(value==null || (AbstractProject<?,?>)subject ==null) return FormValidation.ok(); // a common mistake is to use wildcard if(value.contains("*")) return FormValidation.error(Messages.FilePath_validateRelativePath_wildcardNotAllowed()); try { if(!exists()) // no base directory. can't check return FormValidation.ok(); FilePath path = child(value); if(path.exists()) { if (expectingFile) { if(!path.isDirectory()) return FormValidation.ok(); else return FormValidation.error(Messages.FilePath_validateRelativePath_notFile(value)); } else { if(path.isDirectory()) return FormValidation.ok(); else return FormValidation.error(Messages.FilePath_validateRelativePath_notDirectory(value)); } } String msg = expectingFile ? Messages.FilePath_validateRelativePath_noSuchFile(value) : Messages.FilePath_validateRelativePath_noSuchDirectory(value); if(errorIfNotExist) return FormValidation.error(msg); else return FormValidation.warning(msg); } catch (InterruptedException e) { return FormValidation.ok(); } } /** * A convenience method over {@link #validateRelativePath(String, boolean, boolean)}. */ public FormValidation validateRelativeDirectory(String value, boolean errorIfNotExist) throws IOException { return validateRelativePath(value,errorIfNotExist,false); } public FormValidation validateRelativeDirectory(String value) throws IOException { return validateRelativeDirectory(value,true); } @Deprecated @Override public String toString() { // to make writing JSPs easily, return local return remote; } public VirtualChannel getChannel() { if(channel!=null) return channel; else return Hudson.MasterComputer.localChannel; } /** * Returns true if this {@link FilePath} represents a remote file. */ public boolean isRemote() { return channel!=null; } private void writeObject(ObjectOutputStream oos) throws IOException { Channel target = Channel.current(); if(channel!=null && channel!=target) throw new IllegalStateException("Can't send a remote FilePath to a different remote channel"); oos.defaultWriteObject(); oos.writeBoolean(channel==null); } private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { Channel channel = Channel.current(); assert channel!=null; ois.defaultReadObject(); if(ois.readBoolean()) { this.channel = channel; } else { this.channel = null; } } private static final long serialVersionUID = 1L; public static int SIDE_BUFFER_SIZE = 1024; /** * Adapts {@link FileCallable} to {@link Callable}. */ private class FileCallableWrapper<T> implements DelegatingCallable<T,IOException> { private final FileCallable<T> callable; private transient ClassLoader classLoader; public FileCallableWrapper(FileCallable<T> callable) { this.callable = callable; this.classLoader = callable.getClass().getClassLoader(); } private FileCallableWrapper(FileCallable<T> callable, ClassLoader classLoader) { this.callable = callable; this.classLoader = classLoader; } public T call() throws IOException { return callable.invoke(new File(remote), Channel.current()); } public ClassLoader getClassLoader() { return classLoader; } private static final long serialVersionUID = 1L; } private static final Comparator<String> SHORTER_STRING_FIRST = new Comparator<String>() { public int compare(String o1, String o2) { return o1.length()-o2.length(); } }; }
core/src/main/java/hudson/FilePath.java
/* * The MIT License * * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Eric Lefevre-Ardant, Erik Ramfelt, Michael B. Donohue * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package hudson; import hudson.Launcher.LocalLauncher; import hudson.Launcher.RemoteLauncher; import hudson.model.Hudson; import hudson.model.TaskListener; import hudson.model.AbstractProject; import hudson.model.Item; import hudson.remoting.Callable; import hudson.remoting.Channel; import hudson.remoting.DelegatingCallable; import hudson.remoting.Future; import hudson.remoting.Pipe; import hudson.remoting.RemoteOutputStream; import hudson.remoting.VirtualChannel; import hudson.remoting.RemoteInputStream; import hudson.util.IOException2; import hudson.util.HeadBufferingStream; import hudson.util.FormValidation; import static hudson.util.jna.GNUCLibrary.LIBC; import static hudson.Util.fixEmpty; import static hudson.FilePath.TarCompression.GZIP; import hudson.os.PosixAPI; import hudson.org.apache.tools.tar.TarOutputStream; import hudson.org.apache.tools.tar.TarInputStream; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DirectoryScanner; import org.apache.tools.ant.Project; import org.apache.tools.ant.taskdefs.Copy; import org.apache.tools.ant.types.FileSet; import org.apache.tools.tar.TarEntry; import org.apache.tools.zip.ZipOutputStream; import org.apache.tools.zip.ZipEntry; import org.apache.commons.io.IOUtils; import org.apache.commons.io.input.CountingInputStream; import org.apache.commons.fileupload.FileItem; import org.kohsuke.stapler.Stapler; import org.jvnet.robust_http_client.RetryableHttpStream; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileFilter; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.OutputStream; import java.io.Serializable; import java.io.Writer; import java.io.OutputStreamWriter; import java.io.Closeable; import java.net.URI; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; import java.util.Arrays; import java.util.Comparator; import java.util.regex.Pattern; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.zip.GZIPOutputStream; import java.util.zip.GZIPInputStream; import java.util.zip.ZipInputStream; import com.sun.jna.Native; /** * {@link File} like object with remoting support. * * <p> * Unlike {@link File}, which always implies a file path on the current computer, * {@link FilePath} represents a file path on a specific slave or the master. * * Despite that, {@link FilePath} can be used much like {@link File}. It exposes * a bunch of operations (and we should add more operations as long as they are * generally useful), and when invoked against a file on a remote node, {@link FilePath} * executes the necessary code remotely, thereby providing semi-transparent file * operations. * * <h2>Using {@link FilePath} smartly</h2> * <p> * The transparency makes it easy to write plugins without worrying too much about * remoting, by making it works like NFS, where remoting happens at the file-system * later. * * <p> * But one should note that such use of remoting may not be optional. Sometimes, * it makes more sense to move some computation closer to the data, as opposed to * move the data to the computation. For example, if you are just computing a MD5 * digest of a file, then it would make sense to do the digest on the host where * the file is located, as opposed to send the whole data to the master and do MD5 * digesting there. * * <p> * {@link FilePath} supports this "code migration" by in the * {@link #act(FileCallable)} method. One can pass in a custom implementation * of {@link FileCallable}, to be executed on the node where the data is located. * The following code shows the example: * * <pre> * FilePath file = ...; * * // make 'file' a fresh empty directory. * file.act(new FileCallable&lt;Void>() { * // if 'file' is on a different node, this FileCallable will * // be transfered to that node and executed there. * public Void invoke(File f,VirtualChannel channel) { * // f and file represents the same thing * f.deleteContents(); * f.mkdirs(); * } * }); * </pre> * * <p> * When {@link FileCallable} is transfered to a remote node, it will be done so * by using the same Java serialization scheme that the remoting module uses. * See {@link Channel} for more about this. * * <p> * {@link FilePath} itself can be sent over to a remote node as a part of {@link Callable} * serialization. For example, sending a {@link FilePath} of a remote node to that * node causes {@link FilePath} to become "local". Similarly, sending a * {@link FilePath} that represents the local computer causes it to become "remote." * * @author Kohsuke Kawaguchi */ public final class FilePath implements Serializable { /** * When this {@link FilePath} represents the remote path, * this field is always non-null on master (the field represents * the channel to the remote slave.) When transferred to a slave via remoting, * this field reverts back to null, since it's transient. * * When this {@link FilePath} represents a path on the master, * this field is null on master. When transferred to a slave via remoting, * this field becomes non-null, representing the {@link Channel} * back to the master. * * This is used to determine whether we are running on the master or the slave. */ private transient VirtualChannel channel; // since the platform of the slave might be different, can't use java.io.File private final String remote; /** * Creates a {@link FilePath} that represents a path on the given node. * * @param channel * To create a path that represents a remote path, pass in a {@link Channel} * that's connected to that machine. If null, that means the local file path. */ public FilePath(VirtualChannel channel, String remote) { this.channel = channel; this.remote = remote; } /** * To create {@link FilePath} that represents a "local" path. * * <p> * A "local" path means a file path on the computer where the * constructor invocation happened. */ public FilePath(File localPath) { this.channel = null; this.remote = localPath.getPath(); } /** * Construct a path starting with a base location. * @param base starting point for resolution, and defines channel * @param rel a path which if relative will be resolved against base */ public FilePath(FilePath base, String rel) { this.channel = base.channel; if(isAbsolute(rel)) { // absolute this.remote = rel; } else if(base.isUnix()) { this.remote = base.remote+'/'+rel; } else { this.remote = base.remote+'\\'+rel; } } private static boolean isAbsolute(String rel) { return rel.startsWith("/") || DRIVE_PATTERN.matcher(rel).matches(); } private static final Pattern DRIVE_PATTERN = Pattern.compile("[A-Za-z]:\\\\.*"); /** * Checks if the remote path is Unix. */ private boolean isUnix() { // if the path represents a local path, there' no need to guess. if(!isRemote()) return File.pathSeparatorChar!=';'; // note that we can't use the usual File.pathSeparator and etc., as the OS of // the machine where this code runs and the OS that this FilePath refers to may be different. // Windows absolute path is 'X:\...', so this is usually a good indication of Windows path if(remote.length()>3 && remote.charAt(1)==':' && remote.charAt(2)=='\\') return false; // Windows can handle '/' as a path separator but Unix can't, // so err on Unix side return remote.indexOf("\\")==-1; } public String getRemote() { return remote; } /** * Creates a zip file from this directory or a file and sends that to the given output stream. * * @deprecated as of 1.315. Use {@link #zip(OutputStream)} that has more consistent name. */ public void createZipArchive(OutputStream os) throws IOException, InterruptedException { zip(os); } /** * Creates a zip file from this directory or a file and sends that to the given output stream. */ public void zip(OutputStream os) throws IOException, InterruptedException { zip(os,(FileFilter)null); } /** * Creates a zip file from this directory by using the specified filter, * and sends the result to the given output stream. * * @param filter * Must be serializable since it may be executed remotely. Can be null to add all files. * * @since 1.315 */ public void zip(OutputStream os, FileFilter filter) throws IOException, InterruptedException { archive(new ZipArchiverFactory(),os,filter); } /** * Creates a zip file from this directory by only including the files that match the given glob. * * @param glob * Ant style glob, like "**&#x2F;*.xml". If empty or null, this method * works like {@link #createZipArchive(OutputStream)} * * @since 1.129 * @deprecated as of 1.315 * Use {@link #zip(OutputStream,String)} that has more consistent name. */ public void createZipArchive(OutputStream os, final String glob) throws IOException, InterruptedException { archive(new ZipArchiverFactory(),os,glob); } /** * Creates a zip file from this directory by only including the files that match the given glob. * * @param glob * Ant style glob, like "**&#x2F;*.xml". If empty or null, this method * works like {@link #createZipArchive(OutputStream)} * * @since 1.315 */ public void zip(OutputStream os, final String glob) throws IOException, InterruptedException { archive(new ZipArchiverFactory(),os,glob); } /** * Archives this directory into the specified archive format, to the given {@link OutputStream}, by using * {@link DirScanner} to choose what files to include. * * @return * number of files/directories archived. This is only really useful to check for a situation where nothing * is archived. */ private int archive(final ArchiverFactory factory, OutputStream os, final DirScanner scanner) throws IOException, InterruptedException { final OutputStream out = (channel!=null)?new RemoteOutputStream(os):os; return act(new FileCallable<Integer>() { public Integer invoke(File f, VirtualChannel channel) throws IOException { Archiver a = factory.create(out); try { scanner.scan(f,a); } finally { a.close(); } return a.countEntries(); } private static final long serialVersionUID = 1L; }); } private int archive(final ArchiverFactory factory, OutputStream os, final FileFilter filter) throws IOException, InterruptedException { return archive(factory,os,new DirScanner.Filter(filter)); } private int archive(final ArchiverFactory factory, OutputStream os, final String glob) throws IOException, InterruptedException { return archive(factory,os,new DirScanner.Glob(glob,null)); } /** * When this {@link FilePath} represents a zip file, extracts that zip file. * * @param target * Target directory to expand files to. All the necessary directories will be created. * @since 1.248 * @see #unzipFrom(InputStream) */ public void unzip(final FilePath target) throws IOException, InterruptedException { target.act(new FileCallable<Void>() { public Void invoke(File dir, VirtualChannel channel) throws IOException { unzip(dir,FilePath.this.read()); return null; } private static final long serialVersionUID = 1L; }); } /** * When this {@link FilePath} represents a tar file, extracts that tar file. * * @param target * Target directory to expand files to. All the necessary directories will be created. * @param compression * Compression mode of this tar file. * @since 1.292 * @see #untarFrom(InputStream, TarCompression) */ public void untar(final FilePath target, final TarCompression compression) throws IOException, InterruptedException { target.act(new FileCallable<Void>() { public Void invoke(File dir, VirtualChannel channel) throws IOException { readFromTar(FilePath.this.getName(),dir,compression.extract(FilePath.this.read())); return null; } private static final long serialVersionUID = 1L; }); } /** * Reads the given InputStream as a zip file and extracts it into this directory. * * @param _in * The stream will be closed by this method after it's fully read. * @since 1.283 * @see #unzip(FilePath) */ public void unzipFrom(InputStream _in) throws IOException, InterruptedException { final InputStream in = new RemoteInputStream(_in); act(new FileCallable<Void>() { public Void invoke(File dir, VirtualChannel channel) throws IOException { unzip(dir, in); return null; } private static final long serialVersionUID = 1L; }); } private void unzip(File dir, InputStream in) throws IOException { dir = dir.getAbsoluteFile(); // without absolutization, getParentFile below seems to fail ZipInputStream zip = new ZipInputStream(new BufferedInputStream(in)); java.util.zip.ZipEntry e; try { while((e=zip.getNextEntry())!=null) { File f = new File(dir,e.getName()); if(e.isDirectory()) { f.mkdirs(); } else { File p = f.getParentFile(); if(p!=null) p.mkdirs(); FileOutputStream out = new FileOutputStream(f); try { IOUtils.copy(zip, out); } finally { out.close(); } f.setLastModified(e.getTime()); zip.closeEntry(); } } } finally { zip.close(); } } /** * Absolutizes this {@link FilePath} and returns the new one. */ public FilePath absolutize() throws IOException, InterruptedException { return new FilePath(channel,act(new FileCallable<String>() { public String invoke(File f, VirtualChannel channel) throws IOException { return f.getAbsolutePath(); } })); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FilePath that = (FilePath) o; if (channel != null ? !channel.equals(that.channel) : that.channel != null) return false; return remote.equals(that.remote); } @Override public int hashCode() { return 31 * (channel != null ? channel.hashCode() : 0) + remote.hashCode(); } /** * Supported tar file compression methods. */ public enum TarCompression { NONE { public InputStream extract(InputStream in) { return in; } public OutputStream compress(OutputStream out) { return out; } }, GZIP { public InputStream extract(InputStream _in) throws IOException { HeadBufferingStream in = new HeadBufferingStream(_in,SIDE_BUFFER_SIZE); try { return new GZIPInputStream(in,8192); } catch (IOException e) { // various people reported "java.io.IOException: Not in GZIP format" here, so diagnose this problem better in.fillSide(); throw new IOException2(e.getMessage()+"\nstream="+Util.toHexString(in.getSideBuffer()),e); } } public OutputStream compress(OutputStream out) throws IOException { return new GZIPOutputStream(new BufferedOutputStream(out)); } }; public abstract InputStream extract(InputStream in) throws IOException; public abstract OutputStream compress(OutputStream in) throws IOException; } /** * Reads the given InputStream as a tar file and extracts it into this directory. * * @param _in * The stream will be closed by this method after it's fully read. * @param compression * The compression method in use. * @since 1.292 */ public void untarFrom(InputStream _in, final TarCompression compression) throws IOException, InterruptedException { try { final InputStream in = new RemoteInputStream(_in); act(new FileCallable<Void>() { public Void invoke(File dir, VirtualChannel channel) throws IOException { readFromTar("input stream",dir, compression.extract(in)); return null; } private static final long serialVersionUID = 1L; }); } finally { IOUtils.closeQuietly(_in); } } /** * Given a tgz/zip file, extracts it to the given target directory, if necessary. * * <p> * This method is a convenience method designed for installing a binary package to a location * that supports upgrade and downgrade. Specifically, * * <ul> * <li>If the target directory doesn't exist {@linkplain #mkdirs() it'll be created}. * <li>The timestamp of the .tgz file is left in the installation directory upon extraction. * <li>If the timestamp left in the directory doesn't match with the timestamp of the current archive file, * the directory contents will be discarded and the archive file will be re-extracted. * <li>If the connection is refused but the target directory already exists, it is left alone. * </ul> * * @param archive * The resource that represents the tgz/zip file. This URL must support the "Last-Modified" header. * (Most common usage is to get this from {@link ClassLoader#getResource(String)}) * @param listener * If non-null, a message will be printed to this listener once this method decides to * extract an archive. * @return * true if the archive was extracted. false if the extraction was skipped because the target directory * was considered up to date. * @since 1.299 */ public boolean installIfNecessaryFrom(URL archive, TaskListener listener, String message) throws IOException, InterruptedException { URLConnection con; try { con = archive.openConnection(); con.connect(); } catch (IOException x) { if (this.exists()) { // Cannot connect now, so assume whatever was last unpacked is still OK. if (listener != null) { listener.getLogger().println("Skipping installation of " + archive + " to " + remote + ": " + x); } return false; } else { throw x; } } long sourceTimestamp = con.getLastModified(); FilePath timestamp = this.child(".timestamp"); if(this.exists()) { if(timestamp.exists() && sourceTimestamp ==timestamp.lastModified()) return false; // already up to date this.deleteContents(); } else { this.mkdirs(); } if(listener!=null) listener.getLogger().println(message); // for HTTP downloads, enable automatic retry for added resilience InputStream in = archive.getProtocol().equals("http") ? new RetryableHttpStream(archive) : con.getInputStream(); CountingInputStream cis = new CountingInputStream(in); try { if(archive.toExternalForm().endsWith(".zip")) unzipFrom(cis); else untarFrom(cis,GZIP); } catch (IOException e) { throw new IOException2(String.format("Failed to unpack %s (%d bytes read of total %d)", archive,cis.getByteCount(),con.getContentLength()),e); } timestamp.touch(sourceTimestamp); return true; } /** * Reads the URL on the current VM, and writes all the data to this {@link FilePath} * (this is different from resolving URL remotely.) * * @since 1.293 */ public void copyFrom(URL url) throws IOException, InterruptedException { InputStream in = url.openStream(); try { copyFrom(in); } finally { in.close(); } } /** * Replaces the content of this file by the data from the given {@link InputStream}. * * @since 1.293 */ public void copyFrom(InputStream in) throws IOException, InterruptedException { OutputStream os = write(); try { IOUtils.copy(in, os); } finally { os.close(); } } /** * Conveniene method to call {@link FilePath#copyTo(FilePath)}. * * @since 1.311 */ public void copyFrom(FilePath src) throws IOException, InterruptedException { src.copyTo(this); } /** * Place the data from {@link FileItem} into the file location specified by this {@link FilePath} object. */ public void copyFrom(FileItem file) throws IOException, InterruptedException { if(channel==null) { try { file.write(new File(remote)); } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException2(e); } } else { InputStream i = file.getInputStream(); OutputStream o = write(); try { IOUtils.copy(i,o); } finally { o.close(); i.close(); } } } /** * Code that gets executed on the machine where the {@link FilePath} is local. * Used to act on {@link FilePath}. * * @see FilePath#act(FileCallable) */ public static interface FileCallable<T> extends Serializable { /** * Performs the computational task on the node where the data is located. * * @param f * {@link File} that represents the local file that {@link FilePath} has represented. * @param channel * The "back pointer" of the {@link Channel} that represents the communication * with the node from where the code was sent. */ T invoke(File f, VirtualChannel channel) throws IOException; } /** * Executes some program on the machine that this {@link FilePath} exists, * so that one can perform local file operations. */ public <T> T act(final FileCallable<T> callable) throws IOException, InterruptedException { return act(callable,callable.getClass().getClassLoader()); } private <T> T act(final FileCallable<T> callable, ClassLoader cl) throws IOException, InterruptedException { if(channel!=null) { // run this on a remote system try { return channel.call(new FileCallableWrapper<T>(callable,cl)); } catch (AbortException e) { throw e; // pass through so that the caller can catch it as AbortException } catch (IOException e) { // wrap it into a new IOException so that we get the caller's stack trace as well. throw new IOException2("remote file operation failed",e); } } else { // the file is on the local machine. return callable.invoke(new File(remote), Hudson.MasterComputer.localChannel); } } /** * Executes some program on the machine that this {@link FilePath} exists, * so that one can perform local file operations. */ public <T> Future<T> actAsync(final FileCallable<T> callable) throws IOException, InterruptedException { try { return (channel!=null ? channel : Hudson.MasterComputer.localChannel) .callAsync(new FileCallableWrapper<T>(callable)); } catch (IOException e) { // wrap it into a new IOException so that we get the caller's stack trace as well. throw new IOException2("remote file operation failed",e); } } /** * Executes some program on the machine that this {@link FilePath} exists, * so that one can perform local file operations. */ public <V,E extends Throwable> V act(Callable<V,E> callable) throws IOException, InterruptedException, E { if(channel!=null) { // run this on a remote system return channel.call(callable); } else { // the file is on the local machine return callable.call(); } } /** * Converts this file to the URI, relative to the machine * on which this file is available. */ public URI toURI() throws IOException, InterruptedException { return act(new FileCallable<URI>() { public URI invoke(File f, VirtualChannel channel) { return f.toURI(); } }); } /** * Creates this directory. */ public void mkdirs() throws IOException, InterruptedException { if(!act(new FileCallable<Boolean>() { public Boolean invoke(File f, VirtualChannel channel) throws IOException { if(f.mkdirs() || f.exists()) return true; // OK // following Ant <mkdir> task to avoid possible race condition. try { Thread.sleep(10); } catch (InterruptedException e) { // ignore } return f.mkdirs() || f.exists(); } })) throw new IOException("Failed to mkdirs: "+remote); } /** * Deletes this directory, including all its contents recursively. */ public void deleteRecursive() throws IOException, InterruptedException { act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { Util.deleteRecursive(f); return null; } }); } /** * Deletes all the contents of this directory, but not the directory itself */ public void deleteContents() throws IOException, InterruptedException { act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { Util.deleteContentsRecursive(f); return null; } }); } /** * Gets the file name portion except the extension. * * For example, "foo" for "foo.txt" and "foo.tar" for "foo.tar.gz". */ public String getBaseName() { String n = getName(); int idx = n.lastIndexOf('.'); if (idx<0) return n; return n.substring(0,idx); } /** * Gets just the file name portion. * * This method assumes that the file name is the same between local and remote. */ public String getName() { String r = remote; if(r.endsWith("\\") || r.endsWith("/")) r = r.substring(0,r.length()-1); int len = r.length()-1; while(len>=0) { char ch = r.charAt(len); if(ch=='\\' || ch=='/') break; len--; } return r.substring(len+1); } /** * Short for {@code getParent().child(rel)}. Useful for getting other files in the same directory. */ public FilePath sibling(String rel) { return getParent().child(rel); } /** * Returns a {@link FilePath} by adding the given suffix to this path name. */ public FilePath withSuffix(String suffix) { return new FilePath(channel,remote+suffix); } /** * The same as {@link FilePath#FilePath(FilePath,String)} but more OO. * @param rel a relative or absolute path * @return a file on the same channel */ public FilePath child(String rel) { return new FilePath(this,rel); } /** * Gets the parent file. */ public FilePath getParent() { int len = remote.length()-1; while(len>=0) { char ch = remote.charAt(len); if(ch=='\\' || ch=='/') break; len--; } return new FilePath( channel, remote.substring(0,len) ); } /** * Creates a temporary file in the directory that this {@link FilePath} object designates. */ public FilePath createTempFile(final String prefix, final String suffix) throws IOException, InterruptedException { try { return new FilePath(this,act(new FileCallable<String>() { public String invoke(File dir, VirtualChannel channel) throws IOException { File f = File.createTempFile(prefix, suffix, dir); return f.getName(); } })); } catch (IOException e) { throw new IOException2("Failed to create a temp file on "+remote,e); } } /** * Creates a temporary file in this directory and set the contents by the * given text (encoded in the platform default encoding) */ public FilePath createTextTempFile(final String prefix, final String suffix, final String contents) throws IOException, InterruptedException { return createTextTempFile(prefix,suffix,contents,true); } /** * Creates a temporary file in this directory and set the contents by the * given text (encoded in the platform default encoding) */ public FilePath createTextTempFile(final String prefix, final String suffix, final String contents, final boolean inThisDirectory) throws IOException, InterruptedException { try { return new FilePath(channel,act(new FileCallable<String>() { public String invoke(File dir, VirtualChannel channel) throws IOException { if(!inThisDirectory) dir = new File(System.getProperty("java.io.tmpdir")); else dir.mkdirs(); File f; try { f = File.createTempFile(prefix, suffix, dir); } catch (IOException e) { throw new IOException2("Failed to create a temporary directory in "+dir,e); } Writer w = new FileWriter(f); w.write(contents); w.close(); return f.getAbsolutePath(); } })); } catch (IOException e) { throw new IOException2("Failed to create a temp file on "+remote,e); } } /** * Creates a temporary directory inside the directory represented by 'this' * @since 1.311 */ public FilePath createTempDir(final String prefix, final String suffix) throws IOException, InterruptedException { try { return new FilePath(this,act(new FileCallable<String>() { public String invoke(File dir, VirtualChannel channel) throws IOException { File f = File.createTempFile(prefix, suffix, dir); f.delete(); f.mkdir(); return f.getName(); } })); } catch (IOException e) { throw new IOException2("Failed to create a temp directory on "+remote,e); } } /** * Deletes this file. * @throws IOException if it exists but could not be successfully deleted * @return true, for a modicum of compatibility */ public boolean delete() throws IOException, InterruptedException { act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { Util.deleteFile(f); return null; } }); return true; } /** * Checks if the file exists. */ public boolean exists() throws IOException, InterruptedException { return act(new FileCallable<Boolean>() { public Boolean invoke(File f, VirtualChannel channel) throws IOException { return f.exists(); } }); } /** * Gets the last modified time stamp of this file, by using the clock * of the machine where this file actually resides. * * @see File#lastModified() * @see #touch(long) */ public long lastModified() throws IOException, InterruptedException { return act(new FileCallable<Long>() { public Long invoke(File f, VirtualChannel channel) throws IOException { return f.lastModified(); } }); } /** * Creates a file (if not already exist) and sets the timestamp. * * @since 1.299 */ public void touch(final long timestamp) throws IOException, InterruptedException { act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { if(!f.exists()) new FileOutputStream(f).close(); if(!f.setLastModified(timestamp)) throw new IOException("Failed to set the timestamp of "+f+" to "+timestamp); return null; } }); } /** * Checks if the file is a directory. */ public boolean isDirectory() throws IOException, InterruptedException { return act(new FileCallable<Boolean>() { public Boolean invoke(File f, VirtualChannel channel) throws IOException { return f.isDirectory(); } }); } /** * Returns the file size in bytes. * * @since 1.129 */ public long length() throws IOException, InterruptedException { return act(new FileCallable<Long>() { public Long invoke(File f, VirtualChannel channel) throws IOException { return f.length(); } }); } /** * Sets the file permission. * * On Windows, no-op. * * @param mask * File permission mask. To simplify the permission copying, * if the parameter is -1, this method becomes no-op. * @since 1.303 * @see #mode() */ public void chmod(final int mask) throws IOException, InterruptedException { if(!isUnix() || mask==-1) return; act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { if(LIBC.chmod(f.getAbsolutePath(),mask)!=0) throw new IOException("Failed to chmod "+f+" : "+LIBC.strerror(Native.getLastError())); return null; } }); } /** * Gets the file permission bit mask. * * @return * -1 on Windows, since such a concept doesn't make sense. * @since 1.311 * @see #chmod(int) */ public int mode() throws IOException, InterruptedException { if(!isUnix()) return -1; return act(new FileCallable<Integer>() { public Integer invoke(File f, VirtualChannel channel) throws IOException { return PosixAPI.get().stat(f.getPath()).mode(); } }); } /** * List up files and directories in this directory. * * <p> * This method returns direct children of the directory denoted by the 'this' object. */ public List<FilePath> list() throws IOException, InterruptedException { return list((FileFilter)null); } /** * List up subdirectories. * * @return can be empty but never null. Doesn't contain "." and ".." */ public List<FilePath> listDirectories() throws IOException, InterruptedException { return list(new DirectoryFilter()); } private static final class DirectoryFilter implements FileFilter, Serializable { public boolean accept(File f) { return f.isDirectory(); } private static final long serialVersionUID = 1L; } /** * List up files in this directory, just like {@link File#listFiles(FileFilter)}. * * @param filter * The optional filter used to narrow down the result. * If non-null, must be {@link Serializable}. * If this {@link FilePath} represents a remote path, * the filter object will be executed on the remote machine. */ public List<FilePath> list(final FileFilter filter) throws IOException, InterruptedException { if (filter != null && !(filter instanceof Serializable)) { throw new IllegalArgumentException("Non-serializable filter of " + filter.getClass()); } return act(new FileCallable<List<FilePath>>() { public List<FilePath> invoke(File f, VirtualChannel channel) throws IOException { File[] children = f.listFiles(filter); if(children ==null) return null; ArrayList<FilePath> r = new ArrayList<FilePath>(children.length); for (File child : children) r.add(new FilePath(child)); return r; } }, (filter!=null?filter:this).getClass().getClassLoader()); } /** * List up files in this directory that matches the given Ant-style filter. * * @param includes * See {@link FileSet} for the syntax. String like "foo/*.zip" or "foo/*&#42;/*.xml" * @return * can be empty but always non-null. */ public FilePath[] list(final String includes) throws IOException, InterruptedException { return act(new FileCallable<FilePath[]>() { public FilePath[] invoke(File f, VirtualChannel channel) throws IOException { String[] files = glob(f,includes); FilePath[] r = new FilePath[files.length]; for( int i=0; i<r.length; i++ ) r[i] = new FilePath(new File(f,files[i])); return r; } }); } /** * Runs Ant glob expansion. * * @return * A set of relative file names from the base directory. */ private static String[] glob(File dir, String includes) throws IOException { if(isAbsolute(includes)) throw new IOException("Expecting Ant GLOB pattern, but saw '"+includes+"'. See http://ant.apache.org/manual/CoreTypes/fileset.html for syntax"); FileSet fs = Util.createFileSet(dir,includes); DirectoryScanner ds = fs.getDirectoryScanner(new Project()); String[] files = ds.getIncludedFiles(); return files; } /** * Reads this file. */ public InputStream read() throws IOException { if(channel==null) return new FileInputStream(new File(remote)); final Pipe p = Pipe.createRemoteToLocal(); channel.callAsync(new Callable<Void,IOException>() { public Void call() throws IOException { FileInputStream fis=null; try { fis = new FileInputStream(new File(remote)); Util.copyStream(fis,p.getOut()); return null; } finally { IOUtils.closeQuietly(fis); IOUtils.closeQuietly(p.getOut()); } } }); return p.getIn(); } /** * Reads this file into a string, by using the current system encoding. */ public String readToString() throws IOException { InputStream in = read(); try { return IOUtils.toString(in); } finally { in.close(); } } /** * Writes to this file. * If this file already exists, it will be overwritten. * If the directory doesn't exist, it will be created. */ public OutputStream write() throws IOException, InterruptedException { if(channel==null) { File f = new File(remote).getAbsoluteFile(); f.getParentFile().mkdirs(); return new FileOutputStream(f); } return channel.call(new Callable<OutputStream,IOException>() { public OutputStream call() throws IOException { File f = new File(remote).getAbsoluteFile(); f.getParentFile().mkdirs(); FileOutputStream fos = new FileOutputStream(f); return new RemoteOutputStream(fos); } }); } /** * Overwrites this file by placing the given String as the content. * * @param encoding * Null to use the platform default encoding. * @since 1.105 */ public void write(final String content, final String encoding) throws IOException, InterruptedException { act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { f.getParentFile().mkdirs(); FileOutputStream fos = new FileOutputStream(f); Writer w = encoding != null ? new OutputStreamWriter(fos, encoding) : new OutputStreamWriter(fos); try { w.write(content); } finally { w.close(); } return null; } }); } /** * Computes the MD5 digest of the file in hex string. */ public String digest() throws IOException, InterruptedException { return act(new FileCallable<String>() { public String invoke(File f, VirtualChannel channel) throws IOException { return Util.getDigestOf(new FileInputStream(f)); } }); } /** * Rename this file/directory to the target filepath. This FilePath and the target must * be on the some host */ public void renameTo(final FilePath target) throws IOException, InterruptedException { if(this.channel != target.channel) { throw new IOException("renameTo target must be on the same host"); } act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { f.renameTo(new File(target.remote)); return null; } }); } /** * Moves all the contents of this directory into the specified directory, then delete this directory itself. * * @since 1.308. */ public void moveAllChildrenTo(final FilePath target) throws IOException, InterruptedException { if(this.channel != target.channel) { throw new IOException("pullUpTo target must be on the same host"); } act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { File t = new File(target.getRemote()); for(File child : f.listFiles()) { File target = new File(t, child.getName()); if(!child.renameTo(target)) throw new IOException("Failed to rename "+child+" to "+target); } f.delete(); return null; } }); } /** * Copies this file to the specified target. */ public void copyTo(FilePath target) throws IOException, InterruptedException { OutputStream out = target.write(); try { copyTo(out); } finally { out.close(); } } /** * Copies this file to the specified target, with file permissions intact. * @since 1.311 */ public void copyToWithPermission(FilePath target) throws IOException, InterruptedException { copyTo(target); // copy file permission target.chmod(mode()); } /** * Sends the contents of this file into the given {@link OutputStream}. */ public void copyTo(OutputStream os) throws IOException, InterruptedException { final OutputStream out = new RemoteOutputStream(os); act(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { FileInputStream fis = null; try { fis = new FileInputStream(f); Util.copyStream(fis,out); return null; } finally { IOUtils.closeQuietly(fis); IOUtils.closeQuietly(out); } } }); } /** * Remoting interface used for {@link FilePath#copyRecursiveTo(String, FilePath)}. * * TODO: this might not be the most efficient way to do the copy. */ interface RemoteCopier { /** * @param fileName * relative path name to the output file. Path separator must be '/'. */ void open(String fileName) throws IOException; void write(byte[] buf, int len) throws IOException; void close() throws IOException; } /** * Copies the contents of this directory recursively into the specified target directory. * @since 1.312 */ public int copyRecursiveTo(FilePath target) throws IOException, InterruptedException { return copyRecursiveTo("**/*",target); } public int copyRecursiveTo(String fileMask, FilePath target) throws IOException, InterruptedException { return copyRecursiveTo(fileMask,null,target); } /** * Copies the files that match the given file mask to the specified target node. * * @param fileMask * Ant GLOB pattern. * String like "foo/bar/*.xml" Multiple patterns can be separated * by ',', and whitespace can surround ',' (so that you can write * "abc, def" and "abc,def" to mean the same thing. * @param excludes * Files to be excluded. Can be null. * @return * the number of files copied. */ public int copyRecursiveTo(final String fileMask, final String excludes, final FilePath target) throws IOException, InterruptedException { if(this.channel==target.channel) { // local to local copy. return act(new FileCallable<Integer>() { public Integer invoke(File base, VirtualChannel channel) throws IOException { if(!base.exists()) return 0; assert target.channel==null; try { class CopyImpl extends Copy { private int copySize; public CopyImpl() { setProject(new org.apache.tools.ant.Project()); } @Override protected void doFileOperations() { copySize = super.fileCopyMap.size(); super.doFileOperations(); } public int getNumCopied() { return copySize; } } CopyImpl copyTask = new CopyImpl(); copyTask.setTodir(new File(target.remote)); copyTask.addFileset(Util.createFileSet(base,fileMask,excludes)); copyTask.setIncludeEmptyDirs(false); copyTask.execute(); return copyTask.getNumCopied(); } catch (BuildException e) { throw new IOException2("Failed to copy "+base+"/"+fileMask+" to "+target,e); } } }); } else if(this.channel==null) { // local -> remote copy final Pipe pipe = Pipe.createLocalToRemote(); Future<Void> future = target.actAsync(new FileCallable<Void>() { public Void invoke(File f, VirtualChannel channel) throws IOException { try { readFromTar(remote+'/'+fileMask, f,TarCompression.GZIP.extract(pipe.getIn())); return null; } finally { pipe.getIn().close(); } } }); int r = writeToTar(new File(remote),fileMask,excludes,TarCompression.GZIP.compress(pipe.getOut())); try { future.get(); } catch (ExecutionException e) { throw new IOException2(e); } return r; } else { // remote -> local copy final Pipe pipe = Pipe.createRemoteToLocal(); Future<Integer> future = actAsync(new FileCallable<Integer>() { public Integer invoke(File f, VirtualChannel channel) throws IOException { try { return writeToTar(f,fileMask,excludes,TarCompression.GZIP.compress(pipe.getOut())); } finally { pipe.getOut().close(); } } }); try { readFromTar(remote+'/'+fileMask,new File(target.remote),TarCompression.GZIP.extract(pipe.getIn())); } catch (IOException e) {// BuildException or IOException try { future.get(3,TimeUnit.SECONDS); throw e; // the remote side completed successfully, so the error must be local } catch (ExecutionException x) { // report both errors throw new IOException2(Functions.printThrowable(e),x); } catch (TimeoutException _) { // remote is hanging throw e; } } try { return future.get(); } catch (ExecutionException e) { throw new IOException2(e); } } } private static abstract class DirScanner implements Serializable { abstract void scan(File dir, FileVisitor visitor) throws IOException; /** * Scans everything recursively. */ private static class Full extends DirScanner { private void scan(File f, String path, FileVisitor visitor) throws IOException { if (f.canRead()) { visitor.visit(f,path+f.getName()); if(f.isDirectory()) { for( File child : f.listFiles() ) scan(child,path+f.getName()+'/',visitor); } } } void scan(File dir, FileVisitor visitor) throws IOException { scan(dir,"",visitor); } private static final long serialVersionUID = 1L; } /** * Scans by filtering things out from {@link FileFilter} */ private static class Filter extends Full { private final FileFilter filter; Filter(FileFilter filter) { this.filter = filter; } @Override void scan(File dir, FileVisitor visitor) throws IOException { super.scan(dir,visitor.with(filter)); } private static final long serialVersionUID = 1L; } /** * Scans by using Ant GLOB syntax. */ private static class Glob extends DirScanner { private final String includes, excludes; private Glob(String includes, String excludes) { this.includes = includes; this.excludes = excludes; } void scan(File dir, FileVisitor visitor) throws IOException { if(fixEmpty(includes)==null && excludes==null) { // optimization new Full().scan(dir,visitor); return; } FileSet fs = Util.createFileSet(dir,includes,excludes); if(dir.exists()) { DirectoryScanner ds = fs.getDirectoryScanner(new org.apache.tools.ant.Project()); for( String f : ds.getIncludedFiles()) { File file = new File(dir, f); visitor.visit(file,f); } } } private static final long serialVersionUID = 1L; } private static final long serialVersionUID = 1L; } /** * Visits files in a directory recursively. * Primarily used for building an archive with various filtering. */ private static abstract class FileVisitor { /** * Caleld for each file and directory that matches the criteria. * * @param relativePath * The file/directory name in question */ abstract void visit(File f, String relativePath) throws IOException; /** * Decorates by a given filter. */ FileVisitor with(FileFilter f) { if(f==null) return this; return new FilterFileVisitor(f,this); } } private static final class FilterFileVisitor extends FileVisitor implements Serializable { private final FileFilter filter; private final FileVisitor visitor; private FilterFileVisitor(FileFilter filter, FileVisitor visitor) { this.filter = filter!=null ? filter : PASS_THROUGH; this.visitor = visitor; } public void visit(File f, String relativePath) throws IOException { if(f.isDirectory() || filter.accept(f)) visitor.visit(f,relativePath); } private static final FileFilter PASS_THROUGH = new FileFilter() { public boolean accept(File pathname) { return true; } }; private static final long serialVersionUID = 1L; } private static interface ArchiverFactory extends Serializable { Archiver create(OutputStream out); } private static final class TarArchiverFactory implements ArchiverFactory, Serializable { public Archiver create(OutputStream out) { return new TarWriter(out); } private static final long serialVersionUID = 1L; } private static final class ZipArchiverFactory implements ArchiverFactory, Serializable { public Archiver create(OutputStream out) { return new ZipWriter(out); } private static final long serialVersionUID = 1L; } /** * Base for {@link TarWriter} and {@link ZipWriter}. */ private static abstract class Archiver extends FileVisitor implements Closeable { protected int entriesWritten =0; /** * Number of files/directories archived. */ public int countEntries() { return entriesWritten; } } /** * {@link FileVisitor} that creates a tar archive. */ private static final class TarWriter extends Archiver { private final byte[] buf = new byte[8192]; private final TarOutputStream tar; private TarWriter(OutputStream out) { tar = new TarOutputStream(new BufferedOutputStream(out) { // TarOutputStream uses TarBuffer internally, // which flushes the stream for each block. this creates unnecessary // data stream fragmentation, and flush request to a remote, which slows things down. @Override public void flush() throws IOException { // so don't do anything in flush } }); tar.setLongFileMode(TarOutputStream.LONGFILE_GNU); } public void visit(File file, String relativePath) throws IOException { if(Functions.isWindows()) relativePath = relativePath.replace('\\','/'); if(file.isDirectory()) relativePath+='/'; TarEntry te = new TarEntry(relativePath); te.setModTime(file.lastModified()); if(!file.isDirectory()) te.setSize(file.length()); tar.putNextEntry(te); if (!file.isDirectory()) { FileInputStream in = new FileInputStream(file); int len; while((len=in.read(buf))>=0) tar.write(buf,0,len); in.close(); } tar.closeEntry(); entriesWritten++; } public void close() throws IOException { tar.close(); } } /** * {@link FileVisitor} that creates a zip archive. */ private static final class ZipWriter extends Archiver { private final byte[] buf = new byte[8192]; private final ZipOutputStream zip; private ZipWriter(OutputStream out) { zip = new ZipOutputStream(out); zip.setEncoding(System.getProperty("file.encoding")); } public void visit(File f, String relativePath) throws IOException { if(f.isDirectory()) { ZipEntry dirZipEntry = new ZipEntry(relativePath+'/'); // Setting this bit explicitly is needed by some unzipping applications (see HUDSON-3294). dirZipEntry.setExternalAttributes(BITMASK_IS_DIRECTORY); zip.putNextEntry(dirZipEntry); zip.closeEntry(); } else { zip.putNextEntry(new ZipEntry(relativePath)); FileInputStream in = new FileInputStream(f); int len; while((len=in.read(buf))>0) zip.write(buf,0,len); in.close(); zip.closeEntry(); } entriesWritten++; } public void close() throws IOException { zip.close(); } // Bitmask indicating directories in 'external attributes' of a ZIP archive entry. private static final long BITMASK_IS_DIRECTORY = 1<<4; } /** * Writes files in 'this' directory to a tar stream. * * @param glob * Ant file pattern mask, like "**&#x2F;*.java". */ public int tar(OutputStream out, final String glob) throws IOException, InterruptedException { return archive(new TarArchiverFactory(), out, glob); } public int tar(OutputStream out, FileFilter filter) throws IOException, InterruptedException { return archive(new TarArchiverFactory(), out, filter); } /** * Writes to a tar stream and stores obtained files to the base dir. * * @return * number of files/directories that are written. */ private Integer writeToTar(File baseDir, String fileMask, String excludes, OutputStream out) throws IOException { TarWriter tw = new TarWriter(out); try { new DirScanner.Glob(fileMask,excludes).scan(baseDir,tw); } finally { tw.close(); } return tw.entriesWritten; } /** * Reads from a tar stream and stores obtained files to the base dir. */ private static void readFromTar(String name, File baseDir, InputStream in) throws IOException { TarInputStream t = new TarInputStream(in); try { TarEntry te; while ((te = t.getNextEntry()) != null) { File f = new File(baseDir,te.getName()); if(te.isDirectory()) { f.mkdirs(); } else { File parent = f.getParentFile(); if (parent != null) parent.mkdirs(); OutputStream fos = new FileOutputStream(f); try { IOUtils.copy(t,fos); } finally { fos.close(); } f.setLastModified(te.getModTime().getTime()); int mode = te.getMode()&0777; if(mode!=0 && !Hudson.isWindows()) // be defensive try { LIBC.chmod(f.getPath(),mode); } catch (NoClassDefFoundError e) { // be defensive. see http://www.nabble.com/-3.0.6--Site-copy-problem%3A-hudson.util.IOException2%3A--java.lang.NoClassDefFoundError%3A-Could-not-initialize-class--hudson.util.jna.GNUCLibrary-td23588879.html } } } } catch(IOException e) { throw new IOException2("Failed to extract "+name,e); } finally { t.close(); } } /** * Creates a {@link Launcher} for starting processes on the node * that has this file. * @since 1.89 */ public Launcher createLauncher(TaskListener listener) throws IOException, InterruptedException { if(channel==null) return new LocalLauncher(listener); else return new RemoteLauncher(listener,channel,channel.call(new IsUnix())); } private static final class IsUnix implements Callable<Boolean,IOException> { public Boolean call() throws IOException { return File.pathSeparatorChar==':'; } private static final long serialVersionUID = 1L; } /** * Validates the ant file mask (like "foo/bar/*.txt, zot/*.jar") * against this directory, and try to point out the problem. * * <p> * This is useful in conjunction with {@link FormValidation}. * * @return * null if no error was found. Otherwise returns a human readable error message. * @since 1.90 * @see #validateFileMask(FilePath, String) */ public String validateAntFileMask(final String fileMasks) throws IOException, InterruptedException { return act(new FileCallable<String>() { public String invoke(File dir, VirtualChannel channel) throws IOException { if(fileMasks.startsWith("~")) return Messages.FilePath_TildaDoesntWork(); StringTokenizer tokens = new StringTokenizer(fileMasks,","); while(tokens.hasMoreTokens()) { final String fileMask = tokens.nextToken().trim(); if(hasMatch(dir,fileMask)) continue; // no error on this portion // in 1.172 we introduced an incompatible change to stop using ' ' as the separator // so see if we can match by using ' ' as the separator if(fileMask.contains(" ")) { boolean matched = true; for (String token : Util.tokenize(fileMask)) matched &= hasMatch(dir,token); if(matched) return Messages.FilePath_validateAntFileMask_whitespaceSeprator(); } // a common mistake is to assume the wrong base dir, and there are two variations // to this: (1) the user gave us aa/bb/cc/dd where cc/dd was correct // and (2) the user gave us cc/dd where aa/bb/cc/dd was correct. {// check the (1) above first String f=fileMask; while(true) { int idx = findSeparator(f); if(idx==-1) break; f=f.substring(idx+1); if(hasMatch(dir,f)) return Messages.FilePath_validateAntFileMask_doesntMatchAndSuggest(fileMask,f); } } {// check the (2) above next as this is more expensive. // Try prepending "**/" to see if that results in a match FileSet fs = Util.createFileSet(dir,"**/"+fileMask); DirectoryScanner ds = fs.getDirectoryScanner(new Project()); if(ds.getIncludedFilesCount()!=0) { // try shorter name first so that the suggestion results in least amount of changes String[] names = ds.getIncludedFiles(); Arrays.sort(names,SHORTER_STRING_FIRST); for( String f : names) { // now we want to decompose f to the leading portion that matched "**" // and the trailing portion that matched the file mask, so that // we can suggest the user error. // // this is not a very efficient/clever way to do it, but it's relatively simple String prefix=""; while(true) { int idx = findSeparator(f); if(idx==-1) break; prefix+=f.substring(0,idx)+'/'; f=f.substring(idx+1); if(hasMatch(dir,prefix+fileMask)) return Messages.FilePath_validateAntFileMask_doesntMatchAndSuggest(fileMask, prefix+fileMask); } } } } {// finally, see if we can identify any sub portion that's valid. Otherwise bail out String previous = null; String pattern = fileMask; while(true) { if(hasMatch(dir,pattern)) { // found a match if(previous==null) return Messages.FilePath_validateAntFileMask_portionMatchAndSuggest(fileMask,pattern); else return Messages.FilePath_validateAntFileMask_portionMatchButPreviousNotMatchAndSuggest(fileMask,pattern,previous); } int idx = findSeparator(pattern); if(idx<0) {// no more path component left to go back if(pattern.equals(fileMask)) return Messages.FilePath_validateAntFileMask_doesntMatchAnything(fileMask); else return Messages.FilePath_validateAntFileMask_doesntMatchAnythingAndSuggest(fileMask,pattern); } // cut off the trailing component and try again previous = pattern; pattern = pattern.substring(0,idx); } } } return null; // no error } private boolean hasMatch(File dir, String pattern) { FileSet fs = Util.createFileSet(dir,pattern); DirectoryScanner ds = fs.getDirectoryScanner(new Project()); return ds.getIncludedFilesCount()!=0 || ds.getIncludedDirsCount()!=0; } /** * Finds the position of the first path separator. */ private int findSeparator(String pattern) { int idx1 = pattern.indexOf('\\'); int idx2 = pattern.indexOf('/'); if(idx1==-1) return idx2; if(idx2==-1) return idx1; return Math.min(idx1,idx2); } }); } /** * Shortcut for {@link #validateFileMask(String)} in case the left-hand side can be null. */ public static FormValidation validateFileMask(FilePath pathOrNull, String value) throws IOException { if(pathOrNull==null) return FormValidation.ok(); return pathOrNull.validateFileMask(value); } /** * Short for {@code validateFileMask(value,true)} */ public FormValidation validateFileMask(String value) throws IOException { return validateFileMask(value,true); } /** * Checks the GLOB-style file mask. See {@link #validateAntFileMask(String)}. * Requires configure permission on ancestor AbstractProject object in request. * @since 1.294 */ public FormValidation validateFileMask(String value, boolean errorIfNotExist) throws IOException { AbstractProject subject = Stapler.getCurrentRequest().findAncestorObject(AbstractProject.class); subject.checkPermission(Item.CONFIGURE); value = fixEmpty(value); if(value==null) return FormValidation.ok(); try { if(!exists()) // no workspace. can't check return FormValidation.ok(); String msg = validateAntFileMask(value); if(errorIfNotExist) return FormValidation.error(msg); else return FormValidation.warning(msg); } catch (InterruptedException e) { return FormValidation.ok(); } } /** * Validates a relative file path from this {@link FilePath}. * Requires configure permission on ancestor AbstractProject object in request. * * @param value * The relative path being validated. * @param errorIfNotExist * If true, report an error if the given relative path doesn't exist. Otherwise it's a warning. * @param expectingFile * If true, we expect the relative path to point to a file. * Otherwise, the relative path is expected to be pointing to a directory. */ public FormValidation validateRelativePath(String value, boolean errorIfNotExist, boolean expectingFile) throws IOException { AbstractProject subject = Stapler.getCurrentRequest().findAncestorObject(AbstractProject.class); subject.checkPermission(Item.CONFIGURE); value = fixEmpty(value); // none entered yet, or something is seriously wrong if(value==null || (AbstractProject<?,?>)subject ==null) return FormValidation.ok(); // a common mistake is to use wildcard if(value.contains("*")) return FormValidation.error(Messages.FilePath_validateRelativePath_wildcardNotAllowed()); try { if(!exists()) // no base directory. can't check return FormValidation.ok(); FilePath path = child(value); if(path.exists()) { if (expectingFile) { if(!path.isDirectory()) return FormValidation.ok(); else return FormValidation.error(Messages.FilePath_validateRelativePath_notFile(value)); } else { if(path.isDirectory()) return FormValidation.ok(); else return FormValidation.error(Messages.FilePath_validateRelativePath_notDirectory(value)); } } String msg = expectingFile ? Messages.FilePath_validateRelativePath_noSuchFile(value) : Messages.FilePath_validateRelativePath_noSuchDirectory(value); if(errorIfNotExist) return FormValidation.error(msg); else return FormValidation.warning(msg); } catch (InterruptedException e) { return FormValidation.ok(); } } /** * A convenience method over {@link #validateRelativePath(String, boolean, boolean)}. */ public FormValidation validateRelativeDirectory(String value, boolean errorIfNotExist) throws IOException { return validateRelativePath(value,errorIfNotExist,false); } public FormValidation validateRelativeDirectory(String value) throws IOException { return validateRelativeDirectory(value,true); } @Deprecated @Override public String toString() { // to make writing JSPs easily, return local return remote; } public VirtualChannel getChannel() { if(channel!=null) return channel; else return Hudson.MasterComputer.localChannel; } /** * Returns true if this {@link FilePath} represents a remote file. */ public boolean isRemote() { return channel!=null; } private void writeObject(ObjectOutputStream oos) throws IOException { Channel target = Channel.current(); if(channel!=null && channel!=target) throw new IllegalStateException("Can't send a remote FilePath to a different remote channel"); oos.defaultWriteObject(); oos.writeBoolean(channel==null); } private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { Channel channel = Channel.current(); assert channel!=null; ois.defaultReadObject(); if(ois.readBoolean()) { this.channel = channel; } else { this.channel = null; } } private static final long serialVersionUID = 1L; public static int SIDE_BUFFER_SIZE = 1024; /** * Adapts {@link FileCallable} to {@link Callable}. */ private class FileCallableWrapper<T> implements DelegatingCallable<T,IOException> { private final FileCallable<T> callable; private transient ClassLoader classLoader; public FileCallableWrapper(FileCallable<T> callable) { this.callable = callable; this.classLoader = callable.getClass().getClassLoader(); } private FileCallableWrapper(FileCallable<T> callable, ClassLoader classLoader) { this.callable = callable; this.classLoader = classLoader; } public T call() throws IOException { return callable.invoke(new File(remote), Channel.current()); } public ClassLoader getClassLoader() { return classLoader; } private static final long serialVersionUID = 1L; } private static final Comparator<String> SHORTER_STRING_FIRST = new Comparator<String>() { public int compare(String o1, String o2) { return o1.length()-o2.length(); } }; }
improved the diagnosability. git-svn-id: 28f34f9aa52bc55a5ddd5be9e183c5cccadc6ee4@23882 71c3de6d-444a-0410-be80-ed276b4c234a
core/src/main/java/hudson/FilePath.java
improved the diagnosability.
<ide><path>ore/src/main/java/hudson/FilePath.java <ide> * Copies this file to the specified target. <ide> */ <ide> public void copyTo(FilePath target) throws IOException, InterruptedException { <del> OutputStream out = target.write(); <ide> try { <del> copyTo(out); <del> } finally { <del> out.close(); <add> OutputStream out = target.write(); <add> try { <add> copyTo(out); <add> } finally { <add> out.close(); <add> } <add> } catch (IOException e) { <add> throw new IOException2("Failed to copy "+this+" to "+target,e); <ide> } <ide> } <ide>
Java
apache-2.0
9846c430440bad882e5633377cc0bc47d40b5b3b
0
nuwand/carbon-apimgt,ruks/carbon-apimgt,fazlan-nazeem/carbon-apimgt,tharindu1st/carbon-apimgt,harsha89/carbon-apimgt,bhathiya/carbon-apimgt,uvindra/carbon-apimgt,sanjeewa-malalgoda/carbon-apimgt,chamilaadhi/carbon-apimgt,tharikaGitHub/carbon-apimgt,jaadds/carbon-apimgt,wso2/carbon-apimgt,jaadds/carbon-apimgt,pubudu538/carbon-apimgt,uvindra/carbon-apimgt,pubudu538/carbon-apimgt,isharac/carbon-apimgt,tharikaGitHub/carbon-apimgt,sanjeewa-malalgoda/carbon-apimgt,fazlan-nazeem/carbon-apimgt,pubudu538/carbon-apimgt,fazlan-nazeem/carbon-apimgt,jaadds/carbon-apimgt,isharac/carbon-apimgt,harsha89/carbon-apimgt,malinthaprasan/carbon-apimgt,sanjeewa-malalgoda/carbon-apimgt,ruks/carbon-apimgt,uvindra/carbon-apimgt,fazlan-nazeem/carbon-apimgt,tharindu1st/carbon-apimgt,prasa7/carbon-apimgt,ruks/carbon-apimgt,praminda/carbon-apimgt,tharikaGitHub/carbon-apimgt,malinthaprasan/carbon-apimgt,praminda/carbon-apimgt,prasa7/carbon-apimgt,ruks/carbon-apimgt,bhathiya/carbon-apimgt,bhathiya/carbon-apimgt,prasa7/carbon-apimgt,Rajith90/carbon-apimgt,nuwand/carbon-apimgt,chamindias/carbon-apimgt,wso2/carbon-apimgt,praminda/carbon-apimgt,harsha89/carbon-apimgt,Rajith90/carbon-apimgt,pubudu538/carbon-apimgt,Rajith90/carbon-apimgt,isharac/carbon-apimgt,nuwand/carbon-apimgt,chamilaadhi/carbon-apimgt,wso2/carbon-apimgt,Rajith90/carbon-apimgt,sanjeewa-malalgoda/carbon-apimgt,chamindias/carbon-apimgt,tharikaGitHub/carbon-apimgt,chamindias/carbon-apimgt,harsha89/carbon-apimgt,uvindra/carbon-apimgt,prasa7/carbon-apimgt,chamilaadhi/carbon-apimgt,chamilaadhi/carbon-apimgt,nuwand/carbon-apimgt,tharindu1st/carbon-apimgt,malinthaprasan/carbon-apimgt,isharac/carbon-apimgt,jaadds/carbon-apimgt,wso2/carbon-apimgt,malinthaprasan/carbon-apimgt,bhathiya/carbon-apimgt,chamindias/carbon-apimgt,tharindu1st/carbon-apimgt
/* * Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.wso2.carbon.apimgt.rest.api.publisher.v1.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.cxf.jaxrs.ext.MessageContext; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.APIProvider; import org.wso2.carbon.apimgt.api.model.API; import org.wso2.carbon.apimgt.api.model.Documentation; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.impl.utils.APIUtil; import org.wso2.carbon.apimgt.rest.api.publisher.v1.SearchApiService; import org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.PaginationDTO; import org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.SearchResultDTO; import org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.SearchResultListDTO; import org.wso2.carbon.apimgt.rest.api.publisher.v1.utils.mappings.SearchResultMappingUtil; import org.wso2.carbon.apimgt.rest.api.util.RestApiConstants; import org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.ws.rs.core.Response; public class SearchApiServiceImpl implements SearchApiService { private static final Log log = LogFactory.getLog(SearchApiServiceImpl.class); public Response searchGet(Integer limit, Integer offset, String query, String ifNoneMatch, MessageContext messageContext) { SearchResultListDTO resultListDTO = new SearchResultListDTO(); List<SearchResultDTO> allmatchedResults = new ArrayList<>(); limit = limit != null ? limit : RestApiConstants.PAGINATION_LIMIT_DEFAULT; offset = offset != null ? offset : RestApiConstants.PAGINATION_OFFSET_DEFAULT; query = query == null ? "*" : query; try { if (!query.contains(":")) { query = (APIConstants.CONTENT_SEARCH_TYPE_PREFIX + ":" + query); } String newSearchQuery = APIUtil.constructNewSearchQuery(query); APIProvider apiProvider = RestApiUtil.getLoggedInUserProvider(); String username = RestApiUtil.getLoggedInUsername(); String tenantDomain = MultitenantUtils.getTenantDomain(APIUtil.replaceEmailDomainBack(username)); Map<String, Object> result = apiProvider .searchPaginatedAPIs(newSearchQuery, tenantDomain, offset, limit, false); ArrayList<Object> apis; /* Above searchPaginatedAPIs method underneath calls searchPaginatedAPIsByContent method,searchPaginatedAPIs method and searchAPIDoc method in AbstractApiManager. And those methods respectively returns ArrayList, TreeSet and a HashMap. Hence the below logic. */ Object apiSearchResults = result.get("apis"); if (apiSearchResults instanceof List<?>) { apis = (ArrayList<Object>) apiSearchResults; } else if (apiSearchResults instanceof HashMap) { Collection<String> values = ((HashMap) apiSearchResults).values(); apis = new ArrayList<Object>(values); } else { apis = new ArrayList<Object>(); apis.addAll((Collection<?>) apiSearchResults); } for (Object searchResult : apis) { if (searchResult instanceof API) { API api = (API) searchResult; SearchResultDTO apiResult = SearchResultMappingUtil.fromAPIToAPIResultDTO(api); allmatchedResults.add(apiResult); } else if (searchResult instanceof Map.Entry) { Map.Entry pair = (Map.Entry) searchResult; SearchResultDTO docResult = SearchResultMappingUtil.fromDocumentationToDocumentResultDTO( (Documentation) pair.getKey(), (API) pair.getValue()); allmatchedResults.add(docResult); } } Object totalLength = result.get("length"); Integer length = 0; if (totalLength != null) { length = (Integer) totalLength; } resultListDTO.setList(allmatchedResults); resultListDTO.setCount(allmatchedResults.size()); SearchResultMappingUtil.setPaginationParams(resultListDTO, query, offset, limit, length); } catch (APIManagementException e) { String errorMessage = "Error while retrieving search results"; RestApiUtil.handleInternalServerError(errorMessage, e, log); } return Response.ok().entity(resultListDTO).build(); } }
components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/impl/SearchApiServiceImpl.java
/* * Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.wso2.carbon.apimgt.rest.api.publisher.v1.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.cxf.jaxrs.ext.MessageContext; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.APIProvider; import org.wso2.carbon.apimgt.api.model.API; import org.wso2.carbon.apimgt.api.model.Documentation; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.impl.utils.APIUtil; import org.wso2.carbon.apimgt.rest.api.publisher.v1.SearchApiService; import org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.PaginationDTO; import org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.SearchResultDTO; import org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.SearchResultListDTO; import org.wso2.carbon.apimgt.rest.api.publisher.v1.utils.mappings.SearchResultMappingUtil; import org.wso2.carbon.apimgt.rest.api.util.RestApiConstants; import org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import javax.ws.rs.core.Response; public class SearchApiServiceImpl implements SearchApiService { private static final Log log = LogFactory.getLog(SearchApiServiceImpl.class); public Response searchGet(Integer limit, Integer offset, String query, String ifNoneMatch, MessageContext messageContext) { SearchResultListDTO resultListDTO = new SearchResultListDTO(); List<SearchResultDTO> allmatchedResults = new ArrayList<>(); limit = limit != null ? limit : RestApiConstants.PAGINATION_LIMIT_DEFAULT; offset = offset != null ? offset : RestApiConstants.PAGINATION_OFFSET_DEFAULT; query = query == null ? "*" : query; try { if (!query.contains(":")) { query = (APIConstants.CONTENT_SEARCH_TYPE_PREFIX + ":" + query); } String newSearchQuery = APIUtil.constructNewSearchQuery(query); APIProvider apiProvider = RestApiUtil.getLoggedInUserProvider(); String username = RestApiUtil.getLoggedInUsername(); String tenantDomain = MultitenantUtils.getTenantDomain(APIUtil.replaceEmailDomainBack(username)); Map<String, Object> result = apiProvider .searchPaginatedAPIs(newSearchQuery, tenantDomain, offset, limit, false); ArrayList<Object> apis; /* Above searchPaginatedAPIs method underneath calls searchPaginatedAPIsByContent method and searchPaginatedAPIs method in AbstractApiManager. And those methods respectively returns ArrayList and a TreeSet. Hence the below logic. */ Object apiSearchResults = result.get("apis"); if (apiSearchResults instanceof List<?>) { apis = (ArrayList<Object>) apiSearchResults; } else { apis = new ArrayList<Object>(); apis.addAll((Collection<?>) apiSearchResults); } for (Object searchResult : apis) { if (searchResult instanceof API) { API api = (API) searchResult; SearchResultDTO apiResult = SearchResultMappingUtil.fromAPIToAPIResultDTO(api); allmatchedResults.add(apiResult); } else if (searchResult instanceof Map.Entry) { Map.Entry pair = (Map.Entry) searchResult; SearchResultDTO docResult = SearchResultMappingUtil.fromDocumentationToDocumentResultDTO( (Documentation) pair.getKey(), (API) pair.getValue()); allmatchedResults.add(docResult); } } resultListDTO.setList(allmatchedResults); resultListDTO.setCount(allmatchedResults.size()); SearchResultMappingUtil.setPaginationParams(resultListDTO, query, offset, limit, resultListDTO.getCount()); } catch (APIManagementException e) { String errorMessage = "Error while retrieving search results"; RestApiUtil.handleInternalServerError(errorMessage, e, log); } return Response.ok().entity(resultListDTO).build(); } }
Fix pagination issue and doc: filtered search issue
components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/impl/SearchApiServiceImpl.java
Fix pagination issue and doc: filtered search issue
<ide><path>omponents/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/impl/SearchApiServiceImpl.java <ide> <ide> import java.util.ArrayList; <ide> import java.util.Collection; <add>import java.util.HashMap; <ide> import java.util.List; <ide> import java.util.Map; <ide> import javax.ws.rs.core.Response; <ide> Map<String, Object> result = apiProvider <ide> .searchPaginatedAPIs(newSearchQuery, tenantDomain, offset, limit, false); <ide> ArrayList<Object> apis; <del> /* Above searchPaginatedAPIs method underneath calls searchPaginatedAPIsByContent method and searchPaginatedAPIs <del> method in AbstractApiManager. And those methods respectively returns ArrayList and a TreeSet. <add> /* Above searchPaginatedAPIs method underneath calls searchPaginatedAPIsByContent method,searchPaginatedAPIs <add> method and searchAPIDoc method in AbstractApiManager. And those methods respectively returns ArrayList, <add> TreeSet and a HashMap. <ide> Hence the below logic. <ide> */ <ide> Object apiSearchResults = result.get("apis"); <ide> if (apiSearchResults instanceof List<?>) { <ide> apis = (ArrayList<Object>) apiSearchResults; <add> } else if (apiSearchResults instanceof HashMap) { <add> Collection<String> values = ((HashMap) apiSearchResults).values(); <add> apis = new ArrayList<Object>(values); <ide> } else { <ide> apis = new ArrayList<Object>(); <ide> apis.addAll((Collection<?>) apiSearchResults); <ide> } <ide> } <ide> <add> Object totalLength = result.get("length"); <add> Integer length = 0; <add> if (totalLength != null) { <add> length = (Integer) totalLength; <add> } <add> <ide> resultListDTO.setList(allmatchedResults); <ide> resultListDTO.setCount(allmatchedResults.size()); <del> SearchResultMappingUtil.setPaginationParams(resultListDTO, query, offset, limit, resultListDTO.getCount()); <add> SearchResultMappingUtil.setPaginationParams(resultListDTO, query, offset, limit, length); <ide> <ide> } catch (APIManagementException e) { <ide> String errorMessage = "Error while retrieving search results";
Java
lgpl-2.1
464f09b1ea75ac7ed733d9c29049e710a655cc7e
0
zsoltii/dss,alisdev/dss,esig/dss,openlimit-signcubes/dss,zsoltii/dss,esig/dss,alisdev/dss,openlimit-signcubes/dss
/** * DSS - Digital Signature Services * Copyright (C) 2015 European Commission, provided under the CEF programme * * This file is part of the "DSS - Digital Signature Services" project. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package eu.europa.esig.dss.xades.validation; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.HashSet; import java.util.Set; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import org.apache.xml.security.signature.XMLSignatureInput; import org.apache.xml.security.utils.resolver.ResourceResolverContext; import org.apache.xml.security.utils.resolver.ResourceResolverException; import org.apache.xml.security.utils.resolver.ResourceResolverSpi; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Attr; import org.w3c.dom.Node; import org.w3c.dom.NodeList; /** * An implementation of a resource resolver, which evaluates xpointer expressions. * * * Adapted by * */ public class XPointerResourceResolver extends ResourceResolverSpi { private static final Logger LOG = LoggerFactory.getLogger(XPointerResourceResolver.class); private static final String XP_OPEN = "xpointer("; private static final String XNS_OPEN = "xmlns("; private XPathFactory xPathFactory; private Node baseNode; public XPointerResourceResolver(Node baseNode) { this.xPathFactory = XPathFactory.newInstance(); this.baseNode = baseNode; } @Override public boolean engineCanResolveURI(final ResourceResolverContext context) { boolean xPointerQuery = false; String uri = "?"; final Attr uriAttr = context.attr; if (uriAttr != null) { uri = uriAttr.getNodeValue(); xPointerQuery = isXPointerQuery(uri, false); } if (LOG.isDebugEnabled()) { LOG.debug("I state that I " + (xPointerQuery ? "can" : "cannot") + " resolve Uri/Base Uri:'" + uri + "/" + context.baseUri + "'"); } return xPointerQuery; } /** * Indicates if the given URI is an XPointer query. * * @param uriValue * URI to be analysed * @return true if it is an XPointer query */ public static boolean isXPointerQuery(String uriValue, final boolean strict) { if (uriValue.isEmpty() || uriValue.charAt(0) != '#') { return false; } final String decodedUri; try { decodedUri = URLDecoder.decode(uriValue, "utf-8"); } catch (UnsupportedEncodingException e) { LOG.warn("utf-8 not a valid encoding", e); return false; } final String parts[] = decodedUri.substring(1).split("\\s"); // plain ID reference. if (parts.length == 1 && !parts[0].startsWith(XNS_OPEN)) { return strict ? false : true; } int ii = 0; for (; ii < parts.length - 1; ++ii) { if (!parts[ii].endsWith(")") || !parts[ii].startsWith(XNS_OPEN)) { return false; } } if (!parts[ii].endsWith(")") || !parts[ii].startsWith(XP_OPEN)) { return false; } return true; } @Override public XMLSignatureInput engineResolveURI(ResourceResolverContext context) throws ResourceResolverException { final Attr uriAttr = context.attr; final String baseUri = context.baseUri; String uriNodeValue = uriAttr.getNodeValue(); if (uriNodeValue.charAt(0) != '#') { return null; } String xpURI; try { xpURI = URLDecoder.decode(uriNodeValue, "utf-8"); } catch (UnsupportedEncodingException e) { LOG.warn("utf-8 not a valid encoding", e); return null; } String parts[] = xpURI.substring(1).split("\\s"); int i = 0; DSigNamespaceContext nsContext = null; if (parts.length > 1) { nsContext = new DSigNamespaceContext(); for (; i < parts.length - 1; ++i) { if (!parts[i].endsWith(")") || !parts[i].startsWith(XNS_OPEN)) { return null; } String mapping = parts[i].substring(XNS_OPEN.length(), parts[i].length() - 1); int pos = mapping.indexOf('='); if (pos <= 0 || pos >= mapping.length() - 1) { throw new ResourceResolverException("malformed namespace part of XPointer expression", uriNodeValue, baseUri); } nsContext.addNamespace(mapping.substring(0, pos), mapping.substring(pos + 1)); } } try { Node node = null; NodeList nodes = null; // plain ID reference. if (i == 0 && !parts[i].startsWith(XP_OPEN)) { node = this.baseNode.getOwnerDocument().getElementById(parts[i]); } else { if (!parts[i].endsWith(")") || !parts[i].startsWith(XP_OPEN)) { return null; } XPath xp = this.xPathFactory.newXPath(); if (nsContext != null) { xp.setNamespaceContext(nsContext); } nodes = (NodeList) xp.evaluate(parts[i].substring(XP_OPEN.length(), parts[i].length() - 1), this.baseNode, XPathConstants.NODESET); if (nodes.getLength() == 0) { return null; } if (nodes.getLength() == 1) { node = nodes.item(0); } } XMLSignatureInput result = null; if (node != null) { result = new XMLSignatureInput(node); } else if (nodes != null) { Set<Node> nodeSet = new HashSet<Node>(nodes.getLength()); for (int j = 0; j < nodes.getLength(); ++j) { nodeSet.add(nodes.item(j)); } result = new XMLSignatureInput(nodeSet); } else { return null; } result.setMIMEType("text/xml"); result.setExcludeComments(true); result.setSourceURI((baseUri != null) ? baseUri.concat(uriNodeValue) : uriNodeValue); return result; } catch (XPathExpressionException e) { throw new ResourceResolverException(e, "malformed XPath inside XPointer expression", uriNodeValue, baseUri); } } }
dss-xades/src/main/java/eu/europa/esig/dss/xades/validation/XPointerResourceResolver.java
/** * DSS - Digital Signature Services * Copyright (C) 2015 European Commission, provided under the CEF programme * * This file is part of the "DSS - Digital Signature Services" project. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package eu.europa.esig.dss.xades.validation; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.HashSet; import java.util.Set; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import org.apache.xml.security.signature.XMLSignatureInput; import org.apache.xml.security.utils.resolver.ResourceResolverContext; import org.apache.xml.security.utils.resolver.ResourceResolverException; import org.apache.xml.security.utils.resolver.ResourceResolverSpi; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Attr; import org.w3c.dom.Node; import org.w3c.dom.NodeList; /** * An implementation of a resource resolver, which evaluates xpointer expressions. * * * Adapted by * */ public class XPointerResourceResolver extends ResourceResolverSpi { private static final Logger LOG = LoggerFactory.getLogger(XPointerResourceResolver.class); private static final String XP_OPEN = "xpointer("; private static final String XNS_OPEN = "xmlns("; private XPathFactory xPathFactory; private Node baseNode; public XPointerResourceResolver(Node baseNode) { this.xPathFactory = XPathFactory.newInstance(); this.baseNode = baseNode; } @Override public boolean engineCanResolveURI(final ResourceResolverContext context) { final Attr uriAttr = context.attr; final String uri = uriAttr.getNodeValue(); final boolean xPointerQuery = isXPointerQuery(uri, false); if (LOG.isDebugEnabled()) { LOG.debug("I state that I " + (xPointerQuery ? "can" : "cannot") + " resolve Uri/Base Uri:'" + uri + "/" + context.baseUri + "'"); } return xPointerQuery; } /** * Indicates if the given URI is an XPointer query. * * @param uriValue * URI to be analysed * @return true if it is an XPointer query */ public static boolean isXPointerQuery(String uriValue, final boolean strict) { if (uriValue.isEmpty() || uriValue.charAt(0) != '#') { return false; } final String decodedUri; try { decodedUri = URLDecoder.decode(uriValue, "utf-8"); } catch (UnsupportedEncodingException e) { LOG.warn("utf-8 not a valid encoding", e); return false; } final String parts[] = decodedUri.substring(1).split("\\s"); // plain ID reference. if (parts.length == 1 && !parts[0].startsWith(XNS_OPEN)) { return strict ? false : true; } int ii = 0; for (; ii < parts.length - 1; ++ii) { if (!parts[ii].endsWith(")") || !parts[ii].startsWith(XNS_OPEN)) { return false; } } if (!parts[ii].endsWith(")") || !parts[ii].startsWith(XP_OPEN)) { return false; } return true; } @Override public XMLSignatureInput engineResolveURI(ResourceResolverContext context) throws ResourceResolverException { final Attr uriAttr = context.attr; final String baseUri = context.baseUri; String uriNodeValue = uriAttr.getNodeValue(); if (uriNodeValue.charAt(0) != '#') { return null; } String xpURI; try { xpURI = URLDecoder.decode(uriNodeValue, "utf-8"); } catch (UnsupportedEncodingException e) { LOG.warn("utf-8 not a valid encoding", e); return null; } String parts[] = xpURI.substring(1).split("\\s"); int i = 0; DSigNamespaceContext nsContext = null; if (parts.length > 1) { nsContext = new DSigNamespaceContext(); for (; i < parts.length - 1; ++i) { if (!parts[i].endsWith(")") || !parts[i].startsWith(XNS_OPEN)) { return null; } String mapping = parts[i].substring(XNS_OPEN.length(), parts[i].length() - 1); int pos = mapping.indexOf('='); if (pos <= 0 || pos >= mapping.length() - 1) { throw new ResourceResolverException("malformed namespace part of XPointer expression", uriNodeValue, baseUri); } nsContext.addNamespace(mapping.substring(0, pos), mapping.substring(pos + 1)); } } try { Node node = null; NodeList nodes = null; // plain ID reference. if (i == 0 && !parts[i].startsWith(XP_OPEN)) { node = this.baseNode.getOwnerDocument().getElementById(parts[i]); } else { if (!parts[i].endsWith(")") || !parts[i].startsWith(XP_OPEN)) { return null; } XPath xp = this.xPathFactory.newXPath(); if (nsContext != null) { xp.setNamespaceContext(nsContext); } nodes = (NodeList) xp.evaluate(parts[i].substring(XP_OPEN.length(), parts[i].length() - 1), this.baseNode, XPathConstants.NODESET); if (nodes.getLength() == 0) { return null; } if (nodes.getLength() == 1) { node = nodes.item(0); } } XMLSignatureInput result = null; if (node != null) { result = new XMLSignatureInput(node); } else if (nodes != null) { Set<Node> nodeSet = new HashSet<Node>(nodes.getLength()); for (int j = 0; j < nodes.getLength(); ++j) { nodeSet.add(nodes.item(j)); } result = new XMLSignatureInput(nodeSet); } else { return null; } result.setMIMEType("text/xml"); result.setExcludeComments(true); result.setSourceURI((baseUri != null) ? baseUri.concat(uriNodeValue) : uriNodeValue); return result; } catch (XPathExpressionException e) { throw new ResourceResolverException(e, "malformed XPath inside XPointer expression", uriNodeValue, baseUri); } } }
Avoid NPE
dss-xades/src/main/java/eu/europa/esig/dss/xades/validation/XPointerResourceResolver.java
Avoid NPE
<ide><path>ss-xades/src/main/java/eu/europa/esig/dss/xades/validation/XPointerResourceResolver.java <ide> <ide> @Override <ide> public boolean engineCanResolveURI(final ResourceResolverContext context) { <del> <add> boolean xPointerQuery = false; <add> String uri = "?"; <ide> final Attr uriAttr = context.attr; <del> final String uri = uriAttr.getNodeValue(); <del> final boolean xPointerQuery = isXPointerQuery(uri, false); <add> if (uriAttr != null) { <add> uri = uriAttr.getNodeValue(); <add> xPointerQuery = isXPointerQuery(uri, false); <add> } <ide> if (LOG.isDebugEnabled()) { <del> <ide> LOG.debug("I state that I " + (xPointerQuery ? "can" : "cannot") + " resolve Uri/Base Uri:'" + uri + "/" + context.baseUri + "'"); <ide> } <ide> return xPointerQuery;
JavaScript
mit
17be319e0400862284dd69158fdecf9e8e819936
0
mjmlio/gulp-mjml
var through = require ('through2') var mjmlDefaultEngine = require ('mjml') var gutil = require ('gulp-util') var GulpError = gutil.PluginError var NAME = 'MJML' module.exports = function mjml (mjmlEngine, options) { if(!mjmlEngine) { mjmlEngine = mjmlDefaultEngine } if (options === undefined) { options = {} } return through.obj(function (file, enc, callback) { // Not a big fan of this deep copy methods // But it will work regardless of Node version var localOptions = JSON.parse(JSON.stringify(options)) if (localOptions.filePath === undefined) { localOptions.filePath = file.path.toString() } if (file.isStream()) { this.emit('error', new GulpError(NAME, 'Streams are not supported!')) return callback() } if (file.isBuffer()) { var output = file.clone() var render try { render = mjmlEngine.mjml2html(file.contents.toString(), options) } catch (e) { this.emit('error', new GulpError(NAME, e)) return callback() } output.contents = new Buffer(render.html) output.path = gutil.replaceExtension(file.path.toString(), '.html') this.push(output) } return callback() }) }
src/index.js
var through = require ('through2') var mjmlDefaultEngine = require ('mjml') var gutil = require ('gulp-util') var GulpError = gutil.PluginError var NAME = 'MJML' module.exports = function mjml (mjmlEngine, options) { if(mjmlEngine === undefined) { mjmlEngine = mjmlDefaultEngine } if (options === undefined) { options = {} } return through.obj(function (file, enc, callback) { // Not a big fan of this deep copy methods // But it will work regardless of Node version var localOptions = JSON.parse(JSON.stringify(options)) if (localOptions.filePath === undefined) { localOptions.filePath = file.path.toString() } if (file.isStream()) { this.emit('error', new GulpError(NAME, 'Streams are not supported!')) return callback() } if (file.isBuffer()) { var output = file.clone() var render try { render = mjmlEngine.mjml2html(file.contents.toString(), options) } catch (e) { this.emit('error', new GulpError(NAME, e)) return callback() } output.contents = new Buffer(render.html) output.path = gutil.replaceExtension(file.path.toString(), '.html') this.push(output) } return callback() }) }
Allow mjmlEngine to be null It looks better when we want to pass options but no mjmlEngine ``` mjml(null, {}) // :) mjml(undefined, {}) // :( ```
src/index.js
Allow mjmlEngine to be null
<ide><path>rc/index.js <ide> var NAME = 'MJML' <ide> <ide> module.exports = function mjml (mjmlEngine, options) { <del> if(mjmlEngine === undefined) { <add> if(!mjmlEngine) { <ide> mjmlEngine = mjmlDefaultEngine <ide> } <ide> if (options === undefined) {
Java
apache-2.0
error: pathspec 'src/main/java/tech/sirwellington/alchemy/annotations/designs/patterns/StatePattern.java' did not match any file(s) known to git
2705e9b31dd5930d1a021ca4c811736d9a29e353
1
SirWellington/alchemy-annotations
/* * Copyright 2015 SirWellington Tech. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package tech.sirwellington.alchemy.annotations.designs.patterns; /** * Documents the Application or use of the State Pattern, explained * <a href="https://sourcemaking.com/design_patterns/state">here</a>. * * @see * <a href="https://sourcemaking.com/design_patterns/state">https://sourcemaking.com/design_patterns/state</a> * * @see * <a href="https://en.wikipedia.org/wiki/State_pattern">https://en.wikipedia.org/wiki/State_pattern</a> * * @author SirWellington */ public @interface StatePattern { public static enum Role { /** * Applied to an Object that knowingly makes use of the State Pattern to delegate some of * its behavior. */ CLIENT, /** * Applied to Objects or Classes that represent State. */ STATE, /** * Applied to an Object that executes some action on the State. */ EXECUTOR } }
src/main/java/tech/sirwellington/alchemy/annotations/designs/patterns/StatePattern.java
Adding StatePattern + New Design Pattern, “@StatePattern”
src/main/java/tech/sirwellington/alchemy/annotations/designs/patterns/StatePattern.java
Adding StatePattern
<ide><path>rc/main/java/tech/sirwellington/alchemy/annotations/designs/patterns/StatePattern.java <add>/* <add> * Copyright 2015 SirWellington Tech. <add> * <add> * Licensed under the Apache License, Version 2.0 (the "License"); <add> * you may not use this file except in compliance with the License. <add> * You may obtain a copy of the License at <add> * <add> * http://www.apache.org/licenses/LICENSE-2.0 <add> * <add> * Unless required by applicable law or agreed to in writing, software <add> * distributed under the License is distributed on an "AS IS" BASIS, <add> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <add> * See the License for the specific language governing permissions and <add> * limitations under the License. <add> */ <add>package tech.sirwellington.alchemy.annotations.designs.patterns; <add> <add>/** <add> * Documents the Application or use of the State Pattern, explained <add> * <a href="https://sourcemaking.com/design_patterns/state">here</a>. <add> * <add> * @see <add> * <a href="https://sourcemaking.com/design_patterns/state">https://sourcemaking.com/design_patterns/state</a> <add> * <add> * @see <add> * <a href="https://en.wikipedia.org/wiki/State_pattern">https://en.wikipedia.org/wiki/State_pattern</a> <add> * <add> * @author SirWellington <add> */ <add>public @interface StatePattern <add>{ <add> <add> public static enum Role <add> { <add> <add> /** <add> * Applied to an Object that knowingly makes use of the State Pattern to delegate some of <add> * its behavior. <add> */ <add> CLIENT, <add> /** <add> * Applied to Objects or Classes that represent State. <add> */ <add> STATE, <add> /** <add> * Applied to an Object that executes some action on the State. <add> */ <add> EXECUTOR <add> } <add>}
Java
apache-2.0
55f6b18d85121941fa08f60d4220e8d86bb55db3
0
cosmocode/cosmocode-rendering
/** * Copyright 2010 CosmoCode GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package de.cosmocode.rendering; import java.io.Serializable; import java.util.AbstractCollection; import java.util.AbstractList; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.EnumSet; import java.util.Iterator; import java.util.List; import java.util.RandomAccess; import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import de.cosmocode.commons.reflect.Reflection; import de.cosmocode.junit.UnitProvider; /** * Tests {@link Mappings#defaultMapping()}. * * @since 1.2 * @author Willi Schoenborn */ public final class DefaultMappingTest implements UnitProvider<Mapping> { private static final Logger LOG = LoggerFactory.getLogger(DefaultMappingTest.class); @Override public Mapping unit() { return Mappings.defaultMapping(); } /** * Tests all steps for {@link ArrayList}. */ @Test public void arraylist() { final Iterable<Class<?>> all = Reflection.getAllSuperTypes(ArrayList.class); final Iterator<Class<?>> iterator = all.iterator(); LOG.debug("{}", all); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(ArrayList.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(AbstractList.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(List.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(RandomAccess.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Cloneable.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Serializable.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(AbstractCollection.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(List.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Collection.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Object.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Collection.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Collection.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Iterable.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Iterable.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Iterable.class, iterator.next()); Assert.assertFalse(iterator.hasNext()); } /** * Tests with a list class. * * @since */ @Test public void list() { Assert.assertSame(IterableValueRenderer.INSTANCE, unit().find(Arrays.asList().getClass())); } /** * Tests with a set class. * * @since */ @Test public void set() { Assert.assertSame(IterableValueRenderer.INSTANCE, unit().find(EnumSet.class)); } }
src/test/java/de/cosmocode/rendering/DefaultMappingTest.java
/** * Copyright 2010 CosmoCode GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package de.cosmocode.rendering; import java.io.Serializable; import java.util.AbstractCollection; import java.util.AbstractList; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.RandomAccess; import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import de.cosmocode.commons.reflect.Reflection; import de.cosmocode.junit.UnitProvider; /** * Tests {@link Mappings#defaultMapping()}. * * @since 1.2 * @author Willi Schoenborn */ public final class DefaultMappingTest implements UnitProvider<Mapping> { private static final Logger LOG = LoggerFactory.getLogger(DefaultMappingTest.class); @Override public Mapping unit() { return Mappings.defaultMapping(); } /** * Tests all steps for {@link ArrayList}. */ @Test public void arraylist() { final Iterable<Class<?>> all = Reflection.getAllSuperTypes(ArrayList.class); final Iterator<Class<?>> iterator = all.iterator(); LOG.debug("{}", all); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(ArrayList.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(AbstractList.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(List.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(RandomAccess.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Cloneable.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Serializable.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(AbstractCollection.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(List.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Collection.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Object.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Collection.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Collection.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Iterable.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Iterable.class, iterator.next()); Assert.assertTrue(iterator.hasNext()); Assert.assertSame(Iterable.class, iterator.next()); Assert.assertFalse(iterator.hasNext()); } }
added 2 more tests
src/test/java/de/cosmocode/rendering/DefaultMappingTest.java
added 2 more tests
<ide><path>rc/test/java/de/cosmocode/rendering/DefaultMappingTest.java <ide> import java.util.AbstractCollection; <ide> import java.util.AbstractList; <ide> import java.util.ArrayList; <add>import java.util.Arrays; <ide> import java.util.Collection; <add>import java.util.EnumSet; <ide> import java.util.Iterator; <ide> import java.util.List; <ide> import java.util.RandomAccess; <ide> Assert.assertSame(Iterable.class, iterator.next()); <ide> Assert.assertFalse(iterator.hasNext()); <ide> } <add> <add> /** <add> * Tests with a list class. <add> * <add> * @since <add> */ <add> @Test <add> public void list() { <add> Assert.assertSame(IterableValueRenderer.INSTANCE, unit().find(Arrays.asList().getClass())); <add> } <add> <add> /** <add> * Tests with a set class. <add> * <add> * @since <add> */ <add> @Test <add> public void set() { <add> Assert.assertSame(IterableValueRenderer.INSTANCE, unit().find(EnumSet.class)); <add> } <ide> <ide> }