public class HttpService extends Service implements csbase.remote.HttpServiceInterface
HttpService implementa o serviço de download e upload
de arquivos. Cada requisicao de dowload e' inserida na requestList, para um
usuario, projeto e filePath Nulo, alem de a data de criacao do registro. O
filePath e' nulo no download pois o arquivo pode ter referencias para outros
arquivos que possuem caminhos distintos, sendo que estes precisam de um mesmo
codigo de acesso.| Modifier | Constructor and Description |
|---|---|
protected |
HttpService()
Construtor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
createFile(String accessCode,
String fileName) |
static void |
createService()
Constrói a instância do serviço.
|
boolean |
finishUpload(String accessCode,
String fileName)
Remove o upload da lista de requisicoes e informa que o arquivo nao esta'
mais em construcao, se foi um upload de arquivo de projeto.
|
String |
getDownloadCSVURL(Object userId,
String password,
String text)
Pega a URL que será chamada pelo browser quando o tipo de dowload for CSV.
|
String |
getDownloadCSVURL(Object userId,
String password,
String text,
String fileName)
Pega a URL que será chamada pelo browser quando o tipo de dowload for CSV.
|
String |
getDownloadCSVURL(String text)
Pega a URL que será chamada pelo browser quando o tipo de dowload for CSV.
|
String |
getDownloadCSVURL(String text,
String fileName)
Pega a URL que será chamada pelo browser quando o tipo de dowload for CSV.
|
String |
getDownloadPDFReportURL(String filePath,
Map<String,String> parameters,
String jdbcDriverClassName,
String jdbcURL,
String jdbcUser,
String jdbcPassword)
Obtém a URL para a exibição de um relatório no formato pdf em um navegador
web.
|
String |
getDownloadTextURL(Object userId,
String password,
String text) |
String |
getDownloadTextURL(Object userId,
String password,
String text,
String fileName) |
String |
getDownloadTextURL(String text)
Pega a URL que será chamada pelo browser quando o tipo de dowload for
TEXTO.
|
int |
getDownloadType(String accessCode) |
String |
getDownloadURL(Object userId,
String password,
Object projectId,
String[] filePath) |
String |
getDownloadURL(String filePath)
Obtem a url para download do arquivo.
|
String |
getDownloadURL(String filePath,
Map<String,String> parameters)
Obtem a url para download do arquivo.
|
String |
getFileDownloadURL(String filePath)
Obtém uma URL para exibição de um arquivo do sistema de arquivos (NFS) em
um navegador web.
|
String |
getFilePath(String accessCode) |
String |
getFilePath(String accessCode,
String filePath) |
String |
getFileType(String accessCode,
String filePath) |
static HttpService |
getInstance()
Obtém a instância do serviço.
|
String |
getJdbcDriverClassName(String accessCode) |
String |
getJdbcPassword(String accessCode) |
String |
getJdbcURL(String accessCode) |
String |
getJdbcUser(String accessCode) |
Map<String,String> |
getParameters(String accessCode) |
String |
getPresentationPath(String accessCode) |
int |
getRequestListSize()
Obtém o número de requisições de download retidos em memória, aguardando
limpeza periódica.
|
String |
getResultPath(String accessCode) |
String |
getText(String accessCode) |
String |
getUploadURL(Object userId,
String password,
Object projectId,
String[] filePath,
String fileType) |
String |
getUploadURL(String filePath,
String presentationPath,
String resultPath)
Obtem a url para upload do arquivo.
|
String |
getUploadURL(String filePath,
String presentationPath,
String resultPath,
Observer obs)
Obtem a url para upload do arquivo.
|
String |
getUploadURL(String filePath,
String presentationPath,
String resultPath,
UploadHandler fileHandler)
Obtem a url para upload do arquivo.
|
protected boolean |
has2Update(Object arg,
Object event) |
void |
initService()
Inicialização do serviço.
|
boolean |
isDirectory(String accessCode) |
void |
shutdownService()
Término do serviço.
|
getBooleanProperty, getDefaultLocale, getDoubleProperty, getExternalPropertyFile, getFormattedString, getFormattedString, getInitializationDependencies, getInstance, getIntProperty, getKey, getLongProperty, getName, getOptionalString, getOptionalString, getOSPropertyPath, getSenderName, getServices, getString, getString, getStringListProperty, getStringProperty, getSystemId, getThreadLocale, getUser, getUserPermission, hasProperty, incrCounter, isActive, isEnabled, isInternalServerRequest, isLoggingNotifications, isPropertyNull, logNotification, setEnabled, setKey, setSystemId, setUserId, setUserLocalehandleException, handleFatalErroraddObserver, countObservers, deleteObserver, deleteObserver, deleteObservers, has2update, notifyObserversprotected HttpService()
throws ServerException
ServerException - falha na construção do serviço.public static void createService()
throws ServerException
ServerException - em caso de erro.public String getDownloadURL(Object userId, String password, Object projectId, String[] filePath) throws RemoteException
getDownloadURL in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic String getUploadURL(Object userId, String password, Object projectId, String[] filePath, String fileType) throws RemoteException
getUploadURL in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic String getFileType(String accessCode, String filePath) throws RemoteException
getFileType in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic int getDownloadType(String accessCode) throws RemoteException
getDownloadType in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic boolean createFile(String accessCode, String fileName) throws RemoteException
createFile in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic String getFilePath(String accessCode) throws RemoteException
getFilePath in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic String getFilePath(String accessCode, String filePath) throws RemoteException
getFilePath in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic String getPresentationPath(String accessCode) throws RemoteException
getPresentationPath in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic String getResultPath(String accessCode) throws RemoteException
getResultPath in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic boolean isDirectory(String accessCode) throws RemoteException
isDirectory in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic boolean finishUpload(String accessCode, String fileName) throws csbase.exception.HttpServiceException
finishUpload in interface csbase.remote.HttpServiceInterfaceaccessCode - código de acesso.fileName - O nome original do arquivo que sofreu upload.csbase.exception.HttpServiceException - em caso de erro.public String getFileDownloadURL(String filePath) throws RemoteException
filePath - caminho absoluto do arquivo no sistema de arquivos.RemoteException - em caso de erro.public String getDownloadPDFReportURL(String filePath, Map<String,String> parameters, String jdbcDriverClassName, String jdbcURL, String jdbcUser, String jdbcPassword) throws RemoteException
filePath - caminho absoluto do arquivo .jasper que representa o layout
do relatórioparameters - parâmetros passados para o relatóriojdbcDriverClassName - nome da classe do driver jdbc para criação da
conexão usada no relatóriojdbcURL - URL de acesso para criação da conexão usada no relatóriojdbcUser - usuário de acesso para criação da conexão usada no
relatóriojdbcPassword - senha de acesso para criação da conexão usada no
relatórioRemoteException - em caso de erro.public Map<String,String> getParameters(String accessCode) throws RemoteException
getParameters in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic String getJdbcDriverClassName(String accessCode) throws RemoteException
getJdbcDriverClassName in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic String getJdbcURL(String accessCode) throws RemoteException
getJdbcURL in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic String getJdbcUser(String accessCode) throws RemoteException
getJdbcUser in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic String getJdbcPassword(String accessCode) throws RemoteException
getJdbcPassword in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic String getUploadURL(String filePath, String presentationPath, String resultPath) throws RemoteException
filePath - caminho do arquivo local no projeto.presentationPath - Path do arquivo html para upload.resultPath - Path do arquivo html resultado do upload.RemoteException - em caso de erro.public String getUploadURL(String filePath, String presentationPath, String resultPath, UploadHandler fileHandler)
filePath - caminho do arquivo local no projeto.presentationPath - Path do arquivo html para upload.resultPath - Path do arquivo html resultado do upload.fileHandler - Classe que realiza o upload.public String getUploadURL(String filePath, String presentationPath, String resultPath, Observer obs)
filePath - caminho do arquivo local no projeto.presentationPath - Path do arquivo html para upload.resultPath - Path do arquivo html resultado do upload.obs - Observador que é notificado quando o upload termina.public String getDownloadURL(String filePath) throws RemoteException
filePath - caminho do arquivo local no projeto.RemoteException - em caso de erro.public String getDownloadURL(String filePath, Map<String,String> parameters) throws RemoteException
filePath - caminho do arquivo local no projeto.parameters - parâmetros que serão armazenados na RequestInfo para uso
geral.RemoteException - em caso de erro.public String getDownloadTextURL(Object userId, String password, String text) throws RemoteException
getDownloadTextURL in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic String getDownloadTextURL(String text) throws RemoteException
text - Texto que será exibido no navegadorRemoteException - em caso de erro.public String getDownloadTextURL(Object userId, String password, String text, String fileName) throws RemoteException
getDownloadTextURL in interface csbase.remote.HttpServiceInterfaceRemoteExceptionpublic String getDownloadCSVURL(Object userId, String password, String text) throws RemoteException
getDownloadCSVURL in interface csbase.remote.HttpServiceInterfaceuserId - identificação do usuário.password - senha do usuário.text - texto contendo o conteúdo do CSV.RemoteException - em caso de erro.public String getDownloadCSVURL(String text) throws RemoteException
text - texto contendo o conteúdo do CSV.RemoteException - em caso de erro.public String getDownloadCSVURL(String text, String fileName) throws RemoteException
text - texto contendo o conteúdo do CSV.fileName - nome do arquivo gerado para downloadRemoteException - em caso de erro.public String getText(String accessCode) throws RemoteException
getText in interface csbase.remote.HttpServiceInterfaceRemoteExceptionprotected boolean has2Update(Object arg, Object event)
has2Update in class csbase.remote.RemoteObjectObservablepublic void shutdownService()
throws ServerException
shutdownService in class ServiceServerException - em caso de erro.public void initService()
throws ServerException
initService in class ServiceServerException - se ocorrer um erro na inicializaçãopublic static HttpService getInstance()
public String getDownloadCSVURL(Object userId, String password, String text, String fileName) throws RemoteException
getDownloadCSVURL in interface csbase.remote.HttpServiceInterfaceuserId - identificação do usuário.password - senha do usuário.text - texto contendo o conteúdo do CSV.fileName - nome do arquivo que será geradoRemoteException - em caso de erro.public int getRequestListSize()
throws RemoteException
getRequestListSize in interface csbase.remote.HttpServiceInterfaceRemoteException - em caso de erro.Copyright © 2017. All rights reserved.