Websphere MQ Everyplace

com.ibm.mqe
Class MQeAttribute

java.lang.Object
  |
  +--com.ibm.mqe.MQe
        |
        +--com.ibm.mqe.MQeAttribute
All Implemented Interfaces:
MQeExceptionCodes
Direct Known Subclasses:
MQeMAttribute, MQeMTrustAttribute

public class MQeAttribute
extends MQe

This class is used to create an attribute object. This object contains the mechanisms to perform authentication, encryption and compression. MQeAttribute objects can be associated with queues, messages, and MQeFields objects.


Field Summary
 
Fields inherited from class com.ibm.mqe.MQe
Admin_Queue_Name, Admin_Reply_Queue_Name, copyright, DeadLetter_Queue_Name, Event_Activate, Event_Attribute, Event_Authenticate, Event_Close, Event_Logoff, Event_Logon, Event_MiniCert_Validate, Event_Queue, Event_QueueManager, Event_UserBase, JMS_Version, MQ_Headers, MQe_Log_Audit_Failure, MQe_Log_Audit_Success, MQe_Log_Error, MQe_Log_Information, MQe_Log_Success, MQe_Log_Warning, Msg_BackoutCount, Msg_CorrelID, Msg_ExpireTime, Msg_LockID, Msg_MsgID, Msg_OriginQMgr, Msg_Priority, Msg_ReplyToQ, Msg_ReplyToQMgr, Msg_Resend, Msg_Style, Msg_Style_Datagram, Msg_Style_Reply, Msg_Style_Request, Msg_Time, Msg_WrapMsg, sccsid, System_Default_Queue_Name, version
 
Fields inherited from interface com.ibm.mqe.MQeExceptionCodes
Except_Active, Except_AdapterException, Except_AdapterMissingRemoteAddress, Except_Admin_ActionNotSupported, Except_Admin_InvalidField, Except_Admin_NotAdminMsg, Except_AdminAction, Except_Authenticate, Except_BadRequest, Except_BridgeListener, Except_Chnl_Attributes, Except_Chnl_ID, Except_Chnl_Limit, Except_Chnl_Overrun, Except_Closed, Except_Con_AdapterRequired, Except_Con_AliasAlreadyExists, Except_Con_AlreadyExists, Except_Con_InvalidName, Except_Connect_Failure, Except_ConnectonType, Except_Cryptor, Except_Data, Except_Duplicate, Except_JmxProperties, Except_Listener, Except_MessageStore, Except_MiniCertReg_ActivateFailed, Except_MiniCertReg_BadPIN, Except_MiniCertReg_NotOpen, Except_NotActive, Except_NotAllowed, Except_NotFound, Except_NotSupported, Except_PrivateReg_ActivateFailed, Except_PrivateReg_BadPIN, Except_PrivateReg_NotOpen, Except_PublicReg_ActivateFailed, Except_PublicReg_InvalidAddress, Except_PublicReg_InvalidRequest, Except_Q_Full, Except_Q_InvalidName, Except_Q_InvalidPriority, Except_Q_MsgTooLarge, Except_Q_NoMatchingMsg, Except_Q_TargetRegistryRequired, Except_QMgr_Activated, Except_QMgr_AlreadyExists, Except_QMgr_InvalidQMgrName, Except_QMgr_InvalidQName, Except_QMgr_NotActive, Except_QMgr_NotBridgeEnabled, Except_QMgr_NotConfigured, Except_QMgr_QDoesNotExist, Except_QMgr_QExists, Except_QMgr_QNotEmpty, Except_QMgr_RegistryDataVersion, Except_QMgr_UnknownQMgr, Except_QMgr_WrongQType, Except_Reg_AddFailed, Except_Reg_AlreadyExists, Except_Reg_AlreadyOpen, Except_Reg_CRTKeyDecFailed, Except_Reg_CRTKeySignFailed, Except_Reg_DeleteFailed, Except_Reg_DeleteRegistryFailed, Except_Reg_DoesNotExist, Except_Reg_InvalidSession, Except_Reg_ListFailed, Except_Reg_NotDefined, Except_Reg_NotSecure, Except_Reg_NullName, Except_Reg_OpenFailed, Except_Reg_ReadFailed, Except_Reg_RenameFailed, Except_Reg_ResetPINFailed, Except_Reg_SearchFailed, Except_Reg_UpdateFailed, Except_RemoteException, Except_Rule, Except_S_BadIntegrity, Except_S_BadSubject, Except_S_CertificateExpired, Except_S_Cipher, Except_S_InvalidAttribute, Except_S_InvalidSignature, Except_S_MiniCertNotAvailable, Except_S_MissingSection, Except_S_NoPresetKeyAvailable, Except_S_RegistryNotAvailable, Except_Stopped, Except_Syntax, Except_TimeOut, Except_Transporter, Except_TriggerTransmission, Except_Trnsport_QMgr, Except_Trnsport_Request, Except_Type, Except_UdpipAdapterStateException, Except_UdpipAdapterTimeOut, Except_UdpipAdapterUnableToConfirmSuccess, Except_UnCoded, Except_Uncontactable_DontTransmit
 
