01: /*
02: * BEGIN_HEADER - DO NOT EDIT
03: *
04: * The contents of this file are subject to the terms
05: * of the Common Development and Distribution License
06: * (the "License"). You may not use this file except
07: * in compliance with the License.
08: *
09: * You can obtain a copy of the license at
10: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
11: * See the License for the specific language governing
12: * permissions and limitations under the License.
13: *
14: * When distributing Covered Code, include this CDDL
15: * HEADER in each file and include the License file at
16: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
17: * If applicable add the following below this CDDL HEADER,
18: * with the fields enclosed by brackets "[]" replaced with
19: * your own identifying information: Portions Copyright
20: * [year] [name of copyright owner]
21: */
22:
23: /*
24: * @(#)ArchiveDownloadMBean.java
25: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
26: *
27: * END_HEADER - DO NOT EDIT
28: */
29: package com.sun.jbi.management.repository;
30:
31: /**
32: * Downloads archive bytes from the ESB repository.
33: */
34: public interface ArchiveDownloadMBean {
35: /**
36: * Returns the archive id of a service assembly in the repository.
37: * @param saName name of the service assembly
38: * @return archive ID, or null if the service assembly does not exist
39: * in the repository.
40: */
41: Object getServiceAssemblyArchiveId(String saName);
42:
43: /**
44: * Returns the archive id of a component in the repository.
45: * @param componentName name of the component
46: * @return archive ID, or null if the component does not exist
47: * in the repository.
48: */
49: Object getComponentArchiveId(String componentName);
50:
51: /**
52: * Returns the archive id of a shared library in the repository.
53: * @param sharedLibrayName name of the shared library
54: * @return archive ID, or null if the shared library does not exist
55: * in the repository.
56: */
57: Object getSharedLibraryArchiveId(String sharedLibrayName);
58:
59: /** Initiates the download of an archive identified by 'archiveId'. In
60: * most situations, the archiveId will simply be the CAS-local path to
61: * the archive in the ESB repository. The returned Object is used as
62: * a session id for downloading the archive bytes with
63: * <code>downloadBytes()</code>.
64: * @return download session id
65: */
66: Object initiateDownload(Object archiveId)
67: throws java.io.IOException;
68:
69: /** Initiates the download of the Registry.
70: * @return download session id
71: */
72: Object initiateRegistryDownload() throws java.io.IOException;
73:
74: /** Download <code>length</code> bytes from an existing download session.
75: * @return a byte array of the specified length. If the remaining bytes
76: * in the session <= length, the byte array is sized appropriately. If
77: * all bytes have been downloaded, the returned array length is 0.
78: */
79: byte[] downloadBytes(Object id, int length)
80: throws java.io.IOException;
81:
82: /** Used to indicate that a download session is complete.
83: */
84: void terminateDownload(Object id) throws java.io.IOException;
85: }
|