namespace safmq_php

PHP functions to access SAFMQ.

Child Classes

PHP functions to access SAFMQ. The following is a sample PHP script to access a SAFMQ server.
<?
$con = safmq_open("safmq://localhost","mylogin","mypassword");
if ($con !== false) {
    $queue = safmq_open_queue("myqueue",$con);
    if ($queue !== false) {
        $msg = safmq_msg();
        $msg->Label = "Hello World";
        $msg->Body = "Hello to all the world";
        if (safmq_enqueue($msg,$queue,$con)) {
            printf("The message was sent!\n");
        } else {
            printf("The message was not sent!\n");
        }

$msg = false; $msg = safmq_retrieve(true,-1,$queue,$con); if ($msg !== false) { printf("Message Retrieved\n"); printf("Label: %s\n", $msg->Label); printf("Body: %s\n", $msg->Body); printf("Timestamp: %s\n", strftime("%Y-%m-%d %H:%M:%S",$msg->TimeStamp)); printf("ID: %s\n", $msg->MessageID); } else { printf("Unable to retrieve message\n"); }

} else { printf("Could not open myqueue\n"); } safmq_close($con); } else { printf("Connect connect to localhost\n"); } ?>



Enumerations (enums), Unions, & Structures


struct ClientInfo
Information about a client connection
struct Identity
X509 Identity Information
struct QueueStatistics
Statistical information about a queue or the server
struct TempQueue
Information for a temporary queue

Objects


class Connection
A connection to a SAFMQ server
class Cursor
A interator used to step through the elements in a queue, used in sequential reading of the queue
class Message
A SAFMQ message object
class Permissions
Permissions available to users and groups
class Queue
A reference to a queue on a SAFMQ server
class QueuePermissions
A set of permissions a user or group may have against a queue
class URL: public String
A SAFMQ URL.
class UUID: public String
A universally uniqueue identifier.
class UserInfo
A user's id and description

Functions


