static NamespaceNotification createNotification ( FSEditLogOp op ) { switch ( op . opCode ) { case OP_ADD : return new NamespaceNotification ( ( ( AddOp ) op ) . path , EventType . FILE_ADDED . getByteValue ( ) , op . getTransactionId ( ) ) ; case OP_CLOSE : return new NamespaceNotification ( ( ( CloseOp ) op ) . path , EventType . FILE_CLOSED . getByteValue ( ) , op . getTransactionId ( ) ) ; case OP_DELETE : return new NamespaceNotification ( ( ( DeleteOp ) op ) . path , EventType . NODE_DELETED . getByteValue ( ) , op . getTransactionId ( ) ) ; case OP_MKDIR : return new NamespaceNotification ( ( ( MkdirOp ) op ) . path , EventType . DIR_ADDED . getByteValue ( ) , op . getTransactionId ( ) ) ; default : return null ; } }
Converts a Transaction Log operation into a NamespaceNotification object .