public class

JerseyJiveFacade

extends Object
implements JiveFacade
java.lang.Object
   ↳ org.mule.modules.jive.JerseyJiveFacade

Summary

Fields
private Client client The jersey client
private String gatewayUri The base uri of the rest server
private Object initUserId Syncronized object for the userID operation
private final XmlMapper mapper The xml mapper
private String password The jive password.
private Long userID The userID from jive.
private String username The jive username
Public Constructors
JerseyJiveFacade()
Public Methods
final Long count(EntityType type)
Call the get count service.
final Map<String, Object> create(EntityType type, Map<String, Object> entity)
Creates an entity.
final Map<String, Object> delete(EntityType type, String id)
Deletes an entity.
final Map<String, Object> execute(CustomOp op, Map<String, Object> entity, String id)
Executes a POST CustomOp.
final Map<String, Object> get(EntityType entityType, String id)
Executes a get request with the given id as path params for the given EntityType
final String getPassword()
final String getUser()
final Long getUserID()
Make a request for the userID to the jive server for the given username and password.
final void map2xml(String xmlRootTag, Map<String, Object> entity, Writer writer)
final void setGatewayUri(String gatewayUri)
Sets the gatewayUri to be used as base url for the rest server
final void setPass(String pass)
final void setPassword(String pass)
Sets the jive password
final void setUser(String user)
final void setUserID(Long userID)
final void setUsername(String user)
Sets the jive username
Map<String, Object> update(EntityType entityType, Map<String, Object> entity)
Executes a put method for the given EntityType sending as payload the given entity.
final Map<String, Object> xml2map(Reader reader)
@return
Protected Methods
JiveClient getGateway()
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.mule.modules.jive.JiveFacade

Fields

private Client client

The jersey client

private String gatewayUri

The base uri of the rest server

private Object initUserId

Syncronized object for the userID operation

private final XmlMapper mapper

The xml mapper

private String password

The jive password.

private Long userID

The userID from jive.

private String username

The jive username

Public Constructors

public JerseyJiveFacade ()

Public Methods

public final Long count (EntityType type)

Call the get count service.

Parameters
type The service type
Returns
  • The count as a Long

public final Map<String, Object> create (EntityType type, Map<String, Object> entity)

Creates an entity. Sends a POST request for the given EntityType generating the xml payload corresponding with the entity map.

Parameters
type The service type used to determine the url for this resource.
entity The Map with the entity data to parse to an xml and send in the request.
Returns
  • The xml response parse in a Map.

public final Map<String, Object> delete (EntityType type, String id)

Deletes an entity.

Parameters
type The service type used to determine the url for this resource.
id The id to be added in the url as path parameter.
Returns
  • The xml response parse in a Map.

public final Map<String, Object> execute (CustomOp op, Map<String, Object> entity, String id)

Executes a POST CustomOp.

Parameters
op The service to execute, used to determine the resource url, the http protocol to use and, if needed, the root tag for the xml to be send in the request.
entity The Map with the entity data to parse to an xml and send in the request.
id
Returns
  • The xml response parse in a Map.

public final Map<String, Object> get (EntityType entityType, String id)

Executes a get request with the given id as path params for the given EntityType

Parameters
entityType The entity type
id The path params to add to the resource uri
Returns
  • The server response as a Map

public final String getPassword ()

Returns
  • the pass

public final String getUser ()

Returns
  • the user

public final Long getUserID ()

Make a request for the userID to the jive server for the given username and password.

Returns
  • the userID

public final void map2xml (String xmlRootTag, Map<String, Object> entity, Writer writer)

Parameters
xmlRootTag
entity
writer

public final void setGatewayUri (String gatewayUri)

Sets the gatewayUri to be used as base url for the rest server

Parameters
gatewayUri

public final void setPass (String pass)

Parameters
pass The pass to set

public final void setPassword (String pass)

Sets the jive password

Parameters
pass

public final void setUser (String user)

Parameters
user The user to set

public final void setUserID (Long userID)

Parameters
userID The userID to set

public final void setUsername (String user)

Sets the jive username

Parameters
user

public Map<String, Object> update (EntityType entityType, Map<String, Object> entity)

Executes a put method for the given EntityType sending as payload the given entity.

Parameters
entityType The entity type
entity The data to be send as payload in the request
Returns
  • The server response as a Map

public final Map<String, Object> xml2map (Reader reader)

@return

Parameters
reader
See Also

Protected Methods

protected JiveClient getGateway ()