org.teiid.adminshell
Class AdminShell

java.lang.Object
  extended by org.teiid.adminshell.AdminShell

public class AdminShell
extends java.lang.Object

Contextual shell wrapper around the AdminAPI, see Admin


Field Summary
protected static java.util.logging.Logger log
           
 
Constructor Summary
AdminShell()
           
 
Method Summary
static void addDataRoleMapping(java.lang.String vdbName, int vdbVersion, java.lang.String policyName, java.lang.String role)
           
static void adminHelp()
           
static void adminHelp(java.lang.String method)
           
static void assignToModel(java.lang.String vdbName, int vdbVersion, java.lang.String modelName, java.lang.String sourceName, java.lang.String translatorName, java.lang.String jndiName)
           
static void cancelRequest(java.lang.String sessionId, long executionId)
           
static void changeVDBConnectionType(java.lang.String vdbName, int vdbVersion, java.lang.String type)
           
static void clearCache(java.lang.String cacheType)
           
static void connectAsAdmin()
           
static void connectAsAdmin(java.lang.String url, java.lang.String username, java.lang.String password, java.lang.String connectionName)
           
static void createDataSource(java.lang.String deploymentName, java.lang.String templateName, java.util.Properties properties)
           
static void deleteDataSource(java.lang.String deployedName)
           
static void deleteVDB(java.lang.String vdbName, int vdbVersion)
           
static void deployVDB(java.lang.String vdbFile)
           
static void disconnect()
           
static void disconnectAll()
           
static Admin getAdmin()
           
static java.util.Collection<java.lang.String> getAllConnections()
           
static CacheStatistics getCacheStats(java.lang.String identifier)
           
static java.util.Collection<java.lang.String> getCacheTypes()
           
static java.lang.String getConnectionName()
           
static java.util.Collection<java.lang.String> getDataSourceNames()
           
static java.util.Set<java.lang.String> getDataSourceTemplateNames()
           
static java.util.Collection<Request> getRequests()
           
static java.util.Collection<Request> getRequestsForSession(java.lang.String sessionId)
           
static java.util.Collection<Session> getSessions()
           
static java.util.Collection<PropertyDefinition> getTemplatePropertyDefinitions(java.lang.String templateName)
           
static java.util.Collection<Transaction> getTransactions()
           
static Translator getTranslator(java.lang.String deployedName)
           
static java.util.Collection<Translator> getTranslators()
           
static VDB getVDB(java.lang.String vdbName, int vbdVersion)
           
static java.util.Set<VDB> getVDBs()
           
static WorkerPoolStatistics getWorkerPoolStats()
           
static boolean hasTranslator(java.lang.String factoryName)
           
static boolean hasVDB(java.lang.String vdbName)
           
static boolean hasVDB(java.lang.String vdbName, int version)
           
static void mergeVDBs(java.lang.String sourceVDBName, int sourceVDBVersion, java.lang.String targetVDBName, int targetVDBVersion)
           
static void removeDataRoleMapping(java.lang.String vdbName, int vdbVersion, java.lang.String policyName, java.lang.String role)
           
static void setAnyAuthenticatedForDataRole(java.lang.String vdbName, int vdbVersion, java.lang.String dataRole, boolean anyAuthenticated)
           
static void terminateSession(java.lang.String sessionId)
           
static void terminateTransaction(java.lang.String transactionId)
           
