com.sentilla.host.client.application
Class Application

java.lang.Object
  extended by com.sentilla.host.client.application.Application
All Implemented Interfaces:
Serializable

public class Application
extends Object
implements Serializable

Application encapsulates metadata describing a mote application.

Author:
spence@sentilla.com
See Also:
Serialized Form

Field Summary
private  String appName
           
private  int binaryHash
           
private  byte[] data
           
private  String jarPath
           
private static long serialVersionUID
           
private  ApplicationYaml yaml
           
 
Constructor Summary
Application()
          Creates an empty Application object
Application(String jarPath)
          Creates an Application object using the jar file at the given path.
 
Method Summary
 byte[] getData()
          Returns a byte array representation of this Application object
 String getName()
          Returns the name of this Application object.
 String getPath()
          Returns the filesystem path of this Application object.
 ApplicationYaml getYaml()
          Returns an ApplicationYaml object of metadata about this Application object.
private  boolean readJar()
          Reads the jar file provided when this Application object was instantiated.
 void setAppId(int appId)
          Sets the application ID of this Application object.
 void setYaml(Map<String,Object> id)
          Sets the yaml data for this Application object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

appName

private String appName

jarPath

private String jarPath

data

private byte[] data

binaryHash

private int binaryHash

yaml

private ApplicationYaml yaml
Constructor Detail

Application

public Application(String jarPath)
            throws IOException
Creates an Application object using the jar file at the given path.

Parameters:
jarPath - path of the jarfile
Throws:
IOException - thrown if an error occurs processing the jar file

Application

public Application()
Creates an empty Application object

Method Detail

getName

public String getName()
Returns the name of this Application object.

Returns:
String the name of this Application object

getPath

public String getPath()
Returns the filesystem path of this Application object.

Returns:
String the path of the jar file described by this Application object

getData

public byte[] getData()
Returns a byte array representation of this Application object

Returns:
byte[] the byte data of this jar file (note: may return null)

getYaml

public ApplicationYaml getYaml()
Returns an ApplicationYaml object of metadata about this Application object.

Returns:
ApplicationYaml a hashMap of metadata about this Application object

readJar

private boolean readJar()
                 throws IOException
Reads the jar file provided when this Application object was instantiated.

Returns:
boolean returns true on success, false otherwise
Throws:
IOException - thrown if an error occurs while reading the jar file

setAppId

public void setAppId(int appId)
Sets the application ID of this Application object. This method is not intended to be called by applications.


setYaml

public void setYaml(Map<String,Object> id)
Sets the yaml data for this Application object. This method is not intended to be called by applications.



Copyright © 2007 Sentilla, Inc. All Rights Reserved.