Skip to content

Commit

Permalink
[FAB-3101] rename fabric shim java package
Browse files Browse the repository at this point in the history
As part of cleanup towards a v1.0 release
moved:
  org.hyperledger.java
to:
  org.hyperledger.fabric.shim

Change-Id: Id9e35085a11562b48c8031cd663e091d9de0b06e
Signed-off-by: Luis Sanchez <sanchezl@us.ibm.com>
  • Loading branch information
Luis Sanchez committed Apr 14, 2017
1 parent 8026601 commit 3f0af4d
Show file tree
Hide file tree
Showing 31 changed files with 70 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.hyperledger.java.shim;
package org.hyperledger.fabric.shim;

import org.hyperledger.fabric.protos.peer.ProposalResponsePackage.Response;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.shim;
package org.hyperledger.fabric.shim;

import java.io.File;

Expand Down Expand Up @@ -45,13 +45,13 @@
public abstract class ChaincodeBase implements Chaincode {

/* (non-Javadoc)
* @see org.hyperledger.java.shim.Chaincode#init(org.hyperledger.java.shim.ChaincodeStub)
* @see org.hyperledger.fabric.shim.Chaincode#init(org.hyperledger.fabric.shim.ChaincodeStub)
*/
@Override
public abstract Response init(ChaincodeStub stub);

/* (non-Javadoc)
* @see org.hyperledger.java.shim.Chaincode#invoke(org.hyperledger.java.shim.ChaincodeStub)
* @see org.hyperledger.fabric.shim.Chaincode#invoke(org.hyperledger.fabric.shim.ChaincodeStub)
*/
@Override
public abstract Response invoke(ChaincodeStub stub);
Expand Down Expand Up @@ -176,7 +176,7 @@ public void chatWithPeer(ManagedChannel connection) {
public void onNext(ChaincodeMessage message) {
logger.info("Got message from peer: " + toJsonString(message));
try {
logger.info(String.format("[%s]Received message %s from org.hyperledger.java.shim",
logger.info(String.format("[%s]Received message %s from org.hyperledger.fabric.shim",
Handler.shortID(message.getTxid()), message.getType()));
handler.handleMessage(message);
} catch (Exception e) {
Expand All @@ -202,7 +202,7 @@ public void onCompleted() {
System.exit(-1);
}

// Create the org.hyperledger.java.shim handler responsible for all
// Create the org.hyperledger.fabric.shim handler responsible for all
// control logic
handler = new Handler(requestObserver, this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hyperledger.java.shim;
package org.hyperledger.fabric.shim;

import static org.hyperledger.fabric.protos.common.Common.Status.BAD_REQUEST;
import static org.hyperledger.fabric.protos.common.Common.Status.FORBIDDEN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.shim;
package org.hyperledger.fabric.shim;

import java.util.Collections;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.shim;
package org.hyperledger.fabric.shim;

import static org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.Type.COMPLETED;
import static org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.Type.DEL_STATE;
Expand All @@ -27,10 +27,10 @@
import static org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.Type.REGISTERED;
import static org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.Type.RESPONSE;
import static org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.Type.TRANSACTION;
import static org.hyperledger.java.fsm.CallbackType.AFTER_EVENT;
import static org.hyperledger.java.fsm.CallbackType.BEFORE_EVENT;
import static org.hyperledger.java.shim.HandlerHelper.newCompletedEventMessage;
import static org.hyperledger.java.shim.HandlerHelper.newErrorEventMessage;
import static org.hyperledger.fabric.shim.HandlerHelper.newCompletedEventMessage;
import static org.hyperledger.fabric.shim.HandlerHelper.newErrorEventMessage;
import static org.hyperledger.fabric.shim.fsm.CallbackType.AFTER_EVENT;
import static org.hyperledger.fabric.shim.fsm.CallbackType.BEFORE_EVENT;

import java.util.HashMap;
import java.util.List;
Expand All @@ -45,13 +45,13 @@
import org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage;
import org.hyperledger.fabric.protos.peer.ChaincodeShim.PutStateInfo;
import org.hyperledger.fabric.protos.peer.ProposalResponsePackage.Response;
import org.hyperledger.java.fsm.CBDesc;
import org.hyperledger.java.fsm.Event;
import org.hyperledger.java.fsm.EventDesc;
import org.hyperledger.java.fsm.FSM;
import org.hyperledger.java.fsm.exceptions.CancelledException;
import org.hyperledger.java.fsm.exceptions.NoTransitionException;
import org.hyperledger.java.helper.Channel;
import org.hyperledger.fabric.shim.fsm.CBDesc;
import org.hyperledger.fabric.shim.fsm.Event;
import org.hyperledger.fabric.shim.fsm.EventDesc;
import org.hyperledger.fabric.shim.fsm.FSM;
import org.hyperledger.fabric.shim.fsm.exceptions.CancelledException;
import org.hyperledger.fabric.shim.fsm.exceptions.NoTransitionException;
import org.hyperledger.fabric.shim.helper.Channel;

import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException;
Expand Down Expand Up @@ -729,7 +729,7 @@ public ByteString handleInvokeChaincode(String chaincodeName, String function, L
}
}

// handleMessage message handles loop for org.hyperledger.java.shim side of chaincode/validator stream.
// handleMessage message handles loop for org.hyperledger.fabric.shim side of chaincode/validator stream.
public synchronized void handleMessage(ChaincodeMessage message) throws Exception {

if (message.getType() == ChaincodeMessage.Type.KEEPALIVE){
Expand All @@ -743,7 +743,7 @@ public synchronized void handleMessage(ChaincodeMessage message) throws Exceptio
logger.debug(String.format("[%s]Handling ChaincodeMessage of type: %s(state:%s)", shortID(message), message.getType(), fsm.current()));

if (fsm.eventCannotOccur(message.getType().toString())) {
String errStr = String.format("[%s]Chaincode handler org.hyperledger.java.fsm cannot handle message (%s) with payload size (%d) while in state: %s",
String errStr = String.format("[%s]Chaincode handler org.hyperledger.fabric.shim.fsm cannot handle message (%s) with payload size (%d) while in state: %s",
message.getTxid(), message.getType(), message.getPayload().size(), fsm.current());
serialSend(newErrorEventMessage(message.getTxid(), errStr));
throw new RuntimeException(errStr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hyperledger.java.shim;
package org.hyperledger.fabric.shim;

import static org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.Type.COMPLETED;
import static org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.Type.ERROR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.shim;
package org.hyperledger.fabric.shim;

import org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.fsm;
package org.hyperledger.fabric.shim.fsm;

public class CBDesc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.fsm;
package org.hyperledger.fabric.shim.fsm;

public interface Callback {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.fsm;
package org.hyperledger.fabric.shim.fsm;

public class CallbackKey {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.fsm;
package org.hyperledger.fabric.shim.fsm;

public enum CallbackType {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.fsm;
package org.hyperledger.fabric.shim.fsm;


/** Holds the info that get passed as a reference in the callbacks */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.hyperledger.java.fsm;
package org.hyperledger.fabric.shim.fsm;

/**
* Represents an event when initializing the FSM.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.fsm;
package org.hyperledger.fabric.shim.fsm;

/** Key for the transition map */
public class EventKey {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
limitations under the License.
*/

package org.hyperledger.java.fsm;
package org.hyperledger.fabric.shim.fsm;

import java.util.HashMap;
import java.util.HashSet;

import org.hyperledger.java.fsm.exceptions.AsyncException;
import org.hyperledger.java.fsm.exceptions.CancelledException;
import org.hyperledger.java.fsm.exceptions.InTrasistionException;
import org.hyperledger.java.fsm.exceptions.InvalidEventException;
import org.hyperledger.java.fsm.exceptions.NoTransitionException;
import org.hyperledger.java.fsm.exceptions.NotInTransitionException;
import org.hyperledger.java.fsm.exceptions.UnknownEventException;
import org.hyperledger.fabric.shim.fsm.exceptions.AsyncException;
import org.hyperledger.fabric.shim.fsm.exceptions.CancelledException;
import org.hyperledger.fabric.shim.fsm.exceptions.InTrasistionException;
import org.hyperledger.fabric.shim.fsm.exceptions.InvalidEventException;
import org.hyperledger.fabric.shim.fsm.exceptions.NoTransitionException;
import org.hyperledger.fabric.shim.fsm.exceptions.NotInTransitionException;
import org.hyperledger.fabric.shim.fsm.exceptions.UnknownEventException;

public class FSM {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
limitations under the License.
*/

package org.hyperledger.java.fsm;
package org.hyperledger.fabric.shim.fsm;

import org.hyperledger.java.fsm.exceptions.NotInTransitionException;
import org.hyperledger.fabric.shim.fsm.exceptions.NotInTransitionException;

public class Transitioner {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.fsm.exceptions;
package org.hyperledger.fabric.shim.fsm.exceptions;

public class AsyncException extends Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.fsm.exceptions;
package org.hyperledger.fabric.shim.fsm.exceptions;

public class CancelledException extends Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.fsm.exceptions;
package org.hyperledger.fabric.shim.fsm.exceptions;

public class InTrasistionException extends Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.fsm.exceptions;
package org.hyperledger.fabric.shim.fsm.exceptions;

public class InvalidEventException extends Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.fsm.exceptions;
package org.hyperledger.fabric.shim.fsm.exceptions;

public class NoTransitionException extends Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.fsm.exceptions;
package org.hyperledger.fabric.shim.fsm.exceptions;

public class NotInTransitionException extends Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.fsm.exceptions;
package org.hyperledger.fabric.shim.fsm.exceptions;

public class UnknownEventException extends Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package org.hyperledger.java.helper;
package org.hyperledger.fabric.shim.helper;

import java.io.Closeable;
import java.util.HashSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

package example;

import org.hyperledger.java.shim.ChaincodeBase;
import org.hyperledger.java.shim.ChaincodeStub;
import org.hyperledger.fabric.shim.ChaincodeBase;
import org.hyperledger.fabric.shim.ChaincodeStub;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package example;

import com.google.protobuf.ByteString;
import org.hyperledger.java.shim.ChaincodeBase;
import org.hyperledger.java.shim.ChaincodeStub;
import org.hyperledger.fabric.shim.ChaincodeBase;
import org.hyperledger.fabric.shim.ChaincodeStub;

import java.nio.charset.StandardCharsets;
import java.util.LinkedList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package example;

import org.hyperledger.java.shim.ChaincodeBase;
import org.hyperledger.java.shim.ChaincodeStub;
import org.hyperledger.fabric.shim.ChaincodeBase;
import org.hyperledger.fabric.shim.ChaincodeStub;

public class MapExample extends ChaincodeBase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hyperledger.java.shim.ChaincodeBase;
import org.hyperledger.java.shim.ChaincodeStub;
import org.hyperledger.fabric.shim.ChaincodeBase;
import org.hyperledger.fabric.shim.ChaincodeStub;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

import static java.lang.String.format;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.hyperledger.java.shim.ChaincodeHelper.newBadRequestResponse;
import static org.hyperledger.java.shim.ChaincodeHelper.newInternalServerErrorResponse;
import static org.hyperledger.java.shim.ChaincodeHelper.newSuccessResponse;
import static org.hyperledger.fabric.shim.ChaincodeHelper.newBadRequestResponse;
import static org.hyperledger.fabric.shim.ChaincodeHelper.newInternalServerErrorResponse;
import static org.hyperledger.fabric.shim.ChaincodeHelper.newSuccessResponse;

import java.util.List;

Expand All @@ -29,8 +29,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hyperledger.fabric.protos.peer.ProposalResponsePackage.Response;
import org.hyperledger.java.shim.ChaincodeBase;
import org.hyperledger.java.shim.ChaincodeStub;
import org.hyperledger.fabric.shim.ChaincodeBase;
import org.hyperledger.fabric.shim.ChaincodeStub;

/**
* <h1>Classic "transfer" sample chaincode</h1> (java implementation of <A href=
Expand Down
Loading

0 comments on commit 3f0af4d

Please sign in to comment.