AeroGear Android Libary 1.0.1

org.jboss.aerogear.android.impl.pipeline
Class PipeConfig

java.lang.Object
  extended by org.jboss.aerogear.android.impl.pipeline.PipeConfig

public final class PipeConfig
extends Object

Specifies configurations for Pipe to be build by Pipeline


Constructor Summary
PipeConfig(URL baseURL, Class klass)
           
 
Method Summary
 AuthenticationModule getAuthModule()
           
 URL getBaseURL()
           
 String getDataRoot()
          DataRoot refers to the dotted location of the result we are interested in from the JSON response from the server.
 Charset getEncoding()
          The Encoding is the String encoding to expect from the server.
 String getEndpoint()
           
 com.google.gson.GsonBuilder getGsonBuilder()
           
 PipeHandler getHandler()
           
 String getName()
           
 PageConfig getPageConfig()
          PageConfig is the configuration information for Paging.
 Integer getTimeout()
          Timeout is the length of time in milliseconds that a Pipe will wait for a response from a call to read, readWithfilter, save or remove
 PipeType getType()
           
 void setAuthModule(AuthenticationModule authModule)
          This value must be set to use Authentication in Pipes build from this config.
 void setBaseURL(URL baseURL)
          Change the URL which Endpoints are appended to.
 void setDataRoot(String dataRoot)
          DataRoot refers to the dotted location of the result we are interested in from the JSON response from the server.
 void setEncoding(Charset encoding)
           
 void setEncoding(String charsetName)
           
 void setEndpoint(String endpoint)
          Change the string appended to BaseURL.
 void setGsonBuilder(com.google.gson.GsonBuilder gsonBuilder)
           
 void setHandler(PipeHandler handler)
           
 void setName(String name)
          Modify the name field.
 void setPageConfig(PageConfig pageConfig)
          PageConfig is the configuration information for Paging.
 void setTimeout(Integer timeout)
          Timeout is the length of time in milliseconds that a Pipe will wait for a response from a call to read, readWithfilter, save or remove
 void setType(PipeType type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PipeConfig

public PipeConfig(URL baseURL,
                  Class klass)
Method Detail

getName

public String getName()
Returns:
The Name that Pipeline will use to reference Pipes built by this configuration.

setName

public void setName(String name)
Modify the name field. This is the value Pipeline uses to reference a Pipe built by this configuration.

Parameters:
name -

getBaseURL

public URL getBaseURL()
Returns:
the URL which Endpoints will be appended to.

setBaseURL

public void setBaseURL(URL baseURL)
Change the URL which Endpoints are appended to.

Parameters:
baseURL -

getEndpoint

public String getEndpoint()
Returns:
the string appended to BaseURL. It is the resource a Pipe connects to.

setEndpoint

public void setEndpoint(String endpoint)
Change the string appended to BaseURL. It is the resource a Pipe connects to.

Parameters:
endpoint -

getType

public PipeType getType()
Returns:
type of Pipe to configure.
See Also:
PipeTypes

setType

public void setType(PipeType type)
Parameters:
type - a PipeType to use when building a Pipe with this config.
See Also:
PipeTypes

getGsonBuilder

public com.google.gson.GsonBuilder getGsonBuilder()
Returns:
the current GSONBuilder which will be used to generate GSON objects to be used by Pipes with this config.

setGsonBuilder

public void setGsonBuilder(com.google.gson.GsonBuilder gsonBuilder)
Parameters:
gsonBuilder - GSONBuilder which will be used to generate GSON objects to be used by Pipes with this config.

getAuthModule

public AuthenticationModule getAuthModule()
Returns:
a AuthenticationModule which will be used for Authentication.

setAuthModule

public void setAuthModule(AuthenticationModule authModule)
This value must be set to use Authentication in Pipes build from this config.

Parameters:
authModule - a AuthenticationModule which works with this PipeConfig

getEncoding

public Charset getEncoding()
The Encoding is the String encoding to expect from the server.

Returns:
the current encoding, will not be null.

setEncoding

public void setEncoding(Charset encoding)
Parameters:
encoding - a not null encoding
Throws:
IllegalArgumentException - if encoding is null

setEncoding

public void setEncoding(String charsetName)
Parameters:
charsetName - a string for the encoding to be used
Throws:
UnsupportedCharsetException - if charSet is not supported

getPageConfig

public PageConfig getPageConfig()
PageConfig is the configuration information for Paging.

See Also:
PageConfig

setPageConfig

public void setPageConfig(PageConfig pageConfig)
PageConfig is the configuration information for Paging.

Parameters:
pageConfig -
See Also:
PageConfig

getDataRoot

public String getDataRoot()
DataRoot refers to the dotted location of the result we are interested in from the JSON response from the server. For example:
 {
 "speakers": {
      "data": [
          {"speakerName":"John Doe", "speakerid":42},
          {"speakerName":"Jesse James", "speakerid":5309},
      ]
  }
 }
 
A DataRoot of "speakers.data" would make the pipe pass a List using the array of speakers to the onSuccess method of callback.

Returns:
the current dataRoot

setDataRoot

public void setDataRoot(String dataRoot)
DataRoot refers to the dotted location of the result we are interested in from the JSON response from the server. For example:
 {
 "speakers": {
      "data": [
          {"speakerName":"John Doe", "speakerid":42},
          {"speakerName":"Jesse James", "speakerid":5309},
      ]
  }
 }
 
A DataRoot of "speakers.data" would make the pipe pass a List using the array of speakers to the onSuccess method of callback.

Parameters:
dataRoot -

getHandler

public PipeHandler getHandler()
Returns:
the current PipeHandler for Pipes build using this configuration

setHandler

public void setHandler(PipeHandler handler)
Parameters:
handler - a new PipeHandler for Pipes build using this configuration

getTimeout

public Integer getTimeout()
Timeout is the length of time in milliseconds that a Pipe will wait for a response from a call to read, readWithfilter, save or remove

Returns:
the current timeout.

setTimeout

public void setTimeout(Integer timeout)
Timeout is the length of time in milliseconds that a Pipe will wait for a response from a call to read, readWithfilter, save or remove

Parameters:
timeout - a new

AeroGear Android Libary 1.0.1

Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.