|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectde.unikassel.android.sdcframework.transmission.AbstractProtocol
public abstract class AbstractProtocol
Abstract base class for protocol types.
| Field Summary | |
|---|---|
private String |
authPassword
The password for authentication |
protected Context |
context
the application context to use |
static String |
FILE_NOT_FOUND
The file not found message |
private String |
fileName
The current file to upload |
static String |
INVALID_URL
The invalid URL message |
protected String |
lastError
The last error message |
static String |
UNKNOWN_PROTCOL
The unknown protocol message |
private URL |
url
The URL to upload files to |
private String |
userName
The user name for authentication |
private UUID |
uuid
The unique SDC installation identifier for this device |
| Constructor Summary | |
|---|---|
AbstractProtocol(Context context,
UUID uuid,
TransmissionProtocolConfiguration config)
Constructor |
|
| Method Summary | |
|---|---|
protected void |
doHandleError(String errorMsg)
Error handler |
protected abstract boolean |
doUploadFile(File file)
Does upload a file according to the concrete protocol |
protected String |
getAuthPassword()
Getter for the authPassword |
Context |
getContext()
Getter for the application context |
String |
getFileName()
Getter for name of the file to upload |
String |
getHost()
Getter for the host |
String |
getLastError()
Getter for the last error |
protected String |
getMd5Password()
Getter for the authPassword |
URL |
getURL()
Getter for the URL |
protected String |
getUserName()
Getter for the userName |
protected UUID |
getUuid()
Getter for the uuid |
void |
setFileName(String fileName)
Setter for the file to upload |
void |
setLastError(String lastError)
Setter for the last error |
protected void |
setURL(URL url)
Setter for the url |
void |
updateConfiguration(Context context,
TransmissionProtocolConfiguration config)
Method to update the component by a configuration |
boolean |
uploadFile()
Does upload the current file set |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String FILE_NOT_FOUND
public static final String INVALID_URL
public static final String UNKNOWN_PROTCOL
private URL url
private String userName
private String authPassword
private String fileName
protected final Context context
private final UUID uuid
protected String lastError
| Constructor Detail |
|---|
public AbstractProtocol(Context context,
UUID uuid,
TransmissionProtocolConfiguration config)
context - the contextuuid - the unique SDC installation identifier for this deviceconfig - the current transmission configuration| Method Detail |
|---|
public final URL getURL()
ProtocolStrategy
getURL in interface ProtocolStrategypublic final String getHost()
ProtocolStrategy
getHost in interface ProtocolStrategyprotected final void setURL(URL url)
url - the url to setprotected final String getUserName()
protected final String getAuthPassword()
protected final String getMd5Password()
public final Context getContext()
ProtocolStrategy
getContext in interface ProtocolStrategyprotected UUID getUuid()
public final void setFileName(String fileName)
ProtocolStrategy
setFileName in interface ProtocolStrategyfileName - the name of the file to uploadpublic final String getFileName()
ProtocolStrategy
getFileName in interface ProtocolStrategypublic final void setLastError(String lastError)
ProtocolStrategy
setLastError in interface ProtocolStrategylastError - the laste error to setpublic final String getLastError()
ProtocolStrategy
getLastError in interface ProtocolStrategy
public final void updateConfiguration(Context context,
TransmissionProtocolConfiguration config)
UpdatableTransmissionComponent
updateConfiguration in interface UpdatableTransmissionComponent<TransmissionProtocolConfiguration>context - the application contextconfig - the configuration to update frompublic final boolean uploadFile()
ProtocolStrategy
uploadFile in interface ProtocolStrategyprotected final void doHandleError(String errorMsg)
errorMsg - the error massageprotected abstract boolean doUploadFile(File file)
file - the file for upload
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||