Constructor Summary
MQeAttribute()
          Constructs an empty MQeAttribute object (not activated).
MQeAttribute(MQeAttributeRule rule, MQeAuthenticator authenticator, MQeCryptor cryptor, MQeCompressor compressor)
          Master attribute constructor with rules object as parameter.
MQeAttribute(MQeAuthenticator authenticator, MQeCryptor cryptor, MQeCompressor compressor)
          Constructs an MQeAttribute object.
 
Method Summary
 void activate(MQeAttributeRule rule, MQeAuthenticator authenticator, MQeCryptor cryptor, MQeCompressor compressor)
          Activates an MQeAttribute object.
 java.lang.String authenticatedID()
          Returns a String that is the authenticated identifier.
 void close()
          Closes and releases resources (including that used by its components).
 MQeAuthenticator getAuthenticator()
          Gets the object reference to the authenticator.
 MQeCompressor getCompressor()
          Gets the object reference to the compressor.
 MQeCryptor getCryptor()
          Gets the object reference to the cryptor.
 MQeAttributeRule getRule()
          Gets the object reference to the rule.
 boolean isAcceptable(MQeAttribute item)
          Checks if the input attribute is acceptable as a replacement.
protected  void setAuthenticator(MQeAuthenticator authenticator)
          Sets an authenticator with the attribute.
protected  void setCompressor(MQeCompressor compr)
          Sets a compressor with the attribute.
protected  void setCryptor(MQeCryptor crypt)
          Sets a cryptor with the attribute.
 void setKey(MQeKey key)
          Associates a key with the attribute.
 
Methods inherited from class com.ibm.mqe.MQe
abbreviate, alias, asciiToByte, byteToAscii, byteToHex, byteToHex, byteToInt, byteToLong, byteToShort, byteToUnicode, fileSeparator, getEventLogHandler, hexToAscii, hexToByte, intToByte, isCLDC, loadClass, loadObject, log, setEventLogHandler, setLoader, sliceByteArray, type, unicodeToByte, uniqueValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MQeAttribute

public MQeAttribute()

Constructs an empty MQeAttribute object (not activated).


MQeAttribute

public MQeAttribute(MQeAuthenticator authenticator,
                    MQeCryptor cryptor,
                    MQeCompressor compressor)

Constructs an MQeAttribute object.

Parameters:
authenticator - An MQeAuthenticator object (or null) used to authenticatate data access.
cryptor - An MQeCryptor object (or null) used to encrypt and decrypt data.
compressor - An MQeCompressor object used to compress the data prior to encrytion, or decompress after decryption.
Throws:
MQeException - Various activation errors.
IOException - Various IO errors depending on protocol type.
Example:
 import com.ibm.mqe.MQeAttribute;
 
 try {
     MQeAttribute myAttribute = new MQeAttribute(null,
             new MQeXorCryptor(),
             new MQeRleCompressor());
 } catch (Exception e) {
     System.err.println("Failure ! " + e.toString());
 }
 
 

MQeAttribute

public MQeAttribute(MQeAttributeRule rule,
                    MQeAuthenticator authenticator,
                    MQeCryptor cryptor,
                    MQeCompressor compressor)

Master attribute constructor with rules object as parameter.

Parameters:
rule - An MQeAttributeRule objec (or null) use to verify that various operations are permitted.
authenticator - An MQeAuthenticator object (or null) used to authenticatate data access.
cryptor - An MQeCryptor object (or null) used to encrypt and decrypt data.
compressor - An MQeCompressor object used to compress the data prior to encrytion, or decompress after decryption.
Throws:
MQeException - Various activation errors.
IOException - Various IO errors depending on protocol type.
Method Detail

activate

public void activate(MQeAttributeRule rule,
                     MQeAuthenticator authenticator,
                     MQeCryptor cryptor,
                     MQeCompressor compressor)

