root/head/ambra/libs/otm-models/src/main/java/org/topazproject/ambra/models/ByteArrayBlob.java
@
7613
| Revision 7613, 1.9 KB (checked in by dragisak, 17 months ago) | |
|---|---|
|
|
| Line | |
|---|---|
| 1 | /* |
| 2 | * $HeadURL$ |
| 3 | * $Id$ |
| 4 | * |
| 5 | * Copyright (c) 2006-2009 by Topaz, Inc. |
| 6 | * http://topazproject.org |
| 7 | * |
| 8 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | * you may not use this file except in compliance with the License. |
| 10 | * You may obtain a copy of the License at |
| 11 | * |
| 12 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | * |
| 14 | * Unless required by applicable law or agreed to in writing, software |
| 15 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | * See the License for the specific language governing permissions and |
| 18 | * limitations under the License. |
| 19 | */ |
| 20 | |
| 21 | package org.topazproject.ambra.models; |
| 22 | |
| 23 | import java.io.Serializable; |
| 24 | |
| 25 | import org.topazproject.otm.annotations.Entity; |
| 26 | |
| 27 | /** |
| 28 | * Base class for 'unmanaged' blobs loaded from the BlobStore. Full content of the blob will be |
| 29 | * stored in the byte array. |
| 30 | * |
| 31 | * @author Dragisa Krsmanovic |
| 32 | */ |
| 33 | @Entity() |
| 34 | public abstract class ByteArrayBlob implements Serializable { |
| 35 | private static final long serialVersionUID = -783693796375733488L; |
| 36 | |
| 37 | private byte[] body; |
| 38 | |
| 39 | /** |
| 40 | * Creates a new Blob object. |
| 41 | */ |
| 42 | public ByteArrayBlob() { |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Creates a new Blob object. |
| 47 | * |
| 48 | * @param contentType the content type |
| 49 | */ |
| 50 | public ByteArrayBlob(String contentType) { |
| 51 | // FIXME: contentType |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Get the body blob. Available only when attached to OTM. |
| 56 | * |
| 57 | * @return body as a Blob |
| 58 | */ |
| 59 | public byte[] getBody() { |
| 60 | return body; |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Set the body. Used by OTM. |
| 65 | * |
| 66 | * @param body the value to set. |
| 67 | */ |
| 68 | @org.topazproject.otm.annotations.Blob |
| 69 | public void setBody(byte[] body) { |
| 70 | this.body = body; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Get id. |
| 75 | * |
| 76 | * @return id as String. |
| 77 | */ |
| 78 | public abstract String getId(); |
| 79 | |
| 80 | /** |
| 81 | * Set id. |
| 82 | * |
| 83 | * @param id the value to set. |
| 84 | */ |
| 85 | public abstract void setId(String id); |
| 86 | } |
Note: See TracBrowser
for help on using the browser.
