id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1 value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
135,100 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SheetFilterResourcesImpl.java | SheetFilterResourcesImpl.listFilters | public PagedResult<SheetFilter> listFilters(long sheetId, PaginationParameters pagination) throws SmartsheetException {
String path = "sheets/" + sheetId + "/filters";
HashMap<String, Object> parameters = new HashMap<String, Object>();
if (pagination != null) {
parameters = pagination.toHashMap();
}
path += QueryUtil.generateUrl(null, parameters);
return this.listResourcesWithWrapper(path, SheetFilter.class);
} | java | public PagedResult<SheetFilter> listFilters(long sheetId, PaginationParameters pagination) throws SmartsheetException {
String path = "sheets/" + sheetId + "/filters";
HashMap<String, Object> parameters = new HashMap<String, Object>();
if (pagination != null) {
parameters = pagination.toHashMap();
}
path += QueryUtil.generateUrl(null, parameters);
return this.listResourcesWithWrapper(path, SheetFilter.class);
} | [
"public",
"PagedResult",
"<",
"SheetFilter",
">",
"listFilters",
"(",
"long",
"sheetId",
",",
"PaginationParameters",
"pagination",
")",
"throws",
"SmartsheetException",
"{",
"String",
"path",
"=",
"\"sheets/\"",
"+",
"sheetId",
"+",
"\"/filters\"",
";",
"HashMap",
... | Get all filters.
It mirrors to the following Smartsheet REST API method: GET /sheets/{sheetId}/filters
Exceptions:
IllegalArgumentException : if any argument is null
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with the REST API authorization(access token)
ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
SmartsheetRestException : if there is any other REST API related error occurred during the operation
SmartsheetException : if there is any other error occurred during the operation
@param sheetId the sheet ID
@param pagination the pagination pagination
@return all the filters
@throws SmartsheetException the smartsheet exception | [
"Get",
"all",
"filters",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SheetFilterResourcesImpl.java#L110-L120 |
135,101 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SightResourcesImpl.java | SightResourcesImpl.listSights | public PagedResult<Sight> listSights(PaginationParameters paging, Date modifiedSince) throws SmartsheetException {
String path = "sights";
HashMap<String, Object> parameters = new HashMap<String, Object>();
if (paging != null) {
parameters = paging.toHashMap();
}
if (modifiedSince != null) {
String isoDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(modifiedSince);
parameters.put("modifiedSince", isoDate);
}
path += QueryUtil.generateUrl(null, parameters);
return this.listResourcesWithWrapper(path, Sight.class);
} | java | public PagedResult<Sight> listSights(PaginationParameters paging, Date modifiedSince) throws SmartsheetException {
String path = "sights";
HashMap<String, Object> parameters = new HashMap<String, Object>();
if (paging != null) {
parameters = paging.toHashMap();
}
if (modifiedSince != null) {
String isoDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(modifiedSince);
parameters.put("modifiedSince", isoDate);
}
path += QueryUtil.generateUrl(null, parameters);
return this.listResourcesWithWrapper(path, Sight.class);
} | [
"public",
"PagedResult",
"<",
"Sight",
">",
"listSights",
"(",
"PaginationParameters",
"paging",
",",
"Date",
"modifiedSince",
")",
"throws",
"SmartsheetException",
"{",
"String",
"path",
"=",
"\"sights\"",
";",
"HashMap",
"<",
"String",
",",
"Object",
">",
"par... | Gets the list of all Sights where the User has access.
It mirrors to the following Smartsheet REST API method: GET /sights
@param modifiedSince
@return IndexResult object containing an array of Sight objects limited to the following attributes:
id, name, accessLevel, permalink, createdAt, modifiedAt.
@throws IllegalArgumentException if any argument is null or empty string
@throws InvalidRequestException if there is any problem with the REST API request
@throws AuthorizationException if there is any problem with the REST API authorization (access token)
@throws ResourceNotFoundException if the resource cannot be found
@throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
@throws SmartsheetException if there is any other error during the operation | [
"Gets",
"the",
"list",
"of",
"all",
"Sights",
"where",
"the",
"User",
"has",
"access",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SightResourcesImpl.java#L72-L85 |
135,102 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SightResourcesImpl.java | SightResourcesImpl.getSight | public Sight getSight(long sightId, Integer level) throws SmartsheetException {
String path = "sights/" + sightId;
HashMap<String, Object> parameters = new HashMap<String, Object>();
if (level != null) {
parameters.put("level", level);
}
path += QueryUtil.generateUrl(null, parameters);
return this.getResource(path, Sight.class);
} | java | public Sight getSight(long sightId, Integer level) throws SmartsheetException {
String path = "sights/" + sightId;
HashMap<String, Object> parameters = new HashMap<String, Object>();
if (level != null) {
parameters.put("level", level);
}
path += QueryUtil.generateUrl(null, parameters);
return this.getResource(path, Sight.class);
} | [
"public",
"Sight",
"getSight",
"(",
"long",
"sightId",
",",
"Integer",
"level",
")",
"throws",
"SmartsheetException",
"{",
"String",
"path",
"=",
"\"sights/\"",
"+",
"sightId",
";",
"HashMap",
"<",
"String",
",",
"Object",
">",
"parameters",
"=",
"new",
"Has... | Get a specified Sight.
It mirrors to the following Smartsheet REST API method: GET /sights/{sightId}
@param sightId the Id of the Sight
@param level compatibility level
@return the Sight resource.
@throws IllegalArgumentException if any argument is null or empty string
@throws InvalidRequestException if there is any problem with the REST API request
@throws AuthorizationException if there is any problem with the REST API authorization (access token)
@throws ResourceNotFoundException if the resource cannot be found
@throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
@throws SmartsheetException if there is any other error during the operation | [
"Get",
"a",
"specified",
"Sight",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SightResourcesImpl.java#L120-L130 |
135,103 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SightResourcesImpl.java | SightResourcesImpl.updateSight | public Sight updateSight(Sight sight) throws SmartsheetException {
Util.throwIfNull(sight);
return this.updateResource("sights/" + sight.getId(), Sight.class, sight);
} | java | public Sight updateSight(Sight sight) throws SmartsheetException {
Util.throwIfNull(sight);
return this.updateResource("sights/" + sight.getId(), Sight.class, sight);
} | [
"public",
"Sight",
"updateSight",
"(",
"Sight",
"sight",
")",
"throws",
"SmartsheetException",
"{",
"Util",
".",
"throwIfNull",
"(",
"sight",
")",
";",
"return",
"this",
".",
"updateResource",
"(",
"\"sights/\"",
"+",
"sight",
".",
"getId",
"(",
")",
",",
... | Update a specified Sight.
It mirrors to the following Smartsheet REST API method: PUT /sights/{sightId}
@param sight - the Sight to update
@return the updated Sight resource.
@throws IllegalArgumentException if any argument is null or empty string
@throws InvalidRequestException if there is any problem with the REST API request
@throws AuthorizationException if there is any problem with the REST API authorization (access token)
@throws ResourceNotFoundException if the resource cannot be found
@throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
@throws SmartsheetException if there is any other error during the operation | [
"Update",
"a",
"specified",
"Sight",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SightResourcesImpl.java#L146-L149 |
135,104 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SightResourcesImpl.java | SightResourcesImpl.setPublishStatus | public SightPublish setPublishStatus(long sightId, SightPublish sightPublish) throws SmartsheetException {
Util.throwIfNull(sightPublish);
return this.updateResource("sights/" + sightId + "/publish", SightPublish.class, sightPublish);
} | java | public SightPublish setPublishStatus(long sightId, SightPublish sightPublish) throws SmartsheetException {
Util.throwIfNull(sightPublish);
return this.updateResource("sights/" + sightId + "/publish", SightPublish.class, sightPublish);
} | [
"public",
"SightPublish",
"setPublishStatus",
"(",
"long",
"sightId",
",",
"SightPublish",
"sightPublish",
")",
"throws",
"SmartsheetException",
"{",
"Util",
".",
"throwIfNull",
"(",
"sightPublish",
")",
";",
"return",
"this",
".",
"updateResource",
"(",
"\"sights/\... | Sets the publish status of a Sight and returns the new status, including the URLs of any enabled publishing.
It mirrors to the following Smartsheet REST API method: POST /sights/{sightId}/publish
@param sightId the Id of the Sight
@param sightPublish the SightPublish object containing publish status
@return the Sight's publish status.
@throws IllegalArgumentException if any argument is null or empty string
@throws InvalidRequestException if there is any problem with the REST API request
@throws AuthorizationException if there is any problem with the REST API authorization (access token)
@throws ResourceNotFoundException if the resource cannot be found
@throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
@throws SmartsheetException if there is any other error during the operation | [
"Sets",
"the",
"publish",
"status",
"of",
"a",
"Sight",
"and",
"returns",
"the",
"new",
"status",
"including",
"the",
"URLs",
"of",
"any",
"enabled",
"publishing",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SightResourcesImpl.java#L240-L243 |
135,105 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/TemplateResourcesImpl.java | TemplateResourcesImpl.listUserCreatedTemplates | public PagedResult<Template> listUserCreatedTemplates(PaginationParameters parameters) throws SmartsheetException {
String path = "templates";
if (parameters != null) {
path += parameters.toQueryString();
}
return this.listResourcesWithWrapper(path, Template.class);
} | java | public PagedResult<Template> listUserCreatedTemplates(PaginationParameters parameters) throws SmartsheetException {
String path = "templates";
if (parameters != null) {
path += parameters.toQueryString();
}
return this.listResourcesWithWrapper(path, Template.class);
} | [
"public",
"PagedResult",
"<",
"Template",
">",
"listUserCreatedTemplates",
"(",
"PaginationParameters",
"parameters",
")",
"throws",
"SmartsheetException",
"{",
"String",
"path",
"=",
"\"templates\"",
";",
"if",
"(",
"parameters",
"!=",
"null",
")",
"{",
"path",
"... | List user-created templates.
It mirrors to the following Smartsheet REST API method: GET /templates
@param parameters the pagination parameters
Exceptions:
- InvalidRequestException : if there is any problem with the REST API request
- AuthorizationException : if there is any problem with the REST API authorization(access token)
- ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
- SmartsheetRestException : if there is any other REST API related error occurred during the operation
- SmartsheetException : if there is any other error occurred during the operation
@return all templates (note that empty list will be returned if there is none)
@throws SmartsheetException the smartsheet exception | [
"List",
"user",
"-",
"created",
"templates",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/TemplateResourcesImpl.java#L65-L73 |
135,106 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java | FolderResourcesImpl.getFolder | public Folder getFolder(long folderId, EnumSet<SourceInclusion> includes) throws SmartsheetException {
String path = "folders/" + folderId;
HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put("include", QueryUtil.generateCommaSeparatedList(includes));
path += QueryUtil.generateUrl(null, parameters);
return this.getResource(path, Folder.class);
} | java | public Folder getFolder(long folderId, EnumSet<SourceInclusion> includes) throws SmartsheetException {
String path = "folders/" + folderId;
HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put("include", QueryUtil.generateCommaSeparatedList(includes));
path += QueryUtil.generateUrl(null, parameters);
return this.getResource(path, Folder.class);
} | [
"public",
"Folder",
"getFolder",
"(",
"long",
"folderId",
",",
"EnumSet",
"<",
"SourceInclusion",
">",
"includes",
")",
"throws",
"SmartsheetException",
"{",
"String",
"path",
"=",
"\"folders/\"",
"+",
"folderId",
";",
"HashMap",
"<",
"String",
",",
"Object",
... | Get a folder.
It mirrors to the following Smartsheet REST API method: GET /folder/{id}
Exceptions:
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with the REST API authorization(access token)
ResourceNotFoundException : if the resource can not be found
ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
SmartsheetRestException : if there is any other REST API related error occurred during the operation
SmartsheetException : if there is any other error occurred during the operation
@param folderId the folder id
@param includes the include parameters
@return the folder (note that if there is no such resource, this method will throw ResourceNotFoundException
rather than returning null)
@throws SmartsheetException the smartsheet exception | [
"Get",
"a",
"folder",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java#L77-L84 |
135,107 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java | FolderResourcesImpl.updateFolder | public Folder updateFolder(Folder folder) throws SmartsheetException {
return this.updateResource("folders/" + folder.getId(), Folder.class, folder);
} | java | public Folder updateFolder(Folder folder) throws SmartsheetException {
return this.updateResource("folders/" + folder.getId(), Folder.class, folder);
} | [
"public",
"Folder",
"updateFolder",
"(",
"Folder",
"folder",
")",
"throws",
"SmartsheetException",
"{",
"return",
"this",
".",
"updateResource",
"(",
"\"folders/\"",
"+",
"folder",
".",
"getId",
"(",
")",
",",
"Folder",
".",
"class",
",",
"folder",
")",
";",... | Update a folder.
It mirrors to the following Smartsheet REST API method: PUT /folder/{id}
Exceptions:
IllegalArgumentException : if folder is null
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with the REST API authorization(access token)
ResourceNotFoundException : if the resource can not be found
ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
SmartsheetRestException : if there is any other REST API related error occurred during the operation
SmartsheetException : if there is any other error occurred during the operation
@param folder the folder to update
@return the updated folder (note that if there is no such folder, this method will throw
ResourceNotFoundException rather than returning null).
@throws SmartsheetException the smartsheet exception | [
"Update",
"a",
"folder",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java#L105-L108 |
135,108 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java | FolderResourcesImpl.listFolders | public PagedResult<Folder> listFolders(long parentFolderId, PaginationParameters parameters) throws SmartsheetException {
String path = "folders/" + parentFolderId + "/folders";
if (parameters != null) {
path += parameters.toQueryString();
}
return this.listResourcesWithWrapper(path, Folder.class);
} | java | public PagedResult<Folder> listFolders(long parentFolderId, PaginationParameters parameters) throws SmartsheetException {
String path = "folders/" + parentFolderId + "/folders";
if (parameters != null) {
path += parameters.toQueryString();
}
return this.listResourcesWithWrapper(path, Folder.class);
} | [
"public",
"PagedResult",
"<",
"Folder",
">",
"listFolders",
"(",
"long",
"parentFolderId",
",",
"PaginationParameters",
"parameters",
")",
"throws",
"SmartsheetException",
"{",
"String",
"path",
"=",
"\"folders/\"",
"+",
"parentFolderId",
"+",
"\"/folders\"",
";",
"... | List child folders of a given folder.
It mirrors to the following Smartsheet REST API method: GET /folder/{id}/folders
Parameters: - parentFolderId : the parent folder ID
Exceptions:
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with the REST API authorization(access token)
ResourceNotFoundException : if the resource can not be found
ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
SmartsheetRestException : if there is any other REST API related error occurred during the operation
SmartsheetException : if there is any other error occurred during the operation
@param parentFolderId the parent folder id
@param parameters the parameters for pagination
@return the child folders (note that empty list will be returned if no child folder found)
@throws SmartsheetException the smartsheet exception | [
"List",
"child",
"folders",
"of",
"a",
"given",
"folder",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java#L151-L159 |
135,109 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java | FolderResourcesImpl.createFolder | public Folder createFolder(long parentFolderId, Folder folder) throws SmartsheetException {
return this.createResource("folders/" + parentFolderId + "/folders", Folder.class, folder);
} | java | public Folder createFolder(long parentFolderId, Folder folder) throws SmartsheetException {
return this.createResource("folders/" + parentFolderId + "/folders", Folder.class, folder);
} | [
"public",
"Folder",
"createFolder",
"(",
"long",
"parentFolderId",
",",
"Folder",
"folder",
")",
"throws",
"SmartsheetException",
"{",
"return",
"this",
".",
"createResource",
"(",
"\"folders/\"",
"+",
"parentFolderId",
"+",
"\"/folders\"",
",",
"Folder",
".",
"cl... | Create a folder.
It mirrors to the following Smartsheet REST API method: POST /folder/{id}/folders
Exceptions:
IllegalArgumentException : if folder is null
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with the REST API authorization(access token)
ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
SmartsheetRestException : if there is any other REST API related error occurred during the operation
SmartsheetException : if there is any other error occurred during the operation
@param parentFolderId the parent folder id
@param folder the folder to create
@return the folder
@throws SmartsheetException the smartsheet exception | [
"Create",
"a",
"folder",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java#L179-L182 |
135,110 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java | FolderResourcesImpl.moveFolder | public Folder moveFolder(long folderId, ContainerDestination containerDestination) throws SmartsheetException {
String path = "folders/" + folderId + "/move";
return this.createResource(path, Folder.class, containerDestination);
} | java | public Folder moveFolder(long folderId, ContainerDestination containerDestination) throws SmartsheetException {
String path = "folders/" + folderId + "/move";
return this.createResource(path, Folder.class, containerDestination);
} | [
"public",
"Folder",
"moveFolder",
"(",
"long",
"folderId",
",",
"ContainerDestination",
"containerDestination",
")",
"throws",
"SmartsheetException",
"{",
"String",
"path",
"=",
"\"folders/\"",
"+",
"folderId",
"+",
"\"/move\"",
";",
"return",
"this",
".",
"createRe... | Moves the specified Folder to another location.
It mirrors to the following Smartsheet REST API method: POST /folders/{folderId}/move
Exceptions:
IllegalArgumentException : if folder is null
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with the REST API authorization(access token)
ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
SmartsheetRestException : if there is any other REST API related error occurred during the operation
SmartsheetException : if there is any other error occurred during the operation
@param folderId the folder id
@param containerDestination describes the destination container
@return the folder
@throws SmartsheetException the smartsheet exception | [
"Moves",
"the",
"specified",
"Folder",
"to",
"another",
"location",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java#L262-L266 |
135,111 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SearchResourcesImpl.java | SearchResourcesImpl.searchSheet | public SearchResult searchSheet(long sheetId, String query) throws SmartsheetException {
Util.throwIfNull(query);
Util.throwIfEmpty(query);
try {
return this.getResource("search/sheets/" + sheetId + "?query=" + URLEncoder.encode(query,
"utf-8"), SearchResult.class);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
} | java | public SearchResult searchSheet(long sheetId, String query) throws SmartsheetException {
Util.throwIfNull(query);
Util.throwIfEmpty(query);
try {
return this.getResource("search/sheets/" + sheetId + "?query=" + URLEncoder.encode(query,
"utf-8"), SearchResult.class);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
} | [
"public",
"SearchResult",
"searchSheet",
"(",
"long",
"sheetId",
",",
"String",
"query",
")",
"throws",
"SmartsheetException",
"{",
"Util",
".",
"throwIfNull",
"(",
"query",
")",
";",
"Util",
".",
"throwIfEmpty",
"(",
"query",
")",
";",
"try",
"{",
"return",... | Performs a search within a sheet.
It mirrors to the following Smartsheet REST API method: GET /search/sheet/{sheetId}
Exceptions:
IllegalArgumentException : if query is null/empty string
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with the REST API authorization(access token)
ResourceNotFoundException : if the resource can not be found
ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
SmartsheetRestException : if there is any other REST API related error occurred during the operation
SmartsheetException : if there is any other error occurred during the operation
@param sheetId the sheet id
@param query the query
@return the search result (note that if there is no such resource, this method will throw
ResourceNotFoundException rather than returning null).
@throws UnsupportedEncodingException the unsupported encoding exception
@throws SmartsheetException the smartsheet exception | [
"Performs",
"a",
"search",
"within",
"a",
"sheet",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SearchResourcesImpl.java#L146-L155 |
135,112 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SheetAttachmentResourcesImpl.java | SheetAttachmentResourcesImpl.attachUrl | public Attachment attachUrl(long sheetId, Attachment attachment) throws SmartsheetException
{
return this.createResource("sheets/" + sheetId + "/attachments", Attachment.class, attachment);
} | java | public Attachment attachUrl(long sheetId, Attachment attachment) throws SmartsheetException
{
return this.createResource("sheets/" + sheetId + "/attachments", Attachment.class, attachment);
} | [
"public",
"Attachment",
"attachUrl",
"(",
"long",
"sheetId",
",",
"Attachment",
"attachment",
")",
"throws",
"SmartsheetException",
"{",
"return",
"this",
".",
"createResource",
"(",
"\"sheets/\"",
"+",
"sheetId",
"+",
"\"/attachments\"",
",",
"Attachment",
".",
"... | Attach a URL to a sheet.
The URL can be a normal URL (attachmentType "URL"), a Google Drive URL (attachmentType "GOOGLE_DRIVE") or a
Box.com URL (attachmentType "BOX_COM").
It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/attachments
@param sheetId the sheet id
@param attachment the attachment object
@return the attachment object
@throws IllegalArgumentException if any argument is null or empty string
@throws InvalidRequestException if there is any problem with the REST API request
@throws AuthorizationException if there is any problem with the REST API authorization (access token)
@throws ResourceNotFoundException if the resource cannot be found
@throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
@throws SmartsheetException if there is any other error during the operation | [
"Attach",
"a",
"URL",
"to",
"a",
"sheet",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SheetAttachmentResourcesImpl.java#L58-L61 |
135,113 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SheetAttachmentResourcesImpl.java | SheetAttachmentResourcesImpl.listAttachments | public PagedResult<Attachment> listAttachments(long sheetId, PaginationParameters parameters) throws SmartsheetException {
String path = "sheets/" + sheetId + "/attachments";
if (parameters != null) {
path += parameters.toQueryString();
}
return this.listResourcesWithWrapper(path, Attachment.class);
} | java | public PagedResult<Attachment> listAttachments(long sheetId, PaginationParameters parameters) throws SmartsheetException {
String path = "sheets/" + sheetId + "/attachments";
if (parameters != null) {
path += parameters.toQueryString();
}
return this.listResourcesWithWrapper(path, Attachment.class);
} | [
"public",
"PagedResult",
"<",
"Attachment",
">",
"listAttachments",
"(",
"long",
"sheetId",
",",
"PaginationParameters",
"parameters",
")",
"throws",
"SmartsheetException",
"{",
"String",
"path",
"=",
"\"sheets/\"",
"+",
"sheetId",
"+",
"\"/attachments\"",
";",
"if"... | Gets a list of all Attachments that are on the Sheet, including Sheet, Row, and Discussion level Attachments.
It mirrors to the following Smartsheet REST API method: GET /sheets/{sheetId}/attachments
Exceptions:
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with the REST API authorization(access token)
ResourceNotFoundException : if the resource can not be found
ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
SmartsheetRestException : if there is any other REST API related error occurred during the operation
SmartsheetException : if there is any other error occurred during the operation
@param sheetId the ID of the sheet to which the attachments are associated
@param parameters the pagination parameters
@return the attachments (note that empty list will be returned if there is none)
@throws SmartsheetException the smartsheet exception | [
"Gets",
"a",
"list",
"of",
"all",
"Attachments",
"that",
"are",
"on",
"the",
"Sheet",
"including",
"Sheet",
"Row",
"and",
"Discussion",
"level",
"Attachments",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SheetAttachmentResourcesImpl.java#L128-L135 |
135,114 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/oauth/OAuthFlowBuilder.java | OAuthFlowBuilder.build | public OAuthFlow build() {
if(httpClient == null){
httpClient = new DefaultHttpClient();
}
if(tokenURL == null){
tokenURL = DEFAULT_TOKEN_URL;
}
if(authorizationURL == null){
authorizationURL = DEFAULT_AUTHORIZATION_URL;
}
if(jsonSerializer == null){
jsonSerializer = new JacksonJsonSerializer();
}
if(clientId == null || clientSecret == null || redirectURL == null){
throw new IllegalStateException();
}
return new OAuthFlowImpl(clientId, clientSecret, redirectURL, authorizationURL, tokenURL, httpClient,
jsonSerializer);
} | java | public OAuthFlow build() {
if(httpClient == null){
httpClient = new DefaultHttpClient();
}
if(tokenURL == null){
tokenURL = DEFAULT_TOKEN_URL;
}
if(authorizationURL == null){
authorizationURL = DEFAULT_AUTHORIZATION_URL;
}
if(jsonSerializer == null){
jsonSerializer = new JacksonJsonSerializer();
}
if(clientId == null || clientSecret == null || redirectURL == null){
throw new IllegalStateException();
}
return new OAuthFlowImpl(clientId, clientSecret, redirectURL, authorizationURL, tokenURL, httpClient,
jsonSerializer);
} | [
"public",
"OAuthFlow",
"build",
"(",
")",
"{",
"if",
"(",
"httpClient",
"==",
"null",
")",
"{",
"httpClient",
"=",
"new",
"DefaultHttpClient",
"(",
")",
";",
"}",
"if",
"(",
"tokenURL",
"==",
"null",
")",
"{",
"tokenURL",
"=",
"DEFAULT_TOKEN_URL",
";",
... | Build the OAuthFlow instance.
@return the OAuthFlow instance
@throws IllegalArgumentException if clientId, clientSecret or redirectURL isn't set yet. | [
"Build",
"the",
"OAuthFlow",
"instance",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/oauth/OAuthFlowBuilder.java#L292-L315 |
135,115 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/WorkspaceFolderResourcesImpl.java | WorkspaceFolderResourcesImpl.createFolder | public Folder createFolder(long workspaceId, Folder folder) throws SmartsheetException {
return this.createResource("workspaces/" + workspaceId + "/folders", Folder.class, folder);
} | java | public Folder createFolder(long workspaceId, Folder folder) throws SmartsheetException {
return this.createResource("workspaces/" + workspaceId + "/folders", Folder.class, folder);
} | [
"public",
"Folder",
"createFolder",
"(",
"long",
"workspaceId",
",",
"Folder",
"folder",
")",
"throws",
"SmartsheetException",
"{",
"return",
"this",
".",
"createResource",
"(",
"\"workspaces/\"",
"+",
"workspaceId",
"+",
"\"/folders\"",
",",
"Folder",
".",
"class... | Create a folder in the workspace.
It mirrors to the following Smartsheet REST API method: POST /workspace/{id}/folders
Exceptions:
- IllegalArgumentException : if folder is null
- InvalidRequestException : if there is any problem with the REST API request
- AuthorizationException : if there is any problem with the REST API authorization(access token)
- ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
- SmartsheetRestException : if there is any other REST API related error occurred during the operation
- SmartsheetException : if there is any other error occurred during the operation
@param workspaceId the workspace id
@param folder the folder to create
@return the created folder
@throws SmartsheetException the smartsheet exception | [
"Create",
"a",
"folder",
"in",
"the",
"workspace",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/WorkspaceFolderResourcesImpl.java#L94-L96 |
135,116 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/FavoriteResourcesImpl.java | FavoriteResourcesImpl.addFavorites | public List<Favorite> addFavorites(List<Favorite> favorites) throws SmartsheetException{
return this.postAndReceiveList("favorites/", favorites, Favorite.class);
} | java | public List<Favorite> addFavorites(List<Favorite> favorites) throws SmartsheetException{
return this.postAndReceiveList("favorites/", favorites, Favorite.class);
} | [
"public",
"List",
"<",
"Favorite",
">",
"addFavorites",
"(",
"List",
"<",
"Favorite",
">",
"favorites",
")",
"throws",
"SmartsheetException",
"{",
"return",
"this",
".",
"postAndReceiveList",
"(",
"\"favorites/\"",
",",
"favorites",
",",
"Favorite",
".",
"class"... | Adds one or more items to the user's list of Favorite items.
It mirrors to the following Smartsheet REST API method: POST /favorites
Exceptions:
IllegalArgumentException : if any argument is null
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with the REST API authorization(access token)
ResourceNotFoundException : if the resource can not be found
ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
SmartsheetRestException : if there is any other REST API related error occurred during the operation
SmartsheetException : if there is any other error occurred during the operation
@param favorites the list of favorites object limited to the following attributes: *
objectId * type
@return a single Favorite object or an array of Favorite objects
@throws SmartsheetException the smartsheet exception | [
"Adds",
"one",
"or",
"more",
"items",
"to",
"the",
"user",
"s",
"list",
"of",
"Favorite",
"items",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/FavoriteResourcesImpl.java#L72-L74 |
135,117 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/FavoriteResourcesImpl.java | FavoriteResourcesImpl.listFavorites | public PagedResult<Favorite> listFavorites(PaginationParameters parameters) throws SmartsheetException{
String path = "favorites";
if (parameters != null) {
path += parameters.toQueryString();
}
return this.listResourcesWithWrapper(path, Favorite.class);
} | java | public PagedResult<Favorite> listFavorites(PaginationParameters parameters) throws SmartsheetException{
String path = "favorites";
if (parameters != null) {
path += parameters.toQueryString();
}
return this.listResourcesWithWrapper(path, Favorite.class);
} | [
"public",
"PagedResult",
"<",
"Favorite",
">",
"listFavorites",
"(",
"PaginationParameters",
"parameters",
")",
"throws",
"SmartsheetException",
"{",
"String",
"path",
"=",
"\"favorites\"",
";",
"if",
"(",
"parameters",
"!=",
"null",
")",
"{",
"path",
"+=",
"par... | Gets a list of all of the user's Favorite items.
It mirrors to the following Smartsheet REST API method: GET /favorites
Exceptions:
IllegalArgumentException : if any argument is null
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with the REST API authorization(access token)
ResourceNotFoundException : if the resource can not be found
ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
SmartsheetRestException : if there is any other REST API related error occurred during the operation
SmartsheetException : if there is any other error occurred during the operation
@param parameters pagination parameters
@return a single Favorite object or an array of Favorite objects
@throws SmartsheetException the smartsheet exception | [
"Gets",
"a",
"list",
"of",
"all",
"of",
"the",
"user",
"s",
"Favorite",
"items",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/FavoriteResourcesImpl.java#L94-L102 |
135,118 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/util/QueryUtil.java | QueryUtil.generateCommaSeparatedList | public static <T> String generateCommaSeparatedList(Collection<T> list) {
if (list == null || list.size() == 0) {
return "";
}
StringBuilder result = new StringBuilder();
for (Object obj : list) {
result.append(',').append(obj.toString());
}
return result.length() == 0 ? "" : result.substring(1);
} | java | public static <T> String generateCommaSeparatedList(Collection<T> list) {
if (list == null || list.size() == 0) {
return "";
}
StringBuilder result = new StringBuilder();
for (Object obj : list) {
result.append(',').append(obj.toString());
}
return result.length() == 0 ? "" : result.substring(1);
} | [
"public",
"static",
"<",
"T",
">",
"String",
"generateCommaSeparatedList",
"(",
"Collection",
"<",
"T",
">",
"list",
")",
"{",
"if",
"(",
"list",
"==",
"null",
"||",
"list",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
"\"\"",
";",
"}",
"S... | Returns a comma seperated list of items as a string
@param list the collecion
@param <T> the type
@return comma separated string | [
"Returns",
"a",
"comma",
"seperated",
"list",
"of",
"items",
"as",
"a",
"string"
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/util/QueryUtil.java#L39-L48 |
135,119 | smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/util/QueryUtil.java | QueryUtil.generateQueryString | protected static String generateQueryString(Map<String, Object> parameters) {
if (parameters == null || parameters.size() == 0) {
return "";
}
StringBuilder result = new StringBuilder();
try {
for(Map.Entry<String, Object> entry : parameters.entrySet()) {
// Check to see if the key/value isn't null or empty string
if (entry.getKey() != null && (entry.getValue() != null && !entry.getValue().toString().equals(""))) {
result.append('&').append(URLEncoder.encode(entry.getKey(), "utf-8")).append("=")
.append(URLEncoder.encode(entry.getValue().toString(), "utf-8"));
}
}
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
return result.length() == 0 ? "" : "?" + result.substring(1);
} | java | protected static String generateQueryString(Map<String, Object> parameters) {
if (parameters == null || parameters.size() == 0) {
return "";
}
StringBuilder result = new StringBuilder();
try {
for(Map.Entry<String, Object> entry : parameters.entrySet()) {
// Check to see if the key/value isn't null or empty string
if (entry.getKey() != null && (entry.getValue() != null && !entry.getValue().toString().equals(""))) {
result.append('&').append(URLEncoder.encode(entry.getKey(), "utf-8")).append("=")
.append(URLEncoder.encode(entry.getValue().toString(), "utf-8"));
}
}
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
return result.length() == 0 ? "" : "?" + result.substring(1);
} | [
"protected",
"static",
"String",
"generateQueryString",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"if",
"(",
"parameters",
"==",
"null",
"||",
"parameters",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
"\"\"",
";",
... | Returns a query string.
@param parameters the map of query string keys and values
@return the query string | [
"Returns",
"a",
"query",
"string",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/util/QueryUtil.java#L63-L81 |
135,120 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/model/response/crud/Message.java | Message.errorMessage | @JsonIgnore
public static Message errorMessage(String detailMessage) {
Message message = new Message();
message.setDetailMessage(detailMessage);
message.setSeverity("ERROR");
message.setType("");
return message;
} | java | @JsonIgnore
public static Message errorMessage(String detailMessage) {
Message message = new Message();
message.setDetailMessage(detailMessage);
message.setSeverity("ERROR");
message.setType("");
return message;
} | [
"@",
"JsonIgnore",
"public",
"static",
"Message",
"errorMessage",
"(",
"String",
"detailMessage",
")",
"{",
"Message",
"message",
"=",
"new",
"Message",
"(",
")",
";",
"message",
".",
"setDetailMessage",
"(",
"detailMessage",
")",
";",
"message",
".",
"setSeve... | Returns a Message with Severity set to ERROR and the detailMessage set to what is passed in.
@param detailMessage
@return Returns a Message with Severity set to ERROR and the detailMessage set to what is passed in. | [
"Returns",
"a",
"Message",
"with",
"Severity",
"set",
"to",
"ERROR",
"and",
"the",
"detailMessage",
"set",
"to",
"what",
"is",
"passed",
"in",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/model/response/crud/Message.java#L100-L107 |
135,121 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/model/entity/core/type/AbstractEntity.java | AbstractEntity.handleJsonArrayToJavaString | @JsonAnySetter
public void handleJsonArrayToJavaString(String name, Object value) {
try {
PropertyUtils.setProperty(this, name,
this.convertListToString(value));
} catch (IllegalAccessException e) {
log.debug("Error setting field " + name + " with value " + value
+ " on entity " + this.getClass().getSimpleName());
this.additionalProperties.put(name, value);
} catch (InvocationTargetException e) {
log.debug("Error setting field " + name + " with value " + value
+ " on entity " + this.getClass().getSimpleName());
this.additionalProperties.put(name, value);
} catch (NoSuchMethodException e) {
log.debug("Error setting field " + name + " with value " + value
+ " on entity " + this.getClass().getSimpleName());
this.additionalProperties.put(name, value);
}
} | java | @JsonAnySetter
public void handleJsonArrayToJavaString(String name, Object value) {
try {
PropertyUtils.setProperty(this, name,
this.convertListToString(value));
} catch (IllegalAccessException e) {
log.debug("Error setting field " + name + " with value " + value
+ " on entity " + this.getClass().getSimpleName());
this.additionalProperties.put(name, value);
} catch (InvocationTargetException e) {
log.debug("Error setting field " + name + " with value " + value
+ " on entity " + this.getClass().getSimpleName());
this.additionalProperties.put(name, value);
} catch (NoSuchMethodException e) {
log.debug("Error setting field " + name + " with value " + value
+ " on entity " + this.getClass().getSimpleName());
this.additionalProperties.put(name, value);
}
} | [
"@",
"JsonAnySetter",
"public",
"void",
"handleJsonArrayToJavaString",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"try",
"{",
"PropertyUtils",
".",
"setProperty",
"(",
"this",
",",
"name",
",",
"this",
".",
"convertListToString",
"(",
"value",
")... | Unknown properties are handled here. One main purpose of this method is
to handle String values that are sent as json arrays if configured as
multi-values in bh.
@param name
@param value | [
"Unknown",
"properties",
"are",
"handled",
"here",
".",
"One",
"main",
"purpose",
"of",
"this",
"method",
"is",
"to",
"handle",
"String",
"values",
"that",
"are",
"sent",
"as",
"json",
"arrays",
"if",
"configured",
"as",
"multi",
"-",
"values",
"in",
"bh",... | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/model/entity/core/type/AbstractEntity.java#L47-L67 |
135,122 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/model/entity/core/type/AbstractEntity.java | AbstractEntity.convertListToString | public String convertListToString(Object listOrString) {
if (listOrString == null) {
return null;
}
if (listOrString instanceof Collection) {
List<String> list = (List<String>) listOrString;
return StringUtils.join(list, ",");
}
return listOrString.toString();
} | java | public String convertListToString(Object listOrString) {
if (listOrString == null) {
return null;
}
if (listOrString instanceof Collection) {
List<String> list = (List<String>) listOrString;
return StringUtils.join(list, ",");
}
return listOrString.toString();
} | [
"public",
"String",
"convertListToString",
"(",
"Object",
"listOrString",
")",
"{",
"if",
"(",
"listOrString",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"listOrString",
"instanceof",
"Collection",
")",
"{",
"List",
"<",
"String",
">",
... | Handles the fact that bh rest api sends Strings as json arrays if they
are setup as multipickers in the fieldmaps.
@param listOrString
@return | [
"Handles",
"the",
"fact",
"that",
"bh",
"rest",
"api",
"sends",
"Strings",
"as",
"json",
"arrays",
"if",
"they",
"are",
"setup",
"as",
"multipickers",
"in",
"the",
"fieldmaps",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/model/entity/core/type/AbstractEntity.java#L76-L91 |
135,123 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestJsonConverter.java | RestJsonConverter.createObjectMapper | private ObjectMapper createObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JodaModule());
mapper.configure(SerializationFeature.INDENT_OUTPUT, true);
return mapper;
} | java | private ObjectMapper createObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JodaModule());
mapper.configure(SerializationFeature.INDENT_OUTPUT, true);
return mapper;
} | [
"private",
"ObjectMapper",
"createObjectMapper",
"(",
")",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"mapper",
".",
"registerModule",
"(",
"new",
"JodaModule",
"(",
")",
")",
";",
"mapper",
".",
"configure",
"(",
"SerializationF... | Create the ObjectMapper that deserializes entity to json String.
Registers the JodaModule to convert DateTime so-called epoch timestamp (number of milliseconds since January 1st, 1970,
UTC)
@return | [
"Create",
"the",
"ObjectMapper",
"that",
"deserializes",
"entity",
"to",
"json",
"String",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestJsonConverter.java#L45-L50 |
135,124 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestJsonConverter.java | RestJsonConverter.jsonToEntityUnwrapRoot | public <T> T jsonToEntityUnwrapRoot(String jsonString, Class<T> type) {
return jsonToEntity(jsonString, type, this.objectMapperWrapped);
} | java | public <T> T jsonToEntityUnwrapRoot(String jsonString, Class<T> type) {
return jsonToEntity(jsonString, type, this.objectMapperWrapped);
} | [
"public",
"<",
"T",
">",
"T",
"jsonToEntityUnwrapRoot",
"(",
"String",
"jsonString",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"jsonToEntity",
"(",
"jsonString",
",",
"type",
",",
"this",
".",
"objectMapperWrapped",
")",
";",
"}"
] | Converts a jsonString to an object of type T. Unwraps from root, most often this means that the "data" tag is ignored and
that the entity is created from within that data tag.
@param jsonString
the returned json from the api call.
@param type
the type to convert to
@return a type T | [
"Converts",
"a",
"jsonString",
"to",
"an",
"object",
"of",
"type",
"T",
".",
"Unwraps",
"from",
"root",
"most",
"often",
"this",
"means",
"that",
"the",
"data",
"tag",
"is",
"ignored",
"and",
"that",
"the",
"entity",
"is",
"created",
"from",
"within",
"t... | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestJsonConverter.java#L79-L81 |
135,125 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestJsonConverter.java | RestJsonConverter.convertEntityToJsonString | public <T extends BullhornEntity> String convertEntityToJsonString(T entity) {
String jsonString = "";
try {
jsonString = objectMapperStandard.writeValueAsString(entity);
} catch (JsonProcessingException e) {
log.error("Error deserializing entity of type" + entity.getClass() + " to jsonString.", e);
}
return jsonString;
} | java | public <T extends BullhornEntity> String convertEntityToJsonString(T entity) {
String jsonString = "";
try {
jsonString = objectMapperStandard.writeValueAsString(entity);
} catch (JsonProcessingException e) {
log.error("Error deserializing entity of type" + entity.getClass() + " to jsonString.", e);
}
return jsonString;
} | [
"public",
"<",
"T",
"extends",
"BullhornEntity",
">",
"String",
"convertEntityToJsonString",
"(",
"T",
"entity",
")",
"{",
"String",
"jsonString",
"=",
"\"\"",
";",
"try",
"{",
"jsonString",
"=",
"objectMapperStandard",
".",
"writeValueAsString",
"(",
"entity",
... | Takes a BullhornEntity and converts it to a String in json format.
@param entity
a BullhornEntity
@return the jsonString | [
"Takes",
"a",
"BullhornEntity",
"and",
"converts",
"it",
"to",
"a",
"String",
"in",
"json",
"format",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestJsonConverter.java#L107-L115 |
135,126 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java | RestUriVariablesFactory.getUriVariablesForEntity | public Map<String, String> getUriVariablesForEntity(BullhornEntityInfo entityInfo, Integer id, Set<String> fieldSet, EntityParams params) {
if (params == null) {
params = ParamFactory.entityParams();
}
Map<String, String> uriVariables = params.getParameterMap();
this.addCommonUriVariables(fieldSet, entityInfo, uriVariables);
uriVariables.put(ID, id == null ? "" : id.toString());
return uriVariables;
} | java | public Map<String, String> getUriVariablesForEntity(BullhornEntityInfo entityInfo, Integer id, Set<String> fieldSet, EntityParams params) {
if (params == null) {
params = ParamFactory.entityParams();
}
Map<String, String> uriVariables = params.getParameterMap();
this.addCommonUriVariables(fieldSet, entityInfo, uriVariables);
uriVariables.put(ID, id == null ? "" : id.toString());
return uriVariables;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getUriVariablesForEntity",
"(",
"BullhornEntityInfo",
"entityInfo",
",",
"Integer",
"id",
",",
"Set",
"<",
"String",
">",
"fieldSet",
",",
"EntityParams",
"params",
")",
"{",
"if",
"(",
"params",
"==",
"nu... | Returns the uri variables needed for an "entity" GET
@param entityInfo
@param id
@param fieldSet
@param params
@return all uriVariables needed for the api call | [
"Returns",
"the",
"uri",
"variables",
"needed",
"for",
"an",
"entity",
"GET"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java#L128-L139 |
135,127 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java | RestUriVariablesFactory.getUriVariablesForEntityDelete | public Map<String, String> getUriVariablesForEntityDelete(BullhornEntityInfo entityInfo, Integer id) {
Map<String, String> uriVariables = new LinkedHashMap<String, String>();
addModifyingUriVariables(uriVariables, entityInfo);
uriVariables.put(ID, id.toString());
return uriVariables;
} | java | public Map<String, String> getUriVariablesForEntityDelete(BullhornEntityInfo entityInfo, Integer id) {
Map<String, String> uriVariables = new LinkedHashMap<String, String>();
addModifyingUriVariables(uriVariables, entityInfo);
uriVariables.put(ID, id.toString());
return uriVariables;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getUriVariablesForEntityDelete",
"(",
"BullhornEntityInfo",
"entityInfo",
",",
"Integer",
"id",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
"=",
"new",
"LinkedHashMap",
"<",
"String",
... | Returns the uri variables needed for an "entity" DELETE
@param entityInfo
@param id
@return all uriVariables needed for the api call | [
"Returns",
"the",
"uri",
"variables",
"needed",
"for",
"an",
"entity",
"DELETE"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java#L158-L163 |
135,128 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java | RestUriVariablesFactory.getUriVariablesForEntityInsert | public Map<String, String> getUriVariablesForEntityInsert(BullhornEntityInfo entityInfo) {
Map<String, String> uriVariables = new LinkedHashMap<String, String>();
addModifyingUriVariables(uriVariables, entityInfo);
return uriVariables;
} | java | public Map<String, String> getUriVariablesForEntityInsert(BullhornEntityInfo entityInfo) {
Map<String, String> uriVariables = new LinkedHashMap<String, String>();
addModifyingUriVariables(uriVariables, entityInfo);
return uriVariables;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getUriVariablesForEntityInsert",
"(",
"BullhornEntityInfo",
"entityInfo",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"String",
">",
"... | Returns the uri variables needed for the "entity" PUT request.
@param entityInfo
@return | [
"Returns",
"the",
"uri",
"variables",
"needed",
"for",
"the",
"entity",
"PUT",
"request",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java#L185-L189 |
135,129 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java | RestUriVariablesFactory.getUriVariablesForQueryWithPost | public Map<String, String> getUriVariablesForQueryWithPost(BullhornEntityInfo entityInfo, Set<String> fieldSet, QueryParams params) {
Map<String, String> uriVariables = params.getParameterMap();
this.addCommonUriVariables(fieldSet, entityInfo, uriVariables);
return uriVariables;
} | java | public Map<String, String> getUriVariablesForQueryWithPost(BullhornEntityInfo entityInfo, Set<String> fieldSet, QueryParams params) {
Map<String, String> uriVariables = params.getParameterMap();
this.addCommonUriVariables(fieldSet, entityInfo, uriVariables);
return uriVariables;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getUriVariablesForQueryWithPost",
"(",
"BullhornEntityInfo",
"entityInfo",
",",
"Set",
"<",
"String",
">",
"fieldSet",
",",
"QueryParams",
"params",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uriVa... | Returns the uri variables needed for a "query" request minus where since that will be in the body
@param entityInfo
@param fieldSet
@param params
@return all uriVariables needed for the api call | [
"Returns",
"the",
"uri",
"variables",
"needed",
"for",
"a",
"query",
"request",
"minus",
"where",
"since",
"that",
"will",
"be",
"in",
"the",
"body"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java#L199-L206 |
135,130 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java | RestUriVariablesFactory.getUriVariablesForQuery | public Map<String, String> getUriVariablesForQuery(BullhornEntityInfo entityInfo, String where, Set<String> fieldSet, QueryParams params) {
Map<String, String> uriVariables = params.getParameterMap();
this.addCommonUriVariables(fieldSet, entityInfo, uriVariables);
uriVariables.put(WHERE, where);
return uriVariables;
} | java | public Map<String, String> getUriVariablesForQuery(BullhornEntityInfo entityInfo, String where, Set<String> fieldSet, QueryParams params) {
Map<String, String> uriVariables = params.getParameterMap();
this.addCommonUriVariables(fieldSet, entityInfo, uriVariables);
uriVariables.put(WHERE, where);
return uriVariables;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getUriVariablesForQuery",
"(",
"BullhornEntityInfo",
"entityInfo",
",",
"String",
"where",
",",
"Set",
"<",
"String",
">",
"fieldSet",
",",
"QueryParams",
"params",
")",
"{",
"Map",
"<",
"String",
",",
"St... | Returns the uri variables needed for a "query" request
@param entityInfo
@param where
@param fieldSet
@param params
@return all uriVariables needed for the api call | [
"Returns",
"the",
"uri",
"variables",
"needed",
"for",
"a",
"query",
"request"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java#L217-L225 |
135,131 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java | RestUriVariablesFactory.getUriVariablesForSearchWithPost | public Map<String, String> getUriVariablesForSearchWithPost(BullhornEntityInfo entityInfo, Set<String> fieldSet, SearchParams params) {
Map<String, String> uriVariables = params.getParameterMap();
this.addCommonUriVariables(fieldSet, entityInfo, uriVariables);
return uriVariables;
} | java | public Map<String, String> getUriVariablesForSearchWithPost(BullhornEntityInfo entityInfo, Set<String> fieldSet, SearchParams params) {
Map<String, String> uriVariables = params.getParameterMap();
this.addCommonUriVariables(fieldSet, entityInfo, uriVariables);
return uriVariables;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getUriVariablesForSearchWithPost",
"(",
"BullhornEntityInfo",
"entityInfo",
",",
"Set",
"<",
"String",
">",
"fieldSet",
",",
"SearchParams",
"params",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uri... | Returns the uri variables needed for a "search" request minus query
@param entityInfo
@param fieldSet
@param params
@return all uriVariables needed for the api call | [
"Returns",
"the",
"uri",
"variables",
"needed",
"for",
"a",
"search",
"request",
"minus",
"query"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java#L235-L242 |
135,132 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java | RestUriVariablesFactory.getUriVariablesForSearch | public Map<String, String> getUriVariablesForSearch(BullhornEntityInfo entityInfo, String query, Set<String> fieldSet, SearchParams params) {
Map<String, String> uriVariables = params.getParameterMap();
this.addCommonUriVariables(fieldSet, entityInfo, uriVariables);
uriVariables.put(QUERY, query);
return uriVariables;
} | java | public Map<String, String> getUriVariablesForSearch(BullhornEntityInfo entityInfo, String query, Set<String> fieldSet, SearchParams params) {
Map<String, String> uriVariables = params.getParameterMap();
this.addCommonUriVariables(fieldSet, entityInfo, uriVariables);
uriVariables.put(QUERY, query);
return uriVariables;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getUriVariablesForSearch",
"(",
"BullhornEntityInfo",
"entityInfo",
",",
"String",
"query",
",",
"Set",
"<",
"String",
">",
"fieldSet",
",",
"SearchParams",
"params",
")",
"{",
"Map",
"<",
"String",
",",
"... | Returns the uri variables needed for a "search" request
@param entityInfo
@param query
@param fieldSet
@param params
@return all uriVariables needed for the api call | [
"Returns",
"the",
"uri",
"variables",
"needed",
"for",
"a",
"search",
"request"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java#L253-L261 |
135,133 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java | RestUriVariablesFactory.getUriVariablesForIdSearch | public Map<String, String> getUriVariablesForIdSearch(BullhornEntityInfo entityInfo,
String query,
SearchParams params) {
Map<String, String> uriVariables = params.getParameterMap();
uriVariables.put(BH_REST_TOKEN, bullhornApiRest.getBhRestToken());
uriVariables.put(ENTITY_TYPE, entityInfo.getName());
uriVariables.put(QUERY, query);
return uriVariables;
} | java | public Map<String, String> getUriVariablesForIdSearch(BullhornEntityInfo entityInfo,
String query,
SearchParams params) {
Map<String, String> uriVariables = params.getParameterMap();
uriVariables.put(BH_REST_TOKEN, bullhornApiRest.getBhRestToken());
uriVariables.put(ENTITY_TYPE, entityInfo.getName());
uriVariables.put(QUERY, query);
return uriVariables;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getUriVariablesForIdSearch",
"(",
"BullhornEntityInfo",
"entityInfo",
",",
"String",
"query",
",",
"SearchParams",
"params",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
"=",
"params",
... | Returns the uri variables needed for a id "search" request | [
"Returns",
"the",
"uri",
"variables",
"needed",
"for",
"a",
"id",
"search",
"request"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java#L266-L277 |
135,134 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java | RestUriVariablesFactory.getUriVariablesForResumeFileParse | public Map<String, String> getUriVariablesForResumeFileParse(ResumeFileParseParams params, MultipartFile resume) {
if (params == null) {
params = ParamFactory.resumeFileParseParams();
}
Map<String, String> uriVariables = params.getParameterMap();
String bhRestToken = bullhornApiRest.getBhRestToken();
uriVariables.put(BH_REST_TOKEN, bhRestToken);
uriVariables.put(FORMAT, restFileManager.getFileParam(resume));
return uriVariables;
} | java | public Map<String, String> getUriVariablesForResumeFileParse(ResumeFileParseParams params, MultipartFile resume) {
if (params == null) {
params = ParamFactory.resumeFileParseParams();
}
Map<String, String> uriVariables = params.getParameterMap();
String bhRestToken = bullhornApiRest.getBhRestToken();
uriVariables.put(BH_REST_TOKEN, bhRestToken);
uriVariables.put(FORMAT, restFileManager.getFileParam(resume));
return uriVariables;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getUriVariablesForResumeFileParse",
"(",
"ResumeFileParseParams",
"params",
",",
"MultipartFile",
"resume",
")",
"{",
"if",
"(",
"params",
"==",
"null",
")",
"{",
"params",
"=",
"ParamFactory",
".",
"resumeFil... | Returns the uri variables needed for a resume file request
@param params
@param resume
@return | [
"Returns",
"the",
"uri",
"variables",
"needed",
"for",
"a",
"resume",
"file",
"request"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java#L286-L298 |
135,135 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java | RestUriVariablesFactory.getUriVariablesForResumeTextParse | public Map<String, String> getUriVariablesForResumeTextParse(ResumeTextParseParams params) {
if (params == null) {
params = ParamFactory.resumeTextParseParams();
}
Map<String, String> uriVariables = params.getParameterMap();
String bhRestToken = bullhornApiRest.getBhRestToken();
uriVariables.put(BH_REST_TOKEN, bhRestToken);
return uriVariables;
} | java | public Map<String, String> getUriVariablesForResumeTextParse(ResumeTextParseParams params) {
if (params == null) {
params = ParamFactory.resumeTextParseParams();
}
Map<String, String> uriVariables = params.getParameterMap();
String bhRestToken = bullhornApiRest.getBhRestToken();
uriVariables.put(BH_REST_TOKEN, bhRestToken);
return uriVariables;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getUriVariablesForResumeTextParse",
"(",
"ResumeTextParseParams",
"params",
")",
"{",
"if",
"(",
"params",
"==",
"null",
")",
"{",
"params",
"=",
"ParamFactory",
".",
"resumeTextParseParams",
"(",
")",
";",
... | Returns the uri variables needed for a resume text request
@param params
@return | [
"Returns",
"the",
"uri",
"variables",
"needed",
"for",
"a",
"resume",
"text",
"request"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java#L306-L317 |
135,136 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java | RestUriVariablesFactory.getUriVariablesForGetFile | public Map<String, String> getUriVariablesForGetFile(BullhornEntityInfo entityInfo, Integer entityId, Integer fileId) {
Map<String, String> uriVariables = new LinkedHashMap<String, String>();
String bhRestToken = bullhornApiRest.getBhRestToken();
uriVariables.put(BH_REST_TOKEN, bhRestToken);
uriVariables.put(ENTITY_TYPE, entityInfo.getName());
uriVariables.put(ENTITY_ID, entityId.toString());
uriVariables.put(FILE_ID, fileId.toString());
return uriVariables;
} | java | public Map<String, String> getUriVariablesForGetFile(BullhornEntityInfo entityInfo, Integer entityId, Integer fileId) {
Map<String, String> uriVariables = new LinkedHashMap<String, String>();
String bhRestToken = bullhornApiRest.getBhRestToken();
uriVariables.put(BH_REST_TOKEN, bhRestToken);
uriVariables.put(ENTITY_TYPE, entityInfo.getName());
uriVariables.put(ENTITY_ID, entityId.toString());
uriVariables.put(FILE_ID, fileId.toString());
return uriVariables;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getUriVariablesForGetFile",
"(",
"BullhornEntityInfo",
"entityInfo",
",",
"Integer",
"entityId",
",",
"Integer",
"fileId",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
"=",
"new",
"Lin... | Returns the uri variables needed for a get file request
@param entityInfo
@param entityId
@param fileId
@return | [
"Returns",
"the",
"uri",
"variables",
"needed",
"for",
"a",
"get",
"file",
"request"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java#L327-L335 |
135,137 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java | RestUriVariablesFactory.getUriVariablesForCorpNotes | public Map<String, String> getUriVariablesForCorpNotes(Integer clientCorporationID, Set<String> fieldSet, CorpNotesParams params) {
if (params == null) {
params = ParamFactory.corpNotesParams();
}
Map<String, String> uriVariables = params.getParameterMap();
String bhRestToken = bullhornApiRest.getBhRestToken();
uriVariables.put(BH_REST_TOKEN, bhRestToken);
String fields = this.convertFieldSetToString(fieldSet);
uriVariables.put(FIELDS, fields);
uriVariables.put(CLIENT_CORP_ID, clientCorporationID.toString());
return uriVariables;
} | java | public Map<String, String> getUriVariablesForCorpNotes(Integer clientCorporationID, Set<String> fieldSet, CorpNotesParams params) {
if (params == null) {
params = ParamFactory.corpNotesParams();
}
Map<String, String> uriVariables = params.getParameterMap();
String bhRestToken = bullhornApiRest.getBhRestToken();
uriVariables.put(BH_REST_TOKEN, bhRestToken);
String fields = this.convertFieldSetToString(fieldSet);
uriVariables.put(FIELDS, fields);
uriVariables.put(CLIENT_CORP_ID, clientCorporationID.toString());
return uriVariables;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getUriVariablesForCorpNotes",
"(",
"Integer",
"clientCorporationID",
",",
"Set",
"<",
"String",
">",
"fieldSet",
",",
"CorpNotesParams",
"params",
")",
"{",
"if",
"(",
"params",
"==",
"null",
")",
"{",
"pa... | Returns the uri variables needed for a get corp notes call
@param clientCorporationID
@param fieldSet
@param params
@return | [
"Returns",
"the",
"uri",
"variables",
"needed",
"for",
"a",
"get",
"corp",
"notes",
"call"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java#L452-L466 |
135,138 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java | RestUriVariablesFactory.addModifyingUriVariables | private void addModifyingUriVariables(Map<String, String> uriVariables, BullhornEntityInfo entityInfo) {
String bhRestToken = bullhornApiRest.getBhRestToken();
uriVariables.put(BH_REST_TOKEN, bhRestToken);
uriVariables.put(ENTITY_TYPE, entityInfo.getName());
uriVariables.put(EXECUTE_FORM_TRIGGERS, bullhornApiRest.getExecuteFormTriggers() ? "true" : "false");
} | java | private void addModifyingUriVariables(Map<String, String> uriVariables, BullhornEntityInfo entityInfo) {
String bhRestToken = bullhornApiRest.getBhRestToken();
uriVariables.put(BH_REST_TOKEN, bhRestToken);
uriVariables.put(ENTITY_TYPE, entityInfo.getName());
uriVariables.put(EXECUTE_FORM_TRIGGERS, bullhornApiRest.getExecuteFormTriggers() ? "true" : "false");
} | [
"private",
"void",
"addModifyingUriVariables",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
",",
"BullhornEntityInfo",
"entityInfo",
")",
"{",
"String",
"bhRestToken",
"=",
"bullhornApiRest",
".",
"getBhRestToken",
"(",
")",
";",
"uriVariables",
... | Adds common URI Variables for calls that are creating, updating, or deleting data.
Adds the execute form triggers url parameter if it has been configured.
@param uriVariables The variables map to add the flag to
@param entityInfo The bullhorn entity that is being modified by this call | [
"Adds",
"common",
"URI",
"Variables",
"for",
"calls",
"that",
"are",
"creating",
"updating",
"or",
"deleting",
"data",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java#L490-L495 |
135,139 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java | RestUriVariablesFactory.getUriVariablesForFastFind | public Map<String, String> getUriVariablesForFastFind(String query, FastFindParams params) {
Map<String, String> uriVariables = params.getParameterMap();
uriVariables.put(BH_REST_TOKEN, bullhornApiRest.getBhRestToken());
uriVariables.put(QUERY, query);
return uriVariables;
} | java | public Map<String, String> getUriVariablesForFastFind(String query, FastFindParams params) {
Map<String, String> uriVariables = params.getParameterMap();
uriVariables.put(BH_REST_TOKEN, bullhornApiRest.getBhRestToken());
uriVariables.put(QUERY, query);
return uriVariables;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getUriVariablesForFastFind",
"(",
"String",
"query",
",",
"FastFindParams",
"params",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
"=",
"params",
".",
"getParameterMap",
"(",
")",
";... | Returns the uri variables needed for a "fastFind" request
@param query
@param params
@return all uriVariables needed for the api call | [
"Returns",
"the",
"uri",
"variables",
"needed",
"for",
"a",
"fastFind",
"request"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestUriVariablesFactory.java#L524-L532 |
135,140 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleMultipleUpdates | protected <C extends CrudResponse, T extends UpdateEntity> List<C> handleMultipleUpdates(List<T> entityList) {
if (entityList == null || entityList.isEmpty()) {
return Collections.emptyList();
}
List<EntityUpdateWorker<C>> taskList = new ArrayList<EntityUpdateWorker<C>>();
for (T entity : entityList) {
taskList.add(new EntityUpdateWorker<C>(this, entity));
}
return concurrencyService.spinThreadsAndWaitForResult(taskList);
} | java | protected <C extends CrudResponse, T extends UpdateEntity> List<C> handleMultipleUpdates(List<T> entityList) {
if (entityList == null || entityList.isEmpty()) {
return Collections.emptyList();
}
List<EntityUpdateWorker<C>> taskList = new ArrayList<EntityUpdateWorker<C>>();
for (T entity : entityList) {
taskList.add(new EntityUpdateWorker<C>(this, entity));
}
return concurrencyService.spinThreadsAndWaitForResult(taskList);
} | [
"protected",
"<",
"C",
"extends",
"CrudResponse",
",",
"T",
"extends",
"UpdateEntity",
">",
"List",
"<",
"C",
">",
"handleMultipleUpdates",
"(",
"List",
"<",
"T",
">",
"entityList",
")",
"{",
"if",
"(",
"entityList",
"==",
"null",
"||",
"entityList",
".",
... | Spins off threads that will call handleUpdateEntity for each entity.
@param entityList
@return | [
"Spins",
"off",
"threads",
"that",
"will",
"call",
"handleUpdateEntity",
"for",
"each",
"entity",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1145-L1158 |
135,141 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleParseResumeText | protected <P extends ParsedResume> P handleParseResumeText(String resume, ResumeTextParseParams params) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForResumeTextParse(params);
String url = restUrlFactory.assembleParseResumeTextUrl(params);
JSONObject resumeInfoToPost = new JSONObject();
try {
resumeInfoToPost.put("resume", resume);
} catch (JSONException e) {
log.error("Error creating JsonObject with resume text.", e);
}
String jsonEncodedResume = resumeInfoToPost.toString();
ParsedResume response = this.parseResume(url, jsonEncodedResume, uriVariables);
return (P) response;
} | java | protected <P extends ParsedResume> P handleParseResumeText(String resume, ResumeTextParseParams params) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForResumeTextParse(params);
String url = restUrlFactory.assembleParseResumeTextUrl(params);
JSONObject resumeInfoToPost = new JSONObject();
try {
resumeInfoToPost.put("resume", resume);
} catch (JSONException e) {
log.error("Error creating JsonObject with resume text.", e);
}
String jsonEncodedResume = resumeInfoToPost.toString();
ParsedResume response = this.parseResume(url, jsonEncodedResume, uriVariables);
return (P) response;
} | [
"protected",
"<",
"P",
"extends",
"ParsedResume",
">",
"P",
"handleParseResumeText",
"(",
"String",
"resume",
",",
"ResumeTextParseParams",
"params",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
"=",
"restUriVariablesFactory",
".",
"getUriVa... | Handles the parsing of a resume text. Contains retry logic.
@param resume
@param params
@return | [
"Handles",
"the",
"parsing",
"of",
"a",
"resume",
"text",
".",
"Contains",
"retry",
"logic",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1312-L1328 |
135,142 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.parseResume | protected ParsedResume parseResume(String url, Object requestPayLoad, Map<String, String> uriVariables) {
ParsedResume response = null;
for (int tryNumber = 1; tryNumber <= RESUME_PARSE_RETRY; tryNumber++) {
try {
response = this.performPostResumeRequest(url, requestPayLoad, uriVariables);
break;
} catch (HttpStatusCodeException error) {
response = handleResumeParseError(tryNumber, error);
} catch (Exception e) {
log.error("error", e);
}
}
return response;
} | java | protected ParsedResume parseResume(String url, Object requestPayLoad, Map<String, String> uriVariables) {
ParsedResume response = null;
for (int tryNumber = 1; tryNumber <= RESUME_PARSE_RETRY; tryNumber++) {
try {
response = this.performPostResumeRequest(url, requestPayLoad, uriVariables);
break;
} catch (HttpStatusCodeException error) {
response = handleResumeParseError(tryNumber, error);
} catch (Exception e) {
log.error("error", e);
}
}
return response;
} | [
"protected",
"ParsedResume",
"parseResume",
"(",
"String",
"url",
",",
"Object",
"requestPayLoad",
",",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
")",
"{",
"ParsedResume",
"response",
"=",
"null",
";",
"for",
"(",
"int",
"tryNumber",
"=",
"1"... | Makes the call to the resume parser. If parse fails this method will retry RESUME_PARSE_RETRY number of times.
@param url
@param requestPayLoad
@param uriVariables
@return | [
"Makes",
"the",
"call",
"to",
"the",
"resume",
"parser",
".",
"If",
"parse",
"fails",
"this",
"method",
"will",
"retry",
"RESUME_PARSE_RETRY",
"number",
"of",
"times",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1360-L1374 |
135,143 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleGetAllFileContentWithMetaData | protected List<FileWrapper> handleGetAllFileContentWithMetaData(Class<? extends FileEntity> type, Integer entityId) {
List<FileMeta> metaDataList = this.handleGetEntityMetaFiles(type, entityId);
// Create an ExecutorService with the number of processors available to the Java virtual machine.
ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
// First get all the FileContent
List<Future<FileContent>> futureList = new ArrayList<Future<FileContent>>();
for (FileMeta metaData : metaDataList) {
FileWorker fileWorker = new FileWorker(entityId, metaData.getId(), type, this);
Future<FileContent> fileContent = executor.submit(fileWorker);
futureList.add(fileContent);
}
Map<Integer, FileContent> fileContentMap = new HashMap<Integer, FileContent>();
for (Future<FileContent> future : futureList) {
try {
fileContentMap.put(future.get().getId(), future.get());
} catch (InterruptedException e) {
log.error("Error in bullhornapirest.getAllFileContentWithMetaData", e);
} catch (ExecutionException e) {
log.error("Error in bullhornapirest.getAllFileContentWithMetaData", e);
}
}
// shutdown pool, wait until it's done
executor.shutdown();
while (!executor.isTerminated()) {
}
// null it out
executor = null;
// Second create the FileWrapper list from the FileContent and FileMeta
List<FileWrapper> fileWrapperList = new ArrayList<FileWrapper>();
for (FileMeta metaData : metaDataList) {
FileContent fileContent = fileContentMap.get(metaData.getId());
FileWrapper fileWrapper = new StandardFileWrapper(fileContent, metaData);
fileWrapperList.add(fileWrapper);
}
return fileWrapperList;
} | java | protected List<FileWrapper> handleGetAllFileContentWithMetaData(Class<? extends FileEntity> type, Integer entityId) {
List<FileMeta> metaDataList = this.handleGetEntityMetaFiles(type, entityId);
// Create an ExecutorService with the number of processors available to the Java virtual machine.
ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
// First get all the FileContent
List<Future<FileContent>> futureList = new ArrayList<Future<FileContent>>();
for (FileMeta metaData : metaDataList) {
FileWorker fileWorker = new FileWorker(entityId, metaData.getId(), type, this);
Future<FileContent> fileContent = executor.submit(fileWorker);
futureList.add(fileContent);
}
Map<Integer, FileContent> fileContentMap = new HashMap<Integer, FileContent>();
for (Future<FileContent> future : futureList) {
try {
fileContentMap.put(future.get().getId(), future.get());
} catch (InterruptedException e) {
log.error("Error in bullhornapirest.getAllFileContentWithMetaData", e);
} catch (ExecutionException e) {
log.error("Error in bullhornapirest.getAllFileContentWithMetaData", e);
}
}
// shutdown pool, wait until it's done
executor.shutdown();
while (!executor.isTerminated()) {
}
// null it out
executor = null;
// Second create the FileWrapper list from the FileContent and FileMeta
List<FileWrapper> fileWrapperList = new ArrayList<FileWrapper>();
for (FileMeta metaData : metaDataList) {
FileContent fileContent = fileContentMap.get(metaData.getId());
FileWrapper fileWrapper = new StandardFileWrapper(fileContent, metaData);
fileWrapperList.add(fileWrapper);
}
return fileWrapperList;
} | [
"protected",
"List",
"<",
"FileWrapper",
">",
"handleGetAllFileContentWithMetaData",
"(",
"Class",
"<",
"?",
"extends",
"FileEntity",
">",
"type",
",",
"Integer",
"entityId",
")",
"{",
"List",
"<",
"FileMeta",
">",
"metaDataList",
"=",
"this",
".",
"handleGetEnt... | This method will get all the meta data and then handle the fetching of FileContent in a multi-threaded fashion.
@param type
@param entityId
@return | [
"This",
"method",
"will",
"get",
"all",
"the",
"meta",
"data",
"and",
"then",
"handle",
"the",
"fetching",
"of",
"FileContent",
"in",
"a",
"multi",
"-",
"threaded",
"fashion",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1500-L1539 |
135,144 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleGetFileContentWithMetaData | protected FileWrapper handleGetFileContentWithMetaData(Class<? extends FileEntity> type, Integer entityId, Integer fileId) {
FileWrapper fileWrapper = null;
try {
FileContent fileContent = this.handleGetFileContent(type, entityId, fileId);
List<FileMeta> metaDataList = this.handleGetEntityMetaFiles(type, entityId);
FileMeta correctMetaData = null;
for (FileMeta metaData : metaDataList) {
if (fileId.equals(metaData.getId())) {
correctMetaData = metaData;
break;
}
}
fileWrapper = new StandardFileWrapper(fileContent, correctMetaData);
} catch (Exception e) {
log.error("Error getting file with id: " + fileId + " for " + type.getSimpleName() + " with id:" + entityId);
}
return fileWrapper;
} | java | protected FileWrapper handleGetFileContentWithMetaData(Class<? extends FileEntity> type, Integer entityId, Integer fileId) {
FileWrapper fileWrapper = null;
try {
FileContent fileContent = this.handleGetFileContent(type, entityId, fileId);
List<FileMeta> metaDataList = this.handleGetEntityMetaFiles(type, entityId);
FileMeta correctMetaData = null;
for (FileMeta metaData : metaDataList) {
if (fileId.equals(metaData.getId())) {
correctMetaData = metaData;
break;
}
}
fileWrapper = new StandardFileWrapper(fileContent, correctMetaData);
} catch (Exception e) {
log.error("Error getting file with id: " + fileId + " for " + type.getSimpleName() + " with id:" + entityId);
}
return fileWrapper;
} | [
"protected",
"FileWrapper",
"handleGetFileContentWithMetaData",
"(",
"Class",
"<",
"?",
"extends",
"FileEntity",
">",
"type",
",",
"Integer",
"entityId",
",",
"Integer",
"fileId",
")",
"{",
"FileWrapper",
"fileWrapper",
"=",
"null",
";",
"try",
"{",
"FileContent",... | Makes the api call to get both the file content and filemeta data, and combines those two to a FileWrapper
@param type
@param entityId
@param fileId
@return | [
"Makes",
"the",
"api",
"call",
"to",
"get",
"both",
"the",
"file",
"content",
"and",
"filemeta",
"data",
"and",
"combines",
"those",
"two",
"to",
"a",
"FileWrapper"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1549-L1569 |
135,145 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleGetEntityMetaFiles | protected List<FileMeta> handleGetEntityMetaFiles(Class<? extends FileEntity> type, Integer entityId) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForGetEntityMetaFiles(
BullhornEntityInfo.getTypesRestEntityName(type), entityId);
String url = restUrlFactory.assembleGetEntityMetaFilesUrl();
String jsonString = this.performGetRequest(url, String.class, uriVariables);
EntityMetaFiles<? extends FileMeta> entityMetaFiles = restJsonConverter.jsonToEntityDoNotUnwrapRoot(jsonString,
StandardEntityMetaFiles.class);
if (entityMetaFiles == null || entityMetaFiles.getFileMetas() == null) {
return Collections.emptyList();
}
return (List<FileMeta>) entityMetaFiles.getFileMetas();
} | java | protected List<FileMeta> handleGetEntityMetaFiles(Class<? extends FileEntity> type, Integer entityId) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForGetEntityMetaFiles(
BullhornEntityInfo.getTypesRestEntityName(type), entityId);
String url = restUrlFactory.assembleGetEntityMetaFilesUrl();
String jsonString = this.performGetRequest(url, String.class, uriVariables);
EntityMetaFiles<? extends FileMeta> entityMetaFiles = restJsonConverter.jsonToEntityDoNotUnwrapRoot(jsonString,
StandardEntityMetaFiles.class);
if (entityMetaFiles == null || entityMetaFiles.getFileMetas() == null) {
return Collections.emptyList();
}
return (List<FileMeta>) entityMetaFiles.getFileMetas();
} | [
"protected",
"List",
"<",
"FileMeta",
">",
"handleGetEntityMetaFiles",
"(",
"Class",
"<",
"?",
"extends",
"FileEntity",
">",
"type",
",",
"Integer",
"entityId",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
"=",
"restUriVariablesFactory",
... | Makes the api call to get the FileMeta data for an entity
@param type
@param entityId
@return | [
"Makes",
"the",
"api",
"call",
"to",
"get",
"the",
"FileMeta",
"data",
"for",
"an",
"entity"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1578-L1589 |
135,146 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleGetFileContent | protected FileContent handleGetFileContent(Class<? extends FileEntity> type, Integer entityId, Integer fileId) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForGetFile(BullhornEntityInfo.getTypesRestEntityName(type),
entityId, fileId);
String url = restUrlFactory.assembleGetFileUrl();
String jsonString = this.performGetRequest(url, String.class, uriVariables);
FileContent fileContent = restJsonConverter.jsonToEntityUnwrapRoot(jsonString, StandardFileContent.class);
fileContent.setId(fileId);
return fileContent;
} | java | protected FileContent handleGetFileContent(Class<? extends FileEntity> type, Integer entityId, Integer fileId) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForGetFile(BullhornEntityInfo.getTypesRestEntityName(type),
entityId, fileId);
String url = restUrlFactory.assembleGetFileUrl();
String jsonString = this.performGetRequest(url, String.class, uriVariables);
FileContent fileContent = restJsonConverter.jsonToEntityUnwrapRoot(jsonString, StandardFileContent.class);
fileContent.setId(fileId);
return fileContent;
} | [
"protected",
"FileContent",
"handleGetFileContent",
"(",
"Class",
"<",
"?",
"extends",
"FileEntity",
">",
"type",
",",
"Integer",
"entityId",
",",
"Integer",
"fileId",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
"=",
"restUriVariablesFact... | Makes the api call to get the file content
@param type
@param entityId
@param fileId
@return | [
"Makes",
"the",
"api",
"call",
"to",
"get",
"the",
"file",
"content"
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1599-L1607 |
135,147 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleAddFileWithMultipartFile | protected FileWrapper handleAddFileWithMultipartFile(Class<? extends FileEntity> type, Integer entityId, MultipartFile multipartFile,
String externalId, FileParams params, boolean deleteFile) {
MultiValueMap<String, Object> multiValueMap = null;
try {
multiValueMap = restFileManager.addFileToMultiValueMap(multipartFile);
} catch (IOException e) {
log.error("Error creating temp file", e);
}
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForAddFile(BullhornEntityInfo.getTypesRestEntityName(type),
entityId, externalId, params);
String url = restUrlFactory.assembleAddFileUrl(params);
return this.handleAddFile(type, entityId, multiValueMap, url, uriVariables, multipartFile.getOriginalFilename(), deleteFile);
} | java | protected FileWrapper handleAddFileWithMultipartFile(Class<? extends FileEntity> type, Integer entityId, MultipartFile multipartFile,
String externalId, FileParams params, boolean deleteFile) {
MultiValueMap<String, Object> multiValueMap = null;
try {
multiValueMap = restFileManager.addFileToMultiValueMap(multipartFile);
} catch (IOException e) {
log.error("Error creating temp file", e);
}
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForAddFile(BullhornEntityInfo.getTypesRestEntityName(type),
entityId, externalId, params);
String url = restUrlFactory.assembleAddFileUrl(params);
return this.handleAddFile(type, entityId, multiValueMap, url, uriVariables, multipartFile.getOriginalFilename(), deleteFile);
} | [
"protected",
"FileWrapper",
"handleAddFileWithMultipartFile",
"(",
"Class",
"<",
"?",
"extends",
"FileEntity",
">",
"type",
",",
"Integer",
"entityId",
",",
"MultipartFile",
"multipartFile",
",",
"String",
"externalId",
",",
"FileParams",
"params",
",",
"boolean",
"... | Makes the api call to add files to an entity. Takes a MultipartFile.
@param type
@param entityId
@param multipartFile
@param externalId
@param params
@param deleteFile
@return | [
"Makes",
"the",
"api",
"call",
"to",
"add",
"files",
"to",
"an",
"entity",
".",
"Takes",
"a",
"MultipartFile",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1620-L1635 |
135,148 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleAddFileAndUpdateCandidateDescription | protected FileWrapper handleAddFileAndUpdateCandidateDescription(Integer candidateId, File file, String candidateDescription,
String externalId, FileParams params, boolean deleteFile) {
// first add the file
FileWrapper fileWrapper = this.handleAddFileWithFile(Candidate.class, candidateId, file, externalId, params, deleteFile);
// second update the candidate
try {
Candidate candidateToUpdate = new Candidate();
candidateToUpdate.setId(candidateId);
if (!StringUtils.isBlank(candidateDescription)) {
candidateToUpdate.setDescription(candidateDescription);
this.updateEntity(candidateToUpdate);
}
} catch (Exception e) {
log.error("Error reading file to resume text", e);
}
return fileWrapper;
} | java | protected FileWrapper handleAddFileAndUpdateCandidateDescription(Integer candidateId, File file, String candidateDescription,
String externalId, FileParams params, boolean deleteFile) {
// first add the file
FileWrapper fileWrapper = this.handleAddFileWithFile(Candidate.class, candidateId, file, externalId, params, deleteFile);
// second update the candidate
try {
Candidate candidateToUpdate = new Candidate();
candidateToUpdate.setId(candidateId);
if (!StringUtils.isBlank(candidateDescription)) {
candidateToUpdate.setDescription(candidateDescription);
this.updateEntity(candidateToUpdate);
}
} catch (Exception e) {
log.error("Error reading file to resume text", e);
}
return fileWrapper;
} | [
"protected",
"FileWrapper",
"handleAddFileAndUpdateCandidateDescription",
"(",
"Integer",
"candidateId",
",",
"File",
"file",
",",
"String",
"candidateDescription",
",",
"String",
"externalId",
",",
"FileParams",
"params",
",",
"boolean",
"deleteFile",
")",
"{",
"// fir... | Handles logic to add the file to the candidate entity AND updating the candidate.description with the resume text.
@param candidateId
@param file
@param externalId
@param params
@param deleteFile
@return | [
"Handles",
"logic",
"to",
"add",
"the",
"file",
"to",
"the",
"candidate",
"entity",
"AND",
"updating",
"the",
"candidate",
".",
"description",
"with",
"the",
"resume",
"text",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1693-L1713 |
135,149 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.addFileThenHandleParseResume | protected <P extends ParsedResume> P addFileThenHandleParseResume(Class<? extends FileEntity> type, Integer entityId,
MultipartFile multipartFile, String externalId, FileParams fileParams, ResumeFileParseParams params) {
FileWrapper fileWrapper = handleAddFileWithMultipartFile(type, entityId, multipartFile, externalId, fileParams, true);
P parsedResume = this.handleParseResumeFile(multipartFile, params);
if (!parsedResume.isError()) {
parsedResume.setFileWrapper(fileWrapper);
}
return parsedResume;
} | java | protected <P extends ParsedResume> P addFileThenHandleParseResume(Class<? extends FileEntity> type, Integer entityId,
MultipartFile multipartFile, String externalId, FileParams fileParams, ResumeFileParseParams params) {
FileWrapper fileWrapper = handleAddFileWithMultipartFile(type, entityId, multipartFile, externalId, fileParams, true);
P parsedResume = this.handleParseResumeFile(multipartFile, params);
if (!parsedResume.isError()) {
parsedResume.setFileWrapper(fileWrapper);
}
return parsedResume;
} | [
"protected",
"<",
"P",
"extends",
"ParsedResume",
">",
"P",
"addFileThenHandleParseResume",
"(",
"Class",
"<",
"?",
"extends",
"FileEntity",
">",
"type",
",",
"Integer",
"entityId",
",",
"MultipartFile",
"multipartFile",
",",
"String",
"externalId",
",",
"FilePara... | Makes the api call to both parse the resume and then attach the file. File is only attached if the resume parse was successful.
@param type
@param entityId
@param multipartFile
@param externalId
@param fileParams
@param params
@return | [
"Makes",
"the",
"api",
"call",
"to",
"both",
"parse",
"the",
"resume",
"and",
"then",
"attach",
"the",
"file",
".",
"File",
"is",
"only",
"attached",
"if",
"the",
"resume",
"parse",
"was",
"successful",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1726-L1736 |
135,150 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleDeleteFile | protected FileApiResponse handleDeleteFile(Class<? extends FileEntity> type, Integer entityId, Integer fileId) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesDeleteFile(BullhornEntityInfo.getTypesRestEntityName(type),
entityId, fileId);
String url = restUrlFactory.assembleDeleteFileUrl();
StandardFileApiResponse fileApiResponse = this.performCustomRequest(url, null, StandardFileApiResponse.class, uriVariables,
HttpMethod.DELETE, null);
return fileApiResponse;
} | java | protected FileApiResponse handleDeleteFile(Class<? extends FileEntity> type, Integer entityId, Integer fileId) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesDeleteFile(BullhornEntityInfo.getTypesRestEntityName(type),
entityId, fileId);
String url = restUrlFactory.assembleDeleteFileUrl();
StandardFileApiResponse fileApiResponse = this.performCustomRequest(url, null, StandardFileApiResponse.class, uriVariables,
HttpMethod.DELETE, null);
return fileApiResponse;
} | [
"protected",
"FileApiResponse",
"handleDeleteFile",
"(",
"Class",
"<",
"?",
"extends",
"FileEntity",
">",
"type",
",",
"Integer",
"entityId",
",",
"Integer",
"fileId",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
"=",
"restUriVariablesFact... | Makes the api call to delete a file attached to an entity.
@param type
@param entityId
@param fileId
@return | [
"Makes",
"the",
"api",
"call",
"to",
"delete",
"a",
"file",
"attached",
"to",
"an",
"entity",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1746-L1754 |
135,151 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleAssociateWithEntity | protected <C extends CrudResponse, T extends AssociationEntity> C handleAssociateWithEntity(Class<T> type, Integer entityId,
AssociationField<T, ? extends BullhornEntity> associationName, Set<Integer> associationIds) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForAssociateWithEntity(
BullhornEntityInfo.getTypesRestEntityName(type), entityId, associationName, associationIds);
String url = restUrlFactory.assembleEntityUrlForAssociateWithEntity();
CrudResponse response = null;
try {
response = this.performCustomRequest(url, null, CreateResponse.class, uriVariables, HttpMethod.PUT, null);
} catch (HttpStatusCodeException error) {
response = restErrorHandler.handleHttpFourAndFiveHundredErrors(new CreateResponse(), error, entityId);
}
return (C) response;
} | java | protected <C extends CrudResponse, T extends AssociationEntity> C handleAssociateWithEntity(Class<T> type, Integer entityId,
AssociationField<T, ? extends BullhornEntity> associationName, Set<Integer> associationIds) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForAssociateWithEntity(
BullhornEntityInfo.getTypesRestEntityName(type), entityId, associationName, associationIds);
String url = restUrlFactory.assembleEntityUrlForAssociateWithEntity();
CrudResponse response = null;
try {
response = this.performCustomRequest(url, null, CreateResponse.class, uriVariables, HttpMethod.PUT, null);
} catch (HttpStatusCodeException error) {
response = restErrorHandler.handleHttpFourAndFiveHundredErrors(new CreateResponse(), error, entityId);
}
return (C) response;
} | [
"protected",
"<",
"C",
"extends",
"CrudResponse",
",",
"T",
"extends",
"AssociationEntity",
">",
"C",
"handleAssociateWithEntity",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Integer",
"entityId",
",",
"AssociationField",
"<",
"T",
",",
"?",
"extends",
"Bullhor... | Makes the api call to create associations.
@param type
@param entityId
@param associationName
@param associationIds
@return | [
"Makes",
"the",
"api",
"call",
"to",
"create",
"associations",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1765-L1779 |
135,152 | bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/helper/RestErrorHandler.java | RestErrorHandler.handleHttpFourAndFiveHundredErrors | public <T extends BullhornEntity> CrudResponse handleHttpFourAndFiveHundredErrors(CrudResponse response,
HttpStatusCodeException error, Integer id) {
response.setChangedEntityId(id);
Message message = new Message();
message.setDetailMessage(error.getResponseBodyAsString());
message.setSeverity("ERROR");
message.setType(error.getStatusCode().toString());
response.addOneMessage(message);
response.setErrorCode(error.getStatusCode().toString());
response.setErrorMessage(error.getResponseBodyAsString());
return response;
} | java | public <T extends BullhornEntity> CrudResponse handleHttpFourAndFiveHundredErrors(CrudResponse response,
HttpStatusCodeException error, Integer id) {
response.setChangedEntityId(id);
Message message = new Message();
message.setDetailMessage(error.getResponseBodyAsString());
message.setSeverity("ERROR");
message.setType(error.getStatusCode().toString());
response.addOneMessage(message);
response.setErrorCode(error.getStatusCode().toString());
response.setErrorMessage(error.getResponseBodyAsString());
return response;
} | [
"public",
"<",
"T",
"extends",
"BullhornEntity",
">",
"CrudResponse",
"handleHttpFourAndFiveHundredErrors",
"(",
"CrudResponse",
"response",
",",
"HttpStatusCodeException",
"error",
",",
"Integer",
"id",
")",
"{",
"response",
".",
"setChangedEntityId",
"(",
"id",
")",... | Updates the passed in CrudResponse with the HttpStatusCodeException thrown by the RestTemplate.
@param response
@param error
@param entity
@return | [
"Updates",
"the",
"passed",
"in",
"CrudResponse",
"with",
"the",
"HttpStatusCodeException",
"thrown",
"by",
"the",
"RestTemplate",
"."
] | 0c75a141c768bb31510afc3a412c11bd101eca06 | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/helper/RestErrorHandler.java#L29-L41 |
135,153 | ironjacamar/ironjacamar | web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java | HtmlAdaptorServlet.displayMBeans | private void displayMBeans(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
Iterator mbeans;
try
{
mbeans = getDomainData();
}
catch (Exception e)
{
throw new ServletException("Failed to get MBeans", e);
}
request.setAttribute("mbeans", mbeans);
RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/displaymbeans.jsp");
rd.forward(request, response);
} | java | private void displayMBeans(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
Iterator mbeans;
try
{
mbeans = getDomainData();
}
catch (Exception e)
{
throw new ServletException("Failed to get MBeans", e);
}
request.setAttribute("mbeans", mbeans);
RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/displaymbeans.jsp");
rd.forward(request, response);
} | [
"private",
"void",
"displayMBeans",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"Iterator",
"mbeans",
";",
"try",
"{",
"mbeans",
"=",
"getDomainData",
"(",
")",
";",
"}",... | Display all MBeans
@param request The HTTP request
@param response The HTTP response
@exception ServletException Thrown if an error occurs
@exception IOException Thrown if an I/O error occurs | [
"Display",
"all",
"MBeans"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java#L148-L165 |
135,154 | ironjacamar/ironjacamar | web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java | HtmlAdaptorServlet.inspectMBean | private void inspectMBean(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
String name = request.getParameter("name");
if (trace)
log.trace("inspectMBean, name=" + name);
try
{
MBeanData data = getMBeanData(name);
request.setAttribute("mbeanData", data);
RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/inspectmbean.jsp");
rd.forward(request, response);
}
catch (Exception e)
{
throw new ServletException("Failed to get MBean data", e);
}
} | java | private void inspectMBean(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
String name = request.getParameter("name");
if (trace)
log.trace("inspectMBean, name=" + name);
try
{
MBeanData data = getMBeanData(name);
request.setAttribute("mbeanData", data);
RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/inspectmbean.jsp");
rd.forward(request, response);
}
catch (Exception e)
{
throw new ServletException("Failed to get MBean data", e);
}
} | [
"private",
"void",
"inspectMBean",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"String",
"name",
"=",
"request",
".",
"getParameter",
"(",
"\"name\"",
")",
";",
"if",
"("... | Display a MBeans attributes and operations
@param request The HTTP request
@param response The HTTP response
@exception ServletException Thrown if an error occurs
@exception IOException Thrown if an I/O error occurs | [
"Display",
"a",
"MBeans",
"attributes",
"and",
"operations"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java#L174-L194 |
135,155 | ironjacamar/ironjacamar | web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java | HtmlAdaptorServlet.updateAttributes | private void updateAttributes(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
String name = request.getParameter("name");
if (trace)
log.trace("updateAttributes, name=" + name);
Enumeration paramNames = request.getParameterNames();
HashMap<String, String> attributes = new HashMap<String, String>();
while (paramNames.hasMoreElements())
{
String param = (String)paramNames.nextElement();
if (param.equals("name") || param.equals("action"))
continue;
String value = request.getParameter(param);
if (trace)
log.trace("name=" + param + ", value='" + value + "'");
// Ignore null values, these are empty write-only fields
if (value == null || value.length() == 0)
continue;
attributes.put(param, value);
}
try
{
AttributeList newAttributes = setAttributes(name, attributes);
MBeanData data = getMBeanData(name);
request.setAttribute("mbeanData", data);
RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/inspectmbean.jsp");
rd.forward(request, response);
}
catch (Exception e)
{
throw new ServletException("Failed to update attributes", e);
}
} | java | private void updateAttributes(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
String name = request.getParameter("name");
if (trace)
log.trace("updateAttributes, name=" + name);
Enumeration paramNames = request.getParameterNames();
HashMap<String, String> attributes = new HashMap<String, String>();
while (paramNames.hasMoreElements())
{
String param = (String)paramNames.nextElement();
if (param.equals("name") || param.equals("action"))
continue;
String value = request.getParameter(param);
if (trace)
log.trace("name=" + param + ", value='" + value + "'");
// Ignore null values, these are empty write-only fields
if (value == null || value.length() == 0)
continue;
attributes.put(param, value);
}
try
{
AttributeList newAttributes = setAttributes(name, attributes);
MBeanData data = getMBeanData(name);
request.setAttribute("mbeanData", data);
RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/inspectmbean.jsp");
rd.forward(request, response);
}
catch (Exception e)
{
throw new ServletException("Failed to update attributes", e);
}
} | [
"private",
"void",
"updateAttributes",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"String",
"name",
"=",
"request",
".",
"getParameter",
"(",
"\"name\"",
")",
";",
"if",
... | Update the writable attributes of a MBean
@param request The HTTP request
@param response The HTTP response
@exception ServletException Thrown if an error occurs
@exception IOException Thrown if an I/O error occurs | [
"Update",
"the",
"writable",
"attributes",
"of",
"a",
"MBean"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java#L203-L246 |
135,156 | ironjacamar/ironjacamar | web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java | HtmlAdaptorServlet.invokeOpByName | private void invokeOpByName(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
String name = request.getParameter("name");
if (trace)
log.trace("invokeOpByName, name=" + name);
String[] argTypes = request.getParameterValues("argType");
String[] args = getArgs(request);
String methodName = request.getParameter("methodName");
if (methodName == null)
throw new ServletException("No methodName given in invokeOpByName form");
try
{
OpResultInfo opResult = invokeOpByName(name, methodName, argTypes, args);
request.setAttribute("opResultInfo", opResult);
RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/displayopresult.jsp");
rd.forward(request, response);
}
catch (Exception e)
{
throw new ServletException("Failed to invoke operation", e);
}
} | java | private void invokeOpByName(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
String name = request.getParameter("name");
if (trace)
log.trace("invokeOpByName, name=" + name);
String[] argTypes = request.getParameterValues("argType");
String[] args = getArgs(request);
String methodName = request.getParameter("methodName");
if (methodName == null)
throw new ServletException("No methodName given in invokeOpByName form");
try
{
OpResultInfo opResult = invokeOpByName(name, methodName, argTypes, args);
request.setAttribute("opResultInfo", opResult);
RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/displayopresult.jsp");
rd.forward(request, response);
}
catch (Exception e)
{
throw new ServletException("Failed to invoke operation", e);
}
} | [
"private",
"void",
"invokeOpByName",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"String",
"name",
"=",
"request",
".",
"getParameter",
"(",
"\"name\"",
")",
";",
"if",
"... | Invoke a MBean operation given the method name and its signature.
@param request The HTTP request
@param response The HTTP response
@exception ServletException Thrown if an error occurs
@exception IOException Thrown if an I/O error occurs | [
"Invoke",
"a",
"MBean",
"operation",
"given",
"the",
"method",
"name",
"and",
"its",
"signature",
"."
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java#L294-L321 |
135,157 | ironjacamar/ironjacamar | web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java | HtmlAdaptorServlet.getMBeanData | private MBeanData getMBeanData(final String name) throws PrivilegedActionException
{
return AccessController.doPrivileged(new PrivilegedExceptionAction<MBeanData>()
{
public MBeanData run() throws Exception
{
return Server.getMBeanData(name);
}
});
} | java | private MBeanData getMBeanData(final String name) throws PrivilegedActionException
{
return AccessController.doPrivileged(new PrivilegedExceptionAction<MBeanData>()
{
public MBeanData run() throws Exception
{
return Server.getMBeanData(name);
}
});
} | [
"private",
"MBeanData",
"getMBeanData",
"(",
"final",
"String",
"name",
")",
"throws",
"PrivilegedActionException",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedExceptionAction",
"<",
"MBeanData",
">",
"(",
")",
"{",
"public",
"MBea... | Get the MBean data for a bean
@param name The name of the bean
@return The data
@exception PrivilegedExceptionAction Thrown if the operation cannot be performed | [
"Get",
"the",
"MBean",
"data",
"for",
"a",
"bean"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java#L357-L366 |
135,158 | ironjacamar/ironjacamar | web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java | HtmlAdaptorServlet.setAttributes | @SuppressWarnings({ "unchecked" })
private AttributeList setAttributes(final String name, final HashMap attributes) throws PrivilegedActionException
{
return AccessController.doPrivileged(new PrivilegedExceptionAction<AttributeList>()
{
public AttributeList run() throws Exception
{
return Server.setAttributes(name, attributes);
}
});
} | java | @SuppressWarnings({ "unchecked" })
private AttributeList setAttributes(final String name, final HashMap attributes) throws PrivilegedActionException
{
return AccessController.doPrivileged(new PrivilegedExceptionAction<AttributeList>()
{
public AttributeList run() throws Exception
{
return Server.setAttributes(name, attributes);
}
});
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"private",
"AttributeList",
"setAttributes",
"(",
"final",
"String",
"name",
",",
"final",
"HashMap",
"attributes",
")",
"throws",
"PrivilegedActionException",
"{",
"return",
"AccessController",
".",
"doP... | Set attributes on a MBean
@param name The name of the bean
@param attributes The attributes
@return The updated attributes list
@exception PrivilegedExceptionAction Thrown if the operation cannot be performed | [
"Set",
"attributes",
"on",
"a",
"MBean"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java#L436-L446 |
135,159 | ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/McCodeGen.java | McCodeGen.writeTransaction | private void writeTransaction(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Returns an <code>javax.resource.spi.LocalTransaction</code> instance.\n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, indent, " * @return LocalTransaction instance\n");
writeWithIndent(out, indent, " * @throws ResourceException generic exception if operation fails\n");
writeWithIndent(out, indent, " */\n");
writeWithIndent(out, indent, "public LocalTransaction getLocalTransaction() throws ResourceException");
writeLeftCurlyBracket(out, indent);
if (def.getSupportTransaction().equals("NoTransaction"))
{
writeWithIndent(out, indent + 1, "throw new NotSupportedException(\"getLocalTransaction() not supported\");");
}
else
{
writeLogging(def, out, indent + 1, "trace", "getLocalTransaction");
writeWithIndent(out, indent + 1, "return null;");
}
writeRightCurlyBracket(out, indent);
writeEol(out);
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Returns an <code>javax.transaction.xa.XAresource</code> instance. \n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, indent, " * @return XAResource instance\n");
writeWithIndent(out, indent, " * @throws ResourceException generic exception if operation fails\n");
writeWithIndent(out, indent, " */\n");
writeWithIndent(out, indent, "public XAResource getXAResource() throws ResourceException");
writeLeftCurlyBracket(out, indent);
if (def.getSupportTransaction().equals("NoTransaction"))
{
writeWithIndent(out, indent + 1, "throw new NotSupportedException(\"getXAResource() not supported\");");
}
else
{
writeLogging(def, out, indent + 1, "trace", "getXAResource");
writeWithIndent(out, indent + 1, "return null;");
}
writeRightCurlyBracket(out, indent);
writeEol(out);
} | java | private void writeTransaction(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Returns an <code>javax.resource.spi.LocalTransaction</code> instance.\n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, indent, " * @return LocalTransaction instance\n");
writeWithIndent(out, indent, " * @throws ResourceException generic exception if operation fails\n");
writeWithIndent(out, indent, " */\n");
writeWithIndent(out, indent, "public LocalTransaction getLocalTransaction() throws ResourceException");
writeLeftCurlyBracket(out, indent);
if (def.getSupportTransaction().equals("NoTransaction"))
{
writeWithIndent(out, indent + 1, "throw new NotSupportedException(\"getLocalTransaction() not supported\");");
}
else
{
writeLogging(def, out, indent + 1, "trace", "getLocalTransaction");
writeWithIndent(out, indent + 1, "return null;");
}
writeRightCurlyBracket(out, indent);
writeEol(out);
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Returns an <code>javax.transaction.xa.XAresource</code> instance. \n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, indent, " * @return XAResource instance\n");
writeWithIndent(out, indent, " * @throws ResourceException generic exception if operation fails\n");
writeWithIndent(out, indent, " */\n");
writeWithIndent(out, indent, "public XAResource getXAResource() throws ResourceException");
writeLeftCurlyBracket(out, indent);
if (def.getSupportTransaction().equals("NoTransaction"))
{
writeWithIndent(out, indent + 1, "throw new NotSupportedException(\"getXAResource() not supported\");");
}
else
{
writeLogging(def, out, indent + 1, "trace", "getXAResource");
writeWithIndent(out, indent + 1, "return null;");
}
writeRightCurlyBracket(out, indent);
writeEol(out);
} | [
"private",
"void",
"writeTransaction",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/**\\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",
"in... | Output Transaction method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"Transaction",
"method"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/McCodeGen.java#L391-L435 |
135,160 | ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/workmanager/ClassBundleFactory.java | ClassBundleFactory.getFields | private static Class<?>[] getFields(Class<?> clz)
{
List<Class<?>> result = new ArrayList<Class<?>>();
Class<?> c = clz;
while (!c.equals(Object.class))
{
try
{
Field[] fields = SecurityActions.getDeclaredFields(c);
if (fields.length > 0)
{
for (Field f : fields)
{
Class<?> defClz = f.getType();
String defClzName = defClz.getName();
if (!defClz.isPrimitive() && !defClz.isArray() &&
!defClzName.startsWith("java") && !defClzName.startsWith("javax") && !result.contains(defClz))
{
if (trace)
log.tracef("Adding field: %s", defClzName);
result.add(defClz);
}
}
}
}
catch (Throwable t)
{
// Ignore
}
c = c.getSuperclass();
}
return result.toArray(new Class<?>[result.size()]);
} | java | private static Class<?>[] getFields(Class<?> clz)
{
List<Class<?>> result = new ArrayList<Class<?>>();
Class<?> c = clz;
while (!c.equals(Object.class))
{
try
{
Field[] fields = SecurityActions.getDeclaredFields(c);
if (fields.length > 0)
{
for (Field f : fields)
{
Class<?> defClz = f.getType();
String defClzName = defClz.getName();
if (!defClz.isPrimitive() && !defClz.isArray() &&
!defClzName.startsWith("java") && !defClzName.startsWith("javax") && !result.contains(defClz))
{
if (trace)
log.tracef("Adding field: %s", defClzName);
result.add(defClz);
}
}
}
}
catch (Throwable t)
{
// Ignore
}
c = c.getSuperclass();
}
return result.toArray(new Class<?>[result.size()]);
} | [
"private",
"static",
"Class",
"<",
"?",
">",
"[",
"]",
"getFields",
"(",
"Class",
"<",
"?",
">",
"clz",
")",
"{",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Class",
"<",
"?",
">",
">",
"(",
")",
";",
"C... | Get the classes for all the fields
@param clz The class
@return The classes; empty array if none | [
"Get",
"the",
"classes",
"for",
"all",
"the",
"fields"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/workmanager/ClassBundleFactory.java#L174-L211 |
135,161 | ironjacamar/ironjacamar | web/src/main/java/org/ironjacamar/web/ExecutorThreadPool.java | ExecutorThreadPool.execute | public void execute(Runnable job)
{
try
{
executor.execute(job);
}
catch (RejectedExecutionException e)
{
log.warnf(e, "Job rejected: %s", job);
}
} | java | public void execute(Runnable job)
{
try
{
executor.execute(job);
}
catch (RejectedExecutionException e)
{
log.warnf(e, "Job rejected: %s", job);
}
} | [
"public",
"void",
"execute",
"(",
"Runnable",
"job",
")",
"{",
"try",
"{",
"executor",
".",
"execute",
"(",
"job",
")",
";",
"}",
"catch",
"(",
"RejectedExecutionException",
"e",
")",
"{",
"log",
".",
"warnf",
"(",
"e",
",",
"\"Job rejected: %s\"",
",",
... | Execute a job
@param job The job | [
"Execute",
"a",
"job"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/ExecutorThreadPool.java#L54-L64 |
135,162 | ironjacamar/ironjacamar | web/src/main/java/org/ironjacamar/web/ExecutorThreadPool.java | ExecutorThreadPool.getIdleThreads | public int getIdleThreads()
{
if (executor instanceof ThreadPoolExecutor)
{
final ThreadPoolExecutor tpe = (ThreadPoolExecutor)executor;
return tpe.getPoolSize() - tpe.getActiveCount();
}
return -1;
} | java | public int getIdleThreads()
{
if (executor instanceof ThreadPoolExecutor)
{
final ThreadPoolExecutor tpe = (ThreadPoolExecutor)executor;
return tpe.getPoolSize() - tpe.getActiveCount();
}
return -1;
} | [
"public",
"int",
"getIdleThreads",
"(",
")",
"{",
"if",
"(",
"executor",
"instanceof",
"ThreadPoolExecutor",
")",
"{",
"final",
"ThreadPoolExecutor",
"tpe",
"=",
"(",
"ThreadPoolExecutor",
")",
"executor",
";",
"return",
"tpe",
".",
"getPoolSize",
"(",
")",
"-... | Get the number of idle threads
@return The number; -1 if not supported | [
"Get",
"the",
"number",
"of",
"idle",
"threads"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/ExecutorThreadPool.java#L70-L78 |
135,163 | ironjacamar/ironjacamar | web/src/main/java/org/ironjacamar/web/ExecutorThreadPool.java | ExecutorThreadPool.isLowOnThreads | public boolean isLowOnThreads()
{
if (executor instanceof ThreadPoolExecutor)
{
final ThreadPoolExecutor tpe = (ThreadPoolExecutor)executor;
return tpe.getActiveCount() >= tpe.getMaximumPoolSize();
}
return false;
} | java | public boolean isLowOnThreads()
{
if (executor instanceof ThreadPoolExecutor)
{
final ThreadPoolExecutor tpe = (ThreadPoolExecutor)executor;
return tpe.getActiveCount() >= tpe.getMaximumPoolSize();
}
return false;
} | [
"public",
"boolean",
"isLowOnThreads",
"(",
")",
"{",
"if",
"(",
"executor",
"instanceof",
"ThreadPoolExecutor",
")",
"{",
"final",
"ThreadPoolExecutor",
"tpe",
"=",
"(",
"ThreadPoolExecutor",
")",
"executor",
";",
"return",
"tpe",
".",
"getActiveCount",
"(",
")... | Is the pool low on threads ?
@return True if active threads >= maximum number of threads | [
"Is",
"the",
"pool",
"low",
"on",
"threads",
"?"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/ExecutorThreadPool.java#L98-L106 |
135,164 | ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/PoolFactory.java | PoolFactory.createPool | public static Pool createPool(String type, ConnectionManager cm, PoolConfiguration pc)
{
if (type == null || type.equals(""))
return new DefaultPool(cm, pc);
type = type.toLowerCase(Locale.US);
switch (type)
{
case "default":
return new DefaultPool(cm, pc);
case "stable":
return new StablePool(cm, pc);
default:
{
Class<? extends Pool> clz = customPoolTypes.get(type);
if (clz == null)
throw new RuntimeException(type + " can not be found");
try
{
Constructor constructor = clz.getConstructor(ConnectionManager.class, PoolConfiguration.class);
return (Pool)constructor.newInstance(cm, pc);
}
catch (Exception e)
{
throw new RuntimeException(type + " can not be created", e);
}
}
}
} | java | public static Pool createPool(String type, ConnectionManager cm, PoolConfiguration pc)
{
if (type == null || type.equals(""))
return new DefaultPool(cm, pc);
type = type.toLowerCase(Locale.US);
switch (type)
{
case "default":
return new DefaultPool(cm, pc);
case "stable":
return new StablePool(cm, pc);
default:
{
Class<? extends Pool> clz = customPoolTypes.get(type);
if (clz == null)
throw new RuntimeException(type + " can not be found");
try
{
Constructor constructor = clz.getConstructor(ConnectionManager.class, PoolConfiguration.class);
return (Pool)constructor.newInstance(cm, pc);
}
catch (Exception e)
{
throw new RuntimeException(type + " can not be created", e);
}
}
}
} | [
"public",
"static",
"Pool",
"createPool",
"(",
"String",
"type",
",",
"ConnectionManager",
"cm",
",",
"PoolConfiguration",
"pc",
")",
"{",
"if",
"(",
"type",
"==",
"null",
"||",
"type",
".",
"equals",
"(",
"\"\"",
")",
")",
"return",
"new",
"DefaultPool",
... | Create a pool
@param type The type
@param cm The connection manager
@param pc The pool configuration
@return The pool | [
"Create",
"a",
"pool"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/PoolFactory.java#L74-L105 |
135,165 | ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/SecurityActions.java | SecurityActions.getPasswordCredentials | static Set<PasswordCredential> getPasswordCredentials(final Subject subject)
{
if (System.getSecurityManager() == null)
return subject.getPrivateCredentials(PasswordCredential.class);
return AccessController.doPrivileged(new PrivilegedAction<Set<PasswordCredential>>()
{
public Set<PasswordCredential> run()
{
return subject.getPrivateCredentials(PasswordCredential.class);
}
});
} | java | static Set<PasswordCredential> getPasswordCredentials(final Subject subject)
{
if (System.getSecurityManager() == null)
return subject.getPrivateCredentials(PasswordCredential.class);
return AccessController.doPrivileged(new PrivilegedAction<Set<PasswordCredential>>()
{
public Set<PasswordCredential> run()
{
return subject.getPrivateCredentials(PasswordCredential.class);
}
});
} | [
"static",
"Set",
"<",
"PasswordCredential",
">",
"getPasswordCredentials",
"(",
"final",
"Subject",
"subject",
")",
"{",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"==",
"null",
")",
"return",
"subject",
".",
"getPrivateCredentials",
"(",
"Passwor... | Get the PasswordCredential from the Subject
@param subject The subject
@return The instances | [
"Get",
"the",
"PasswordCredential",
"from",
"the",
"Subject"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/SecurityActions.java#L176-L188 |
135,166 | ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/SecurityActions.java | SecurityActions.getStackTrace | static StackTraceElement[] getStackTrace(final Thread t)
{
if (System.getSecurityManager() == null)
return t.getStackTrace();
return AccessController.doPrivileged(new PrivilegedAction<StackTraceElement[]>()
{
public StackTraceElement[] run()
{
return t.getStackTrace();
}
});
} | java | static StackTraceElement[] getStackTrace(final Thread t)
{
if (System.getSecurityManager() == null)
return t.getStackTrace();
return AccessController.doPrivileged(new PrivilegedAction<StackTraceElement[]>()
{
public StackTraceElement[] run()
{
return t.getStackTrace();
}
});
} | [
"static",
"StackTraceElement",
"[",
"]",
"getStackTrace",
"(",
"final",
"Thread",
"t",
")",
"{",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"==",
"null",
")",
"return",
"t",
".",
"getStackTrace",
"(",
")",
";",
"return",
"AccessController",
... | Get stack trace
@param t The thread
@return The trace | [
"Get",
"stack",
"trace"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/SecurityActions.java#L238-L250 |
135,167 | ironjacamar/ironjacamar | validator/src/main/java/org/ironjacamar/validator/cli/Main.java | Main.main | public static void main(String[] args)
{
boolean quiet = false;
String outputDir = "."; //put report into current directory by default
int arg = 0;
String[] classpath = null;
if (args.length > 0)
{
while (args.length > arg + 1)
{
if (args[arg].startsWith("-"))
{
if (args[arg].endsWith("quiet"))
{
quiet = true;
}
else if (args[arg].endsWith("output"))
{
arg++;
if (arg + 1 >= args.length)
{
usage();
System.exit(OTHER);
}
outputDir = args[arg];
}
else if (args[arg].endsWith("classpath"))
{
arg++;
classpath = args[arg].split(System.getProperty("path.separator"));
}
}
else
{
usage();
System.exit(OTHER);
}
arg++;
}
try
{
int systemExitCode = Validation.validate(new File(args[arg]).toURI().toURL(), outputDir, classpath);
if (!quiet)
{
if (systemExitCode == SUCCESS)
{
System.out.println("Validation sucessful");
}
else if (systemExitCode == FAIL)
{
System.out.println("Validation errors");
}
else if (systemExitCode == OTHER)
{
System.out.println("Validation unknown");
}
}
System.exit(systemExitCode);
}
catch (ArrayIndexOutOfBoundsException oe)
{
usage();
System.exit(OTHER);
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
}
else
{
usage();
}
System.exit(SUCCESS);
} | java | public static void main(String[] args)
{
boolean quiet = false;
String outputDir = "."; //put report into current directory by default
int arg = 0;
String[] classpath = null;
if (args.length > 0)
{
while (args.length > arg + 1)
{
if (args[arg].startsWith("-"))
{
if (args[arg].endsWith("quiet"))
{
quiet = true;
}
else if (args[arg].endsWith("output"))
{
arg++;
if (arg + 1 >= args.length)
{
usage();
System.exit(OTHER);
}
outputDir = args[arg];
}
else if (args[arg].endsWith("classpath"))
{
arg++;
classpath = args[arg].split(System.getProperty("path.separator"));
}
}
else
{
usage();
System.exit(OTHER);
}
arg++;
}
try
{
int systemExitCode = Validation.validate(new File(args[arg]).toURI().toURL(), outputDir, classpath);
if (!quiet)
{
if (systemExitCode == SUCCESS)
{
System.out.println("Validation sucessful");
}
else if (systemExitCode == FAIL)
{
System.out.println("Validation errors");
}
else if (systemExitCode == OTHER)
{
System.out.println("Validation unknown");
}
}
System.exit(systemExitCode);
}
catch (ArrayIndexOutOfBoundsException oe)
{
usage();
System.exit(OTHER);
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
}
else
{
usage();
}
System.exit(SUCCESS);
} | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"boolean",
"quiet",
"=",
"false",
";",
"String",
"outputDir",
"=",
"\".\"",
";",
"//put report into current directory by default",
"int",
"arg",
"=",
"0",
";",
"String",
"[",
"]",... | Validator standalone tool
@param args command line arguments | [
"Validator",
"standalone",
"tool"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/validator/src/main/java/org/ironjacamar/validator/cli/Main.java#L46-L126 |
135,168 | ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractPool.java | AbstractPool.getLocalXAResource | protected LocalXAResource getLocalXAResource(ManagedConnection mc) throws ResourceException
{
TransactionalConnectionManager txCM = (TransactionalConnectionManager) cm;
LocalXAResource xaResource = null;
String eisProductName = null;
String eisProductVersion = null;
String jndiName = cm.getConnectionManagerConfiguration().getJndiName();
try
{
if (mc.getMetaData() != null)
{
eisProductName = mc.getMetaData().getEISProductName();
eisProductVersion = mc.getMetaData().getEISProductVersion();
}
}
catch (ResourceException re)
{
// Ignore
}
if (eisProductName == null)
eisProductName = jndiName;
if (eisProductVersion == null)
eisProductVersion = jndiName;
if (cm.getConnectionManagerConfiguration().isConnectable())
{
if (mc instanceof org.ironjacamar.core.spi.transaction.ConnectableResource)
{
ConnectableResource cr = (ConnectableResource) mc;
xaResource = txCM.getTransactionIntegration()
.createConnectableLocalXAResource(cm, eisProductName, eisProductVersion, jndiName, cr, statistics);
}
else if (txCM.getTransactionIntegration().isConnectableResource(mc))
{
xaResource = txCM.getTransactionIntegration()
.createConnectableLocalXAResource(cm, eisProductName, eisProductVersion, jndiName, mc, statistics);
}
}
if (xaResource == null)
xaResource = txCM.getTransactionIntegration()
.createLocalXAResource(cm, eisProductName, eisProductVersion, jndiName, statistics);
return xaResource;
} | java | protected LocalXAResource getLocalXAResource(ManagedConnection mc) throws ResourceException
{
TransactionalConnectionManager txCM = (TransactionalConnectionManager) cm;
LocalXAResource xaResource = null;
String eisProductName = null;
String eisProductVersion = null;
String jndiName = cm.getConnectionManagerConfiguration().getJndiName();
try
{
if (mc.getMetaData() != null)
{
eisProductName = mc.getMetaData().getEISProductName();
eisProductVersion = mc.getMetaData().getEISProductVersion();
}
}
catch (ResourceException re)
{
// Ignore
}
if (eisProductName == null)
eisProductName = jndiName;
if (eisProductVersion == null)
eisProductVersion = jndiName;
if (cm.getConnectionManagerConfiguration().isConnectable())
{
if (mc instanceof org.ironjacamar.core.spi.transaction.ConnectableResource)
{
ConnectableResource cr = (ConnectableResource) mc;
xaResource = txCM.getTransactionIntegration()
.createConnectableLocalXAResource(cm, eisProductName, eisProductVersion, jndiName, cr, statistics);
}
else if (txCM.getTransactionIntegration().isConnectableResource(mc))
{
xaResource = txCM.getTransactionIntegration()
.createConnectableLocalXAResource(cm, eisProductName, eisProductVersion, jndiName, mc, statistics);
}
}
if (xaResource == null)
xaResource = txCM.getTransactionIntegration()
.createLocalXAResource(cm, eisProductName, eisProductVersion, jndiName, statistics);
return xaResource;
} | [
"protected",
"LocalXAResource",
"getLocalXAResource",
"(",
"ManagedConnection",
"mc",
")",
"throws",
"ResourceException",
"{",
"TransactionalConnectionManager",
"txCM",
"=",
"(",
"TransactionalConnectionManager",
")",
"cm",
";",
"LocalXAResource",
"xaResource",
"=",
"null",... | Get a LocalXAResource instance
@param mc The ManagedConnection
@return The instance
@throws ResourceException Thrown if an error occurs | [
"Get",
"a",
"LocalXAResource",
"instance"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractPool.java#L354-L402 |
135,169 | ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractPool.java | AbstractPool.getXAResource | protected XAResource getXAResource(ManagedConnection mc) throws ResourceException
{
TransactionalConnectionManager txCM = (TransactionalConnectionManager) cm;
XAResource xaResource = null;
if (cm.getConnectionManagerConfiguration().isWrapXAResource())
{
String eisProductName = null;
String eisProductVersion = null;
String jndiName = cm.getConnectionManagerConfiguration().getJndiName();
boolean padXid = cm.getConnectionManagerConfiguration().isPadXid();
Boolean isSameRMOverride = cm.getConnectionManagerConfiguration().isIsSameRMOverride();
try
{
if (mc.getMetaData() != null)
{
eisProductName = mc.getMetaData().getEISProductName();
eisProductVersion = mc.getMetaData().getEISProductVersion();
}
}
catch (ResourceException re)
{
// Ignore
}
if (eisProductName == null)
eisProductName = jndiName;
if (eisProductVersion == null)
eisProductVersion = jndiName;
if (cm.getConnectionManagerConfiguration().isConnectable())
{
if (mc instanceof org.ironjacamar.core.spi.transaction.ConnectableResource)
{
ConnectableResource cr = (ConnectableResource) mc;
xaResource = txCM.getTransactionIntegration()
.createConnectableXAResourceWrapper(mc.getXAResource(), padXid, isSameRMOverride, eisProductName,
eisProductVersion, jndiName, cr, statistics);
}
else if (txCM.getTransactionIntegration().isConnectableResource(mc))
{
xaResource = txCM.getTransactionIntegration()
.createConnectableXAResourceWrapper(mc.getXAResource(), padXid, isSameRMOverride, eisProductName,
eisProductVersion, jndiName, mc, statistics);
}
}
if (xaResource == null)
{
XAResource xar = mc.getXAResource();
if (!(xar instanceof org.ironjacamar.core.spi.transaction.xa.XAResourceWrapper))
{
boolean firstResource = txCM.getTransactionIntegration().isFirstResource(mc);
xaResource = txCM.getTransactionIntegration()
.createXAResourceWrapper(xar, padXid, isSameRMOverride, eisProductName, eisProductVersion,
jndiName, firstResource, statistics);
}
else
{
xaResource = xar;
}
}
}
else
{
xaResource = mc.getXAResource();
}
return xaResource;
} | java | protected XAResource getXAResource(ManagedConnection mc) throws ResourceException
{
TransactionalConnectionManager txCM = (TransactionalConnectionManager) cm;
XAResource xaResource = null;
if (cm.getConnectionManagerConfiguration().isWrapXAResource())
{
String eisProductName = null;
String eisProductVersion = null;
String jndiName = cm.getConnectionManagerConfiguration().getJndiName();
boolean padXid = cm.getConnectionManagerConfiguration().isPadXid();
Boolean isSameRMOverride = cm.getConnectionManagerConfiguration().isIsSameRMOverride();
try
{
if (mc.getMetaData() != null)
{
eisProductName = mc.getMetaData().getEISProductName();
eisProductVersion = mc.getMetaData().getEISProductVersion();
}
}
catch (ResourceException re)
{
// Ignore
}
if (eisProductName == null)
eisProductName = jndiName;
if (eisProductVersion == null)
eisProductVersion = jndiName;
if (cm.getConnectionManagerConfiguration().isConnectable())
{
if (mc instanceof org.ironjacamar.core.spi.transaction.ConnectableResource)
{
ConnectableResource cr = (ConnectableResource) mc;
xaResource = txCM.getTransactionIntegration()
.createConnectableXAResourceWrapper(mc.getXAResource(), padXid, isSameRMOverride, eisProductName,
eisProductVersion, jndiName, cr, statistics);
}
else if (txCM.getTransactionIntegration().isConnectableResource(mc))
{
xaResource = txCM.getTransactionIntegration()
.createConnectableXAResourceWrapper(mc.getXAResource(), padXid, isSameRMOverride, eisProductName,
eisProductVersion, jndiName, mc, statistics);
}
}
if (xaResource == null)
{
XAResource xar = mc.getXAResource();
if (!(xar instanceof org.ironjacamar.core.spi.transaction.xa.XAResourceWrapper))
{
boolean firstResource = txCM.getTransactionIntegration().isFirstResource(mc);
xaResource = txCM.getTransactionIntegration()
.createXAResourceWrapper(xar, padXid, isSameRMOverride, eisProductName, eisProductVersion,
jndiName, firstResource, statistics);
}
else
{
xaResource = xar;
}
}
}
else
{
xaResource = mc.getXAResource();
}
return xaResource;
} | [
"protected",
"XAResource",
"getXAResource",
"(",
"ManagedConnection",
"mc",
")",
"throws",
"ResourceException",
"{",
"TransactionalConnectionManager",
"txCM",
"=",
"(",
"TransactionalConnectionManager",
")",
"cm",
";",
"XAResource",
"xaResource",
"=",
"null",
";",
"if",... | Get a XAResource instance
@param mc The ManagedConnection
@return The instance
@throws ResourceException Thrown if an error occurs | [
"Get",
"a",
"XAResource",
"instance"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractPool.java#L411-L485 |
135,170 | ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractPool.java | AbstractPool.prefill | @Override
public void prefill()
{
if (isShutdown())
return;
if (poolConfiguration.isPrefill())
{
ManagedConnectionPool mcp = pools.get(getPrefillCredential());
if (mcp == null)
{
// Trigger the initial-pool-size prefill by creating the ManagedConnectionPool
getManagedConnectionPool(getPrefillCredential());
}
else
{
// Standard prefill request
mcp.prefill();
}
}
} | java | @Override
public void prefill()
{
if (isShutdown())
return;
if (poolConfiguration.isPrefill())
{
ManagedConnectionPool mcp = pools.get(getPrefillCredential());
if (mcp == null)
{
// Trigger the initial-pool-size prefill by creating the ManagedConnectionPool
getManagedConnectionPool(getPrefillCredential());
}
else
{
// Standard prefill request
mcp.prefill();
}
}
} | [
"@",
"Override",
"public",
"void",
"prefill",
"(",
")",
"{",
"if",
"(",
"isShutdown",
"(",
")",
")",
"return",
";",
"if",
"(",
"poolConfiguration",
".",
"isPrefill",
"(",
")",
")",
"{",
"ManagedConnectionPool",
"mcp",
"=",
"pools",
".",
"get",
"(",
"ge... | Prefill the connection pool | [
"Prefill",
"the",
"connection",
"pool"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractPool.java#L490-L511 |
135,171 | ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractPool.java | AbstractPool.getPrefillCredential | @Override
public Credential getPrefillCredential()
{
if (this.prefillCredential == null)
{
if (cm.getSubjectFactory() == null || cm.getConnectionManagerConfiguration().getSecurityDomain() == null)
{
prefillCredential = new Credential(null, null);
}
else
{
prefillCredential =
new Credential(SecurityActions.createSubject(cm.getSubjectFactory(),
cm.getConnectionManagerConfiguration().getSecurityDomain(),
cm.getManagedConnectionFactory()),
null);
}
}
return this.prefillCredential;
} | java | @Override
public Credential getPrefillCredential()
{
if (this.prefillCredential == null)
{
if (cm.getSubjectFactory() == null || cm.getConnectionManagerConfiguration().getSecurityDomain() == null)
{
prefillCredential = new Credential(null, null);
}
else
{
prefillCredential =
new Credential(SecurityActions.createSubject(cm.getSubjectFactory(),
cm.getConnectionManagerConfiguration().getSecurityDomain(),
cm.getManagedConnectionFactory()),
null);
}
}
return this.prefillCredential;
} | [
"@",
"Override",
"public",
"Credential",
"getPrefillCredential",
"(",
")",
"{",
"if",
"(",
"this",
".",
"prefillCredential",
"==",
"null",
")",
"{",
"if",
"(",
"cm",
".",
"getSubjectFactory",
"(",
")",
"==",
"null",
"||",
"cm",
".",
"getConnectionManagerConf... | Get prefill credential
@return credential used to prefill | [
"Get",
"prefill",
"credential"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractPool.java#L518-L537 |
135,172 | ironjacamar/ironjacamar | embedded/src/main/java/org/ironjacamar/embedded/deployers/AbstractFungalRADeployer.java | AbstractFungalRADeployer.isRarArchive | protected boolean isRarArchive(URL url)
{
if (url == null)
return false;
return isRarFile(url) || isRarDirectory(url);
} | java | protected boolean isRarArchive(URL url)
{
if (url == null)
return false;
return isRarFile(url) || isRarDirectory(url);
} | [
"protected",
"boolean",
"isRarArchive",
"(",
"URL",
"url",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"return",
"false",
";",
"return",
"isRarFile",
"(",
"url",
")",
"||",
"isRarDirectory",
"(",
"url",
")",
";",
"}"
] | Does the URL represent a .rar archive
@param url The URL
@return <code>true</code> if .rar archive, otherwise <code>false</code> | [
"Does",
"the",
"URL",
"represent",
"a",
".",
"rar",
"archive"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/embedded/src/main/java/org/ironjacamar/embedded/deployers/AbstractFungalRADeployer.java#L83-L89 |
135,173 | ironjacamar/ironjacamar | embedded/src/main/java/org/ironjacamar/embedded/deployers/AbstractFungalRADeployer.java | AbstractFungalRADeployer.isRarFile | protected boolean isRarFile(URL url)
{
if (url != null && url.toExternalForm().endsWith(".rar") && !url.toExternalForm().startsWith("jar"))
return true;
return false;
} | java | protected boolean isRarFile(URL url)
{
if (url != null && url.toExternalForm().endsWith(".rar") && !url.toExternalForm().startsWith("jar"))
return true;
return false;
} | [
"protected",
"boolean",
"isRarFile",
"(",
"URL",
"url",
")",
"{",
"if",
"(",
"url",
"!=",
"null",
"&&",
"url",
".",
"toExternalForm",
"(",
")",
".",
"endsWith",
"(",
"\".rar\"",
")",
"&&",
"!",
"url",
".",
"toExternalForm",
"(",
")",
".",
"startsWith",... | Does the URL represent a .rar file
@param url The URL
@return <code>true</code> if .rar file, otherwise <code>false</code> | [
"Does",
"the",
"URL",
"represent",
"a",
".",
"rar",
"file"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/embedded/src/main/java/org/ironjacamar/embedded/deployers/AbstractFungalRADeployer.java#L96-L102 |
135,174 | ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/annotations/repository/jandex/AnnotationImpl.java | AnnotationImpl.getAnnotation | @Override
public Object getAnnotation()
{
try
{
if (isOnField())
{
Class<?> clazz = cl.loadClass(className);
while (!clazz.equals(Object.class))
{
try
{
Field field = SecurityActions.getDeclaredField(clazz, memberName);
return field.getAnnotation(annotationClass);
}
catch (Throwable t)
{
clazz = clazz.getSuperclass();
}
}
}
else if (isOnMethod())
{
Class<?> clazz = cl.loadClass(className);
Class<?>[] params = new Class<?>[parameterTypes.size()];
int i = 0;
for (String paramClazz : parameterTypes)
{
params[i] = cl.loadClass(paramClazz);
i++;
}
while (!clazz.equals(Object.class))
{
try
{
Method method = SecurityActions.getDeclaredMethod(clazz, memberName, params);
return method.getAnnotation(annotationClass);
}
catch (Throwable t)
{
clazz = clazz.getSuperclass();
}
}
}
else
{ // onclass
Class<?> clazz = cl.loadClass(className);
return clazz.getAnnotation(annotationClass);
}
}
catch (Exception e)
{
log.error(e.getMessage(), e);
}
return null;
} | java | @Override
public Object getAnnotation()
{
try
{
if (isOnField())
{
Class<?> clazz = cl.loadClass(className);
while (!clazz.equals(Object.class))
{
try
{
Field field = SecurityActions.getDeclaredField(clazz, memberName);
return field.getAnnotation(annotationClass);
}
catch (Throwable t)
{
clazz = clazz.getSuperclass();
}
}
}
else if (isOnMethod())
{
Class<?> clazz = cl.loadClass(className);
Class<?>[] params = new Class<?>[parameterTypes.size()];
int i = 0;
for (String paramClazz : parameterTypes)
{
params[i] = cl.loadClass(paramClazz);
i++;
}
while (!clazz.equals(Object.class))
{
try
{
Method method = SecurityActions.getDeclaredMethod(clazz, memberName, params);
return method.getAnnotation(annotationClass);
}
catch (Throwable t)
{
clazz = clazz.getSuperclass();
}
}
}
else
{ // onclass
Class<?> clazz = cl.loadClass(className);
return clazz.getAnnotation(annotationClass);
}
}
catch (Exception e)
{
log.error(e.getMessage(), e);
}
return null;
} | [
"@",
"Override",
"public",
"Object",
"getAnnotation",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"isOnField",
"(",
")",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"cl",
".",
"loadClass",
"(",
"className",
")",
";",
"while",
"(",
"!",
"clazz",
".",
... | Get the annotation.
@return the annotation. | [
"Get",
"the",
"annotation",
"."
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/annotations/repository/jandex/AnnotationImpl.java#L109-L165 |
135,175 | ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/ds/DsParser.java | DsParser.parse | public DataSources parse(XMLStreamReader reader) throws Exception
{
DataSources dataSources = null;
//iterate over tags
int iterate;
try
{
iterate = reader.nextTag();
}
catch (XMLStreamException e)
{
//found a non tag..go on. Normally non-tag found at beginning are comments or DTD declaration
iterate = reader.nextTag();
}
switch (iterate)
{
case END_ELEMENT : {
// should mean we're done, so ignore it.
break;
}
case START_ELEMENT : {
switch (reader.getLocalName())
{
case XML.ELEMENT_DATASOURCES : {
dataSources = parseDataSources(reader);
break;
}
default :
throw new ParserException(bundle.unexpectedElement(reader.getLocalName()));
}
break;
}
default :
throw new IllegalStateException();
}
return dataSources;
} | java | public DataSources parse(XMLStreamReader reader) throws Exception
{
DataSources dataSources = null;
//iterate over tags
int iterate;
try
{
iterate = reader.nextTag();
}
catch (XMLStreamException e)
{
//found a non tag..go on. Normally non-tag found at beginning are comments or DTD declaration
iterate = reader.nextTag();
}
switch (iterate)
{
case END_ELEMENT : {
// should mean we're done, so ignore it.
break;
}
case START_ELEMENT : {
switch (reader.getLocalName())
{
case XML.ELEMENT_DATASOURCES : {
dataSources = parseDataSources(reader);
break;
}
default :
throw new ParserException(bundle.unexpectedElement(reader.getLocalName()));
}
break;
}
default :
throw new IllegalStateException();
}
return dataSources;
} | [
"public",
"DataSources",
"parse",
"(",
"XMLStreamReader",
"reader",
")",
"throws",
"Exception",
"{",
"DataSources",
"dataSources",
"=",
"null",
";",
"//iterate over tags",
"int",
"iterate",
";",
"try",
"{",
"iterate",
"=",
"reader",
".",
"nextTag",
"(",
")",
"... | Parse a -ds.xml file
@param reader The reader
@return The datasource definitions
@exception Exception Thrown if an error occurs | [
"Parse",
"a",
"-",
"ds",
".",
"xml",
"file"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/ds/DsParser.java#L74-L115 |
135,176 | ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/ds/DsParser.java | DsParser.store | public void store(DataSources metadata, XMLStreamWriter writer) throws Exception
{
if (metadata != null && writer != null)
{
writer.writeStartElement(XML.ELEMENT_DATASOURCES);
if (metadata.getDataSource() != null && !metadata.getDataSource().isEmpty())
{
for (DataSource ds : metadata.getDataSource())
{
storeDataSource(ds, writer);
}
}
if (metadata.getXaDataSource() != null && !metadata.getXaDataSource().isEmpty())
{
for (XaDataSource xads : metadata.getXaDataSource())
{
storeXaDataSource(xads, writer);
}
}
if (metadata.getDrivers() != null && !metadata.getDrivers().isEmpty())
{
writer.writeStartElement(XML.ELEMENT_DRIVERS);
for (Driver drv : metadata.getDrivers())
{
storeDriver(drv, writer);
}
writer.writeEndElement();
}
writer.writeEndElement();
}
} | java | public void store(DataSources metadata, XMLStreamWriter writer) throws Exception
{
if (metadata != null && writer != null)
{
writer.writeStartElement(XML.ELEMENT_DATASOURCES);
if (metadata.getDataSource() != null && !metadata.getDataSource().isEmpty())
{
for (DataSource ds : metadata.getDataSource())
{
storeDataSource(ds, writer);
}
}
if (metadata.getXaDataSource() != null && !metadata.getXaDataSource().isEmpty())
{
for (XaDataSource xads : metadata.getXaDataSource())
{
storeXaDataSource(xads, writer);
}
}
if (metadata.getDrivers() != null && !metadata.getDrivers().isEmpty())
{
writer.writeStartElement(XML.ELEMENT_DRIVERS);
for (Driver drv : metadata.getDrivers())
{
storeDriver(drv, writer);
}
writer.writeEndElement();
}
writer.writeEndElement();
}
} | [
"public",
"void",
"store",
"(",
"DataSources",
"metadata",
",",
"XMLStreamWriter",
"writer",
")",
"throws",
"Exception",
"{",
"if",
"(",
"metadata",
"!=",
"null",
"&&",
"writer",
"!=",
"null",
")",
"{",
"writer",
".",
"writeStartElement",
"(",
"XML",
".",
... | Store a -ds.xml file
@param metadata The datasource definitions
@param writer The writer
@exception Exception Thrown if an error occurs | [
"Store",
"a",
"-",
"ds",
".",
"xml",
"file"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/ds/DsParser.java#L123-L155 |
135,177 | ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/ds/DsParser.java | DsParser.storeDriver | protected void storeDriver(Driver drv, XMLStreamWriter writer) throws Exception
{
writer.writeStartElement(XML.ELEMENT_DRIVER);
if (drv.getName() != null)
writer.writeAttribute(XML.ATTRIBUTE_NAME,
drv.getValue(XML.ATTRIBUTE_NAME, drv.getName()));
if (drv.getModule() != null)
writer.writeAttribute(XML.ATTRIBUTE_MODULE,
drv.getValue(XML.ATTRIBUTE_MODULE, drv.getModule()));
if (drv.getMajorVersion() != null)
writer.writeAttribute(XML.ATTRIBUTE_MAJOR_VERSION,
drv.getValue(XML.ATTRIBUTE_MAJOR_VERSION, drv.getMajorVersion().toString()));
if (drv.getMinorVersion() != null)
writer.writeAttribute(XML.ATTRIBUTE_MINOR_VERSION,
drv.getValue(XML.ATTRIBUTE_MINOR_VERSION, drv.getMinorVersion().toString()));
if (drv.getDriverClass() != null)
{
writer.writeStartElement(XML.ELEMENT_DRIVER_CLASS);
writer.writeCharacters(drv.getValue(XML.ELEMENT_DRIVER_CLASS, drv.getDriverClass()));
writer.writeEndElement();
}
if (drv.getDataSourceClass() != null)
{
writer.writeStartElement(XML.ELEMENT_DATASOURCE_CLASS);
writer.writeCharacters(drv.getValue(XML.ELEMENT_DATASOURCE_CLASS, drv.getDataSourceClass()));
writer.writeEndElement();
}
if (drv.getXaDataSourceClass() != null)
{
writer.writeStartElement(XML.ELEMENT_XA_DATASOURCE_CLASS);
writer.writeCharacters(drv.getValue(XML.ELEMENT_XA_DATASOURCE_CLASS, drv.getXaDataSourceClass()));
writer.writeEndElement();
}
writer.writeEndElement();
} | java | protected void storeDriver(Driver drv, XMLStreamWriter writer) throws Exception
{
writer.writeStartElement(XML.ELEMENT_DRIVER);
if (drv.getName() != null)
writer.writeAttribute(XML.ATTRIBUTE_NAME,
drv.getValue(XML.ATTRIBUTE_NAME, drv.getName()));
if (drv.getModule() != null)
writer.writeAttribute(XML.ATTRIBUTE_MODULE,
drv.getValue(XML.ATTRIBUTE_MODULE, drv.getModule()));
if (drv.getMajorVersion() != null)
writer.writeAttribute(XML.ATTRIBUTE_MAJOR_VERSION,
drv.getValue(XML.ATTRIBUTE_MAJOR_VERSION, drv.getMajorVersion().toString()));
if (drv.getMinorVersion() != null)
writer.writeAttribute(XML.ATTRIBUTE_MINOR_VERSION,
drv.getValue(XML.ATTRIBUTE_MINOR_VERSION, drv.getMinorVersion().toString()));
if (drv.getDriverClass() != null)
{
writer.writeStartElement(XML.ELEMENT_DRIVER_CLASS);
writer.writeCharacters(drv.getValue(XML.ELEMENT_DRIVER_CLASS, drv.getDriverClass()));
writer.writeEndElement();
}
if (drv.getDataSourceClass() != null)
{
writer.writeStartElement(XML.ELEMENT_DATASOURCE_CLASS);
writer.writeCharacters(drv.getValue(XML.ELEMENT_DATASOURCE_CLASS, drv.getDataSourceClass()));
writer.writeEndElement();
}
if (drv.getXaDataSourceClass() != null)
{
writer.writeStartElement(XML.ELEMENT_XA_DATASOURCE_CLASS);
writer.writeCharacters(drv.getValue(XML.ELEMENT_XA_DATASOURCE_CLASS, drv.getXaDataSourceClass()));
writer.writeEndElement();
}
writer.writeEndElement();
} | [
"protected",
"void",
"storeDriver",
"(",
"Driver",
"drv",
",",
"XMLStreamWriter",
"writer",
")",
"throws",
"Exception",
"{",
"writer",
".",
"writeStartElement",
"(",
"XML",
".",
"ELEMENT_DRIVER",
")",
";",
"if",
"(",
"drv",
".",
"getName",
"(",
")",
"!=",
... | Store a driver
@param drv The driver
@param writer The writer
@exception Exception Thrown if an error occurs | [
"Store",
"a",
"driver"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/ds/DsParser.java#L1713-L1755 |
135,178 | ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/workmanager/ClassDefinitionFactory.java | ClassDefinitionFactory.createClassDefinition | public static ClassDefinition createClassDefinition(Serializable s, Class<?> clz)
{
if (s == null || clz == null)
return null;
String name = clz.getName();
long serialVersionUID = 0L;
byte[] data = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
InputStream is = null;
try
{
try
{
Field svuf = getSerialVersionUID(clz);
if (svuf != null)
serialVersionUID = (long)svuf.get(s);
}
catch (Throwable t)
{
// No serialVersionUID value
}
String clzName = name.replace('.', '/') + ".class";
is = SecurityActions.getClassLoader(s.getClass()).getResourceAsStream(clzName);
int i = is.read();
while (i != -1)
{
baos.write(i);
i = is.read();
}
data = baos.toByteArray();
return new ClassDefinition(name, serialVersionUID, data);
}
catch (Throwable t)
{
// Ignore
}
finally
{
if (is != null)
{
try
{
is.close();
}
catch (IOException ioe)
{
// Ignore
}
}
}
return null;
} | java | public static ClassDefinition createClassDefinition(Serializable s, Class<?> clz)
{
if (s == null || clz == null)
return null;
String name = clz.getName();
long serialVersionUID = 0L;
byte[] data = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
InputStream is = null;
try
{
try
{
Field svuf = getSerialVersionUID(clz);
if (svuf != null)
serialVersionUID = (long)svuf.get(s);
}
catch (Throwable t)
{
// No serialVersionUID value
}
String clzName = name.replace('.', '/') + ".class";
is = SecurityActions.getClassLoader(s.getClass()).getResourceAsStream(clzName);
int i = is.read();
while (i != -1)
{
baos.write(i);
i = is.read();
}
data = baos.toByteArray();
return new ClassDefinition(name, serialVersionUID, data);
}
catch (Throwable t)
{
// Ignore
}
finally
{
if (is != null)
{
try
{
is.close();
}
catch (IOException ioe)
{
// Ignore
}
}
}
return null;
} | [
"public",
"static",
"ClassDefinition",
"createClassDefinition",
"(",
"Serializable",
"s",
",",
"Class",
"<",
"?",
">",
"clz",
")",
"{",
"if",
"(",
"s",
"==",
"null",
"||",
"clz",
"==",
"null",
")",
"return",
"null",
";",
"String",
"name",
"=",
"clz",
"... | Create a class definition
@param s The serializable
@param clz The class
@return The definition | [
"Create",
"a",
"class",
"definition"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/workmanager/ClassDefinitionFactory.java#L59-L116 |
135,179 | ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/workmanager/ClassDefinitionFactory.java | ClassDefinitionFactory.getSerialVersionUID | private static Field getSerialVersionUID(Class<?> clz)
{
Class<?> c = clz;
while (c != null)
{
try
{
Field svuf = SecurityActions.getDeclaredField(clz, "serialVersionUID");
SecurityActions.setAccessible(svuf);
return svuf;
}
catch (Throwable t)
{
// No serialVersionUID definition
}
c = c.getSuperclass();
}
return null;
} | java | private static Field getSerialVersionUID(Class<?> clz)
{
Class<?> c = clz;
while (c != null)
{
try
{
Field svuf = SecurityActions.getDeclaredField(clz, "serialVersionUID");
SecurityActions.setAccessible(svuf);
return svuf;
}
catch (Throwable t)
{
// No serialVersionUID definition
}
c = c.getSuperclass();
}
return null;
} | [
"private",
"static",
"Field",
"getSerialVersionUID",
"(",
"Class",
"<",
"?",
">",
"clz",
")",
"{",
"Class",
"<",
"?",
">",
"c",
"=",
"clz",
";",
"while",
"(",
"c",
"!=",
"null",
")",
"{",
"try",
"{",
"Field",
"svuf",
"=",
"SecurityActions",
".",
"g... | Find the serialVersionUID field
@param clz The class
@return The field or <code>null</code> if none were found | [
"Find",
"the",
"serialVersionUID",
"field"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/workmanager/ClassDefinitionFactory.java#L123-L142 |
135,180 | ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/common/CommonIronJacamarParser.java | CommonIronJacamarParser.parseWorkManager | protected WorkManager parseWorkManager(XMLStreamReader reader) throws XMLStreamException, ParserException,
ValidateException
{
WorkManagerSecurity security = null;
while (reader.hasNext())
{
switch (reader.nextTag())
{
case END_ELEMENT : {
if (CommonXML.ELEMENT_WORKMANAGER.equals(reader.getLocalName()))
{
return new WorkManagerImpl(security);
}
else
{
switch (reader.getLocalName())
{
case CommonXML.ELEMENT_SECURITY :
break;
default :
throw new ParserException(bundle.unexpectedEndTag(reader.getLocalName()));
}
}
break;
}
case START_ELEMENT : {
switch (reader.getLocalName())
{
case CommonXML.ELEMENT_SECURITY : {
security = parseWorkManagerSecurity(reader);
break;
}
default :
throw new ParserException(bundle.unexpectedElement(reader.getLocalName()));
}
break;
}
}
}
throw new ParserException(bundle.unexpectedEndOfDocument());
} | java | protected WorkManager parseWorkManager(XMLStreamReader reader) throws XMLStreamException, ParserException,
ValidateException
{
WorkManagerSecurity security = null;
while (reader.hasNext())
{
switch (reader.nextTag())
{
case END_ELEMENT : {
if (CommonXML.ELEMENT_WORKMANAGER.equals(reader.getLocalName()))
{
return new WorkManagerImpl(security);
}
else
{
switch (reader.getLocalName())
{
case CommonXML.ELEMENT_SECURITY :
break;
default :
throw new ParserException(bundle.unexpectedEndTag(reader.getLocalName()));
}
}
break;
}
case START_ELEMENT : {
switch (reader.getLocalName())
{
case CommonXML.ELEMENT_SECURITY : {
security = parseWorkManagerSecurity(reader);
break;
}
default :
throw new ParserException(bundle.unexpectedElement(reader.getLocalName()));
}
break;
}
}
}
throw new ParserException(bundle.unexpectedEndOfDocument());
} | [
"protected",
"WorkManager",
"parseWorkManager",
"(",
"XMLStreamReader",
"reader",
")",
"throws",
"XMLStreamException",
",",
"ParserException",
",",
"ValidateException",
"{",
"WorkManagerSecurity",
"security",
"=",
"null",
";",
"while",
"(",
"reader",
".",
"hasNext",
"... | Parse workmanager element
@param reader The reader
@return The value
@exception XMLStreamException XMLStreamException
@exception ParserException ParserException
@exception ValidateException ValidateException | [
"Parse",
"workmanager",
"element"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/common/CommonIronJacamarParser.java#L169-L210 |
135,181 | ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/common/CommonIronJacamarParser.java | CommonIronJacamarParser.storeAdminObject | protected void storeAdminObject(AdminObject ao, XMLStreamWriter writer) throws Exception
{
writer.writeStartElement(CommonXML.ELEMENT_ADMIN_OBJECT);
if (ao.getClassName() != null)
writer.writeAttribute(CommonXML.ATTRIBUTE_CLASS_NAME,
ao.getValue(CommonXML.ATTRIBUTE_CLASS_NAME, ao.getClassName()));
if (ao.getJndiName() != null)
writer.writeAttribute(CommonXML.ATTRIBUTE_JNDI_NAME,
ao.getValue(CommonXML.ATTRIBUTE_JNDI_NAME, ao.getJndiName()));
if (ao.isEnabled() != null && (ao.hasExpression(CommonXML.ATTRIBUTE_ENABLED) ||
!Defaults.ENABLED.equals(ao.isEnabled())))
writer.writeAttribute(CommonXML.ATTRIBUTE_ENABLED,
ao.getValue(CommonXML.ATTRIBUTE_ENABLED, ao.isEnabled().toString()));
if (ao.getId() != null)
writer.writeAttribute(CommonXML.ATTRIBUTE_ID, ao.getValue(CommonXML.ATTRIBUTE_ID, ao.getId()));
if (ao.getConfigProperties() != null && !ao.getConfigProperties().isEmpty())
{
Iterator<Map.Entry<String, String>> it = ao.getConfigProperties().entrySet().iterator();
while (it.hasNext())
{
Map.Entry<String, String> entry = it.next();
writer.writeStartElement(CommonXML.ELEMENT_CONFIG_PROPERTY);
writer.writeAttribute(CommonXML.ATTRIBUTE_NAME, entry.getKey());
writer.writeCharacters(ao.getValue(CommonXML.ELEMENT_CONFIG_PROPERTY, entry.getKey(), entry.getValue()));
writer.writeEndElement();
}
}
writer.writeEndElement();
} | java | protected void storeAdminObject(AdminObject ao, XMLStreamWriter writer) throws Exception
{
writer.writeStartElement(CommonXML.ELEMENT_ADMIN_OBJECT);
if (ao.getClassName() != null)
writer.writeAttribute(CommonXML.ATTRIBUTE_CLASS_NAME,
ao.getValue(CommonXML.ATTRIBUTE_CLASS_NAME, ao.getClassName()));
if (ao.getJndiName() != null)
writer.writeAttribute(CommonXML.ATTRIBUTE_JNDI_NAME,
ao.getValue(CommonXML.ATTRIBUTE_JNDI_NAME, ao.getJndiName()));
if (ao.isEnabled() != null && (ao.hasExpression(CommonXML.ATTRIBUTE_ENABLED) ||
!Defaults.ENABLED.equals(ao.isEnabled())))
writer.writeAttribute(CommonXML.ATTRIBUTE_ENABLED,
ao.getValue(CommonXML.ATTRIBUTE_ENABLED, ao.isEnabled().toString()));
if (ao.getId() != null)
writer.writeAttribute(CommonXML.ATTRIBUTE_ID, ao.getValue(CommonXML.ATTRIBUTE_ID, ao.getId()));
if (ao.getConfigProperties() != null && !ao.getConfigProperties().isEmpty())
{
Iterator<Map.Entry<String, String>> it = ao.getConfigProperties().entrySet().iterator();
while (it.hasNext())
{
Map.Entry<String, String> entry = it.next();
writer.writeStartElement(CommonXML.ELEMENT_CONFIG_PROPERTY);
writer.writeAttribute(CommonXML.ATTRIBUTE_NAME, entry.getKey());
writer.writeCharacters(ao.getValue(CommonXML.ELEMENT_CONFIG_PROPERTY, entry.getKey(), entry.getValue()));
writer.writeEndElement();
}
}
writer.writeEndElement();
} | [
"protected",
"void",
"storeAdminObject",
"(",
"AdminObject",
"ao",
",",
"XMLStreamWriter",
"writer",
")",
"throws",
"Exception",
"{",
"writer",
".",
"writeStartElement",
"(",
"CommonXML",
".",
"ELEMENT_ADMIN_OBJECT",
")",
";",
"if",
"(",
"ao",
".",
"getClassName",... | Store admin object
@param ao The admin object
@param writer The writer
@exception Exception Thrown if an error occurs | [
"Store",
"admin",
"object"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/common/CommonIronJacamarParser.java#L787-L822 |
135,182 | ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/spi/annotations/repository/AnnotationScannerFactory.java | AnnotationScannerFactory.getAnnotationScanner | public static AnnotationScanner getAnnotationScanner()
{
if (active != null)
return active;
if (defaultImplementation == null)
throw new IllegalStateException(bundle.noAnnotationScanner());
return defaultImplementation;
} | java | public static AnnotationScanner getAnnotationScanner()
{
if (active != null)
return active;
if (defaultImplementation == null)
throw new IllegalStateException(bundle.noAnnotationScanner());
return defaultImplementation;
} | [
"public",
"static",
"AnnotationScanner",
"getAnnotationScanner",
"(",
")",
"{",
"if",
"(",
"active",
"!=",
"null",
")",
"return",
"active",
";",
"if",
"(",
"defaultImplementation",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"bundle",
".",
... | Get the annotation scanner
@return The scanner | [
"Get",
"the",
"annotation",
"scanner"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/spi/annotations/repository/AnnotationScannerFactory.java#L75-L84 |
135,183 | ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/PropsCodeGen.java | PropsCodeGen.writeConfigPropsDeclare | void writeConfigPropsDeclare(Definition def, Writer out, int indent) throws IOException
{
if (getConfigProps(def) == null)
return;
for (int i = 0; i < getConfigProps(def).size(); i++)
{
writeWithIndent(out, indent, "/** " + getConfigProps(def).get(i).getName() + " */\n");
if (def.isUseAnnotation())
{
writeIndent(out, indent);
out.write("@ConfigProperty(defaultValue = \"" + getConfigProps(def).get(i).getValue() + "\")");
if (getConfigProps(def).get(i).isRequired())
{
out.write(" @NotNull");
}
writeEol(out);
}
writeWithIndent(out, indent, "private " +
getConfigProps(def).get(i).getType() +
" " +
getConfigProps(def).get(i).getName() +
";\n\n");
}
} | java | void writeConfigPropsDeclare(Definition def, Writer out, int indent) throws IOException
{
if (getConfigProps(def) == null)
return;
for (int i = 0; i < getConfigProps(def).size(); i++)
{
writeWithIndent(out, indent, "/** " + getConfigProps(def).get(i).getName() + " */\n");
if (def.isUseAnnotation())
{
writeIndent(out, indent);
out.write("@ConfigProperty(defaultValue = \"" + getConfigProps(def).get(i).getValue() + "\")");
if (getConfigProps(def).get(i).isRequired())
{
out.write(" @NotNull");
}
writeEol(out);
}
writeWithIndent(out, indent, "private " +
getConfigProps(def).get(i).getType() +
" " +
getConfigProps(def).get(i).getName() +
";\n\n");
}
} | [
"void",
"writeConfigPropsDeclare",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"if",
"(",
"getConfigProps",
"(",
"def",
")",
"==",
"null",
")",
"return",
";",
"for",
"(",
"int",
"i",
"=",
"0",
... | Output Configuration Properties Declare
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"Configuration",
"Properties",
"Declare"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/PropsCodeGen.java#L46-L71 |
135,184 | ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/PropsCodeGen.java | PropsCodeGen.writeConfigProps | void writeConfigProps(Definition def, Writer out, int indent) throws IOException
{
if (getConfigProps(def) == null)
return;
for (int i = 0; i < getConfigProps(def).size(); i++)
{
String name = getConfigProps(def).get(i).getName();
String upcaseName = upcaseFirst(name);
//set
writeWithIndent(out, indent, "/** \n");
writeWithIndent(out, indent, " * Set " + name);
writeEol(out);
writeWithIndent(out, indent, " * @param " + name + " The value\n");
writeWithIndent(out, indent, " */\n");
writeWithIndent(out, indent, "public void set" +
upcaseName +
"(" +
getConfigProps(def).get(i).getType() +
" " +
name +
")");
writeLeftCurlyBracket(out, indent);
writeWithIndent(out, indent + 1, "this." + name + " = " + name + ";");
writeRightCurlyBracket(out, indent);
writeEol(out);
//get
writeWithIndent(out, indent, "/** \n");
writeWithIndent(out, indent, " * Get " + name);
writeEol(out);
writeWithIndent(out, indent, " * @return The value\n");
writeWithIndent(out, indent, " */\n");
writeWithIndent(out, indent, "public " +
getConfigProps(def).get(i).getType() +
" get" +
upcaseName +
"()");
writeLeftCurlyBracket(out, indent);
writeWithIndent(out, indent + 1, "return " + name + ";");
writeRightCurlyBracket(out, indent);
writeEol(out);
}
} | java | void writeConfigProps(Definition def, Writer out, int indent) throws IOException
{
if (getConfigProps(def) == null)
return;
for (int i = 0; i < getConfigProps(def).size(); i++)
{
String name = getConfigProps(def).get(i).getName();
String upcaseName = upcaseFirst(name);
//set
writeWithIndent(out, indent, "/** \n");
writeWithIndent(out, indent, " * Set " + name);
writeEol(out);
writeWithIndent(out, indent, " * @param " + name + " The value\n");
writeWithIndent(out, indent, " */\n");
writeWithIndent(out, indent, "public void set" +
upcaseName +
"(" +
getConfigProps(def).get(i).getType() +
" " +
name +
")");
writeLeftCurlyBracket(out, indent);
writeWithIndent(out, indent + 1, "this." + name + " = " + name + ";");
writeRightCurlyBracket(out, indent);
writeEol(out);
//get
writeWithIndent(out, indent, "/** \n");
writeWithIndent(out, indent, " * Get " + name);
writeEol(out);
writeWithIndent(out, indent, " * @return The value\n");
writeWithIndent(out, indent, " */\n");
writeWithIndent(out, indent, "public " +
getConfigProps(def).get(i).getType() +
" get" +
upcaseName +
"()");
writeLeftCurlyBracket(out, indent);
writeWithIndent(out, indent + 1, "return " + name + ";");
writeRightCurlyBracket(out, indent);
writeEol(out);
}
} | [
"void",
"writeConfigProps",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"if",
"(",
"getConfigProps",
"(",
"def",
")",
"==",
"null",
")",
"return",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Output Configuration Properties
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"Configuration",
"Properties"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/PropsCodeGen.java#L81-L125 |
135,185 | ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/stable/StablePool.java | StablePool.verifyConnectionListener | public synchronized Object verifyConnectionListener(ConnectionListener cl) throws ResourceException
{
for (Map.Entry<Object, Map<ManagedConnectionPool, ConnectionListener>> entry : transactionMap.entrySet())
{
if (entry.getValue().values().contains(cl))
{
try
{
TransactionalConnectionManager txCM = (TransactionalConnectionManager)cm;
Transaction tx = txCM.getTransactionIntegration().getTransactionManager().getTransaction();
Object id = txCM.getTransactionIntegration().getTransactionSynchronizationRegistry().getTransactionKey();
if (!id.equals(entry.getKey()))
return entry.getKey();
}
catch (Exception e)
{
throw new ResourceException(e);
}
}
}
return null;
} | java | public synchronized Object verifyConnectionListener(ConnectionListener cl) throws ResourceException
{
for (Map.Entry<Object, Map<ManagedConnectionPool, ConnectionListener>> entry : transactionMap.entrySet())
{
if (entry.getValue().values().contains(cl))
{
try
{
TransactionalConnectionManager txCM = (TransactionalConnectionManager)cm;
Transaction tx = txCM.getTransactionIntegration().getTransactionManager().getTransaction();
Object id = txCM.getTransactionIntegration().getTransactionSynchronizationRegistry().getTransactionKey();
if (!id.equals(entry.getKey()))
return entry.getKey();
}
catch (Exception e)
{
throw new ResourceException(e);
}
}
}
return null;
} | [
"public",
"synchronized",
"Object",
"verifyConnectionListener",
"(",
"ConnectionListener",
"cl",
")",
"throws",
"ResourceException",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Object",
",",
"Map",
"<",
"ManagedConnectionPool",
",",
"ConnectionListener",
">",
">",
... | Verify if a connection listener is already in use
@param cl The connection listener
@return The transaction object if in use, or null if not
@exception ResourceException Thrown in case of an error | [
"Verify",
"if",
"a",
"connection",
"listener",
"is",
"already",
"in",
"use"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/stable/StablePool.java#L177-L200 |
135,186 | ironjacamar/ironjacamar | validator/src/main/java/org/ironjacamar/validator/rules/ConfigPropertiesHelper.java | ConfigPropertiesHelper.validateConfigPropertiesType | public static List<Failure> validateConfigPropertiesType(ValidateClass vo, String section, String failMsg)
{
List<Failure> failures = new ArrayList<Failure>(1);
for (ConfigProperty cpmd : vo.getConfigProperties())
{
try
{
containGetOrIsMethod(vo, "get", cpmd, section, failMsg, failures);
}
catch (Throwable t)
{
try
{
containGetOrIsMethod(vo, "is", cpmd, section, failMsg, failures);
}
catch (Throwable it)
{
// Ignore
}
}
}
if (failures.isEmpty())
return null;
return failures;
} | java | public static List<Failure> validateConfigPropertiesType(ValidateClass vo, String section, String failMsg)
{
List<Failure> failures = new ArrayList<Failure>(1);
for (ConfigProperty cpmd : vo.getConfigProperties())
{
try
{
containGetOrIsMethod(vo, "get", cpmd, section, failMsg, failures);
}
catch (Throwable t)
{
try
{
containGetOrIsMethod(vo, "is", cpmd, section, failMsg, failures);
}
catch (Throwable it)
{
// Ignore
}
}
}
if (failures.isEmpty())
return null;
return failures;
} | [
"public",
"static",
"List",
"<",
"Failure",
">",
"validateConfigPropertiesType",
"(",
"ValidateClass",
"vo",
",",
"String",
"section",
",",
"String",
"failMsg",
")",
"{",
"List",
"<",
"Failure",
">",
"failures",
"=",
"new",
"ArrayList",
"<",
"Failure",
">",
... | validate ConfigProperties type
@param vo ValidateClass
@param section section in the spec document
@param failMsg fail or warn message
@return list of failures | [
"validate",
"ConfigProperties",
"type"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/validator/src/main/java/org/ironjacamar/validator/rules/ConfigPropertiesHelper.java#L82-L109 |
135,187 | ironjacamar/ironjacamar | validator/src/main/java/org/ironjacamar/validator/rules/ConfigPropertiesHelper.java | ConfigPropertiesHelper.containGetOrIsMethod | private static void containGetOrIsMethod(ValidateClass vo, String getOrIs,
ConfigProperty cpmd, String section, String failMsg, List<Failure> failures)
throws NoSuchMethodException
{
String methodName = getOrIs + cpmd.getConfigPropertyName().getValue().substring(0, 1).toUpperCase(Locale.US);
if (cpmd.getConfigPropertyName().getValue().length() > 1)
{
methodName += cpmd.getConfigPropertyName().getValue().substring(1);
}
Method method = SecurityActions.getMethod(vo.getClazz(), methodName, (Class[])null);
if (!VALID_TYPES.contains(method.getReturnType()))
{
StringBuilder sb = new StringBuilder("Class: " + vo.getClazz().getName());
sb = sb.append(" Property: " + cpmd.getConfigPropertyName().getValue());
sb = sb.append(" Type: " + method.getReturnType().getName());
Failure failure;
if (WARNING_TYPES.contains(method.getReturnType()))
{
failure = new Failure(Severity.WARNING,
section,
failMsg,
sb.toString());
}
else
{
failure = new Failure(Severity.ERROR,
section,
failMsg,
sb.toString());
}
failures.add(failure);
}
} | java | private static void containGetOrIsMethod(ValidateClass vo, String getOrIs,
ConfigProperty cpmd, String section, String failMsg, List<Failure> failures)
throws NoSuchMethodException
{
String methodName = getOrIs + cpmd.getConfigPropertyName().getValue().substring(0, 1).toUpperCase(Locale.US);
if (cpmd.getConfigPropertyName().getValue().length() > 1)
{
methodName += cpmd.getConfigPropertyName().getValue().substring(1);
}
Method method = SecurityActions.getMethod(vo.getClazz(), methodName, (Class[])null);
if (!VALID_TYPES.contains(method.getReturnType()))
{
StringBuilder sb = new StringBuilder("Class: " + vo.getClazz().getName());
sb = sb.append(" Property: " + cpmd.getConfigPropertyName().getValue());
sb = sb.append(" Type: " + method.getReturnType().getName());
Failure failure;
if (WARNING_TYPES.contains(method.getReturnType()))
{
failure = new Failure(Severity.WARNING,
section,
failMsg,
sb.toString());
}
else
{
failure = new Failure(Severity.ERROR,
section,
failMsg,
sb.toString());
}
failures.add(failure);
}
} | [
"private",
"static",
"void",
"containGetOrIsMethod",
"(",
"ValidateClass",
"vo",
",",
"String",
"getOrIs",
",",
"ConfigProperty",
"cpmd",
",",
"String",
"section",
",",
"String",
"failMsg",
",",
"List",
"<",
"Failure",
">",
"failures",
")",
"throws",
"NoSuchMeth... | validated object contain 'get or 'is' Method
@param vo ValidateClass
@param getOrIs 'get or 'is' String
@param cpmd ConfigProperty metadata
@param section section in the spec document
@param failMsg fail or warn message
@param failures list of failures
@throws NoSuchMethodException | [
"validated",
"object",
"contain",
"get",
"or",
"is",
"Method"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/validator/src/main/java/org/ironjacamar/validator/rules/ConfigPropertiesHelper.java#L122-L157 |
135,188 | ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/AbstractConnectionManager.java | AbstractConnectionManager.getConnectionListener | protected org.ironjacamar.core.connectionmanager.listener.ConnectionListener getConnectionListener(
Credential credential) throws ResourceException
{
org.ironjacamar.core.connectionmanager.listener.ConnectionListener result = null;
Exception failure = null;
// First attempt
boolean isInterrupted = Thread.interrupted();
boolean innerIsInterrupted = false;
try
{
result = pool.getConnectionListener(credential);
if (supportsLazyAssociation == null)
{
supportsLazyAssociation =
(result.getManagedConnection() instanceof DissociatableManagedConnection) ? Boolean.TRUE : Boolean.FALSE;
}
return result;
}
catch (ResourceException e)
{
failure = e;
// Retry?
if (cmConfiguration.getAllocationRetry() != 0 || e instanceof RetryableException)
{
int to = cmConfiguration.getAllocationRetry();
long sleep = cmConfiguration.getAllocationRetryWaitMillis();
if (to == 0 && e instanceof RetryableException)
to = 1;
for (int i = 0; i < to; i++)
{
if (shutdown.get())
{
throw new ResourceException();
}
if (Thread.currentThread().isInterrupted())
{
Thread.interrupted();
innerIsInterrupted = true;
}
try
{
if (sleep > 0)
Thread.sleep(sleep);
return pool.getConnectionListener(credential);
}
catch (ResourceException re)
{
failure = re;
}
catch (InterruptedException ie)
{
failure = ie;
innerIsInterrupted = true;
}
}
}
}
catch (Exception e)
{
failure = e;
}
finally
{
if (isInterrupted || innerIsInterrupted)
{
Thread.currentThread().interrupt();
if (innerIsInterrupted)
throw new ResourceException(failure);
}
}
if (cmConfiguration.isSharable() && Boolean.TRUE.equals(supportsLazyAssociation))
return associateConnectionListener(credential, null);
// If we get here all retries failed, throw the lastest failure
throw new ResourceException(failure);
} | java | protected org.ironjacamar.core.connectionmanager.listener.ConnectionListener getConnectionListener(
Credential credential) throws ResourceException
{
org.ironjacamar.core.connectionmanager.listener.ConnectionListener result = null;
Exception failure = null;
// First attempt
boolean isInterrupted = Thread.interrupted();
boolean innerIsInterrupted = false;
try
{
result = pool.getConnectionListener(credential);
if (supportsLazyAssociation == null)
{
supportsLazyAssociation =
(result.getManagedConnection() instanceof DissociatableManagedConnection) ? Boolean.TRUE : Boolean.FALSE;
}
return result;
}
catch (ResourceException e)
{
failure = e;
// Retry?
if (cmConfiguration.getAllocationRetry() != 0 || e instanceof RetryableException)
{
int to = cmConfiguration.getAllocationRetry();
long sleep = cmConfiguration.getAllocationRetryWaitMillis();
if (to == 0 && e instanceof RetryableException)
to = 1;
for (int i = 0; i < to; i++)
{
if (shutdown.get())
{
throw new ResourceException();
}
if (Thread.currentThread().isInterrupted())
{
Thread.interrupted();
innerIsInterrupted = true;
}
try
{
if (sleep > 0)
Thread.sleep(sleep);
return pool.getConnectionListener(credential);
}
catch (ResourceException re)
{
failure = re;
}
catch (InterruptedException ie)
{
failure = ie;
innerIsInterrupted = true;
}
}
}
}
catch (Exception e)
{
failure = e;
}
finally
{
if (isInterrupted || innerIsInterrupted)
{
Thread.currentThread().interrupt();
if (innerIsInterrupted)
throw new ResourceException(failure);
}
}
if (cmConfiguration.isSharable() && Boolean.TRUE.equals(supportsLazyAssociation))
return associateConnectionListener(credential, null);
// If we get here all retries failed, throw the lastest failure
throw new ResourceException(failure);
} | [
"protected",
"org",
".",
"ironjacamar",
".",
"core",
".",
"connectionmanager",
".",
"listener",
".",
"ConnectionListener",
"getConnectionListener",
"(",
"Credential",
"credential",
")",
"throws",
"ResourceException",
"{",
"org",
".",
"ironjacamar",
".",
"core",
".",... | Get a connection listener
@param credential The credential
@return The listener
@throws ResourceException Thrown in case of an error | [
"Get",
"a",
"connection",
"listener"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/AbstractConnectionManager.java#L368-L454 |
135,189 | ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/AbstractConnectionManager.java | AbstractConnectionManager.associateConnectionListener | private org.ironjacamar.core.connectionmanager.listener.ConnectionListener
associateConnectionListener(Credential credential, Object connection)
throws ResourceException
{
log.tracef("associateConnectionListener(%s, %s)", credential, connection);
if (isShutdown())
{
throw new ResourceException();
}
if (!cmConfiguration.isSharable())
throw new ResourceException();
org.ironjacamar.core.connectionmanager.listener.ConnectionListener cl =
pool.getActiveConnectionListener(credential);
if (cl == null)
{
if (!pool.isFull())
{
try
{
cl = pool.getConnectionListener(credential);
}
catch (ResourceException re)
{
// Ignore
}
}
if (cl == null)
{
org.ironjacamar.core.connectionmanager.listener.ConnectionListener removeCl =
pool.removeConnectionListener(null);
if (removeCl != null)
{
try
{
if (ccm != null)
{
for (Object c : removeCl.getConnections())
{
ccm.unregisterConnection(this, removeCl, c);
}
}
returnConnectionListener(removeCl, true);
cl = pool.getConnectionListener(credential);
}
catch (ResourceException ire)
{
// Nothing we can do
}
}
else
{
if (getTransactionSupport() == TransactionSupportLevel.NoTransaction)
{
org.ironjacamar.core.connectionmanager.listener.ConnectionListener targetCl =
pool.removeConnectionListener(credential);
if (targetCl != null)
{
if (targetCl.getManagedConnection() instanceof DissociatableManagedConnection)
{
DissociatableManagedConnection dmc =
(DissociatableManagedConnection)targetCl.getManagedConnection();
if (ccm != null)
{
for (Object c : targetCl.getConnections())
{
ccm.unregisterConnection(this, targetCl, c);
}
}
dmc.dissociateConnections();
targetCl.clearConnections();
cl = targetCl;
}
else
{
try
{
if (ccm != null)
{
for (Object c : targetCl.getConnections())
{
ccm.unregisterConnection(this, targetCl, c);
}
}
returnConnectionListener(targetCl, true);
cl = pool.getConnectionListener(credential);
}
catch (ResourceException ire)
{
// Nothing we can do
}
}
}
}
}
}
}
if (cl == null)
throw new ResourceException();
if (connection != null)
{
// Associate managed connection with the connection
cl.getManagedConnection().associateConnection(connection);
cl.addConnection(connection);
if (ccm != null)
{
ccm.registerConnection(this, cl, connection);
}
}
return cl;
} | java | private org.ironjacamar.core.connectionmanager.listener.ConnectionListener
associateConnectionListener(Credential credential, Object connection)
throws ResourceException
{
log.tracef("associateConnectionListener(%s, %s)", credential, connection);
if (isShutdown())
{
throw new ResourceException();
}
if (!cmConfiguration.isSharable())
throw new ResourceException();
org.ironjacamar.core.connectionmanager.listener.ConnectionListener cl =
pool.getActiveConnectionListener(credential);
if (cl == null)
{
if (!pool.isFull())
{
try
{
cl = pool.getConnectionListener(credential);
}
catch (ResourceException re)
{
// Ignore
}
}
if (cl == null)
{
org.ironjacamar.core.connectionmanager.listener.ConnectionListener removeCl =
pool.removeConnectionListener(null);
if (removeCl != null)
{
try
{
if (ccm != null)
{
for (Object c : removeCl.getConnections())
{
ccm.unregisterConnection(this, removeCl, c);
}
}
returnConnectionListener(removeCl, true);
cl = pool.getConnectionListener(credential);
}
catch (ResourceException ire)
{
// Nothing we can do
}
}
else
{
if (getTransactionSupport() == TransactionSupportLevel.NoTransaction)
{
org.ironjacamar.core.connectionmanager.listener.ConnectionListener targetCl =
pool.removeConnectionListener(credential);
if (targetCl != null)
{
if (targetCl.getManagedConnection() instanceof DissociatableManagedConnection)
{
DissociatableManagedConnection dmc =
(DissociatableManagedConnection)targetCl.getManagedConnection();
if (ccm != null)
{
for (Object c : targetCl.getConnections())
{
ccm.unregisterConnection(this, targetCl, c);
}
}
dmc.dissociateConnections();
targetCl.clearConnections();
cl = targetCl;
}
else
{
try
{
if (ccm != null)
{
for (Object c : targetCl.getConnections())
{
ccm.unregisterConnection(this, targetCl, c);
}
}
returnConnectionListener(targetCl, true);
cl = pool.getConnectionListener(credential);
}
catch (ResourceException ire)
{
// Nothing we can do
}
}
}
}
}
}
}
if (cl == null)
throw new ResourceException();
if (connection != null)
{
// Associate managed connection with the connection
cl.getManagedConnection().associateConnection(connection);
cl.addConnection(connection);
if (ccm != null)
{
ccm.registerConnection(this, cl, connection);
}
}
return cl;
} | [
"private",
"org",
".",
"ironjacamar",
".",
"core",
".",
"connectionmanager",
".",
"listener",
".",
"ConnectionListener",
"associateConnectionListener",
"(",
"Credential",
"credential",
",",
"Object",
"connection",
")",
"throws",
"ResourceException",
"{",
"log",
".",
... | Associate a ConnectionListener
@param credential The credential
@param connection The connection handle (optional)
@return The connection listener instance
@exception ResourceException Thrown in case of an error | [
"Associate",
"a",
"ConnectionListener"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/AbstractConnectionManager.java#L520-L645 |
135,190 | ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/AbstractTransactionalConnectionManager.java | AbstractTransactionalConnectionManager.shouldEnlist | private boolean shouldEnlist(ConnectionListener cl)
{
if (cmConfiguration.isEnlistment() && cl.getManagedConnection() instanceof LazyEnlistableManagedConnection)
return false;
return true;
} | java | private boolean shouldEnlist(ConnectionListener cl)
{
if (cmConfiguration.isEnlistment() && cl.getManagedConnection() instanceof LazyEnlistableManagedConnection)
return false;
return true;
} | [
"private",
"boolean",
"shouldEnlist",
"(",
"ConnectionListener",
"cl",
")",
"{",
"if",
"(",
"cmConfiguration",
".",
"isEnlistment",
"(",
")",
"&&",
"cl",
".",
"getManagedConnection",
"(",
")",
"instanceof",
"LazyEnlistableManagedConnection",
")",
"return",
"false",
... | Should enlist the ConnectionListener
@param cl The ConnectionListener
@return True if enlist, otherwise false | [
"Should",
"enlist",
"the",
"ConnectionListener"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/AbstractTransactionalConnectionManager.java#L140-L146 |
135,191 | ironjacamar/ironjacamar | web/src/main/java/org/ironjacamar/web/SecurityActions.java | SecurityActions.createWARClassLoader | static WARClassLoader createWARClassLoader(final Kernel kernel, final ClassLoader parent)
{
return AccessController.doPrivileged(new PrivilegedAction<WARClassLoader>()
{
public WARClassLoader run()
{
return new WARClassLoader(kernel, parent);
}
});
} | java | static WARClassLoader createWARClassLoader(final Kernel kernel, final ClassLoader parent)
{
return AccessController.doPrivileged(new PrivilegedAction<WARClassLoader>()
{
public WARClassLoader run()
{
return new WARClassLoader(kernel, parent);
}
});
} | [
"static",
"WARClassLoader",
"createWARClassLoader",
"(",
"final",
"Kernel",
"kernel",
",",
"final",
"ClassLoader",
"parent",
")",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"WARClassLoader",
">",
"(",
")",
"{",
"pu... | Create a WARClassLoader
@param kernel The kernel
@param parent The parent class loader
@return The class loader | [
"Create",
"a",
"WARClassLoader"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/SecurityActions.java#L135-L144 |
135,192 | ironjacamar/ironjacamar | web/src/main/java/org/ironjacamar/web/SecurityActions.java | SecurityActions.createWebAppClassLoader | static WebAppClassLoader createWebAppClassLoader(final ClassLoader cl, final WebAppContext wac)
{
return AccessController.doPrivileged(new PrivilegedAction<WebAppClassLoader>()
{
public WebAppClassLoader run()
{
try
{
return new WebAppClassLoader(cl, wac);
}
catch (IOException ioe)
{
return null;
}
}
});
} | java | static WebAppClassLoader createWebAppClassLoader(final ClassLoader cl, final WebAppContext wac)
{
return AccessController.doPrivileged(new PrivilegedAction<WebAppClassLoader>()
{
public WebAppClassLoader run()
{
try
{
return new WebAppClassLoader(cl, wac);
}
catch (IOException ioe)
{
return null;
}
}
});
} | [
"static",
"WebAppClassLoader",
"createWebAppClassLoader",
"(",
"final",
"ClassLoader",
"cl",
",",
"final",
"WebAppContext",
"wac",
")",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"WebAppClassLoader",
">",
"(",
")",
"... | Create a WebClassLoader
@param cl The classloader
@param wac The web app context
@return The class loader | [
"Create",
"a",
"WebClassLoader"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/SecurityActions.java#L152-L168 |
135,193 | ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java | BaseProfile.generateRaCode | void generateRaCode(Definition def)
{
if (def.isUseRa())
{
generateClassCode(def, "Ra");
generateClassCode(def, "RaMeta");
}
if (def.isGenAdminObject())
{
for (int i = 0; i < def.getAdminObjects().size(); i++)
{
generateMultiAdminObjectClassCode(def, "AoImpl", i);
generateMultiAdminObjectClassCode(def, "AoInterface", i);
}
}
} | java | void generateRaCode(Definition def)
{
if (def.isUseRa())
{
generateClassCode(def, "Ra");
generateClassCode(def, "RaMeta");
}
if (def.isGenAdminObject())
{
for (int i = 0; i < def.getAdminObjects().size(); i++)
{
generateMultiAdminObjectClassCode(def, "AoImpl", i);
generateMultiAdminObjectClassCode(def, "AoInterface", i);
}
}
} | [
"void",
"generateRaCode",
"(",
"Definition",
"def",
")",
"{",
"if",
"(",
"def",
".",
"isUseRa",
"(",
")",
")",
"{",
"generateClassCode",
"(",
"def",
",",
"\"Ra\"",
")",
";",
"generateClassCode",
"(",
"def",
",",
"\"RaMeta\"",
")",
";",
"}",
"if",
"(",
... | generate resource adapter code
@param def Definition | [
"generate",
"resource",
"adapter",
"code"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java#L116-L131 |
135,194 | ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java | BaseProfile.generateOutboundCode | void generateOutboundCode(Definition def)
{
if (def.isSupportOutbound())
{
if (def.getMcfDefs() == null)
throw new IllegalStateException("Should define at least one mcf class");
for (int num = 0; num < def.getMcfDefs().size(); num++)
{
generateMultiMcfClassCode(def, "Mcf", num);
generateMultiMcfClassCode(def, "Mc", num);
generateMultiMcfClassCode(def, "McMeta", num);
if (!def.getMcfDefs().get(num).isUseCciConnection())
{
generateMultiMcfClassCode(def, "CfInterface", num);
generateMultiMcfClassCode(def, "Cf", num);
generateMultiMcfClassCode(def, "ConnInterface", num);
generateMultiMcfClassCode(def, "ConnImpl", num);
}
else
{
generateMultiMcfClassCode(def, "CciConn", num);
generateMultiMcfClassCode(def, "CciConnFactory", num);
generateMultiMcfClassCode(def, "ConnMeta", num);
generateMultiMcfClassCode(def, "ConnSpec", num);
}
}
}
} | java | void generateOutboundCode(Definition def)
{
if (def.isSupportOutbound())
{
if (def.getMcfDefs() == null)
throw new IllegalStateException("Should define at least one mcf class");
for (int num = 0; num < def.getMcfDefs().size(); num++)
{
generateMultiMcfClassCode(def, "Mcf", num);
generateMultiMcfClassCode(def, "Mc", num);
generateMultiMcfClassCode(def, "McMeta", num);
if (!def.getMcfDefs().get(num).isUseCciConnection())
{
generateMultiMcfClassCode(def, "CfInterface", num);
generateMultiMcfClassCode(def, "Cf", num);
generateMultiMcfClassCode(def, "ConnInterface", num);
generateMultiMcfClassCode(def, "ConnImpl", num);
}
else
{
generateMultiMcfClassCode(def, "CciConn", num);
generateMultiMcfClassCode(def, "CciConnFactory", num);
generateMultiMcfClassCode(def, "ConnMeta", num);
generateMultiMcfClassCode(def, "ConnSpec", num);
}
}
}
} | [
"void",
"generateOutboundCode",
"(",
"Definition",
"def",
")",
"{",
"if",
"(",
"def",
".",
"isSupportOutbound",
"(",
")",
")",
"{",
"if",
"(",
"def",
".",
"getMcfDefs",
"(",
")",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Should de... | generate outbound code
@param def Definition | [
"generate",
"outbound",
"code"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java#L138-L167 |
135,195 | ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java | BaseProfile.generateInboundCode | void generateInboundCode(Definition def)
{
if (def.isSupportInbound())
{
if (def.isDefaultPackageInbound())
generateClassCode(def, "Ml", "inflow");
generateClassCode(def, "As", "inflow");
generateClassCode(def, "Activation", "inflow");
generatePackageInfo(def, "main", "inflow");
}
} | java | void generateInboundCode(Definition def)
{
if (def.isSupportInbound())
{
if (def.isDefaultPackageInbound())
generateClassCode(def, "Ml", "inflow");
generateClassCode(def, "As", "inflow");
generateClassCode(def, "Activation", "inflow");
generatePackageInfo(def, "main", "inflow");
}
} | [
"void",
"generateInboundCode",
"(",
"Definition",
"def",
")",
"{",
"if",
"(",
"def",
".",
"isSupportInbound",
"(",
")",
")",
"{",
"if",
"(",
"def",
".",
"isDefaultPackageInbound",
"(",
")",
")",
"generateClassCode",
"(",
"def",
",",
"\"Ml\"",
",",
"\"inflo... | generate inbound code
@param def Definition | [
"generate",
"inbound",
"code"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java#L174-L184 |
135,196 | ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java | BaseProfile.generateMBeanCode | void generateMBeanCode(Definition def)
{
if (def.isSupportOutbound())
{
generateClassCode(def, "MbeanInterface", "mbean");
generateClassCode(def, "MbeanImpl", "mbean");
generatePackageInfo(def, "main", "mbean");
}
} | java | void generateMBeanCode(Definition def)
{
if (def.isSupportOutbound())
{
generateClassCode(def, "MbeanInterface", "mbean");
generateClassCode(def, "MbeanImpl", "mbean");
generatePackageInfo(def, "main", "mbean");
}
} | [
"void",
"generateMBeanCode",
"(",
"Definition",
"def",
")",
"{",
"if",
"(",
"def",
".",
"isSupportOutbound",
"(",
")",
")",
"{",
"generateClassCode",
"(",
"def",
",",
"\"MbeanInterface\"",
",",
"\"mbean\"",
")",
";",
"generateClassCode",
"(",
"def",
",",
"\"... | generate MBean code
@param def Definition | [
"generate",
"MBean",
"code"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java#L191-L199 |
135,197 | ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java | BaseProfile.generateClassCode | void generateClassCode(Definition def, String className, String subDir)
{
if (className == null || className.equals(""))
return;
try
{
String clazzName = this.getClass().getPackage().getName() + ".code." + className + "CodeGen";
String javaFile =
Definition.class.getMethod("get" + className + "Class").invoke(def, (Object[]) null) + ".java";
FileWriter fw;
if (subDir == null)
fw = Utils.createSrcFile(javaFile, def.getRaPackage(), def.getOutputDir());
else
fw = Utils.createSrcFile(javaFile, def.getRaPackage() + "." + subDir, def.getOutputDir());
Class<?> clazz = Class.forName(clazzName, true, Thread.currentThread().getContextClassLoader());
AbstractCodeGen codeGen = (AbstractCodeGen) clazz.newInstance();
codeGen.generate(def, fw);
fw.flush();
fw.close();
}
catch (Exception e)
{
e.printStackTrace();
}
} | java | void generateClassCode(Definition def, String className, String subDir)
{
if (className == null || className.equals(""))
return;
try
{
String clazzName = this.getClass().getPackage().getName() + ".code." + className + "CodeGen";
String javaFile =
Definition.class.getMethod("get" + className + "Class").invoke(def, (Object[]) null) + ".java";
FileWriter fw;
if (subDir == null)
fw = Utils.createSrcFile(javaFile, def.getRaPackage(), def.getOutputDir());
else
fw = Utils.createSrcFile(javaFile, def.getRaPackage() + "." + subDir, def.getOutputDir());
Class<?> clazz = Class.forName(clazzName, true, Thread.currentThread().getContextClassLoader());
AbstractCodeGen codeGen = (AbstractCodeGen) clazz.newInstance();
codeGen.generate(def, fw);
fw.flush();
fw.close();
}
catch (Exception e)
{
e.printStackTrace();
}
} | [
"void",
"generateClassCode",
"(",
"Definition",
"def",
",",
"String",
"className",
",",
"String",
"subDir",
")",
"{",
"if",
"(",
"className",
"==",
"null",
"||",
"className",
".",
"equals",
"(",
"\"\"",
")",
")",
"return",
";",
"try",
"{",
"String",
"cla... | generate class code
@param def Definition
@param className class name
@param subDir sub-directory name | [
"generate",
"class",
"code"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java#L219-L247 |
135,198 | ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java | BaseProfile.generateMultiMcfClassCode | void generateMultiMcfClassCode(Definition def, String className, int num)
{
if (className == null || className.equals(""))
return;
if (num < 0 || num + 1 > def.getMcfDefs().size())
return;
try
{
String clazzName = this.getClass().getPackage().getName() + ".code." + className + "CodeGen";
String javaFile =
McfDef.class.getMethod("get" + className + "Class").invoke(def.getMcfDefs().get(num), (Object[]) null)
+ ".java";
FileWriter fw;
fw = Utils.createSrcFile(javaFile, def.getRaPackage(), def.getOutputDir());
Class<?> clazz = Class.forName(clazzName, true, Thread.currentThread().getContextClassLoader());
AbstractCodeGen codeGen = (AbstractCodeGen) clazz.newInstance();
codeGen.setNumOfMcf(num);
codeGen.generate(def, fw);
fw.flush();
fw.close();
}
catch (Exception e)
{
e.printStackTrace();
}
} | java | void generateMultiMcfClassCode(Definition def, String className, int num)
{
if (className == null || className.equals(""))
return;
if (num < 0 || num + 1 > def.getMcfDefs().size())
return;
try
{
String clazzName = this.getClass().getPackage().getName() + ".code." + className + "CodeGen";
String javaFile =
McfDef.class.getMethod("get" + className + "Class").invoke(def.getMcfDefs().get(num), (Object[]) null)
+ ".java";
FileWriter fw;
fw = Utils.createSrcFile(javaFile, def.getRaPackage(), def.getOutputDir());
Class<?> clazz = Class.forName(clazzName, true, Thread.currentThread().getContextClassLoader());
AbstractCodeGen codeGen = (AbstractCodeGen) clazz.newInstance();
codeGen.setNumOfMcf(num);
codeGen.generate(def, fw);
fw.flush();
fw.close();
}
catch (Exception e)
{
e.printStackTrace();
}
} | [
"void",
"generateMultiMcfClassCode",
"(",
"Definition",
"def",
",",
"String",
"className",
",",
"int",
"num",
")",
"{",
"if",
"(",
"className",
"==",
"null",
"||",
"className",
".",
"equals",
"(",
"\"\"",
")",
")",
"return",
";",
"if",
"(",
"num",
"<",
... | generate multi mcf class code
@param def Definition
@param className class name
@param num number of order | [
"generate",
"multi",
"mcf",
"class",
"code"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java#L256-L286 |
135,199 | ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java | BaseProfile.generateMultiAdminObjectClassCode | void generateMultiAdminObjectClassCode(Definition def, String className, int num)
{
if (className == null || className.equals(""))
return;
try
{
String clazzName = this.getClass().getPackage().getName() + ".code." + className + "CodeGen";
Class<?> clazz = Class.forName(clazzName, true, Thread.currentThread().getContextClassLoader());
AbstractCodeGen codeGen = (AbstractCodeGen) clazz.newInstance();
String javaFile = "";
if (codeGen instanceof AoImplCodeGen)
{
((AoImplCodeGen) codeGen).setNumOfAo(num);
javaFile = def.getAdminObjects().get(num).getAdminObjectClass() + ".java";
}
else if (codeGen instanceof AoInterfaceCodeGen)
{
((AoInterfaceCodeGen) codeGen).setNumOfAo(num);
javaFile = def.getAdminObjects().get(num).getAdminObjectInterface() + ".java";
}
FileWriter fw = Utils.createSrcFile(javaFile, def.getRaPackage(), def.getOutputDir());
codeGen.generate(def, fw);
fw.flush();
fw.close();
}
catch (Exception e)
{
e.printStackTrace();
}
} | java | void generateMultiAdminObjectClassCode(Definition def, String className, int num)
{
if (className == null || className.equals(""))
return;
try
{
String clazzName = this.getClass().getPackage().getName() + ".code." + className + "CodeGen";
Class<?> clazz = Class.forName(clazzName, true, Thread.currentThread().getContextClassLoader());
AbstractCodeGen codeGen = (AbstractCodeGen) clazz.newInstance();
String javaFile = "";
if (codeGen instanceof AoImplCodeGen)
{
((AoImplCodeGen) codeGen).setNumOfAo(num);
javaFile = def.getAdminObjects().get(num).getAdminObjectClass() + ".java";
}
else if (codeGen instanceof AoInterfaceCodeGen)
{
((AoInterfaceCodeGen) codeGen).setNumOfAo(num);
javaFile = def.getAdminObjects().get(num).getAdminObjectInterface() + ".java";
}
FileWriter fw = Utils.createSrcFile(javaFile, def.getRaPackage(), def.getOutputDir());
codeGen.generate(def, fw);
fw.flush();
fw.close();
}
catch (Exception e)
{
e.printStackTrace();
}
} | [
"void",
"generateMultiAdminObjectClassCode",
"(",
"Definition",
"def",
",",
"String",
"className",
",",
"int",
"num",
")",
"{",
"if",
"(",
"className",
"==",
"null",
"||",
"className",
".",
"equals",
"(",
"\"\"",
")",
")",
"return",
";",
"try",
"{",
"Strin... | generate multi admin object class code
@param def Definition
@param className class name
@param num number of order | [
"generate",
"multi",
"admin",
"object",
"class",
"code"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java#L295-L329 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.