hackedteam/rcs-console-library

View on GitHub
src/it/ht/rcs/console/connector/rest/DBConnector.as

Summary

Maintainability
Test Coverage
/**
 * This is a generated sub-class of _DBConnector.as and is intended for behavior
 * customization.  This class is only generated when there is no file already present
 * at its target location.  Thus custom behavior that you add here will survive regeneration
 * of the super-class. 
 **/
 
package it.ht.rcs.console.connector.rest
{
  import it.ht.rcs.console.DB;
  import it.ht.rcs.console.connector.model.Connector;
  
  import mx.rpc.CallResponder;

public class DBConnector extends _Super_DBConnector implements IDBConnector
{
    /**
     * Override super.init() to provide any initialization customization if needed.
     */
    protected override function preInitializeService():void
    {
        super.preInitializeService();
        // Initialization customization goes here
    }
        
    public function DBConnector(host:String)
    { 
      super();
      _serviceControl.baseURL = host;
    }
    
    public function all(onResult:Function=null, onFault:Function=null):void
    {
      var resp:CallResponder = DB.getCallResponder(onResult, onFault);
      resp.token = all_();
    }
    
    public function create(params:Object, onResult:Function=null, onFault:Function=null):void
    {
      var resp:CallResponder = DB.getCallResponder(onResult, onFault);
      resp.token = create_(JSON.stringify(params));
    }
    
    public function destroy(f:Connector, onResult:Function=null, onFault:Function=null):void
    {
      var resp:CallResponder = DB.getCallResponder(onResult, onFault);
      resp.token = destroy_(JSON.stringify({_id: f._id}));
    }
    
    public function update(f:Connector, property:Object, onResult:Function=null, onFault:Function=null):void
    {
      var resp:CallResponder = DB.getCallResponder(onResult, onFault);
      property['_id'] = f._id;
      resp.token = update_(JSON.stringify(property));
    }
}

}