static void useConnection(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static java.util.logging.Logger log
Constructor Detail

AdminShell

public AdminShell()
Method Detail

connectAsAdmin

@Help.Doc(text="Get a named Admin connection to the specified server")
public static void connectAsAdmin(@Help.Doc(text="url - URL in the format \"mm[s]://host:port\"")
                                               java.lang.String url,
                                               @Help.Doc(text="username")
                                               java.lang.String username,
                                               @Help.Doc(text="password")
                                               java.lang.String password,
                                               @Help.Doc(text="connection name")
                                               java.lang.String connectionName)
                           throws AdminException
Throws:
AdminException

connectAsAdmin

@Help.Doc(text="Connect as Admin using the defaults from connection.properties")
public static void connectAsAdmin()
                           throws AdminException
Throws:
AdminException

addDataRoleMapping

@Help.Doc(text="Adds a mapped role to the specified data role")
public static void addDataRoleMapping(@Help.Doc(text="vdb name")
                                                   java.lang.String vdbName,
                                                   @Help.Doc(text="vdb version")
                                                   int vdbVersion,
                                                   @Help.Doc(text="dataRole name")
                                                   java.lang.String policyName,
                                                   @Help.Doc(text="mapped role name")
                                                   java.lang.String role)
                               throws AdminException
Throws:
AdminException

assignToModel

@Help.Doc(text="Assign a translator and data source to a source Model")
public static void assignToModel(@Help.Doc(text="vdb name")
                                              java.lang.String vdbName,
                                              @Help.Doc(text="vdb version")
                                              int vdbVersion,
                                              @Help.Doc(text="model name")
                                              java.lang.String modelName,
                                              @Help.Doc(text="source name")
                                              java.lang.String sourceName,
                                              @Help.Doc(text="translator name")
                                              java.lang.String translatorName,
                                              @Help.Doc(text="jndi name")
                                              java.lang.String jndiName)
                          throws AdminException
Throws:
AdminException

cancelRequest

@Help.Doc(text="Cancel a request")
public static void cancelRequest(@Help.Doc(text="session id")
                                              java.lang.String sessionId,
                                              @Help.Doc(text="execution id")
                                              long executionId)
                          throws AdminException
Throws:
AdminException

clearCache

@Help.Doc(text="Clear the given cache")
public static void clearCache(@Help.Doc(text="cache type")
                                           java.lang.String cacheType)
                       throws AdminException
Throws:
AdminException

deleteVDB

@Help.Doc(text="Delete a VDB")
public static void deleteVDB(@Help.Doc(text="vdb name")
                                          java.lang.String vdbName,
                                          @Help.Doc(text="vdb version")
                                          int vdbVersion)
                      throws AdminException
Throws:
AdminException

getCacheTypes

@Help.Doc(text="Get all cache type Strings")
public static java.util.Collection<java.lang.String> getCacheTypes()
                                                            throws AdminException
Throws:
AdminException

changeVDBConnectionType

@Help.Doc(text="Change a VDB Connection Type")
public static void changeVDBConnectionType(@Help.Doc(text="vdb name")
                                                        java.lang.String vdbName,
                                                        @Help.Doc(text="vdb version")
                                                        int vdbVersion,
                                                        @Help.Doc(text="Connection Type (NONE, BY_VERSION, or ANY")
                                                        java.lang.String type)
                                    throws AdminException
Throws:
AdminException

getTranslators

@Help.Doc(text="Get all translator instances")
public static java.util.Collection<Translator> getTranslators()
                                                       throws AdminException
Throws:
AdminException

getTranslator

@Help.Doc(text="Get the specified ConnectionFactory")
public static Translator getTranslator(@Help.Doc(text="deployed name")
                                                    java.lang.String deployedName)
                                throws AdminException
Throws:
AdminException

getTemplatePropertyDefinitions

@Help.Doc(text="Get all PropertyDefinitions for the given template")
public static java.util.Collection<PropertyDefinition> getTemplatePropertyDefinitions(@Help.Doc(text="template name")
                                                                                                   java.lang.String templateName)
                                                                               throws AdminException
Throws:
AdminException

getRequests

@Help.Doc(text="Get all Request instances")
public static java.util.Collection<Request> getRequests()
                                                 throws AdminException
Throws:
AdminException

getRequestsForSession

@Help.Doc(text="Get all Request instances for the given session")
public static java.util.Collection<Request> getRequestsForSession(@Help.Doc(text="session id")
                                                                               java.lang.String sessionId)
                                                           throws AdminException
Throws:
AdminException

getSessions

@Help.Doc(text="Get all Session instances")
public static java.util.Collection<Session> getSessions()
                                                 throws AdminException
Throws:
AdminException

getTransactions

@Help.Doc(text="Get all Transaction instances")
public static java.util.Collection<Transaction> getTransactions()
                                                         throws AdminException
Throws:
AdminException

getVDB

@Help.Doc(text="Get a specific VDB")
public static VDB getVDB(@Help.Doc(text="vdb name")
                                      java.lang.String vdbName,
                                      @Help.Doc(text="vdb version")
                                      int vbdVersion)
                  throws AdminException
Throws:
AdminException

getVDBs

@Help.Doc(text="Get all VDB instances")
public static java.util.Set<VDB> getVDBs()
                                  throws AdminException
Throws:
AdminException

getWorkerPoolStats

@Help.Doc(text="Get thread pool statistics for Teiid")
public static WorkerPoolStatistics getWorkerPoolStats()
                                               throws AdminException
Throws:
AdminException

getCacheStats

@Help.Doc(text="Get cache statistics for given cache type")
public static CacheStatistics getCacheStats(@Help.Doc(text="cacheType")
                                                         java.lang.String identifier)
                                     throws AdminException
Throws:
AdminException

removeDataRoleMapping

@Help.Doc(text="Remove a mapped role for the data role")
public static void removeDataRoleMapping(@Help.Doc(text="vdb name")
                                                      java.lang.String vdbName,
                                                      @Help.Doc(text="vdb version")
                                                      int vdbVersion,
                                                      @Help.Doc(text="dataRole name")
                                                      java.lang.String policyName,
                                                      @Help.Doc(text="mapped role name")
                                                      java.lang.String role)
                                  throws AdminException
Throws:
AdminException

setAnyAuthenticatedForDataRole

@Help.Doc(text="Set the any authenticated flag for the data role")
public static void setAnyAuthenticatedForDataRole(@Help.Doc(text="vdb name")
                                                               java.lang.String vdbName,
                                                               @Help.Doc(text="vdb version")
                                                               int vdbVersion,
                                                               @Help.Doc(text="dataRole name")
                                                               java.lang.String dataRole,
                                                               @Help.Doc(text="any authenticated")
                                                               boolean anyAuthenticated)
                                           throws AdminException
Throws:
AdminException

terminateSession

@Help.Doc(text="Terminate a session and associated requests")
public static void terminateSession(@Help.Doc(text="session id")
                                                 java.lang.String sessionId)
                             throws AdminException
Throws:
AdminException

terminateTransaction

@Help.Doc(text="Terminate a transaction")
public static void terminateTransaction(@Help.Doc(text="transaction id")
                                                     java.lang.String transactionId)
                                 throws AdminException
Throws:
AdminException

mergeVDBs

@Help.Doc(text="Merge two vdbs")
public static void mergeVDBs(@Help.Doc(text="source vdb name")
                                          java.lang.String sourceVDBName,
                                          @Help.Doc(text="source vdb version")
                                          int sourceVDBVersion,
                                          @Help.Doc(text="target vdb name")
                                          java.lang.String targetVDBName,
                                          @Help.Doc(text="target vdb version")
                                          int targetVDBVersion)
                      throws AdminException
Throws:
AdminException

hasTranslator

@Help.Doc(text="Checks if a translator exists")
public static boolean hasTranslator(@Help.Doc(text="deployed name")
                                                 java.lang.String factoryName)
                             throws AdminException
Throws:
AdminException

hasVDB

@Help.Doc(text="Checks if a VDB exists")
public static boolean hasVDB(@Help.Doc(text="vdb name")
                                          java.lang.String vdbName)
                      throws AdminException
Throws:
AdminException

hasVDB

@Help.Doc(text="Checks if a specific VDB version exists")
public static boolean hasVDB(@Help.Doc(text="vdb name")
                                          java.lang.String vdbName,
                                          @Help.Doc(text="vdb version")
                                          int version)
                      throws AdminException
Throws:
AdminException

deployVDB

@Help.Doc(text="Deploy a VDB from file")
public static void deployVDB(@Help.Doc(text="file name")
                                          java.lang.String vdbFile)
                      throws AdminException,
                             java.io.FileNotFoundException
Throws:
AdminException
java.io.FileNotFoundException

createDataSource

@Help.Doc(text="Create a data source from supplied properties")
public static void createDataSource(@Help.Doc(text="deployed name")
                                                 java.lang.String deploymentName,
                                                 @Help.Doc(text="template name")
                                                 java.lang.String templateName,
                                                 @Help.Doc(text="properties")
                                                 java.util.Properties properties)
                             throws AdminException
Throws:
AdminException

deleteDataSource

@Help.Doc(text="Delete data source")
public static void deleteDataSource(@Help.Doc(text="deployed name")
                                                 java.lang.String deployedName)
                             throws AdminException
Throws:
AdminException

getDataSourceNames

@Help.Doc(text="Available data sources")
public static java.util.Collection<java.lang.String> getDataSourceNames()
                                                                 throws AdminException
Throws:
AdminException

getDataSourceTemplateNames

@Help.Doc(text="Available data source template names")
public static java.util.Set<java.lang.String> getDataSourceTemplateNames()
                                                                  throws AdminException
Throws:
AdminException

getAdmin

@Help.Doc(text="Get the current org.teiid.adminapi.Admin instance for direct use. Note: Used for advanced usecases to bypass AdminShell methods")
public static Admin getAdmin()

disconnect

@Help.Doc(text="Disconnect the current connection for the server")
public static void disconnect()

disconnectAll

@Help.Doc(text="Disconnect all connections from the server")
public static void disconnectAll()

useConnection

@Help.Doc(text="Use another connection")
public static void useConnection(@Help.Doc(text="connection name")
                                              java.lang.String name)

getConnectionName

@Help.Doc(text="Returns the current connection name")
public static java.lang.String getConnectionName()

getAllConnections

@Help.Doc(text="Return all connection names")
public static java.util.Collection<java.lang.String> getAllConnections()

adminHelp

@Help.Doc(text="Show help for all admin methods")
public static void adminHelp()

adminHelp

@Help.Doc(text="Show help for the given admin method")
public static void adminHelp(@Help.Doc(text="method name")
                                          java.lang.String method)


Copyright © 2010. All Rights Reserved.