public class AdminService extends WeaveServlet implements IWeaveEntityManagementService
WeaveServlet.ServletRequestInfo
debugThreshold, JSONRPC_VERSION, METHOD, PARAMS, STREAM_PARAMETER_INDEX
Constructor and Description |
---|
AdminService() |
Modifier and Type | Method and Description |
---|---|
int[] |
addChild(int parentId,
int childId,
int insertAtIndex)
Adds a parent-child relationship to the server-side entity hierarchy table.
|
boolean |
authenticate(java.lang.String username,
java.lang.String password) |
boolean |
checkDatabaseConfigExists() |
void |
checkKeyColumnsForCSVImport(java.lang.String csvFile,
java.lang.String[] keyColumns)
Check if selected key column from CSV data has unique values
|
java.lang.Boolean |
checkKeyColumnsForDBFImport(java.lang.String[] fileNames,
java.lang.String[] keyColumnNames) |
void |
checkKeyColumnsForSQLImport(java.lang.String schemaName,
java.lang.String tableName,
java.lang.String[] keyColumns) |
void |
destroy() |
int[] |
findEntityIds(java.util.Map<java.lang.String,java.lang.String> publicMetadata,
java.lang.String[] wildcardFields)
Gets an Array of entity IDs with matching public metadata.
|
java.lang.String[] |
findPublicFieldValues(java.lang.String fieldName,
java.lang.String valueSearch)
Finds matching values for a public metadata field.
|
ConnectionConfig.ConnectionInfo |
getConnectionInfo(java.lang.String userToGet) |
java.lang.String[] |
getConnectionNames() |
java.lang.String[] |
getCSVColumnNames(java.lang.String csvFile)
Read a list of csv files and return common header columns.
|
ConnectionConfig.DatabaseConfigInfo |
getDatabaseConfigInfo() |
java.lang.String[] |
getDBFColumnNames(java.lang.String[] dbfFileNames) |
DataConfig.DataEntityWithRelationships[] |
getEntities(int[] ids)
Gets an Array of Entity objects.
|
DataConfig.EntityHierarchyInfo[] |
getHierarchyInfo(java.util.Map<java.lang.String,java.lang.String> publicMetadata)
Gets EntityHierarchyInfo objects containing basic information on entities matching public metadata.
|
java.lang.String[] |
getKeyTypes() |
java.lang.String[] |
getSQLColumnNames(java.lang.String schemaName,
java.lang.String tableName) |
java.lang.String[] |
getSQLSchemaNames()
The following functions get information about the database associated with a given connection name.
|
java.lang.String[] |
getSQLTableNames(java.lang.String schemaName) |
WeaveFileInfo[] |
getUploadedCSVFiles() |
WeaveFileInfo[] |
getUploadedSHPFiles() |
java.lang.String |
getVersion() |
WeaveFileInfo |
getWeaveFileInfo(java.lang.String fileName) |
java.lang.String[] |
getWeaveFileNames(java.lang.Boolean showAllFiles)
Return a list of Client Config files from docroot
|
int |
importCSV(java.lang.String csvFile,
java.lang.String csvKeyColumn,
java.lang.String csvSecondaryKeyColumn,
java.lang.String sqlSchema,
java.lang.String sqlTable,
boolean sqlOverwrite,
java.lang.String configDataTableName,
java.lang.String configKeyType,
java.lang.String[] nullValues,
java.lang.String[] filterColumnNames,
boolean configAppend) |
void |
importDBF(java.lang.String[] fileNameWithoutExtension,
java.lang.String sqlSchema,
java.lang.String sqlTableName,
boolean sqlOverwrite,
java.lang.String[] nullValues) |
int |
importSHP(java.lang.String[] fileNameWithoutExtension,
java.lang.String[] keyColumns,
java.lang.String sqlSchema,
java.lang.String sqlTablePrefix,
boolean sqlOverwrite,
java.lang.String configTitle,
java.lang.String configKeyType,
java.lang.String projectionSRS,
java.lang.String[] nullValues,
boolean importDBFData,
boolean append)
The following functions involve getting shapes into the database and into the config file.
|
int |
importSQL(java.lang.String schemaName,
java.lang.String tableName,
java.lang.String keyColumnName,
java.lang.String secondaryKeyColumnName,
java.lang.String configDataTableName,
java.lang.String keyType,
java.lang.String[] filterColumnNames,
boolean append) |
void |
init(javax.servlet.ServletConfig config) |
void |
initializeAdminService()
This function should be the first thing called by the Admin Console to initialize the servlet.
|
void |
keepAlive() |
int |
newEntity(DataConfig.DataEntityMetadata meta,
int parentId,
int insertAtIndex)
Creates a new entity.
|
void |
removeChild(int parentId,
int childId)
Removes a parent-child relationship from the server-side entity hierarchy table.
|
java.lang.String |
removeConnectionInfo(java.lang.String userToRemove) |
int[] |
removeEntities(int[] entityIds)
Removes entities and their children recursively.
|
java.lang.String |
removeWeaveFile(java.lang.String fileName)
Delete a Client Config file from docroot
|
java.lang.String |
saveConnectionInfo(java.lang.String newUser,
java.lang.String newPass,
java.lang.String folderName,
boolean grantSuperuser,
java.lang.String connectString,
boolean configOverwrite) |
java.lang.String |
saveWeaveFile(java.io.InputStream fileContent,
java.lang.String fileName,
boolean overwriteFile) |
java.lang.String |
setDatabaseConfigInfo(java.lang.String connectionName,
java.lang.String password,
java.lang.String schema,
java.lang.String[] idFields) |
DataConfig.DataEntity[] |
testAllQueries(int table_id)
Returns the results of testing attribute column sql queries.
|
void |
updateEntity(int entityId,
DataConfig.DataEntityMetadata diff)
Updates the metadata for an existing entity.
|
void |
uploadFile(java.lang.String fileName,
java.io.InputStream content,
boolean append)
This function accepts an uploaded file.
|
cast, deserializeAmf3, doGet, doPost, getCapabilities, getServletRequestInfo, initAllMethods, initMethod, methodToString, serializeCompressedAmf3
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class WeaveServlet
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
public void initializeAdminService() throws java.rmi.RemoteException
java.rmi.RemoteException
- Thrown when the DataConfig could not be initialized.public java.lang.String getVersion()
public boolean checkDatabaseConfigExists() throws java.rmi.RemoteException
java.rmi.RemoteException
public boolean authenticate(java.lang.String username, java.lang.String password) throws java.rmi.RemoteException
user
- password
- java.rmi.RemoteException
- If authentication fails.public void keepAlive() throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String[] getWeaveFileNames(java.lang.Boolean showAllFiles) throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String saveWeaveFile(java.io.InputStream fileContent, java.lang.String fileName, boolean overwriteFile) throws java.rmi.RemoteException
fileContent
- fileName
- overwriteFile
- java.rmi.RemoteException
public java.lang.String removeWeaveFile(java.lang.String fileName) throws java.rmi.RemoteException, java.lang.IllegalArgumentException
java.rmi.RemoteException
java.lang.IllegalArgumentException
public WeaveFileInfo getWeaveFileInfo(java.lang.String fileName) throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String[] getConnectionNames() throws java.rmi.RemoteException
java.rmi.RemoteException
public ConnectionConfig.ConnectionInfo getConnectionInfo(java.lang.String userToGet) throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String saveConnectionInfo(java.lang.String newUser, java.lang.String newPass, java.lang.String folderName, boolean grantSuperuser, java.lang.String connectString, boolean configOverwrite) throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String removeConnectionInfo(java.lang.String userToRemove) throws java.rmi.RemoteException
java.rmi.RemoteException
public ConnectionConfig.DatabaseConfigInfo getDatabaseConfigInfo() throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String setDatabaseConfigInfo(java.lang.String connectionName, java.lang.String password, java.lang.String schema, java.lang.String[] idFields) throws java.rmi.RemoteException
java.rmi.RemoteException
public int[] addChild(int parentId, int childId, int insertAtIndex) throws java.rmi.RemoteException
IWeaveEntityManagementService
addChild
in interface IWeaveEntityManagementService
parentId
- The ID of the parent entity.childId
- The ID of the child entity.insertAtIndex
- Specifies insertion index for sort order.java.rmi.RemoteException
public void removeChild(int parentId, int childId) throws java.rmi.RemoteException
IWeaveEntityManagementService
removeChild
in interface IWeaveEntityManagementService
parentId
- The ID of the parent entity.childId
- The ID of the child entity.java.rmi.RemoteException
public int newEntity(DataConfig.DataEntityMetadata meta, int parentId, int insertAtIndex) throws java.rmi.RemoteException
IWeaveEntityManagementService
newEntity
in interface IWeaveEntityManagementService
meta
- Metadata for the new entity.parentId
- The parent entity ID, or -1 for no parent.insertAtIndex
- Specifies insertion index for sort order.java.rmi.RemoteException
public int[] removeEntities(int[] entityIds) throws java.rmi.RemoteException
IWeaveEntityManagementService
removeEntities
in interface IWeaveEntityManagementService
entityIds
- A list of entity IDs to remove.java.rmi.RemoteException
public void updateEntity(int entityId, DataConfig.DataEntityMetadata diff) throws java.rmi.RemoteException
IWeaveEntityManagementService
updateEntity
in interface IWeaveEntityManagementService
entityId
- An entity ID.diff
- Specifies the changes to make to the metadata.java.rmi.RemoteException
public DataConfig.EntityHierarchyInfo[] getHierarchyInfo(java.util.Map<java.lang.String,java.lang.String> publicMetadata) throws java.rmi.RemoteException
IWeaveEntityManagementService
getHierarchyInfo
in interface IWeaveEntityManagementService
publicMetadata
- EntityMetadata containing values to match.java.rmi.RemoteException
public DataConfig.DataEntityWithRelationships[] getEntities(int[] ids) throws java.rmi.RemoteException
IWeaveEntityManagementService
getEntities
in interface IWeaveEntityManagementService
ids
- A list of entity IDs.java.rmi.RemoteException
public int[] findEntityIds(java.util.Map<java.lang.String,java.lang.String> publicMetadata, java.lang.String[] wildcardFields) throws java.rmi.RemoteException
IWeaveEntityManagementService
findEntityIds
in interface IWeaveEntityManagementService
publicMetadata
- Public metadata to search for.wildcardFields
- A list of field names in publicMetadata that should be treated
as search strings with wildcards '?' and '*' for single-character
and multi-character matching, respectively.java.rmi.RemoteException
public java.lang.String[] findPublicFieldValues(java.lang.String fieldName, java.lang.String valueSearch) throws java.rmi.RemoteException
IWeaveEntityManagementService
findPublicFieldValues
in interface IWeaveEntityManagementService
fieldName
- The name of the public metadata field to search.valueSearch
- A search string.java.rmi.RemoteException
public java.lang.String[] getSQLSchemaNames() throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String[] getSQLTableNames(java.lang.String schemaName) throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String[] getSQLColumnNames(java.lang.String schemaName, java.lang.String tableName) throws java.rmi.RemoteException
java.rmi.RemoteException
public void uploadFile(java.lang.String fileName, java.io.InputStream content, boolean append) throws java.rmi.RemoteException
fileName
- The name of the file.content
- The file content.append
- Set to true to append to an existing file.java.rmi.RemoteException
public WeaveFileInfo[] getUploadedCSVFiles() throws java.rmi.RemoteException
java.rmi.RemoteException
public WeaveFileInfo[] getUploadedSHPFiles() throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String[] getCSVColumnNames(java.lang.String csvFile) throws java.rmi.RemoteException
csvFile
- A CSV file namejava.rmi.RemoteException
public java.lang.String[] getDBFColumnNames(java.lang.String[] dbfFileNames) throws java.rmi.RemoteException
java.rmi.RemoteException
public void checkKeyColumnsForSQLImport(java.lang.String schemaName, java.lang.String tableName, java.lang.String[] keyColumns) throws java.rmi.RemoteException
java.rmi.RemoteException
public void checkKeyColumnsForCSVImport(java.lang.String csvFile, java.lang.String[] keyColumns) throws java.rmi.RemoteException
csvFile
- The CSV file to checkkeyColumns
- The column names to check for unique valuesjava.rmi.RemoteException
- if the values in the key columns cannot be used to uniquely identify records.public java.lang.Boolean checkKeyColumnsForDBFImport(java.lang.String[] fileNames, java.lang.String[] keyColumnNames) throws java.io.IOException
java.io.IOException
public int importCSV(java.lang.String csvFile, java.lang.String csvKeyColumn, java.lang.String csvSecondaryKeyColumn, java.lang.String sqlSchema, java.lang.String sqlTable, boolean sqlOverwrite, java.lang.String configDataTableName, java.lang.String configKeyType, java.lang.String[] nullValues, java.lang.String[] filterColumnNames, boolean configAppend) throws java.rmi.RemoteException
java.rmi.RemoteException
public int importSQL(java.lang.String schemaName, java.lang.String tableName, java.lang.String keyColumnName, java.lang.String secondaryKeyColumnName, java.lang.String configDataTableName, java.lang.String keyType, java.lang.String[] filterColumnNames, boolean append) throws java.rmi.RemoteException
java.rmi.RemoteException
public int importSHP(java.lang.String[] fileNameWithoutExtension, java.lang.String[] keyColumns, java.lang.String sqlSchema, java.lang.String sqlTablePrefix, boolean sqlOverwrite, java.lang.String configTitle, java.lang.String configKeyType, java.lang.String projectionSRS, java.lang.String[] nullValues, boolean importDBFData, boolean append) throws java.rmi.RemoteException
java.rmi.RemoteException
public void importDBF(java.lang.String[] fileNameWithoutExtension, java.lang.String sqlSchema, java.lang.String sqlTableName, boolean sqlOverwrite, java.lang.String[] nullValues) throws java.rmi.RemoteException
java.rmi.RemoteException
public DataConfig.DataEntity[] testAllQueries(int table_id) throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String[] getKeyTypes() throws java.rmi.RemoteException
java.rmi.RemoteException