public class JarUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private DataDictionary |
dd |
private DataDescriptorGenerator |
ddg |
private FileResource |
fr |
private LanguageConnectionContext |
lcc |
private java.lang.String |
schemaName |
private java.lang.String |
sqlName |
Modifier | Constructor and Description |
---|---|
private |
JarUtil(LanguageConnectionContext lcc,
java.lang.String schemaName,
java.lang.String sqlName) |
Modifier and Type | Method and Description |
---|---|
private long |
add(java.io.InputStream is)
Add a jar file to the current connection's database.
|
private void |
drop()
Drop a jar file from the current connection's database.
|
static void |
drop(LanguageConnectionContext lcc,
java.lang.String schemaName,
java.lang.String sqlName)
Drop a jar file from the current connection's database.
|
private static Context |
getContextOrNull(java.lang.String contextID)
Privileged lookup of a Context.
|
private FileInfoDescriptor |
getInfo()
Get the FileInfoDescriptor for the Jar file or null if it does not exist.
|
static long |
install(LanguageConnectionContext lcc,
java.lang.String schemaName,
java.lang.String sqlName,
java.lang.String externalPath)
install a jar file to the current connection's database.
|
static java.lang.String |
mkExternalName(UUID id,
java.lang.String schemaName,
java.lang.String sqlName,
char separatorChar)
Make an external name for a jar file stored in the database.
|
private static java.lang.String |
mkExternalNameInternal(UUID id,
java.lang.String schemaName,
java.lang.String sqlName,
char separatorChar,
boolean upgrading,
boolean newStyle) |
private void |
notifyLoader(boolean reload) |
private static java.io.InputStream |
openJarURL(java.lang.String externalPath)
Open an input stream to read a URL or a file.
|
private long |
replace(java.io.InputStream is)
Replace a jar file in the current connection's database with the
content of an external file.
|
static long |
replace(LanguageConnectionContext lcc,
java.lang.String schemaName,
java.lang.String sqlName,
java.lang.String externalPath)
Replace a jar file from the current connection's database with the content of an
external file.
|
private long |
setJar(java.lang.String jarExternalName,
java.io.InputStream contents,
boolean add,
long currentGenerationId)
Copy the jar from the externally obtained
input stream into the database
|
static void |
upgradeJar(TransactionController tc,
FileInfoDescriptor fid)
Upgrade code: upgrade one jar file to new style (>= 10.9)
|
private LanguageConnectionContext lcc
private java.lang.String schemaName
private java.lang.String sqlName
private FileResource fr
private DataDictionary dd
private DataDescriptorGenerator ddg
private JarUtil(LanguageConnectionContext lcc, java.lang.String schemaName, java.lang.String sqlName) throws StandardException
StandardException
public static long install(LanguageConnectionContext lcc, java.lang.String schemaName, java.lang.String sqlName, java.lang.String externalPath) throws StandardException
schemaName
- the name for the schema that holds the jar file.sqlName
- the sql name for the jar file.externalPath
- the path for the jar file to add.StandardException
- Oppsprivate long add(java.io.InputStream is) throws StandardException
The reason for adding the jar file in this private instance method is that it allows us to share set up logic with drop and replace.
is
- A stream for reading the content of the file to add.StandardException
- Oppspublic static void drop(LanguageConnectionContext lcc, java.lang.String schemaName, java.lang.String sqlName) throws StandardException
schemaName
- the name for the schema that holds the jar file.sqlName
- the sql name for the jar file.StandardException
- Oppsprivate void drop() throws StandardException
The reason for dropping the jar file in this private instance method is that it allows us to share set up logic with add and replace.
StandardException
- Oppspublic static long replace(LanguageConnectionContext lcc, java.lang.String schemaName, java.lang.String sqlName, java.lang.String externalPath) throws StandardException
schemaName
- the name for the schema that holds the jar file.sqlName
- the sql name for the jar file.externalPath
- the path for the jar file to add.StandardException
- Oppsprivate long replace(java.io.InputStream is) throws StandardException
The reason for adding the jar file in this private instance method is that it allows us to share set up logic with add and drop.
is
- An input stream for reading the new content of the jar file.StandardException
- Oppsprivate FileInfoDescriptor getInfo() throws StandardException
StandardException
- Ooopsprivate void notifyLoader(boolean reload) throws StandardException
StandardException
private static java.io.InputStream openJarURL(java.lang.String externalPath) throws java.io.IOException
java.io.IOException
private long setJar(java.lang.String jarExternalName, java.io.InputStream contents, boolean add, long currentGenerationId) throws StandardException
jarExternalName
- Name of jar with database structure.contents
- Contents of jar file.add
- true to add, false to replacecurrentGenerationId
- generation id of existing version, ignored when adding.StandardException
public static java.lang.String mkExternalName(UUID id, java.lang.String schemaName, java.lang.String sqlName, char separatorChar) throws StandardException
StandardException
private static java.lang.String mkExternalNameInternal(UUID id, java.lang.String schemaName, java.lang.String sqlName, char separatorChar, boolean upgrading, boolean newStyle) throws StandardException
StandardException
public static void upgradeJar(TransactionController tc, FileInfoDescriptor fid) throws StandardException
tc
- transaction controllerfid
- the jar file to be upgradedStandardException
private static Context getContextOrNull(java.lang.String contextID)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.