Activates an MQeAttribute object.

Attaches the specified rule, cryptor, and compressor to the attribute (any rule, cryptor, and compressor already attached is replaced).

Parameters:
rule - An MQeAttributeRule objec (or null) use to verify that various operations are permitted. If null is specified, then the default rule of MQeAttributeRule is assumed.
authenticator - An MQeAuthenticator object (or null) used to authenticatate data access.
cryptor - An MQeCryptor object (or null) used to encrypt and decrypt data.
compressor - An MQeCompressor object used to compress the data prior to encrytion, or decompress after decryption.
Returns:
void
Throws:
MQeException - Various activation errors.
IOException - Various IO errors depending on protocol type.
Example:
 MQeAttribute myAttribute = null;
  
 try {
     myAttribute = new MQeAttribute();
 } catch (Exception e) {
     System.err.println("Failure ! ".toString());
 }
 myAttribute.activate(null, authenticator, cryptor, compressor);
 
 

authenticatedID

public java.lang.String authenticatedID()

Returns a String that is the authenticated identifier.

This method returns a String that is the authenticated identifier, or null if it is not authenticated. This indicates if an authentication has been successfully completed.

Returns:
A String that is the authenticated identifier or null if one has not been set.
Example:
 String result = null;
 MQeAttribute attr = new MQeAttribute();
 
 result = attr.authenticatedID();
 
 

close

public void close()

Closes and releases resources (including that used by its components).

This method should be called by applications after the attribute is not longer needed.

Returns:
void

isAcceptable

public boolean isAcceptable(MQeAttribute item)

Checks if the input attribute is acceptable as a replacement.

Parameters:
item - A replacement MQeAttribute object.
Returns:
A boolean value true implies item is acceptable, false otherwise.
Example:
 MQeAttribute attrib = new MQeAttribute();
 
 if (attrib.isAcceptable(attr)) {// The input attribute, attr - is acceptable.
 } else {
     Accept = false;
 }
 
 

getAuthenticator

public MQeAuthenticator getAuthenticator()

Gets the object reference to the authenticator.

This method is called to return the object reference to the authenticator used by this attribute, or null if there is no authenticator.

Returns:
An MQeAuthenticator object reference or null.
Example:
 MQeAttribute attr = new MQeAttribute();
 
 auth = attr.getAuthenticator();
 
 

getCompressor

public MQeCompressor getCompressor()

Gets the object reference to the compressor.

This method is called to return the object reference to the compressor used by this attribute, or null if there is no compressor.

Returns:
An MQeCompressor object reference or null.
Example:
 MQeAttribute attr = new MQeAttribute();
 
 comp = attr.getCompressor();
 
 

getCryptor

public MQeCryptor getCryptor()

Gets the object reference to the cryptor.

This method is called to return the object reference to the cryptor used by this attribute, or null if there is no cryptor.

Returns:
An MQeCryptor object reference or null.
Example:
 MQeAttribute attr = new MQeAttribute();
 
 crypt = attr.getCryptor();
 
 

getRule

public MQeAttributeRule getRule()

Gets the object reference to the rule.

This method is called to return the object reference to the rule used by this attribute, or null if there is no rule.

Returns:
An MQeCryptor object reference or null.
Example:
 MQeAttribute attr = new MQeAttribute();
 
 AttRule = attr.getRule();
 
 

setAuthenticator

protected void setAuthenticator(MQeAuthenticator authenticator)

Sets an authenticator with the attribute.

This method associates an authenticator with the attribute.

Parameters:
authenticator - Authenticator to be used with the attribute.

setCryptor

protected void setCryptor(MQeCryptor crypt)

Sets a cryptor with the attribute.

This method associates a cryptor with the attribute.


setCompressor

protected void setCompressor(MQeCompressor compr)

Sets a compressor with the attribute.

This method associates a compressor with the attribute.


setKey

public void setKey(MQeKey key)
            throws MQeException

Associates a key with the attribute.

This method associates a key with the attribute. This is required if the attribute has a cryptor. Once set, the key cannot be re-set.

Parameters:
key - The key object to be used with the attribute’s cryptor.
Throws:
MQeException - Except_NotAllowed , thrown if the key has already been set.
Example:
 MQeAttribute attr = new MQeAttribute();
 
 key = new MQeKey();
 key.setLocalKey("It_is_a_secret");
 
 attr.setKey(key);
 
 

Websphere MQ Everyplace