bool safmq_add_user_identity(String subjectDN, String issuerDN, String username, Connection con)
Adds a X509 identity.
Boolean safmq_advance_cursor(Cursor cursor, Queue queue, Connection con)
Advances a cursor to the next message in the queue
bool safmq_begin_transaction(Connection con)
Begins a transaction.
Boolean safmq_close(Connection con)
Closes a connection to a SAFMQ server.
Boolean safmq_close_cursor(Cursor cursor, Queue queue, Connection con)
Closes a queue cursor.
Boolean safmq_close_queue(Queue queue, Connection con)
Closes a previously opened queue.
bool safmq_commit_transaction(Connection con)
Commits the transaction with out closing the transaction.
Boolean safmq_create_group(String group_name, Connection con)
Creates a new user group.
Boolean safmq_create_queue(String name, Connection con)
Creates a new message queue.
TempQueue safmq_create_temp_queue(Connection con)
Creates a temporary queue.
Boolean safmq_create_user(String username, String password, String description, Connection con)
Creates a new user.
Boolean safmq_delete_group(String group_name, Connection con)
Deletes a user group.
Boolean safmq_delete_queue(String name, Connection con)
Deletes a message queue.
Boolean safmq_delete_user(String username, Connection con)
Removes a user.
void safmq_display_connections()
Lists all open connections, queues and cursors
bool safmq_end_transaction(Connection con)
Ends the transaction and explicity commits all actions.
Boolean safmq_enqueue(Message msg, Queue queue, Connection con)
Places a message in a queue.
Boolean safmq_enqueue_with_relay(URL relayURL, Message msg, Connection con)
Sends a message to the SAFMQ server to be forwarded to a queue, possibly on another server.
String[] safmq_enumerate_groups(Connection con)
Lists all groups on the server
String[] safmq_enumerate_queues(Connection con)
Lists all queues on the server
Identity[] safmq_enumerate_user_identities(String username)
Lists the user identities for a particular user.
UserInfo[] safmq_enumerate_users(Connection con)
Lists all users on the server
ClientInfo[] safmq_get_client_info(Connection con)
Gets a list of connected clients.
QueueStatistics safmq_get_queue_statistics(bool includeStorageBytes, bool includeMessageBytes, QueueHandle queueHandle, Connection con)
Gets statistical information about a queue.
Integer safmq_get_server_major_protocol_version(Connection con)
Provides the major protocol version for server connected via the con Connection resource.
Integer safmq_get_server_minor_protocol_version(Connection con)
Provides the minor protocol version for server connected via the con Connection resource.
QueueStatistics safmq_get_server_statistics(Connection con)
Gets statistical information about a server.
Boolean safmq_group_add_user(String group_name, String username, Connection con)
Adds a user to a group.
Boolean safmq_group_delete_user(String group_name, String username, Connection con)
Removes a user from a group.
String[] safmq_group_enumerate_users(String group_name, Connection con)
Lists all members of a group
Permissions safmq_group_get_permissions(String group_name, Connection con)
Gets the permisison s of a user group.
Boolean safmq_group_set_permissions(String group_name, Boolean modifyqueues, Boolean modifyusers, Boolean modifygroups, Connection con)
Sets the permission of a user group.
Message safmq_msg()
Allocates a new empty message object for use in Enqueueing.
Connection safmq_open(URL url, String username, String password)
Opens a connection to a SAFMQ Server.
Cursor safmq_open_cursor(Queue queue, Connection con)
Opens a cursor for sequentially reading from the queue.
Queue safmq_open_queue(String name, Connection con)
Opens a queue for reading and writing.
Message safmq_peek_cursor(Boolean get_body, Cursor cursor, Queue queue, Connection con)
Retrieves the data from a message located by a cursor but does not remove the message from the queue.
Message safmq_peek_front(Boolean get_body, Ineger timeout, Queue queue, Connection con)
Retrieves the data from the first message in the queue, but does not remove the message from the queue.
Message safmq_peek_id(UUID reciptid, Boolean get_body, Integer timeout, Queue queue, Connection con)
Retrieves the data from a message located using a recipt id, but does not remove the message fromt he queue.
Boolean safmq_queue_delete_group_permission(String queue_name, String group_name, Connection con)
Removes a groups's permissions against a queue
Boolean safmq_queue_delete_user_permission(String queue_name, String username, Connection con)
Removes a user's permisisons against a queue
QueuePermissions[] safmq_queue_enumerate_permissions(String queue_name, Connection con)
Lists all permissions for a queue
Boolean safmq_queue_set_group_permission(String queue_name, String group_name, Boolean read, Boolean write, Boolean destroy, Boolean change_security, Connection con)
Sets a groups's permissions against a queue
Boolean safmq_queue_set_user_permission(String queue_name, String username, Boolean read, Boolean write, Boolean destroy, Boolean change_security, Connection con)
Sets a user's permisions against a queue.
bool safmq_remove_user_identity(String subjectDN, String issuerDN, Connection con)
Removes an X509 identity from the SAFMQ security configuraiton.
Message safmq_retrieve(Boolean get_body, Integer timeout, Queue queue, Connection con)
Retrieves the first message at the beginining of a queue.
Message safmq_retrieve_cursor(Boolean get_body, Cursor cursor, Queue queue, Connection con)
Retrieves a message from the queue using a cursor to locate the message.
Message safmq_retrieve_id(UUID reciptID, Boolean get_body, Integer timeout, Queue queue, Connection con)
Retrieves a message from the queue utilizing a recipt id to locate the message.
bool safmq_rollback_transaction(Connection con)
Performs an "undo" on all actions done durring the transaction.
Boolean safmq_seek_id(UUID reciptID, Integer timeout, Cursor cursor, Queue queue, Connection con)
Moves the cursor's possition to be located on a message indicated by the recipt id.
Boolean safmq_set_password(String username, String password, Connection con)
Sets the password of a user.
Boolean safmq_test_cursor(Cursor cursor, Queue queue, Connection con)
Determines if the cursor is still valid.
String[] safmq_user_enumerate_groups(String user_name, Connection con)
Lists all groups of which the user is a member
Permssions safmq_user_get_permissions(String username, Connection con)
Gets the permission of a user
Boolean safmq_user_set_permissions(String username, Boolean modifyqueues, Boolean modifyusers, Boolean modifygroups, Connection con)
Sets the permisisons of a user

Member Documentation

Table of Contents HTML hierarchy of classes or Java


Safmq Documentation, copyright (c) 2004-2010 Matthew J. Battey, Licensed Under Apache License Ver 2.0
Powered By: Get SAFMQ: Store and Forward Message Queue at SourceForge.net. Fast, secure and Free Open Source software downloads