public class

JiveModule

extends Object
java.lang.Object
   ↳ org.mule.modules.jive.JiveModule
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Provides Jive connectivity to Mule:

  • Allows CRUD operations on Jive objects

Summary

Fields
private JiveFacade facade The jive facade
private String gatewayUri The base rest server url
private String password The password.
private String username The username to access the jive instance.
Public Constructors
JiveModule()
Public Methods
Long count(EntityTypeName type)
Counts all the instances of the given entity type
Map<String, Object> create(EntityTypeName type, Map<String, Object> entity)
Creates an entity of the given type.
void delete(EntityTypeName type, String id)
Deletes an existent entity If there is no entity with the given id the system will throw a JiveGenericException with the message returned from the server.
Map<String, Object> execute(CustomOp operation, Map<String, Object> entity, String id)
Executes a custom operation If a wrong number of attributes is sent, or the operation requires an entity an none is sent, the system will repond with a JiveGenericException.
Map<String, Object> get(EntityTypeName type, String id)
Retrieves the attributes for the entity of the given type and id.
Long getUserId()
Answers the id of the logged user
void init()
Initialise the facade
void setFacade(JiveFacade facade)
void setGatewayUri(String gatewayUri)
void setPassword(String password)
void setUsername(String username)
void update(EntityTypeName type, Map<String, Object> entity)
Updates an existent entity If the entity you are trying to update doesn't exist, the system thorws a JiveGenericException with an aclaratory message.
Protected Methods
JiveFacade newFacade()
Creates a JerseyJiveFacade for and sets the password, username and gatewayUri.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private JiveFacade facade

The jive facade

private String gatewayUri

The base rest server url

private String password

The password.

private String username

The username to access the jive instance.

Public Constructors

public JiveModule ()

Public Methods

public Long count (EntityTypeName type)

Counts all the instances of the given entity type

Parameters
type The entity type to be counted
Returns
  • The number of instances of the given type

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

Creates an entity of the given type. If the entity already exists or cannot be created the system throws a JiveGenericException with the correspondat message. If the data pass in entity it's not the data expected the system will throw a JiveGenericException with the correspondant message.

Parameters
type The type of entity to create
entity The entity attributes
Returns
  • The jive response as a Map. Generally it will return the entity just created with additional data added by jive.

public void delete (EntityTypeName type, String id)

Deletes an existent entity If there is no entity with the given id the system will throw a JiveGenericException with the message returned from the server. If the number of arguments is wrong the system will throw a JiveGenericException

Parameters
type The entity type
id The id of the entity to delete

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

Executes a custom operation If a wrong number of attributes is sent, or the operation requires an entity an none is sent, the system will repond with a JiveGenericException.

Parameters
operation The custom operation to be executed
entity The Map with the entity data to be send as payload
id The path parameters to be added to the operation uri
Returns
  • A Map with the server response

public Map<String, Object> get (EntityTypeName type, String id)

Retrieves the attributes for the entity of the given type and id. If the entity you are trying to get doesn't exist, the system will throw a JiveGenericException with the correponging message.

Parameters
type The entity type
id The entity id
Returns
  • the entity attributes, as a String-Object Map

public Long getUserId ()

Answers the id of the logged user

Returns
  • the user id

public void init ()

Initialise the facade

public void setFacade (JiveFacade facade)

Parameters
facade

public void setGatewayUri (String gatewayUri)

Parameters
gatewayUri

public void setPassword (String password)

Parameters
password

public void setUsername (String username)

Parameters
username

public void update (EntityTypeName type, Map<String, Object> entity)

Updates an existent entity If the entity you are trying to update doesn't exist, the system thorws a JiveGenericException with an aclaratory message.

Parameters
type The type of entity to update
entity The attributes of the entity

Protected Methods

protected JiveFacade newFacade ()

Creates a JerseyJiveFacade for and sets the password, username and gatewayUri.

Returns
  • The facade ready to make requests